Skip to content

Share One Any-Level Heading Region Primitive Between build_dist heading_body and fidelity_text extract_anchored #3810

Done

Description

@ptr727

Observed

Two functions now work out the same heading region over fidelity_text.headings(). The region starts at one heading of any level and ends at the next heading at that level or above.

Only the match key and the duplicate policy differ. A later boundary fix, such as a fence-closing or setext rule, would have to be made in both places.

Expected

fidelity_text holds one any-level span primitive, taking the match key as a parameter. Both callers move onto it. sections() stays the level-two unit's own extent, since a manifest section ends only at the next H2.

scripts/build_dist.py was outside that branch's file claim, so the consolidation is filed here per "Design Before Code" (a site in a file the change does not touch moves in a change of its own).

Found by the local strict-review pass on that branch.

Activity

  1. added
    script
    deferred
    on Nov 2, 2026
  2. removed
    deferred
    on Nov 23, 2026
  3. ptr727 commented on Nov 23, 2026

    @ptr727
    OwnerAuthor

    Lifting deferred: the deferral was only that another lane held this fix's file. Checked live on 2026-11-23: no open pull request and no branch other than origin/feature/wsl-2299 holds any file. The outcome is already stated in the body, so the issue returns to the ranking.

  4. ptr727 commented on Nov 24, 2026

    @ptr727
    OwnerAuthor

    Released (2026-11-24): PR #4399 merged to develop at 541077f; branch and worktree cleaned up, so this claim holds no files. The issue closes on promotion.

    Backlog burndown claim (away run 2026-11-24, round 2, group 4): branch burndown/heading-region-primitive, issue #3810.

    Predicted files:

    • spec/fidelity_text.py, the new any-level heading region primitive and extract_anchored.
    • scripts/build_dist.py, heading_body.
    • tests/test_fidelity_text.py and tests/test_build_dist.py.
    • spec/audit.py and tests/test_audit_helpers.py, only where extract_anchored's signature changes.

    Any other group needing one of these files waits for this branch to merge.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    script

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions