Skip to content

docs(ingestion): investigate issue #149 — superseded by #927 - #242

Closed
folusho-adeyemi wants to merge 3 commits into
ascherj:mainfrom
folusho-adeyemi:149-structural-chunker-silently-drops-documents-that-contain-no-headings
Closed

docs(ingestion): investigate issue #149 — superseded by #927#242
folusho-adeyemi wants to merge 3 commits into
ascherj:mainfrom
folusho-adeyemi:149-structural-chunker-silently-drops-documents-that-contain-no-headings

Conversation

@folusho-adeyemi

@folusho-adeyemi folusho-adeyemi commented Jul 21, 2026

Copy link
Copy Markdown

Important

Superseded by #927 — please review that PR instead.

This PR was opened from the branch 149-structural-chunker-silently-drops-documents-that-contain-no-headings, which does not follow the <type>/<issue-number>-<short-description> branch naming convention required by CONTRIBUTING.md. The work was moved to fix/149-structural-chunker-drops-heading-less-docs and continues in #927. No commits are lost — #927 contains every commit from this branch plus the completed fix, tests and journal entries.

This description is filled in below for the record.

Summary

StructuralChunker silently dropped any markdown document that contained no headings. _extract_sections() only collected content lines after a heading had been seen, and only emitted a section when the heading stack was non-empty, so a heading-less document produced zero sections and chunk() returned []. Because StrategySelector routes every readme source type to this chunker, a README with no headings never entered the RAG index and no error was raised anywhere. The same guard also discarded any preamble appearing before the first heading.

At the point this PR was opened it contained only the Week 8 investigation — a failing reproduction test and PLAN.md. The implemented fix, its unit tests and the Week 9 check-ins are in #927.

Issue

Relates to #149 — closed by #927.

Changes

Commits that were on this branch when it was superseded:

The fix itself (fix(ingestion): emit sections for markdown without headings) and its tests (test(ingestion): cover heading-less documents and preamble chunking) landed on the renamed branch and are reviewable in #927.

Testing

Testing is documented in full in #927, which reports:

Check Baseline on main With the fix Delta
make test-unit 53 failed, 375 passed 52 failed, 380 passed 0 new failures; fixes test_document_with_no_headings
make lint 182 errors 178 errors 0 new errors
make typecheck 5 errors 5 errors byte-identical

Screenshots / Demo

Not applicable — backend chunking logic with no user-facing surface.

Notes for Reviewers

Nothing to review here — please use #927. Closing this to avoid two open PRs for issue #149.

folusho-adeyemi and others added 3 commits July 21, 2026 18:31
…less docs

Add a root-cause note at the content-collection guard in
_extract_sections. A document with no markdown headings never populates
heading_stack, so no section is emitted and chunk() returns [], silently
excluding the whole document from the RAG index.

Reproduction:
  StructuralChunker().chunk('plain text ' * 20, {}) -> 0 chunks
  pytest test_document_with_no_headings -> FAILED (assert 0 >= 1)

Bypassing pre-commit: ruff/mypy flag pre-existing issues in this file
(unused current_level, missing annotations) that are out of scope for a
doc-only reproduction commit; they will be addressed with the Week 9 fix.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@folusho-adeyemi folusho-adeyemi changed the title started working on issue 149 docs(ingestion): investigate issue #149 — superseded by #927 Aug 5, 2026
@folusho-adeyemi

Copy link
Copy Markdown
Author

Closing in favour of #927. The branch was renamed to fix/149-structural-chunker-drops-heading-less-docs to follow the <type>/<issue-number>-<short-description> convention in CONTRIBUTING.md; #927 carries every commit from this branch plus the implemented fix, its unit tests, and the Week 9 journal check-ins. Description above filled in for the record.

folusho-adeyemi added a commit to folusho-adeyemi/pathreview that referenced this pull request Aug 12, 2026
Records that no reviewer feedback arrived on ascherj#927 or ascherj#242, and what I
self-reviewed against CONTRIBUTING.md and the repo tooling in its absence:
the branch rename, the two existing tests that computed an assertion
without ever checking it, and the pre-existing-failure baseline.

Reflects on the four-week cycle - that the fix was small relative to
establishing a baseline in a repo where make check already fails, that
deciding what not to fix was harder than fixing, where AI assistance
helped versus where it produced a confident but unnecessary
recommendation, and why the root-cause fix was chosen over the
SemanticChunker fallback other claimants proposed.
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