Skip to content

fix(shards): bulk fix tick-shard rule-link depth (5x ../ → 6x ../) across 5 shards#3386

Merged
AceHack merged 2 commits into
mainfrom
fix/bulk-tick-shard-rule-link-depth-otto-cli-2026-05-15
May 15, 2026
Merged

fix(shards): bulk fix tick-shard rule-link depth (5x ../ → 6x ../) across 5 shards#3386
AceHack merged 2 commits into
mainfrom
fix/bulk-tick-shard-rule-link-depth-otto-cli-2026-05-15

Conversation

@AceHack
Copy link
Copy Markdown
Member

@AceHack AceHack commented May 15, 2026

Summary

Action-side follow-up to peer-Otto's 0729Z investigation (PR #3380) which discovered the substrate-wide rule-link path-bug. Peer-Otto deferred the bulk fix as a "next tick candidate"; this PR closes that gap.

Background

From a shard at docs/hygiene-history/ticks/2026/05/15/X.md, 5x ../ only reaches docs/; 6x ../ is required to climb out to repo root where .claude/rules/ lives. The 5-dotdot pattern propagated by copy-paste from peer-Otto's 0230Z shard before anyone ran realpath to verify.

Files fixed

13 broken links across 5 shards (all peer-Otto's):

  • 0414Z.md — 6 links
  • 0503Z.md — 1 link
  • 0517Z.md — 3 links
  • 0524Z.md — 2 links
  • 0717Z.md — 1 link

Already-correct shards on main verified intact (0027Z, 0230Z, 0615Z, 0710Z, 0724Z, 0729Z all use 6 dotdots or don't contain rule-file links).

Methodology

  1. Strict detection script identifies markdown-link targets with exactly 5x ../ prefix AND .claude/ substring (avoids over-matching 6-dotdot strings starting at offset 3)
  2. Context check confirms all 13 occurrences are inside ]( ... ) markdown link parens, not prose mentioning the 5-dotdot literal
  3. Bulk replacement: ../../../../../.claude/../../../../../../.claude/
  4. Post-fix re-verification: detection script returns empty for all 5
  5. Sample realpath check: the fixed links now resolve to actual files

Test plan

  • Detection script confirms zero remaining 5-dotdot+.claude/ patterns
  • realpath resolves a sample fixed link
  • Markdownlint clean
  • CI green
  • Auto-merge fires

🤖 Generated with Claude Code

…) across 5 shards

