Skip to content

fix(xrefs): update Riven-migration backlinks per Codex P2 on PR #3513#3529

Merged
AceHack merged 1 commit into
mainfrom
fix/post-merge-riven-migration-backlinks-otto-cli-2026-05-15
May 15, 2026
Merged

fix(xrefs): update Riven-migration backlinks per Codex P2 on PR #3513#3529
AceHack merged 1 commit into
mainfrom
fix/post-merge-riven-migration-backlinks-otto-cli-2026-05-15

Conversation

@AceHack
Copy link
Copy Markdown
Member

@AceHack AceHack commented May 15, 2026

Summary

Addresses Codex P2 finding on the (already-merged) Riven §33 migration PR #3513. The migration moved `docs/research/2026-05-01-claudeai-backlog-driven-dual-pm-loop-with-refresh-discipline.md` to `memory/persona/riven/conversations/` but did not carry the existing references — three live navigation pointers had dead links until this PR.

Files

File Why live-navigation
`.claude/rules/refresh-before-decide.md` Auto-loaded rule cites the verbatim packet
`docs/backlog/P1/B-0159-...md` Backlog row origin pointer
`memory/feedback_refresh_before_decide_invariant_two_layer_print_dx_claudeai_2026_05_01.md` Description + caused_by + composes_with entries

NOT updated (intentional)

  • `docs/history/pr-reviews/*` — frozen historical state (snapshot of PR-review at time of authoring)
  • `docs/hygiene-history/ticks/*` — frozen tick shards
  • `docs/pr-discussions/*` — frozen PR-discussion archives
  • Sibling `docs/research/*.md` files — themselves candidates for future migration; their internal pointers are part of their own provenance trail

Test plan

  • Diff is exactly 3 files, all paths updated
  • Relative-path math verified for `docs/backlog/P1/` (`../../../memory/persona/...`)
  • CI green
  • Auto-merge arms

🤖 Generated with Claude Code

#3513

Codex flagged dead xrefs after PR #3513 (Riven §33 migration) moved
docs/research/2026-05-01-claudeai-backlog-driven-dual-pm-loop-with-refresh-discipline.md
to memory/persona/riven/conversations/. Three live-navigation pointers
needed updating:

- .claude/rules/refresh-before-decide.md (the rule cites the verbatim
  packet — load-bearing pointer at auto-load scope)
