Skip to content

Make validate.py's files.json Section-Name Match Agree With section_key #3706

Closed

Description

@ptr727

spec/validate.py compares each section name declared in files.json to level-two heading text exactly, with no strip or case fold. spec/audit.py, scripts/carry.py, and scripts/canonical_review.py key section names through fidelity_text.section_key (strip, then case-fold), so the validator and the readers disagree about what counts as the same section.

Constructed case: files.json declares the section "repository boundaries" for a Markdown file whose heading is ## Repository Boundaries. The audit and the carry resolve it as present, and the validator reports declares section 'repository boundaries' but no '## repository boundaries' heading exists.

Decide whether the exact match is deliberate (then comment why at the comparison) or should move onto section_key. Found by the strict-review pass on the section_key refactor (#3686). Class: pre-existing.

Activity

  1. added
    pre-existing
    on Oct 31, 2026
  2. ptr727 commented on Nov 1, 2026

    @ptr727
    OwnerAuthor

    Decision needed (decision triage, 2026-11-01)

    Question: Is the exact section-name match in spec/validate.py (files.json declared names against the hub's own H2 text, no strip or case fold) deliberate, so it gets a comment, or should it move onto fidelity_text.section_key like the readers?

    Options, recommended first:

    1. Keep the exact match, comment why (recommended): The validator reads only the hub's own copy, so strictness costs nothing, and it keeps each files.json name byte-equal to the heading, which matters because the name is the verbatim "path > section" disposition label (validate.py:1787) while canonical_review.py keys units by heading text. Readers fold to tolerate re-cased downstream copies, a different job. No work in flight.
    2. Move the comparison onto section_key: Validator and readers agree, so a re-cased declaration passes CI, but the files.json spelling and heading can drift apart, splitting the label from the heading-keyed unit. No work in flight.
    3. Keep exact, name a case-only mismatch in the error: Option 1 plus a clearer message; today the error says no such heading exists even when a differently-cased one does. No work in flight.

    Evidence: spec/validate.py:1767-1775 tests name not in headings on raw heading text. spec/section-model.md "Enforcement" requires a declared section "resolves to a real level-two heading in the hub's own copy". scripts/canonical_review.py:369-372 folds on purpose and keys the unit "by the document's heading rather than the manifest's spelling". The exact match fails loudly in CI, never silently. Independent of #3710.

    Blocks: none

  3. added
    decision
    on Nov 1, 2026
  4. ptr727 commented on Nov 1, 2026

    @ptr727
    OwnerAuthor

    Maintainer answer (decision triage, 2026-11-01): Option 1: keep validate.py's exact section-name match and add a comment at it saying why: the files.json name is the verbatim disposition label. This is now work for the next burndown round.

  5. removed
    decision
    on Nov 1, 2026
  6. ptr727 commented on Nov 2, 2026

    @ptr727
    OwnerAuthor

    Released (2026-11-02): PR #3811 merged to develop and its branch is deleted, so this claim holds no files. The issue closes on promotion.

    Backlog burndown claim (away run 2026-11-02, round 1, group G2). Branch: burndown/1819-audit-intent. Issues: #1819, #727, #3710, #3706, #3623.

    Predicted file set:

    • spec/audit.py, spec/checks.json, spec/fidelity_text.py, spec/validate.py, spec/fidelity-model.md
    • registry/repos.json, registry/repos.schema.json
    • AUDIT.md
    • tests/test_audit.py, tests/test_audit_helpers.py, tests/test_audit_size.py, tests/test_fidelity_text.py, tests/test_spec_validate.py

    Out of bounds for this group: .agents/skills/* (no skill text changes in this group), GOVERNANCE.md, .github/workflows/* and .github/actions/* (open PR #3801).

    Scope: develop only. The feature pull request carries Closes on promotion: for each issue it fully fixes.

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

    pre-existing

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions