Skip to content

fix: prefer URL file_name and keep slash titles as one section - #494

Merged
EricNGOntos merged 1 commit into
mainfrom
fix/wuchengke/url-filename-and-section-parts
Nov 2, 2026
Merged

EricNGOntos merged 1 commit into
mainfrom
fix/wuchengke/url-filename-and-section-parts

Conversation

@EricNGOntos

Copy link
Copy Markdown
Contributor

Summary

  • URL jobs now use an explicit file_name instead of the URL basename original.md.
  • Publication builds sections from pre-split path parts, so titles that contain / or / stay one section.
  • No API, worker, migration, or env-var change.

Verification

  • make check (ruff + pyright): passed
  • pytest apps/api/tests/unit/test_document_ingestion_filename.py: 4 passed
  • pytest packages/shared-python/shared/tests/test_path_segments.py: 8 passed
  • Did not re-ingest the original Hipo plan document on a live API

Deployment Notes

  • No new environment variables
  • No database migrations
  • Existing published snapshots stay as-is; Hipo already compensates for old original.md / ∕ snapshots. New ingest after this API ships writes the real file name.

Checklist

  • Tests were added or updated when behavior changed
  • Public docs, examples, or OpenAPI contracts were updated when needed
  • Database migrations are idempotent and safe to deploy
  • Logs, errors, and validation paths avoid leaking secrets or user data
  • The pull request description explains any breaking or user-visible change

Test plan

  • Create a URL job with source_url ending in original.md and file_name set to the real document name; confirm published source_file_name and root chunk path use the real name
  • Ingest a heading that contains user/assistant; confirm one section, not two
  • Ingest a heading that contains MD / TXT; confirm one section

Made with Cursor

- Updated the `_resolve_url_source_file_name` function to prefer an explicit file name from the payload and append the file extension if missing.
- Modified the `_resolve_source_file_name` function to prioritize the requested file name over the URL basename, ensuring better handling of file names in various ingestion scenarios.
- Added unit tests to validate the new file name resolution logic and ensure correct behavior across different cases.
@EricNGOntos
EricNGOntos merged commit 5976405 into main Nov 2, 2026
6 checks passed
@EricNGOntos
EricNGOntos deleted the fix/wuchengke/url-filename-and-section-parts branch November 2, 2026 14:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant