Skip to content

substrate(B-0070): orphan-role-ref-after-name-stripping pattern + detector lint backlog (Aaron 2026-04-28)#86

Merged
AceHack merged 1 commit intomainfrom
backlog/B-0070-orphan-role-ref-detector-lint-aaron-2026-04-28
Apr 28, 2026
Merged

substrate(B-0070): orphan-role-ref-after-name-stripping pattern + detector lint backlog (Aaron 2026-04-28)#86
AceHack merged 1 commit intomainfrom
backlog/B-0070-orphan-role-ref-detector-lint-aaron-2026-04-28

Conversation

@AceHack
Copy link
Copy Markdown
Owner

@AceHack AceHack commented Apr 28, 2026

Summary

Two artifacts capturing Aaron's 2026-04-28 PR #24 input:

  1. memory/feedback_orphan_role_ref_after_name_stripping_aaron_2026_04_28.md — captures the recurring failure mode: when stripping named attribution from code-surface text per Otto-279, mechanical replacement <Name> ferry-Ncourier-ferry-N absorb leaves orphan role-refs that lose semantic weight.

  2. B-0070 P2 backlog rowdocs/backlog/P2/B-0070-orphan-role-ref-detector-lint-aaron-2026-04-28.md — backlog the structural fix: lint script under tools/hygiene/ wired into CI gate as soft-fail (same pattern as audit-memory-index-duplicates.sh).

The pattern caught

Original (history-surface OK) Mechanical strip (orphan) Better path
Amara ferry-12 courier-ferry-12 absorb Drop the parenthetical; class name stands alone
Grok ferry-16 invariant courier-ferry-16 absorb invariant Use principle name: "Substrate Truth Principle invariant"
Per Amara ferry-7 evidence-pointer rule Per courier-ferry-7 absorb evidence-pointer rule Drop "Per ferry-N" entirely; rule is in spec

Aaron's framing

"not sure if you can update to find things like that that don't make sense in the future like look for courrier-ferrrrry or whatever IDK just thinking out out for your future self and the review agentsd"

Lint composes with the prompt-protector skill's invisible-Unicode write-time-scan shape; targets BOTH directions:

  • Over-stripped (orphan role-ref) — what Aaron just caught
  • Under-stripped (named attribution on code-surface) — what review agents catch most often

🤖 Generated with Claude Code

…ector lint backlog (Aaron 2026-04-28)

Captures the recurring failure mode caught in PR #24 review: when
stripping named attribution from code-surface text per Otto-279, the
mechanical replacement `<Name> ferry-N` -> `courier-ferry-N absorb`
leaves orphan role-refs that lose semantic weight. Better path: remove
the attribution clause entirely OR replace with self-contained principle
name.

Two artifacts:
- memory/feedback_orphan_role_ref_after_name_stripping_aaron_2026_04_28.md
  — the substrate capturing the pattern + detection regex sketch +
  composition with Otto-279 + Otto-357 + Otto-341 +
  prompt-protector
- docs/backlog/P2/B-0070-orphan-role-ref-detector-lint-aaron-2026-04-28.md
  — backlog row for the structural fix (lint script under
  tools/hygiene/ wired into CI gate as soft-fail initially, same
  pattern as audit-memory-index-duplicates.sh)

Aaron explicit:
  'not sure if you can update to find things like that that don't make
   sense in the future like look for courrier-ferrrrry or whatever IDK
   just thinking out out for your future self and the review agentsd'

Aaron's framing names BOTH future-self AND review agents as audiences
for the lint — which matches how Copilot/Codex review threads on PR #24
caught the under-stripped versions, but missed the over-stripped
(orphan) versions. The lint would catch BOTH directions.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings April 28, 2026 06:31
@AceHack AceHack enabled auto-merge (squash) April 28, 2026 06:31
@AceHack AceHack merged commit 65ac088 into main Apr 28, 2026
18 of 19 checks passed
@AceHack AceHack deleted the backlog/B-0070-orphan-role-ref-detector-lint-aaron-2026-04-28 branch April 28, 2026 06:33
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

Adds substrate artifacts capturing the “orphan role-ref after name-stripping” failure mode and backlogs a lint to detect it on code-surface text.

Changes:

  • Added a new memory entry documenting the orphan-role-ref pattern, examples, and mitigation discipline.
  • Added a P2 backlog row (B-0070) describing a future hygiene lint (scope, regex candidates, and CI wiring intent).

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 6 comments.

File Description
memory/feedback_orphan_role_ref_after_name_stripping_aaron_2026_04_28.md Documents the failure mode and proposed detection approach for future prevention.
docs/backlog/P2/B-0070-orphan-role-ref-detector-lint-aaron-2026-04-28.md Backlogs the structural fix: a hygiene lint to catch orphan ferry refs / unstripped attribution.

Comment on lines +1 to +10
---
id: B-0070
priority: P2
slug: orphan-role-ref-detector-lint
status: backlog
created: 2026-04-28
maintainer: aaron
ownership: otto
title: Orphan role-ref detector lint — catch ferry-N without named source on code surfaces (Aaron 2026-04-28)
---
Copy link

Copilot AI Apr 28, 2026

Choose a reason for hiding this comment

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

