Skip to content

Decide Whether section_key Should Casefold Rather Than Lowercase #3710

Closed

Description

@ptr727

fidelity_text.section_key keys a section name with strip().lower(), so two headings that differ only by a character str.lower() leaves distinct but str.casefold() equates (for example "Straße" and "Strasse") are different sections to the audit, the carry, and the canonical-review ledger. Decide whether the key should be strip().casefold(), which changes every lookup path at once and needs a non-ASCII test, or whether ASCII-level folding is the intent (then say so in the docstring).

Raised by Copilot on the pull request that centralized the key (#3708), which was a no-behavior-change refactor. Class: pre-existing.

Activity

  1. added
    pre-existingReview finding classed pre-existing per local-strict-review Disposing of Findings
    on Oct 31, 2026
  2. ptr727 commented on Nov 1, 2026

    @ptr727
    OwnerAuthor

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

    Question: Should section_key in spec/fidelity_text.py switch from name.strip().lower() to name.strip().casefold(), or stay on lower() with a docstring saying ASCII-level folding is intended?

    Options, recommended first:

    1. Keep lower(), say ASCII folding in docstring (recommended): Fleet headings are ASCII by rule, so casefold() gives the same key for every heading the readers see, and a non-ASCII test would guard a case "Trust Boundaries and Hardening Effort" rules out. One docstring line. No work in flight.
    2. Switch to casefold(), add a non-ASCII test: Python's documented caseless match, reaching every lookup path now that Move the Section-Name Lookup Key Into spec/fidelity_text.py #3708 centralized the key. Costs a test for input that does not occur, same behavior on current content. No work in flight.

    Evidence: spec/fidelity_text.py:193-195 return name.strip().lower() under the docstring "stripped, then case-folded". #3708 (6fb7527) routed build_dist.py, carry.py, audit.py, audit_markdown.py, canonical_review.py through it. 0 non-ASCII headings in tracked Markdown, 0 non-ASCII characters in spec/files.json and spec/readme-sections.json. comment-and-doc-style: "Agent-authored text is ASCII by default". For ASCII input lower() and casefold() are identical.

    Blocks: none

  3. added
    decisionA question waiting on the maintainer, alone or beside whatever else the issue carries
    on Nov 1, 2026
  4. ptr727 commented on Nov 1, 2026

    @ptr727
    OwnerAuthor

    Maintainer answer (decision triage, 2026-11-01): Option 1: keep strip().lower() and correct the section_key docstring to say ASCII folding is intended. This is now work for the next burndown round.

  5. removed
    decisionA question waiting on the maintainer, alone or beside whatever else the issue carries
    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-existingReview finding classed pre-existing per local-strict-review Disposing of Findings

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions