Skip to content
Closed
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
---
pr_number: 4472
title: "shard(2026-05-21/0149Z): orphaned-branch triage \u2014 substrate-drift discriminator generalizes"
author: "AceHack"
state: "MERGED"
created_at: "2026-05-21T01:56:38Z"
merged_at: "2026-05-21T01:58:14Z"
closed_at: "2026-05-21T01:58:14Z"
head_ref: "shard/tick-0149z-otto-cli-orphaned-branch-mostly-rescued-substrate-drift-discriminator-generalizes-2026-05-21"
base_ref: "main"
archived_at: "2026-05-21T02:51:37Z"
archive_tool: "tools/pr-preservation/archive-pr.ts"
---

# PR #4472: shard(2026-05-21/0149Z): orphaned-branch triage — substrate-drift discriminator generalizes

## PR description

## Summary

Follow-up to [PR #4461](https://github.com/Lucent-Financial-Group/Zeta/pull/4461) + [PR #4468](https://github.com/Lucent-Financial-Group/Zeta/pull/4468) (0059Z cold-boot + corrections). Verifies the orphaned `otto/2012z-...` branch carry-forward against current `origin/main`.

**Finding**: 4 of 5 orphaned commits' substrate is already rescued via peer agents. HC-8 NCI (`f0abf3ed`) was landed by [PR #4205](https://github.com/Lucent-Financial-Group/Zeta/pull/4205) between 2026-05-18 (orphan creation) and 2026-05-21 (cold-boot). The 0059Z carry-forward overestimated re-landing needs.

**Generalization**: the substrate-drift discriminator from [`.claude/rules/backlog-item-start-gate.md`](https://github.com/Lucent-Financial-Group/Zeta/blob/main/.claude/rules/backlog-item-start-gate.md) step 0 (row-scope) generalizes to **orphaned-branch scope**: before re-landing, run `git diff origin/main..<sha>` per file. 0 lines = fully rescued; 20-50 = partial drift; hundreds = genuine deltas worth cherry-picking.

**DO NOT re-apply `467424ec` Lior prompt fix** — Lior's prompt has evolved repeatedly since 2026-05-18; re-applying the stranded fix would regress 22 lines of newer prompt-engineering work.

## Verify

- 1 file added: `docs/hygiene-history/ticks/2026/05/21/0149Z.md` (83 lines)
- Pre-push gate passed (MD032 / markdownlint / relative-path audit)
- Branch off current `origin/main` (`7dd66fb7`) — no rebase conflict expected

🤖 Generated with [Claude Code](https://claude.com/claude-code)

## Reviews

### COMMENTED — @copilot-pull-request-reviewer (2026-05-21T01:58:19Z)

## Pull request overview

Adds a new hygiene-history tick shard documenting an orphaned-branch triage verification against `origin/main`, and generalizes the existing “substrate-drift discriminator” concept to orphaned-commit triage so future sessions avoid redundant re-landing or regressions.

**Changes:**
- Adds tick 0149Z documenting that most orphaned commits’ substrate is already present on `origin/main` (via other PRs/rescues).
- Introduces an “orphaned-branch triage discriminator” procedure using `git show` + `git diff origin/main..<sha> -- <file>` to classify rescue vs drift vs real deltas.
- Records explicit guidance not to re-apply the stale Lior prompt fix commit due to on-main evolution.
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
---
pr_number: 4477
title: "rule(backlog-item-start-gate): extend substrate-drift discriminator to orphaned-branch scope"
author: "AceHack"
state: "MERGED"
created_at: "2026-05-21T02:11:37Z"
merged_at: "2026-05-21T02:13:36Z"
closed_at: "2026-05-21T02:13:36Z"
head_ref: "rule/backlog-item-start-gate-extend-substrate-drift-discriminator-to-orphaned-branch-scope-2026-05-21"
base_ref: "main"
archived_at: "2026-05-21T02:51:36Z"
archive_tool: "tools/pr-preservation/archive-pr.ts"
---

# PR #4477: rule(backlog-item-start-gate): extend substrate-drift discriminator to orphaned-branch scope

## PR description

## Summary

Extends [`.claude/rules/backlog-item-start-gate.md`](https://github.com/Lucent-Financial-Group/Zeta/blob/main/.claude/rules/backlog-item-start-gate.md) with 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`](https://github.com/Lucent-Financial-Group/Zeta/blob/main/.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](https://github.com/Lucent-Financial-Group/Zeta/pull/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

- **3-step verification procedure** (grep main for rescue PR; per-file diff; line count)
- **3-tier interpretation table** (`0 lines` = rescued / `20–50` = partial drift / `hundreds` = genuine deltas)
- **Special-case guard for runtime scripts** (`.gemini/bin/lior-loop-tick.ts` and similar): DO NOT re-apply without operator awareness even with large diffs, because runtime scripts evolve continuously on main
- **Empirical anchors**: [PR #4205 (HC-8 rescue)](https://github.com/Lucent-Financial-Group/Zeta/pull/4205) + [PR #4461 (0059Z cold-boot)](https://github.com/Lucent-Financial-Group/Zeta/pull/4461) + [PR #4472 (0149Z discovery)](https://github.com/Lucent-Financial-Group/Zeta/pull/4472)
- **Composes-with** edge to [`honor-those-that-came-before.md`](https://github.com/Lucent-Financial-Group/Zeta/blob/main/.claude/rules/honor-those-that-came-before.md): verifying substrate-on-main IS the honor at orphaned-commit scope

## Verify

- 1 file modified: `.claude/rules/backlog-item-start-gate.md` (+59 lines)
- Pre-push gate passed (MD032 / markdownlint / relative-path audit)
- Markdownlint required restructure — original attempt as `0a.` step broke ordered-list parsing (MD029); refactored as a top-level sub-section after the main gate steps

🤖 Generated with [Claude Code](https://claude.com/claude-code)

## Reviews

### COMMENTED — @chatgpt-codex-connector (2026-05-21T02:13:45Z)


### 💡 Codex Review

Here are some automated review suggestions for this pull request.

**Reviewed commit:** `1a0ce66e51`


<details> <summary>ℹ️ About Codex in GitHub</summary>
<br/>

[Your team has set up Codex to review pull requests in this repo](https://chatgpt.com/codex/cloud/settings/general). 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".

</details>

### COMMENTED — @copilot-pull-request-reviewer (2026-05-21T02:14:10Z)

## 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.

## Review threads

### Thread 1: .claude/rules/backlog-item-start-gate.md:90 (unresolved)

**@chatgpt-codex-connector** (2026-05-21T02:13:45Z):

**<sub><sub>![P1 Badge](https://img.shields.io/badge/P1-orange?style=flat)</sub></sub> 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 👍 / 👎.

### Thread 2: .claude/rules/backlog-item-start-gate.md:89 (unresolved)

**@copilot-pull-request-reviewer** (2026-05-21T02:14:10Z):

P0: `git show --name-only --format="" <sha> | head -1` is likely to return a blank line (git prints an empty separator line before the filename list when the commit header is suppressed), so `<that file>` becomes empty and the next `git diff` step won’t work as written. Use a command that never emits the leading blank line (e.g., `git diff-tree --no-commit-id --name-only -r <sha>`), or filter empty lines before `head -1`.

### Thread 3: .claude/rules/backlog-item-start-gate.md:101 (unresolved)

**@copilot-pull-request-reviewer** (2026-05-21T02:14:10Z):

The procedure picks only the first file in the commit and then classifies drift based on “count lines” of raw `git diff` output. Both can misclassify: a commit may have mixed rescued/unrescued files, and diff line-count includes headers/context and can vary by settings. Consider iterating over all touched files and using a stable metric like `--numstat`/`--shortstat` (or `--stat`) for the size tiers.
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
---
pr_number: 4478
title: "docs(shard/0202Z): close 0149Z orphan-branch triage \u2014 full-file verification"
author: "AceHack"
state: "MERGED"
created_at: "2026-05-21T02:12:11Z"
merged_at: "2026-05-21T02:14:00Z"
closed_at: "2026-05-21T02:14:01Z"
head_ref: "shard/tick-0202z-orphan-branch-triage-closeout-otto-cli-2026-05-21"
base_ref: "main"
archived_at: "2026-05-21T02:51:35Z"
archive_tool: "tools/pr-preservation/archive-pr.ts"
---

# PR #4478: docs(shard/0202Z): close 0149Z orphan-branch triage — full-file verification

## PR description

## Summary

Closes the [PR #4472 (0149Z)](https://github.com/Lucent-Financial-Group/Zeta/pull/4472) carry-forward by upgrading the first-file spot-check to **full per-file diff verification** across all 5 orphaned commits on the local-only branch `otto/2012z-land-nci-tonal-momentum-rules-cross-substrate-triangulator-skill-2026-05-18`.

## Verification table (all diffs vs `origin/main` HEAD `9e0b316a`)

| Commit | Verdict |
|---|---|
| `f0abf3ed` HC-8 NCI (2 files) | Fully rescued via [PR #4205](https://github.com/Lucent-Financial-Group/Zeta/pull/4205) → `2df803c5` |
| `29d89be8` Agora V6 followup (4 files) | **0 lines diff on ALL 4 files** — fully rescued (upgrades 0149Z's "likely fully rescued" to confirmed) |
| `09a9a3c2` V6 constitution (32 files) | 20-163 line drift; main version preferred per discriminator |
| `2ca87ef8` Mirror/Beacon (4 files) | 30-37 line uniform drift; main version preferred |
| `467424ec` Lior prompt | 22 lines diff — DO NOT re-apply (Lior prompt evolved) |

Branch is **local-only** (`git ls-remote origin "otto/2012z-..."` returns empty) → no remote cleanup needed.

## Operational outcome

- Closes 0149Z carry-forward ("spot-check the 4 remaining commits more carefully")
- Adds empirical-anchor confirmation that the substrate-drift discriminator generalizes from row-scope ([`backlog-item-start-gate.md`](.claude/rules/backlog-item-start-gate.md) step 0) to orphaned-branch-scope: first-file spot-check correctly classified 4 of 4 cases this session checked
- Authored from isolated worktree per [`zeta-expected-branch.md`](.claude/rules/zeta-expected-branch.md) race-window-caveat (contested root has 311 stale mods + 52 stashes from prior-session state)

## Test plan

- [x] `git ls-tree HEAD` = 53 (canary check per [`codeql-no-source-on-docs-only-pr-is-broken-commit-canary.md`](.claude/rules/codeql-no-source-on-docs-only-pr-is-broken-commit-canary.md))
Comment on lines +38 to +43
- [x] Per-file diffs reproducible via `git diff origin/main..<sha> -- <path> | wc -l` on fresh `origin/main` worktree
- [x] All cross-references to PRs / rules use stable paths (no `<N>`-style placeholders)
- [ ] CI runs (docs-only, no F# touched)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

## Reviews

### COMMENTED — @copilot-pull-request-reviewer (2026-05-21T02:15:21Z)

## Pull request overview

Adds a new hygiene-history tick shard (0202Z) to close the 0149Z orphaned-branch triage carry-forward by documenting full per-file diff verification for all commits on the stranded local-only branch.

**Changes:**
- Adds `0202Z` tick documenting full file-by-file verification of 5 orphaned commits vs `origin/main`.
- Records the supersession verdict and restates the discriminator with an empirical-anchor confirmation.

## Review threads

### Thread 1: docs/hygiene-history/ticks/2026/05/21/0202Z.md:13 (unresolved)

**@copilot-pull-request-reviewer** (2026-05-21T02:15:21Z):

P1: In the `f0abf3ed` row, “2 files (`docs/ALIGNMENT.md`, new rule)” is ambiguous and appears inconsistent with the referenced rescue PR description (which indicates the second file was a research doc). Please name the exact second file path (or clarify what “new rule” refers to) so the verification is reproducible and the cross-reference stays accurate.

### Thread 2: docs/hygiene-history/ticks/2026/05/21/0202Z.md:15 (unresolved)

**@copilot-pull-request-reviewer** (2026-05-21T02:15:21Z):

P1: The parenthetical “B-0633 was subsequently deleted on main per `git status`” is inaccurate/unclear: there is currently a `docs/backlog/P3/B-0633-...md` on main, and `git status` isn’t a reliable way to assert deletion history. Suggest rewording to the specific file/renumbering event you observed (e.g., B-0633→B-0649) or drop the deletion claim.
Loading
Loading