Skip to content

docs: add section-detection plan and reorganize documentation#9

Merged
hadro merged 3 commits into
mainfrom
claude/elegant-brown-3ju1kg
Jun 15, 2026
Merged

docs: add section-detection plan and reorganize documentation#9
hadro merged 3 commits into
mainfrom
claude/elegant-brown-3ju1kg

Conversation

@hadro

@hadro hadro commented Jun 15, 2026

Copy link
Copy Markdown
Owner

Summary

Adds a comprehensive implementation plan for automatic section detection in multi-section city directories, plus reorganizes documentation with a new index.

Key changes

  • New plan: docs/plans/section-detection-plan.md — a detailed 6-phase roadmap for building a detect_sections pipeline stage that auto-drafts sections.txt by analyzing per-page OCR features (geometry, text patterns, density). The plan is scoped to produce a draft artifact only (never overwriting curated files), mirrors the existing detect_columns stage pattern, and defers implementation to a local session with actual output/ data on disk.

  • Documentation index: docs/README.md — new entry point organizing reference docs (pipeline-stages, usage-examples, key-design-decisions, costs), background (prior-work, comparison-htr-alto-pipeline), and plans (section-detection, huggingface-uv-scripts, aws-migration) with status indicators.

  • Plan status headers: Added Status: lines to docs/plans/huggingface-uv-scripts.md and docs/plans/aws-migration-plan.md to clarify that these are point-in-time roadmaps, not active work.

  • Updated CLAUDE.md: Corrected reference to the new docs/plans/huggingface-uv-scripts.md location and clarified that the local-models strategy is deferred to a future session.

  • Updated README.md: Added links to the new docs index and plans.

Implementation notes

The section-detection plan is not code yet — it is a detailed specification for a future implementer. Key design decisions:

  • Consumer side already exists: sections.txt is fully wired in extract_entries.py, run_gemini_ocr.py, generate_prompt.py, and select_pages.py via utils/section_utils.py. The plan only needs to build the producer.
  • Heuristic-first approach: Deterministic feature scoring (line count, column geometry, digit-leading fractions, ALL-CAPS density, alphabetical cadence) gets ~80–90% accuracy; a small model only adjudicates low-confidence boundaries.
  • Phase 0 validation: Before any stage wiring, run a read-only feature dump on output/tulsa_1921/ and output/hearnes_brooklyn_city_directory_for_hearnesbrooklync1852/ to confirm sections separate cleanly on these features and calibrate thresholds.
  • Never overwrites curated files: Writes sections_draft.txt + sections_report.csv; user reviews and promotes the draft to sections.txt.
  • Opt-in, not in default chain: Like detect_columns, it is declarative in stages.py and only runs when --detect-sections is passed.

The plan includes a full file/function map, test strategy, risk caveats, and a session log template for tracking progress.

https://claude.ai/code/session_019WuZdFZZXu5wb7CFeEP5dE

claude added 3 commits June 15, 2026 20:11
Plan for a detect_sections stage that auto-drafts sections.txt for
multi-section city directories (alphabetical / street / classified /
frontmatter), unlocking per-section NER prompt routing. The consumer
side (section_utils + extract_entries) is already wired; this plans the
missing producer. Phased, heuristic-first with an optional model
backstop, with verification ground rules and a session log for a local
implementation pass.

https://claude.ai/code/session_019WuZdFZZXu5wb7CFeEP5dE
Organize docs/ by lifecycle: point-in-time roadmaps move under docs/plans/
(huggingface-uv-scripts, section-detection-plan, aws-migration-plan), each
gaining a Status: line. Evergreen reference + background docs stay flat.

Add docs/README.md as a categorized index (Reference / Background / Plans)
and link it from README.md. Repoint the moved-file references in CLAUDE.md
and the section-detection plan's internal link.

Document the dangling CLAUDE.md reference to refactor-plan.md (a local-only
working doc never committed) as a known gap in CLAUDE.md and the index rather
than leaving it as a silent broken link. The iiif-content-search.md reference
in comparison-htr-alto-pipeline.md is an upstream-project citation, left as-is.

https://claude.ai/code/session_019WuZdFZZXu5wb7CFeEP5dE
The multi-session simplification refactor is done. Remove the now-stale
'Active work: simplification plan' section from CLAUDE.md (it pointed at a
local-only refactor-plan.md that was never committed) and drop the matching
index entry. No remaining references to refactor-plan remain in the repo.

https://claude.ai/code/session_019WuZdFZZXu5wb7CFeEP5dE
@hadro hadro merged commit 783bc72 into main Jun 15, 2026
1 check passed
@hadro hadro deleted the claude/elegant-brown-3ju1kg branch June 15, 2026 23:30
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.

2 participants