- docs/backlog/P1/B-0159-...md (the backlog row's origin pointer)
- memory/feedback_refresh_before_decide_invariant_two_layer_print_dx_claudeai_2026_05_01.md
  (description + caused_by + composes_with entries)

Per docs/history/pr-reviews/* + docs/hygiene-history/ticks/* + docs/pr-discussions/*
NOT updated — those are frozen historical state.
Sibling docs/research/*.md xrefs NOT updated — those are themselves
candidates for future migration and their internal pointers are part
of their own provenance trail.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings May 15, 2026 17:48
@AceHack AceHack enabled auto-merge (squash) May 15, 2026 17:48
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 three live-navigation cross-references that broke when PR #3513 moved the Claude.ai 2026-05-01 feedback packet from docs/research/ to Riven's persona conversations folder. Each pointer (auto-loaded rule, backlog row origin, and feedback memo description/caused_by/sources) is repointed to the new location. Historical/frozen surfaces (PR-review archive, hygiene tick shards, PR-discussion archives) are intentionally left as-is.

Changes:

  • Repoint verbatim-packet reference in .claude/rules/refresh-before-decide.md to memory/persona/riven/conversations/....
  • Update backlog row B-0159 origin link with corrected ../../../memory/... relative depth.
  • Update three references in the refresh_before_decide feedback memo (description, caused_by, Sources).

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
.claude/rules/refresh-before-decide.md Updates the verbatim-packet path to its new persona-folder location.
docs/backlog/P1/B-0159-refresh-github-worldview-cross-cutting-claudeai-2026-05-01.md Repoints origin link to the migrated file with correct ../../../memory/... relative path.
memory/feedback_refresh_before_decide_invariant_two_layer_print_dx_claudeai_2026_05_01.md Updates three references (description, caused_by, Sources link) to the migrated packet.

AceHack added a commit that referenced this pull request May 15, 2026
; dead-xref fix shipped (#3533)

- All 3 prior-tick PRs merged
- Audit of post-merge review activity surfaced Codex P2 finding on PR #3513
- Filed PR #3529 — 3-file backlinks fix (rule + backlog row + feedback memo)
- Codex thread replied + resolved
- 3-tick parallel-audit pattern: 1718Z → 1731Z → 1749Z, each tick audits prior tick

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@AceHack AceHack merged commit 8e6901a into main May 15, 2026
27 of 29 checks passed
@AceHack AceHack deleted the fix/post-merge-riven-migration-backlinks-otto-cli-2026-05-15 branch May 15, 2026 18:05
AceHack added a commit that referenced this pull request May 15, 2026
Codex P2 finding on already-merged PR #3513 named a real bug class:
§33 migrations move files but don't auto-update backlinks. Narrow fix
shipped as PR #3529; this row captures the broader pattern.

Empirical scan (tick 1802Z) surfaced 20+ dead xrefs in live-nav
surfaces across 8 migrated personas. Two-slice approach:

- Slice A: per-persona PR batches updating dead xrefs in live-nav
  surfaces (excludes frozen history archives)
- Slice B: static lint at tools/hygiene/lint-section-33-xrefs.ts +
  wired into gate.yml; composes with B-0532 mechanization pattern

ID-allocation discipline applied: B-0531 in-flight (PR #3520), B-0532
on main (file lint), B-0533 free + verified via gh pr list search.

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
AceHack added a commit that referenced this pull request May 15, 2026
Mechanizes the dead-xref class Codex P2 caught on PR #3513 (Riven §33
archive migration). Scans live-nav surfaces for references to
docs/research/<basename> where <basename> has been migrated to
memory/persona/<persona>/conversations/<basename>.

Scope (Slice B.1):

- Detect-only scanner (exit 0 always; humans triage before fixing)
- Walks .claude/{rules,agents,commands,skills}/, memory/*.md (top-level
  only, persona/ excluded), docs/backlog/, repo-root *.md
- Skips frozen historical archives (docs/history, docs/hygiene-history,
  docs/pr-discussions, docs/research itself, memory/persona/**/conversations/)

Empirical baseline (first run): 10 dead xrefs (9 DeepSeek + 1 Riven that
PR #3529's manual fix missed at line 135). My earlier rough-scan estimate
of 20+ was a false positive — the scanner gives substrate-honest truth.

Follow-up slices (separate PRs):

- Slice B.2: test file (DST-friendly fixtures)
- Slice B.3: wire into .github/workflows/gate.yml as warn-only
- Slice B.4: promote to error after baseline cleanup

Composes with B-0532 (sibling lint pattern), audit-rule-cross-refs.ts
(template), B-0533 (parent row).

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
AceHack added a commit that referenced this pull request May 15, 2026
…st correction (10 dead xrefs, not 20+) (#3550)

- PR #3546 (1820Z) merged
- PR #3548 — Slice B.1 scanner (audit-section-33-migration-xrefs.ts, 284 LOC)
- Empirical baseline: 10 dead xrefs (9 DeepSeek + 1 Riven) — 1807Z's "20+" was false positive
- Scanner caught B-0159:135 dead xref that PR #3529's manual sweep missed
- 7-tick parallel-substantive pattern continues; mechanization landed

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
AceHack added a commit that referenced this pull request May 15, 2026
Completes B-0533 Slice A baseline cleanup. Following the scanner
(PR #3548) empirical baseline of 10 dead xrefs, updates all live-nav
references to migrated §33 archive files.

Mapping: docs/research/<basename> → memory/persona/<persona>/conversations/<basename>

Files updated (6 files, 10 line-edits):

Riven (1):
- docs/backlog/P1/B-0159-refresh-github-worldview-cross-cutting-claudeai-2026-05-01.md:135
  (PR #3529 fixed line 17; this completes the second reference at line 135)

DeepSeek (9):
- docs/backlog/P1/B-0463-wallet-immune-system-vaccine-spread-poucc-spec.md:95, :97
  (hkt-clifford-e8 + immune-system files)
- docs/backlog/P3/B-0202-...md:62, :444
  (claudeai-tinygrad-uop file; ×2 occurrences)
- docs/backlog/P3/B-0203-...md:36, :430
  (claudeai-tinygrad-uop file; ×2 markdown-link occurrences;
  relative path also updated to ../../../memory/persona/deepseek/...)
- memory/feedback_carved_sentence_*.md:580, :1225
  (deepseek-csap-architecture-review-verbatim file; ×2 occurrences)
- memory/feedback_dbsp_zsets_*.md:55
  (claudeai-tinygrad-uop file; 1 occurrence)

Verification: `bun tools/hygiene/audit-section-33-migration-xrefs.ts`
returns "Dead xrefs found: 0" after these edits.

Composes with:
- B-0533 (parent row)
- B-0533 Slice A POC (PR #3544 — established the pattern)
- B-0533 Slice B.1 (PR #3548 — the scanner that surfaced 10/10)
- PR #3529 (narrow Codex P2 fix that missed B-0159:135)

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
AceHack added a commit that referenced this pull request May 15, 2026
* feat(b-0533): Slice B.3 + B.4 — --enforce flag + gate.yml wiring

Completes B-0533 mechanization. Scanner now supports --enforce flag
(exit 1 if dead xrefs found, exit 0 otherwise). New gate.yml job
lint-section-33-migration-xrefs runs the scanner in --enforce mode
on every PR.

With baseline = 0 (PR #3552 cleanup landed) the new gate fires only
when a future migration leaves dead xrefs in live-nav surfaces —
the catch-once-then-lint pattern completing for the §33 migration
class.

Sibling of lint-archive-header-section33 (B-0036): same shape,
different failure-class. Both catch §33-discipline violations at PR
time before merge.

Changes:

- tools/hygiene/audit-section-33-migration-xrefs.ts:
  - Add --enforce CLI flag
  - Add exit code 1 when dead xrefs found and --enforce set
  - Update header comment with new exit-code semantics
- .github/workflows/gate.yml:
  - Add lint-section-33-migration-xrefs job after lint-archive-header-section33
  - Same install.sh + bun pattern as sibling job
  - Header comment cites empirical baseline (10) + full lineage

Discipline arc complete:

| Tick | Slice | PR |
|------|-------|----|
| 1749Z | Catch | #3529 |
| 1807Z | Row | #3540 |
| 1820Z | Slice A POC | #3544 |
| 1833Z | Slice B.1 scanner | #3548 |
| 1844Z | Slice A baseline | #3552 |
| 1848Z | Slice B.3 + B.4 (this) | (new) |

Remaining: Slice B.2 (test file with DST fixtures) — optional, scanner
logic is simple enough that the end-to-end gate.yml job acts as integration test.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* fix(B-0533): dynamically detect root .md files in audit-section-33 scanner

ROOT_MD was hard-coded to 4 files; readdirSync now discovers all repo-root
*.md files so CONTRIBUTING.md, SECURITY.md, CODE_OF_CONDUCT.md, SUPPORT.md
are protected by the enforced gate. Resolves Copilot P1 thread on PR #3555.

Co-Authored-By: Claude <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
AceHack added a commit that referenced this pull request May 16, 2026
…ed (PR #3692) (#3693)

Highest-value-per-effort substrate of session — mechanizes the bug class
that shipped twice this session (5-`..` paths resolving to docs/ instead of
repo root). 255-line audit walks 833 shards, found 17 pre-existing
findings as detect-only baseline. Followup: cleanup PR + enforce gate
following same 4-step pattern as §33 migration xrefs (PR #3513#3529#3548#3552 → enforce).

GraphQL still 0/5000 (resets 02:55:28Z); REST sufficient for PR creation.
Auto-merge arming on #3690 + #3692 deferred to post-reset tick.

Co-authored-by: Claude <noreply@anthropic.com>
AceHack added a commit that referenced this pull request May 16, 2026
…cleanup pending) (#3692)

* feat(hygiene): tick-shard relative-path audit (detect-only; baseline cleanup pending)

Bug class: tick shards live 5 directories below docs/, so the count-the-..
pattern is error-prone. Empirical evidence this session: PR #3676 + PR #3679
both shipped with 5-`..` paths that resolved to docs/ instead of repo root;
Copilot caught both via review threads, but the broken links landed on main
briefly (PR #3680 fixed post-merge).

This audit walks docs/hygiene-history/ticks/**/*.md, extracts every relative
markdown link target (skipping URLs/anchors/code-blocks/images), resolves
from the shard's directory, and reports missing-or-escaping targets.

Empirical baseline (run on origin/main at 2026-05-16T02:48Z):
  - 833 tick shards scanned
  - 17 broken relative-path links across multiple historical shards
  - Real bug classes detected: wrong-depth `..` (B-0442 link in 1436Z),
    malformed link syntax (`docs/api(v2`), missing-file refs

Detect-only initially. CI enforce wires in after baseline cleanup (same
pattern as §33 migration xrefs: PR #3513#3529#3548#3552 → enforce).

`bun --bun tsc --noEmit -p tsconfig.json` exit 0.

Co-Authored-By: Claude <noreply@anthropic.com>

* fix(audit): skip placeholder targets (..., parens, identifier-only)

First baseline showed 17 findings; ~7 were false positives where shard prose
contained inline `[label](path-shape)` constructs as pattern illustrations:
- `path` / `otto-kenji-...` / `.claude/...` / `docs/...` — placeholder names
- `docs/api(v2` — fragmentary malformed syntax
- `docs/research/...amara-...md` — ellipsis-marked example

Add `isPlaceholderTarget` filter:
- contains `...` → placeholder
- contains `(` or `)` → malformed/fragment
- no `/` AND no `.` → pure identifier (not a path)

Re-run: 17 → 10 findings. The 10 remaining are real broken links
(wrong-depth `..` in `1436Z.md`, `0329Z.md`, `0852Z.md`; one borderline
`docs/foo.md` example). Worth a separate baseline-cleanup PR.

`bun --bun tsc --noEmit -p tsconfig.json` exit 0.

Co-Authored-By: Claude <noreply@anthropic.com>

* fix(audit): 4 Copilot P1/P2 — sonarjs disable, main export, URI scheme, --files validation

PR #3692 review threads:

P1 (lint failure risk):
1. spawnSync("git", ...) at repoRoot() needs the standard repo-convention
   `// eslint-disable-next-line sonarjs/no-os-command-from-path` comment.
   Every sibling tool (check-tick-history-shard-schema.ts:23, etc.) uses it.
2. Top-level `process.exit(main(...))` blocks safe module-import for tests
   or composition. Switch to `export function main` + guarded
   `if (import.meta.main) { process.exit(main(...)); }` per the sibling
   audit-section-33-migration-xrefs.ts convention.

P2 (precision / brittleness):
3. isRelativeTarget only exempts http(s) + mailto. Replace with a generic
   `<scheme>:` regex (`/^[A-Za-z][A-Za-z0-9+.-]*:/`) so ftp:, file:, tel:,
   data:, etc. are properly classified as absolute.
4. --files inputs aren't validated; readFileSync throws on missing path.
   Add an explicit existence check at the args boundary; emit
   `input not found: <path>` and return exit 64.

Local verify:
- Baseline still 10 findings (no regression)
- `--files /tmp/does-not-exist` → exit 64 with structured message
- `bun --bun tsc --noEmit -p tsconfig.json` exit 0

Co-Authored-By: Claude <noreply@anthropic.com>

* fix(audit): 2 Copilot fixups — directory inputs + Windows path separator

PR #3692 second-pass review threads:

P1 (line 244): --files validation only checked existsSync; a directory or
unreadable file passed the preflight, then `readFileSync` threw EISDIR/EACCES
inside extractLinks, bypassing the structured exit-64 contract. Tighten to
also require `statSync(abs).isFile()` and wrap stat in try/catch for
permission failures. Empirical verify:
- --files docs/hygiene-history/ → "input not a regular file" + exit 64
- --files /tmp/does-not-exist → "input not found" + exit 64

P2 (line 210): Repo-boundary check hardcoded "/" in `ROOT + "/"`. On Windows
`resolve()` returns paths with `\\` separators, so valid in-repo targets like
`C:\\repo\\docs\\...` would fail the `C:\\repo/` prefix test and be flagged
as `escapes-repo` — false positive that would break --enforce mode on
Windows CI. Replace with platform-correct `PATH_SEP` imported as
`sep as PATH_SEP` from node:path.

Local verify:
- Baseline still 10 findings (no regression)
- `bun --bun tsc --noEmit -p tsconfig.json` exit 0

Co-Authored-By: Claude <noreply@anthropic.com>

---------

Co-authored-by: Claude <noreply@anthropic.com>
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