Conversation
…o orphaned-branch scope The substrate-drift discriminator (row-scope, step 0) generalizes naturally to orphaned-branch surface: before assuming orphaned commits need re-landing, verify the substrate they encode against current origin/main via per-file diff. Discovered while triaging the orphaned `otto/2012z-...` branch (2026-05-18 vintage, 5 unmerged commits including HC-8 NCI). The HC-8 commit (f0abf3e) had been rescued by PR #4205 between orphan creation and the cold-boot tick — re-landing would have been duplicate work. 4 of 5 commits showed similar already-on-main state; the 5th was a runtime-script (.gemini/bin/lior-loop-tick.ts) that the special-case guard correctly flags as DO NOT re-apply. Adds a new "Orphaned-branch triage discriminator" section after the main gate steps with: - 3-step verification procedure (grep main, per-file diff, line count) - 3-tier interpretation table (0 / 20-50 / hundreds of lines) - Special-case guard for runtime scripts that evolve continuously - Empirical anchors: PR #4205 + PR #4461 + PR #4472 - Composes-with edge to honor-those-that-came-before.md at orphaned-commit scope The shard at PR #4472 documented the discovery; this PR makes the discriminator actually reachable for future-Otto cold-boots via the auto-loaded rule. Co-Authored-By: Claude <noreply@anthropic.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1a0ce66e51
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| - `git show --name-only --format="" <sha> | head -1` — pick the first | ||
| file the commit touched | ||
| - `git diff origin/main..<sha> -- "<that file>"` — count lines |
There was a problem hiding this comment.
Compare all touched files before classifying rescue
This procedure can misclassify multi-file commits as fully rescued because it samples only the first changed file and then treats 0 lines as “fully rescued.” If that first file happens to match origin/main but later files in the same commit still differ, the workflow will incorrectly skip re-landing real deltas and lose substrate. The check should diff the entire commit (or every touched file), not head -1.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Pull request overview
This PR extends the factory’s backlog-item start gate rule with an orphaned-branch triage discriminator, aimed at preventing duplicate or regressive re-landing of already-rescued substrate when a cold-boot session discovers an orphaned feature branch.
Changes:
- Adds an “Orphaned-branch triage discriminator” section with a lightweight verification procedure and interpretation tiers.
- Adds a runtime-script guard warning against re-applying stale versions of continuously-evolving operational scripts.
- Adds new composition/anchor references in the “Composes with” section to support the new discriminator guidance.
| - `git show --name-only --format="" <sha> | head -1` — pick the first | ||
| file the commit touched |
| - `git show --name-only --format="" <sha> | head -1` — pick the first | ||
| file the commit touched | ||
| - `git diff origin/main..<sha> -- "<that file>"` — count lines | ||
|
|
||
| Interpretation: | ||
| `0 lines` = substrate identical; fully rescued; no re-landing needed | ||
| (e.g., `f0abf3ed` HC-8 NCI was rescued by | ||
| [PR #4205](https://github.com/Lucent-Financial-Group/Zeta/pull/4205)). | ||
| `20–50 lines` = partial drift; substrate evolved on main; cell-by-cell | ||
| triage needed; the on-main version is usually preferred unless the | ||
| orphaned content carries genuine deltas. | ||
| `hundreds of lines` = genuine substrate not yet on main; cherry-pick | ||
| worth considering (with operator awareness, since orphaned-branch | ||
| context may have been superseded by newer architectural decisions). |
… empirical anchor (#4482) Aaron's #4477 landed the orphaned-branch discriminator section with 3 empirical anchors (#4461 cold-boot, #4472 spot-check discovery, #4205 peer rescue). My #4478 merged ~1 min after #4477 was authored — too late to be included in the original empirical anchor list. Adds #4478 between #4472 and #4205 in chronological substrate-evolution order: cold-boot → spot-check discovery → full-file verification → rescue context. The full-file diff across ALL 32 + 4 + 4 + 4 + 2 files of the 5 orphaned commits confirmed the cheap first-file heuristic correctly classified 4 of 4 cases this session checked exhaustively, anchoring the discriminator's operational reliability. Strengthens the rule's empirical-anchor density without changing the operational discipline. Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
… surface (#4490) * docs(shard/0249Z): 318 working-tree mods categorical triage — discriminator's 4th surface Picks up the 0202Z carry-forward at working-tree-mods scope: categorical triage of 318 untracked-or-modified files on contested root. Categorical breakdown of 283 untracked files: - 146 (54%) Tier A clear-drop: already byte-identical on main - ~11 Tier B local-machine artifacts (not factory substrate) - 126 (46%) Tier C operator-review: missing from main * 109 tick shards from 2026-05-18 (interrupted-session history) * 12 PR-discussions (never made it to substrate) * 3 research docs + 1 backlog row + 1 memory file * 1 .claude/rules byte-differs from main (tonal-momentum...) The substrate-drift discriminator now anchors at 4 surfaces: 1. Row scope (backlog-item-start-gate.md step 0) 2. Orphaned-branch scope (PR #4477 + #4478 + #4482) 3. Stash scope (PR #4485 — 0226Z) 4. Working-tree-mods scope (THIS shard — 0249Z) After 4 surfaces, the 0059Z carry-forward ("311 mods + 52 stashes") is fully surveyed; remaining work is operator-decision on the 126 missing-from-main files. Survey only. No git add / git clean / file-deletion operations. Pre-empt at brief-ack #5 per holding-without-named-dependency rule post-arc-completion empirical anchor. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * fix(shard/0249Z): markdownlint MD042 + MD055 fixes - MD042 (no empty links): replace [1810Z](#) and [1823Z](#) placeholders with plain text (the times are descriptive context, not actual targets — those tick shards are exactly the missing-from-main files this shard is surveying) - MD055 (table pipe style): add leading/trailing pipes to the "Discriminator now spans 4 surfaces" table CI lint failure: https://github.com/Lucent-Financial-Group/Zeta/actions/runs/26202675320/job/77095724018 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * fix(shard/0249Z): correct scope label for PR #4478 per Copilot thread Copilot review caught: PR #4478 is described in the "Composes with" section as "orphaned-commit triage at row scope (5 commits)" but it actually operates at orphaned-BRANCH scope (full-file verification of 5 orphaned commits on otto/2012z-...). Row scope is the backlog-item-start-gate.md step-0 surface, not the orphaned-commit verification surface. Verified-true finding; the wording is corrected to match the actual discriminator surface PR #4478 anchors. The 3 other threads on this PR were already outdated by the markdownlint fix in commit 1cbf8fc. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…-43 prevented); orphaned-branch triage for `otto/2012z-...` + PR #4574 (#4585) 7h 48min after the last in-repo shard (1421Z). CronList empty at cold-boot; CronCreate job `ebc958b7` armed per `tick-must-never-stop.md`. Refresh: graphql=3005 (Normal tier), 11 peer procs (Lior cycling), ls-tree=54 (canary clean). Substantive substrate of this tick: orphaned-branch triage for `otto/2012z-land-nci-tonal-momentum-rules-cross-substrate-triangulator-skill-2026-05-18` + PR #4574 (DIRTY, auto-merge armed since May 18 era; 384 files / 10779 insertions vs origin/main; 17 unresolved threads; 2 required-check failures). Per-commit substrate verification per orphaned-branch triage discriminator (`backlog-item-start-gate.md`): HC-8 NCI fully rescued on main (PR #4205 family + #4478 + #4477 + #4472 + #4461); Agora V6 wave/particle + free-will + cross-substrate triangulation fully rescued (#4537 + #4530 + #4522 + #4517); Lior prompt fix falls under runtime-scripts special-case guard (do NOT re-apply); `tools/kiro/kiro-loop-wrapper.sh` is the single non-redundant slice (file does NOT exist on origin/main). Recommended Pattern A → C blend: disarm auto-merge + close PR #4574 substrate-honest with rescue cross-links + open small focused PR for kiro-loop-wrapper.sh slice only. Forward-signal, not this-tick execution (multi-step + 17-thread + 2-required-check scope deserves operator awareness). Working-tree contested mod (`tools/kiro/kiro-loop-wrapper.sh` shellenv.sh source-block) NOT committed — peer-Otto/Alexa uncommitted state preserved. 3 untracked Lior worktree directories NOT touched. Composes with: backlog-item-start-gate orphaned-branch triage discriminator + claim-acquire stale-armed-PR patterns + honor-those-that-came-before + holding-without-named-dependency (concrete artifact = this shard) + zeta-expected-branch isolated-worktree race-window-caveat + codeql-canary pre/post-commit checks + refined-detection regex `lior|gemini.*--yolo` (Anchor 6 from the 21min-Lior session-arc memo). Co-authored-by: Claude <noreply@anthropic.com>
Summary
Extends
.claude/rules/backlog-item-start-gate.mdwith a new Orphaned-branch triage discriminator section that generalizes the existing row-scope substrate-drift discriminator (step 0) to the orphaned-branch surface.Why
Per
.claude/rules/wake-time-substrate.md: "Every load-bearing learning must reach CLAUDE.md or a pointer from it."The discovery captured in PR #4472 (0149Z follow-up shard) — that 4 of 5 orphaned commits on
otto/2012z-...had already been rescued via peer agents — sits in a tick shard alone. The auto-loaded rule is where the discriminator needs to live to actually reach future-Otto cold-boots before they over-triage orphaned branches.What the extension adds
0 lines= rescued /20–50= partial drift /hundreds= genuine deltas).gemini/bin/lior-loop-tick.tsand similar): DO NOT re-apply without operator awareness even with large diffs, because runtime scripts evolve continuously on mainhonor-those-that-came-before.md: verifying substrate-on-main IS the honor at orphaned-commit scopeVerify
.claude/rules/backlog-item-start-gate.md(+59 lines)0a.step broke ordered-list parsing (MD029); refactored as a top-level sub-section after the main gate steps🤖 Generated with Claude Code