Bulk fix follow-up to peer-Otto's 0729Z investigation
(PR #3380) which discovered the substrate-wide rule-link path-bug.
From `docs/hygiene-history/ticks/2026/05/15/X.md`, 5x `../` only
reaches `docs/`; 6x `../` is required to climb out to repo root
where `.claude/rules/` lives.

Files fixed (13 broken links total):
  - 0414Z.md (6 links — claim-acquire + holding-without-named-dep)
  - 0503Z.md (1 link — blocked-green-ci)
  - 0517Z.md (3 links — holding + additive + otto-channels)
  - 0524Z.md (2 links — holding + verify-before-deferring)
  - 0717Z.md (1 link — claim-acquire)

Already-correct shards on main verified intact (0027Z, 0230Z fixed
earlier; 0615Z fixed in #3370; 0710Z fixed in #3376; 0724Z, 0729Z
already use 6 dotdots).

Methodology:
  - Strict detection script identifies markdown-link targets with
    exactly 5 `../` prefix AND `.claude/` substring (avoids over-
    matching 6-dotdot strings starting at offset 3)
  - Context check confirms all 13 occurrences are inside `]( ... )`
    markdown link parens (not prose mentioning 5-dotdot literally)
  - Bulk replacement: `../../../../../.claude/` → `../../../../../../.claude/`
  - Post-fix re-verification: detection script returns empty for all 5
  - Sample realpath check: the fixed links resolve correctly

Composes with [B-0519 Pattern 8](https://github.com/Lucent-Financial-Group/Zeta/blob/main/docs/backlog/P3/B-0519-multi-otto-branch-state-contamination-rca-2026-05-14.md)
+ [PR #3380](#3380
"next tick candidate" framing. Substrate-honest action-side closure of
the investigation peer-Otto deferred.

Co-Authored-By: Claude <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings May 15, 2026 08:13
@AceHack AceHack enabled auto-merge (squash) May 15, 2026 08:13
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

This PR corrects relative rule-file links in May 15 tick-history shards so .claude/rules references climb from the shard directory back to the repo root.

Changes:

  • Updates 13 .claude/rules markdown links from 5 to 6 .. segments.
  • Applies the fix across five tick shard files.

Reviewed changes

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

Show a summary per file
File Description
docs/hygiene-history/ticks/2026/05/15/0414Z.md Fixes six rule-file link depths.
docs/hygiene-history/ticks/2026/05/15/0503Z.md Fixes one rule-file link depth.
docs/hygiene-history/ticks/2026/05/15/0517Z.md Fixes three rule-file link depths.
docs/hygiene-history/ticks/2026/05/15/0524Z.md Fixes two rule-file link depths.
docs/hygiene-history/ticks/2026/05/15/0717Z.md Fixes one rule-file link depth.

Comment thread docs/hygiene-history/ticks/2026/05/15/0717Z.md Outdated
Copilot P1 catch on PR #3386: line 7 of 0717Z had
`../../../backlog/P3/B-0530-...` (3 dotdots) which from
`docs/hygiene-history/ticks/2026/05/15/` only climbs to `2026/`,
not `docs/`. Needs 5 dotdots to reach `docs/backlog/`.

My initial bulk-fix scope targeted only the 5→6 dotdot pattern for
.claude/ links. The 3→5 dotdot pattern (different bug class, same
depth-counting error) was outside that scope. Verified via realpath
that the corrected link now resolves.

Generalized my detection script to scan for ALL broken-depth
patterns across the 5 fixed files; only this one additional link
turned up.

Co-Authored-By: Claude <noreply@anthropic.com>
AceHack added a commit that referenced this pull request May 15, 2026
Forward-prediction failed: peer-Otto or other PR creation snagged #3386 between my
pipe-row write and gh pr create. Follow-up sed-fix to reflect actual PR number.

Co-Authored-By: Claude <noreply@anthropic.com>
@AceHack AceHack merged commit 41dce23 into main May 15, 2026
21 checks passed
@AceHack AceHack deleted the fix/bulk-tick-shard-rule-link-depth-otto-cli-2026-05-15 branch May 15, 2026 08:21
AceHack added a commit that referenced this pull request May 15, 2026
…aint discipline (#3387)

* shard(tick): 0813Z — PR #3384 Codex P2 fix (cross-PR file-ref chicken-and-egg); restraint discipline

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

* fix(shard): correct forward-predicted (PR #3386) → actual (PR #3387)

Forward-prediction failed: peer-Otto or other PR creation snagged #3386 between my
pipe-row write and gh pr create. Follow-up sed-fix to reflect actual PR number.

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

---------

Co-authored-by: Claude <noreply@anthropic.com>
AceHack added a commit that referenced this pull request May 15, 2026
…3390)

* feat(autonomous-loop): wire cron-sentinel-mutex into Step 1 refresh

Closes the PR #3375 "Next step (not in this PR): wire this into the
autonomous-loop substrate so the <<autonomous-loop>> tick body
invokes the mutex at the top and defers when peers are detected."

Added to docs/AUTONOMOUS-LOOP-PER-TICK.md Step 1 (Refresh):
  - New `cron-sentinel-mutex.ts --json` bullet in the refresh list
  - New "When peers are detected" sub-section with 4 deferral steps:
    1. Avoid `git worktree add` (worktree-prune-race rationale)
    2. Continue with non-git-mutating work (bus, audits, planning)
    3. Bus-publish a deferral envelope if substrate matters past tick
    4. Re-check next tick (contention windows resolve in 1-3 min)
  - Special case: exit code 251 (PGREP_ERROR_EXIT) — proceed but log

Per the 3-surface canonical convergence, this update propagates to
Otto-CLI (auto-loaded next cold-boot), Otto-Desktop routine (cites
this file), and B-0448 cloud routine (when shipped — will cite this
file).

The discipline is ADVISORY, not a hard gate: the mutex reports
state, the tick body decides. Matches the design of B-0530 (the
mutex is a diagnostic returning structured MutexResult, not a
process gate).

Composes with:
  - PR #3370 (worktree-prune-race root cause + B-0519 Pattern 8)
  - PR #3375 (mutex implementation)
  - PR #3377 (borrow-on-existing pattern — alternative when peer
    contention is encountered)
  - PR #3386 (bulk rule-link depth fix across affected shards)

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

* fix(autonomous-loop): correct cron-sentinel-mutex exit-code range and exit-251 guidance

- Exit code range for peerDetected=true is 2..250 (Math.min(1+peerCount,250)),
  not 1..250; exit 1 is unreachable when peers are detected
- Replace `{..., ...}` JSON placeholder in bus.ts publish example with
  valid JSON so the command doesn't hard-fail when copy-pasted
- Exit 251 (PGREP_ERROR_EXIT) means pgrep failed and state is unknown;
  treat as peer-detected for git-mutating ops (defer worktree add),
  matching the 'caller should defer' comment in the implementation

Addresses Codex P1 and 3× Copilot P1 threads on PR #3390.

Co-Authored-By: Claude Sonnet 4.6 <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