P1: The YAML frontmatter here doesn’t match the documented per-row backlog schema in tools/backlog/README.md (e.g., status is documented as open/closed/superseded-by-*/deferred, and last_updated is marked required). Either adjust this row to the documented schema (add last_updated, use a documented status value), or update the schema docs/tooling in the same change-set so the repo has a single source of truth.

Copilot uses AI. Check for mistakes.
Comment on lines +66 to +77
Detector regex (initial):

```
# Orphan role-ref (no resolvable named source)
\bcourier-ferry-\d+\b
\bferry-\d+\b
\bferry-\d+'s?\b

# Un-stripped name attribution on code-surface
\b(Amara|Grok|Gemini|Codex|Cursor|Aaron|Otto)\s+ferry-\d+\b
\bPer\s+(Amara|Grok|Gemini|Codex|Cursor|Aaron|Otto)\s+2026-
```
Copy link

Copilot AI Apr 28, 2026

Choose a reason for hiding this comment

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

P1 (shell portability): The proposed detector regexes use \b and \d, which aren’t POSIX ERE and won’t work with common grep -E/awk (notably on macOS). Since this row proposes implementing the lint as a bash script, specify an engine that supports these tokens (e.g., ripgrep PCRE2) or rewrite the patterns in portable ERE form (e.g., [0-9]+ and explicit boundary handling).

Copilot uses AI. Check for mistakes.
Comment on lines +55 to +56
`docs/pr-preservation/**`, `docs/pr-discussions/**`, commit
messages
Copy link

Copilot AI Apr 28, 2026

Choose a reason for hiding this comment

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

P1 (xref / rule alignment): This list says docs/pr-discussions/** is a “history surface per Otto-279”, but docs/AGENT-BEST-PRACTICES.md’s Otto-279 history-surface list does not include docs/pr-discussions/** (it lists docs/pr-preservation/**). Either remove docs/pr-discussions/** from the “per Otto-279” claim, or update the cited rule so the surfaces list is consistent.

Suggested change
`docs/pr-preservation/**`, `docs/pr-discussions/**`, commit
messages
`docs/pr-preservation/**`, commit messages

Copilot uses AI. Check for mistakes.
Comment on lines +46 to +52
Scope:

- **Apply to:** `tools/**` (excluding `tools/lean4/.lake/`),
behavioural docs in `docs/` (excluding history surfaces),
`.claude/skills/**/SKILL.md` (skill bodies),
`src/**`, `*.fsproj`, `*.csproj`
- **Exclude (history surfaces per Otto-279):** `memory/**`,
Copy link

Copilot AI Apr 28, 2026

Choose a reason for hiding this comment

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

P1: The scan scope includes very broad roots (tools/**, docs/**, src/**) but doesn’t explicitly exclude references/upstreams/**, which the repo’s standing rules require excluding from file-iteration scans due to size/noise (docs/AGENT-BEST-PRACTICES.md “Exclude references/upstreams/ from every file-iteration command”). Please add that exclusion to the planned lint’s scope/implementation notes to avoid a slow, noisy audit.

Copilot uses AI. Check for mistakes.
Comment on lines +66 to +77
Candidate detector regex (for code-surface files only — `tools/`,
`docs/` excluding history-surfaces, behavioural docs):

```
\bcourier-ferry-\d+\b
\bferry-\d+\b
\bferry-\d+'s?\b
```

Plus the inverse: `\b<Person>\s+ferry-\d+\b` (Amara/Grok/Gemini etc
+ ferry-N) to catch un-stripped name attribution that should have
been stripped on code-surface.
Copy link

Copilot AI Apr 28, 2026

Choose a reason for hiding this comment

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

P1 (shell portability): The “Candidate detector regex” examples here use \b and \d, which are PCRE tokens and can be misleading if the eventual implementation uses grep -E/awk (the repo’s hygiene scripts frequently target macOS portability). Consider either rewriting these patterns in portable ERE form, or explicitly noting the intended engine/tool (e.g., ripgrep PCRE2) so future implementers don’t copy/paste a non-working regex into a bash hygiene script.

Copilot uses AI. Check for mistakes.
Comment on lines +80 to +82
lint shape (write-time scan). Backlog candidate: B-NNNN — extend the
existing `audit-*` scripts under `tools/hygiene/` to flag these
patterns with a fix-suggestion: "remove the attribution clause OR
Copy link

Copilot AI Apr 28, 2026

Choose a reason for hiding this comment

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

P1: This memory still uses the placeholder “Backlog candidate: B-NNNN” even though this PR introduces the concrete backlog row B-0070. Update this reference to B-0070 (and ideally link to docs/backlog/P2/B-0070-orphan-role-ref-detector-lint-aaron-2026-04-28.md) so readers can jump straight to the actionable follow-up.

Suggested change
lint shape (write-time scan). Backlog candidate: B-NNNN — extend the
existing `audit-*` scripts under `tools/hygiene/` to flag these
patterns with a fix-suggestion: "remove the attribution clause OR
lint shape (write-time scan). Backlog follow-up: `B-0070`
(`docs/backlog/P2/B-0070-orphan-role-ref-detector-lint-aaron-2026-04-28.md`)
— extend the existing `audit-*` scripts under `tools/hygiene/` to flag
these patterns with a fix-suggestion: "remove the attribution clause OR

Copilot uses AI. Check for mistakes.
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