Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 23 additions & 5 deletions .claude/rules/otto-channels-reference-card.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,15 +55,33 @@ Allocating a new monotonically-increasing ID across multi-Otto surfaces
items if numeric, etc.) requires checking BOTH ambient surfaces β€” not just
on-disk state:

1. **On-disk check** β€” what's currently merged:
1. **Merged-state check via `origin/main`** β€” what's currently merged
(regardless of local worktree state):

```bash
# Portable across GNU + BSD find (macOS/Linux). The `B-NNNN` pattern only
# appears once per filename in practice, so extracting from full paths is safe.
find docs/backlog -name "B-*.md" -type f \
| grep -oE "B-[0-9]+" | sort -u -t- -k2 -n | tail -3
# `git fetch origin` (no branch arg) updates ALL configured remote-tracking
# refs reliably; the form `git fetch origin main` updates FETCH_HEAD but
# may not refresh refs/remotes/origin/main under all configs (refspec
# overrides, partial-clone, etc.).
Comment on lines +62 to +65
git fetch origin
Comment on lines +62 to +66
git ls-tree -r origin/main -- docs/backlog/ \
| awk '{print $4}' | grep -oE "B-[0-9]+" | sort -u -t- -k2 -n | tail -5
Comment on lines +66 to +68
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Short-circuit ID lookup when fetch fails

The new origin/main check runs git ls-tree even if git fetch origin fails, because the commands are separate lines. In offline/auth-error cases this silently falls back to a stale origin/main, which recreates the exact stale-state ID collision this change is trying to prevent. Make the lookup conditional on a successful fetch (e.g., &&) or add an explicit failure guard before reading origin/main.

Useful? React with πŸ‘Β / πŸ‘Ž.

```

**Important**: do NOT use `find docs/backlog -name "B-*.md"` on the local
worktree. The local working tree may be on a stale HEAD (detached from
an abandoned rebase, on a feature branch that's behind, etc.), which
gives misleading "what's free" answers. Empirical anchor: tick 0742Z
on 2026-05-15 β€” Otto-CLI's primary worktree was stuck on detached HEAD
`65c7865` from an 8h-stale peer-agent rebase; local `find` showed B-0526
as the top, missing B-0527 + B-0528 (which were taken by PRs #3334 +
#3342 on `origin/main`). The mis-allocation was caught by Copilot review
but reached a public PR-comment first; correction comment had to follow.
See [PR #3381](https://github.com/Lucent-Financial-Group/Zeta/pull/3381)
(which lands `docs/hygiene-history/ticks/2026/05/15/0742Z.md` carrying
the full trace), plus the correction comment on
Comment on lines +81 to +82
[PR #3323](https://github.com/Lucent-Financial-Group/Zeta/pull/3323).

2. **In-flight check** β€” what peer Otto is filing right now:

```bash
Expand Down
Loading