Skip to content

tools(hygiene): exclude docs/lost-substrate/** from orphan-role-ref lint#1193

Merged
AceHack merged 2 commits intomainfrom
tools/audit-orphan-role-refs-exclude-lost-substrate-2026-05-02
May 2, 2026
Merged

tools(hygiene): exclude docs/lost-substrate/** from orphan-role-ref lint#1193
AceHack merged 2 commits intomainfrom
tools/audit-orphan-role-refs-exclude-lost-substrate-2026-05-02

Conversation

@AceHack
Copy link
Copy Markdown
Member

@AceHack AceHack commented May 2, 2026

Summary

Small fix on PR #1187 (orphan-role-ref lint). `docs/lost-substrate/**` is by definition a history-surface (incident artifacts + dated inventory ledgers from the 2026-04-29 corruption-triage). Persona names + dated attribution are explicitly ALLOWED there per Otto-279 history-surface carve-out.

Adding to the lint's history-surface exclusion list closes two false-positive findings the initial implementation flagged.

Smoke-test

Before fix: 16 findings on full-repo audit.
After fix: 14 findings (the two `docs/lost-substrate/` findings correctly suppressed).

The remaining 14 are real findings to address in follow-up PRs:

  • `tools/hygiene/audit-agencysignature-*.sh/.ts` — comments reference the originating "ferry-7 enforcement-instrument" purpose. May be legitimate-but-stripable.
  • `tools/hygiene/validate-agencysignature-pr-body.sh/.ts` — same pattern.
  • `tools/peer-call/grok.sh` — `Grok ferry-14/16` reference in comment.
  • `tools/github/poll-pr-gate-batch.test.ts` — `Per Aaron 2026-05-01` in comment header.
  • `tests/Tests.FSharp/Algebra/Veridicality.Tests.fs` — `"repo/amara/ferry-10"` as a test fixture string (not a real substrate-attribution claim; deserves a parser-aware refinement to suppress).

Composes with

🤖 Generated with Claude Code

`docs/lost-substrate/**` is by definition a history-surface
(incident artifacts + dated inventory ledgers from the
2026-04-29 corruption-triage). Persona names + dated
attribution are explicitly ALLOWED there per Otto-279
history-surface carve-out.

Adding to the lint's history-surface exclusion list closes
two false-positive findings the initial implementation flagged
(docs/lost-substrate/artifacts/2026-04-29-corruption/triage-
report.md lines 10 + 55).

Smoke-test confirms: full-repo audit drops from 16 findings
to 14 (the two lost-substrate findings are now correctly
suppressed). The remaining 14 are real findings in tools/ +
tests/ surfaces; cleanup deferred to follow-up PRs (most are
in audit-agencysignature-* / validate-agencysignature-* tools
that reference the originating-ferry purpose; some are clear
"Per Aaron 2026-MM-DD" violations on tool comments).

Note on test-fixture-strings: tests/Tests.FSharp/Algebra/
Veridicality.Tests.fs:12 contains the string `"repo/amara/
ferry-10"` as a TEST FIXTURE (sourceID under test, not a
substrate-attribution claim). The lint's regex matches the
literal token; a parser-aware refinement that distinguishes
string literals from comment/doc context would suppress this.
Deferred to a follow-up — current lint catches the case at
write-time which is a tractable signal even with the noise.

Composes with PR #1187 (initial lint).
Copilot AI review requested due to automatic review settings May 2, 2026 01:17
@AceHack AceHack enabled auto-merge (squash) May 2, 2026 01:17
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the orphan-role-ref hygiene audit to treat docs/lost-substrate/** as a history-surface so persona-name / dated attribution content in incident artifacts isn’t incorrectly linted as a code-surface violation.

Changes:

  • Document docs/lost-substrate/** as a history-surface in the script header comment.
  • Exclude docs/lost-substrate/* in is_history_surface() so files under that tree are skipped by the lint.

Comment thread tools/hygiene/audit-orphan-role-refs.sh
Copilot P1 finding on PR #1193: header claimed Otto-279 carve-out
is defined by docs/AGENT-BEST-PRACTICES.md, but that doc's closed
list does NOT yet include docs/lost-substrate/**. Without an
explicit reconciliation note, future readers see policy/tool
drift between the doc and the script.

Resolution: amended the script's comment block to make the
doctrine-extension explicit. Three buckets now distinguished:

  - Canonical (in AGENT-BEST-PRACTICES.md closed list)
  - Tool-extended (lost-substrate; pending doctrine update to
    add it to the canonical list)
  - Always-skip (non-substrate paths)

Plus a "Doctrine-extension follow-up" note: when AGENT-BEST-
PRACTICES.md's Otto-279 closed list next gets edited, fold
lost-substrate into the canonical list and remove the
tool-extended note here. The doc remains the source of truth
for the categorical rule; this script encodes the operational
implementation.

Behavior unchanged. Comment-only edit.
@AceHack AceHack merged commit 2a9303c into main May 2, 2026
25 checks passed
@AceHack AceHack deleted the tools/audit-orphan-role-refs-exclude-lost-substrate-2026-05-02 branch May 2, 2026 01:27
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