diff --git a/docs/pr-discussions/PR-0844-ops-0-0-0-post-reset-cleanup-stale-prose-fixes-protection-co.md b/docs/pr-discussions/PR-0844-ops-0-0-0-post-reset-cleanup-stale-prose-fixes-protection-co.md new file mode 100644 index 00000000..48aa96f1 --- /dev/null +++ b/docs/pr-discussions/PR-0844-ops-0-0-0-post-reset-cleanup-stale-prose-fixes-protection-co.md @@ -0,0 +1,193 @@ +--- +pr_number: 844 +title: "ops(0-0-0): post-reset cleanup \u2014 stale-prose fixes + protection-config memory" +author: "AceHack" +state: "CLOSED" +created_at: "2026-04-29T14:14:41Z" +closed_at: "2026-04-29T14:18:52Z" +head_ref: "post-0-0-0-cleanup-2026-04-29" +base_ref: "main" +archived_at: "2026-04-29T14:30:11Z" +archive_tool: "tools/pr-preservation/archive-pr.sh" +--- + +# PR #844: ops(0-0-0): post-reset cleanup โ€” stale-prose fixes + protection-config memory + +## PR description + +## Summary + +The small in-lane cleanup PR Amara prescribed after 0/0/0 was reached. Two scoped changes: + +1. **Stale-prose fixes in `docs/active-trajectory.md`** โ€” flip post-reset contradicting language to in-force 0/0/0-achieved language +2. **Protection-config memory** โ€” document the dual-layer surprise + Aaron's "delete legacy, rulesets canonical" decision + +## ๐ŸŽฏ 0/0/0 ACHIEVED 2026-04-29T14:04:50Z + +``` +AceHack/main = LFG/main = 621aae082d70fcbf36931718ecf1b6d9e149295f +Topology: 0 ahead, 0 behind, 0 file content diff +Archive ref: archive/acehack-main-pre-000-reset-2026-04-29 โ†’ 6755081... (preserved) +Layers: legacy DELETED (per Aaron); rulesets re-enabled +``` + +## Stale-prose fixes (Amara substrate-pass catch) + +Two paragraphs flipped from pre-reset state to in-force post-reset state: +- Line 221: *"Currently NOT signoff-eligible"* โ†’ *"0/0/0 ACHIEVED 2026-04-29T14:04:50Z..."* +- Line 413: *"Hard-reset is NOT YET signoff-eligible"* โ†’ *"Hard-reset complete (2026-04-29T14:04:50Z)..."* + +This is **Derived-Rollup Drift** class โ€” primary state changed, downstream prose still claims old state. Caught pre-commit by Amara's substrate pass; not a Codex/Copilot retry. + +## Protection-config memory + +`memory/feedback_protection_config_dual_layer_legacy_deleted_rulesets_canonical_2026_04_29.md`: + +- AceHack/Zeta had BOTH legacy branch protection AND repository rulesets on `main` +- Both layers enforced independently; GitHub UI doesn't surface dual-layer state +- Aaron: *"I knew there were two but I was confused why."* +- Maintainer call: legacy DELETED, rulesets canonical going forward +- Error-code mapping: `GH013` = rulesets surface, `GH006` = legacy surface +- Diagnostic script (`gh api` commands) for future audits +- Future-protocol note: rulesets `non_fast_forward` rule still doesn't match CLAUDE.md's *"force-push to AceHack main is part of protocol"* โ€” task #305 home for that decision + +`MEMORY.md` index updated with one-line pointer. + +## Tick shard 1410Z + +Records the entire 0/0/0 hard-reset arc: +- Triple-check buddy review (Amara approved meaningful-content-loss-free) +- Verify-only gate packet (5/5 PASS at 13:39Z) +- Aaron's explicit EXECUTE at 13:58Z +- Steps A/B/C with the dual-layer surprise + recovery +- Path 1 v3 success at 14:04:50Z + +## What this PR does NOT do (per Amara's lane discipline) + +- โŒ Does NOT start the recovery lane (inventory parked at `/tmp/recovery-inventory-2026-04-29.tsv`, awaits Amara's classification framework which just landed) +- โŒ Does NOT consolidate the 8 deferred-queue rule candidates (P1 work, post-0/0/0-success-trigger satisfied but lane discipline says one cleanup PR first) +- โŒ Does NOT touch Aurora extension (P2) +- โŒ Does NOT mutate any branches/worktrees/stashes (Aaron's authority for irreversible) + +## Authority boundary going forward (per Amara post-reset packet) + +``` +Reversible + in-lane + PR-reviewed โ†’ proceed autonomously +Irreversible / deletion / force-push / authority config / identity canon โ†’ ask Aaron +Unclear โ†’ stop, report exact uncertainty, propose one safe action +``` + +## Test plan + +- [x] Stale "Currently NOT signoff-eligible" โ†’ in-force 0/0/0-achieved language +- [x] Stale "Hard-reset is NOT YET signoff-eligible" โ†’ "Hard-reset complete" language +- [x] Memory file written + MEMORY.md index updated +- [x] Tick shard 1410Z appended +- [x] No new ledger headline introduced (273/0/0 doesn't need to flip โ€” it's the final state) +- [ ] CI green +- [ ] Codex / Copilot reviews resolved if any threads land + +๐Ÿค– Generated with [Claude Code](https://claude.com/claude-code) + +## Reviews + +### COMMENTED โ€” @chatgpt-codex-connector (2026-04-29T14:16:32Z) + + +### ๐Ÿ’ก Codex Review + +Here are some automated review suggestions for this pull request. + +**Reviewed commit:** `8630c28e57` + + +
โ„น๏ธ About Codex in GitHub +
+ +[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". + +
+ +### COMMENTED โ€” @copilot-pull-request-reviewer (2026-04-29T14:19:29Z) + +## Pull request overview + +Post-0/0/0 cleanup to align durable docs/memory with the now-in-force hard-reset state and to capture the branch-protection dual-layer incident for future debugging. + +**Changes:** +- Updates `docs/active-trajectory.md` to reflect that the 0/0/0 hard-reset is complete (replacing stale โ€œnot signoff-eligibleโ€ prose). +- Adds a new memory entry documenting the dual-layer (rulesets + legacy branch protection) enforcement surprise and the chosen canonical surface going forward. +- Updates the memory index and appends a tick shard recording the reset arc and this cleanup PR. + +### Reviewed changes + +Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments. + +| File | Description | +| ---- | ----------- | +| `memory/feedback_protection_config_dual_layer_legacy_deleted_rulesets_canonical_2026_04_29.md` | New memory capturing the GH013/GH006 dual-layer behavior, decision, and diagnostics. | +| `memory/MEMORY.md` | Adds an index entry pointing to the new protection-config memory. | +| `docs/hygiene-history/ticks/2026/04/29/1410Z.md` | New tick shard recording the 0/0/0 achievement and follow-on cleanup PR. | +| `docs/active-trajectory.md` | Flips two stale paragraphs to reflect the achieved post-reset state. | + +## Review threads + +### Thread 1: memory/feedback_protection_config_dual_layer_legacy_deleted_rulesets_canonical_2026_04_29.md:40 (resolved) + +**@chatgpt-codex-connector** (2026-04-29T14:16:33Z): + +**![P2 Badge](https://img.shields.io/badge/P2-yellow?style=flat) Use supported gh api request-body syntax** + +The `Executed` commands document `gh api ... --input '{"enforcement": "disabled"}'`, but `gh api` treats `--input` as a file argument (manual: `--input `, use `-` for stdin), so this form is interpreted as a filename and is not reproducible as written. Because this memory file is positioned as an operational reference for future protection toggles, the current command text can cause failed retries during incident handling; use a real file/stdin body or field flags instead. + +Useful? React with ๐Ÿ‘ย / ๐Ÿ‘Ž. + +### Thread 2: memory/feedback_protection_config_dual_layer_legacy_deleted_rulesets_canonical_2026_04_29.md:42 (unresolved) + +**@copilot-pull-request-reviewer** (2026-04-29T14:19:27Z): + +The `gh api ... --input '{"enforcement": ...}'` invocations wonโ€™t work as written: `gh api --input` expects a file path (or stdin via `--input -`), not an inline JSON string. Use `-f enforcement=...`/`-F enforcement=...`, or pass JSON via stdin (e.g., `--input -`) so this is copy/paste-correct for future audits. + +### Thread 3: memory/feedback_protection_config_dual_layer_legacy_deleted_rulesets_canonical_2026_04_29.md:43 (unresolved) + +**@copilot-pull-request-reviewer** (2026-04-29T14:19:28Z): + +The step list appears internally inconsistent: the earlier GH006 rejection indicates legacy branch protection was active, but the subsequent `gh api -X DELETE .../branches/main/protection` line claims a 404 "Branch not protected" response (which typically means there was no classic protection to delete). To keep this memory reliable, please reconcile this (e.g., clarify an intermediate UI/API change, confirm the endpoint/repo/branch used, or update the recorded responses). +```suggestion +# Delete legacy branch protection (this removed the GH006 blocker) +gh api -X DELETE repos/AceHack/Zeta/branches/main/protection +# โ†’ 204 No Content +``` + +### Thread 4: memory/feedback_protection_config_dual_layer_legacy_deleted_rulesets_canonical_2026_04_29.md:82 (unresolved) + +**@copilot-pull-request-reviewer** (2026-04-29T14:19:28Z): + +References to โ€œTask #305โ€ here are ambiguous in-repo (this repo already has a PR #305, and backlog rows use `B-####` IDs under `docs/backlog/**`). Consider replacing โ€œTask #305โ€/โ€œ#305-adjacentโ€ with the actual backlog-row ID (if any) or a direct URL so readers donโ€™t chase the wrong artifact. + +### Thread 5: memory/feedback_protection_config_dual_layer_legacy_deleted_rulesets_canonical_2026_04_29.md:18 (unresolved) + +**@copilot-pull-request-reviewer** (2026-04-29T14:19:28Z): + +Minor wording nit: โ€œthe only rulesets rulesetโ€ reads like a duplication. Consider rephrasing to โ€œthe only rulesetโ€ / โ€œthe only rulesets entryโ€ for clarity. +```suggestion +After disabling the only ruleset (id=15524390 "Default", `enforcement: disabled`) and retrying, the push was rejected AGAIN with a **different error code**: +``` + +## General comments + +### @AceHack (2026-04-29T14:17:34Z) + +Codex P2 (14:16Z) addressed in f6d6a94. Fixed memory-file documentation: `gh api --input '{json}'` was wrong syntax (gh treats --input value as a file path). Replaced with the actual heredoc-from-stdin pattern that was used live: `gh api ... --input - <<'EOF'` + JSON body + `EOF`. Added clarifying note about gh CLI flag semantics for future readers. + +### @AceHack (2026-04-29T14:18:51Z) + +Closing per Aaron's correction: this PR went LFG-first, but the canonical pattern is AceHack-first โ†’ LFG forward-sync โ†’ AceHack absorbs LFG squash-SHA. *"Without the double-hop in a few hours we'll be right back to where we started โ€” that's load-bearing to get right."* Branch `post-0-0-0-cleanup-2026-04-29` is being repushed to AceHack remote and opened there as the canonical first PR. Codex P2 review feedback (gh api --input syntax fix) is preserved as commit `f6d6a94` on the branch + carried into the AceHack PR. diff --git a/docs/pr-discussions/PR-0845-ops-0-0-0-lfg-forward-sync-post-reset-cleanup-copilot-fixes.md b/docs/pr-discussions/PR-0845-ops-0-0-0-lfg-forward-sync-post-reset-cleanup-copilot-fixes.md new file mode 100644 index 00000000..7398e64d --- /dev/null +++ b/docs/pr-discussions/PR-0845-ops-0-0-0-lfg-forward-sync-post-reset-cleanup-copilot-fixes.md @@ -0,0 +1,81 @@ +--- +pr_number: 845 +title: "ops(0-0-0): LFG forward-sync \u2014 post-reset cleanup + Copilot fixes + pr-preservation drain-logs (mirror of AceHack #101)" +author: "AceHack" +state: "MERGED" +created_at: "2026-04-29T14:25:11Z" +merged_at: "2026-04-29T14:27:35Z" +closed_at: "2026-04-29T14:27:35Z" +head_ref: "post-0-0-0-cleanup-2026-04-29" +base_ref: "main" +archived_at: "2026-04-29T14:30:07Z" +archive_tool: "tools/pr-preservation/archive-pr.sh" +--- + +# PR #845: ops(0-0-0): LFG forward-sync โ€” post-reset cleanup + Copilot fixes + pr-preservation drain-logs (mirror of AceHack #101) + +## PR description + +## Summary + +LFG forward-sync PR for the AceHack-first cleanup that landed at AceHack#101 (merged 2026-04-29T14:19:41Z, squash โ†’ `5485772e87d74f3b96cdac4f39063cb0e82d7839`). + +This is **step 2 of the canonical double-hop**: AceHack-first (#101 โœ“) โ†’ LFG forward-sync (this PR) โ†’ AceHack absorbs LFG squash-SHA (after this merges). + +## Diff vs LFG main (same content as AceHack #101 + LFG-side review fixes + pr-preservation files) + +1. **Original cleanup commits** (from AceHack #101): stale-prose fixes in `docs/active-trajectory.md`, protection-config memory file, MEMORY.md index entry, tick shard 1410Z + +2. **LFG #844 Codex P2 fix** (commit `f6d6a94`): `gh api --input` syntax corrected to heredoc-stdin pattern + +3. **LFG #844 Copilot thread fixes** (this commit): + - Internal consistency on legacy DELETE response (DELETE returned 204; GET-after-DELETE returned 404 "Branch not protected" โ€” two-step accuracy) + - "Task #305" โ†’ "task #275" (correct in-session TaskList reference) + namespace-disambiguation parenthetical + - "the only rulesets ruleset" โ†’ "the only ruleset" (wording nit) + +4. **PR-preservation drain-logs** (Aaron 2026-04-29 directive): `docs/pr-preservation/lfg-844-drain-log.md` + `docs/pr-preservation/acehack-101-drain-log.md` โ€” verbatim threads + responses + outcome classes for both PRs in this double-hop round + +## Sequence after this PR merges + +1. LFG/main advances to new squash-SHA = `` +2. AceHack/main is at `5485772...` (post-#101); LFG/main moves to `` (post-this) +3. Force-push acehack/main โ†’ LFG/main `` (toggle ruleset / push / restore โ€” same pattern as the 0/0/0 hard-reset) +4. AceHack/main = LFG/main = `` โ€” 0/0/0 invariant restored + +## Authority boundary + +Step 3 (force-push to AceHack) is irreversible from the ref-perspective + requires ruleset toggle โ†’ **gates on Aaron's authority**. After this PR merges, I prepare the verify-only gate packet for the absorption push, then await Aaron's `EXECUTE`. + +Also addresses Copilot review feedback from LFG #844 carried forward. + +๐Ÿค– Generated with [Claude Code](https://claude.com/claude-code) + +## Reviews + +### COMMENTED โ€” @copilot-pull-request-reviewer (2026-04-29T14:28:47Z) + +## Pull request overview + +Forward-syncs the AceHack-first post-reset cleanup into LFG, preserving operational learnings from the 0/0/0 reset and capturing PR review/drain artifacts as durable history. + +**Changes:** +- Adds/updates protection-config operational memory (dual-layer legacy branch protection vs rulesets) and indexes it in `memory/MEMORY.md`. +- Updates `docs/active-trajectory.md` to reflect the now-achieved 0/0/0 state (replacing stale pre-reset โ€œnot signoff-eligibleโ€ language). +- Adds PR-preservation drain logs for both sides of the double-hop and appends the 14:10Z tick-history shard. + +### Reviewed changes + +Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments. + +
+Show a summary per file + +| File | Description | +| ---- | ----------- | +| memory/feedback_protection_config_dual_layer_legacy_deleted_rulesets_canonical_2026_04_29.md | Documents the dual-layer protection discovery, error-code mapping, and the operational sequence (incl. corrected `gh api --input -` usage). | +| memory/MEMORY.md | Adds an index entry pointing to the new protection-config memory. | +| docs/pr-preservation/lfg-844-drain-log.md | Records LFG-side PR #844 review threads and resolutions for training-signal preservation. | +| docs/pr-preservation/acehack-101-drain-log.md | Records AceHack-side PR #101 outcome (auto-merged/no-review) for the double-hop record. | +| docs/hygiene-history/ticks/2026/04/29/1410Z.md | Adds the 14:10Z tick shard row capturing the reset completion + cleanup PR opening. | +| docs/active-trajectory.md | Updates trajectory text to reflect the completed hard-reset and new next-action lane. | +
diff --git a/docs/pr-discussions/PR-acehack-0101-ops-0-0-0-post-reset-cleanup-stale-prose-fixes-protection-co.md b/docs/pr-discussions/PR-acehack-0101-ops-0-0-0-post-reset-cleanup-stale-prose-fixes-protection-co.md new file mode 100644 index 00000000..bce8ed5b --- /dev/null +++ b/docs/pr-discussions/PR-acehack-0101-ops-0-0-0-post-reset-cleanup-stale-prose-fixes-protection-co.md @@ -0,0 +1,144 @@ +--- +pr_number: 101 +title: "ops(0-0-0): post-reset cleanup \u2014 stale-prose fixes + protection-config memory" +author: "AceHack" +state: "MERGED" +created_at: "2026-04-29T14:19:35Z" +merged_at: "2026-04-29T14:19:41Z" +closed_at: "2026-04-29T14:19:42Z" +head_ref: "post-0-0-0-cleanup-2026-04-29" +base_ref: "main" +archived_at: "2026-04-29T14:34:12Z" +archive_tool: "tools/pr-preservation/archive-pr.sh" +--- + +# PR #101: ops(0-0-0): post-reset cleanup โ€” stale-prose fixes + protection-config memory + +## PR description + +## Summary + +Canonical AceHack-first PR: post-reset cleanup after the 0/0/0 hard-reset achieved 2026-04-29T14:04:50Z. Two scoped changes: + +1. **Stale-prose fixes in `docs/active-trajectory.md`** โ€” flip post-reset contradicting language to in-force 0/0/0-achieved language +2. **Protection-config memory** โ€” document the dual-layer surprise + Aaron's "delete legacy, rulesets canonical" decision + +## Lineage + +This PR was originally opened on LFG-side (Lucent-Financial-Group/Zeta#844) by mistake โ€” Aaron correctly flagged that the canonical flow is AceHack-first โ†’ LFG forward-sync โ†’ AceHack absorbs LFG squash-SHA. *"Without the double-hop in a few hours we'll be right back to where we started โ€” that's load-bearing to get right."* + the high-signal-data-multiplier framing: 2ร— review-agent passes per PR = 2ร— signal for the training corpus. + +LFG #844 closed; branch repushed to AceHack as the canonical first stop. Includes Codex P2 review feedback from the LFG side (gh api --input syntax fix at commit `f6d6a94`) preserved as part of the branch history. + +## ๐ŸŽฏ 0/0/0 ACHIEVED 2026-04-29T14:04:50Z + +``` +AceHack/main = LFG/main = 621aae082d70fcbf36931718ecf1b6d9e149295f +Topology: 0 ahead, 0 behind, 0 file content diff +Archive ref: archive/acehack-main-pre-000-reset-2026-04-29 โ†’ 6755081... (preserved) +Layers: legacy DELETED (per Aaron); rulesets canonical +``` + +## Stale-prose fixes (Amara substrate-pass catch) + +Two paragraphs flipped from pre-reset state to in-force post-reset state: +- *"Currently NOT signoff-eligible"* โ†’ *"0/0/0 ACHIEVED 2026-04-29T14:04:50Z..."* +- *"Hard-reset is NOT YET signoff-eligible"* โ†’ *"Hard-reset complete (2026-04-29T14:04:50Z)..."* + +Derived-Rollup Drift class โ€” primary state changed, downstream prose still claimed old state. + +## Protection-config memory + +`memory/feedback_protection_config_dual_layer_legacy_deleted_rulesets_canonical_2026_04_29.md`: + +- AceHack/Zeta had BOTH legacy branch protection AND repository rulesets on `main` +- Both layers enforced independently; GitHub UI doesn't surface dual-layer state +- Aaron: *"I knew there were two but I was confused why."* +- Maintainer call: legacy DELETED, rulesets canonical going forward +- Error-code mapping: `GH013` = rulesets surface, `GH006` = legacy surface +- Diagnostic script (`gh api` commands, with correct heredoc-stdin syntax per Codex's feedback) for future audits +- Future-protocol note: rulesets `non_fast_forward` rule still doesn't match CLAUDE.md *"force-push to AceHack main is part of protocol"* โ€” task #305 home for that decision + +`MEMORY.md` index updated with one-line pointer. + +## Tick shard 1410Z + +Records the entire 0/0/0 hard-reset arc. + +## Sequence after this PR merges + +1. AceHack/main advances by 1 (this content) +2. Open forward-sync PR on LFG/Zeta with this content +3. After LFG forward-sync merges, force-push AceHack/main to LFG's squash-SHA (absorbs the LFG squash, restoring AceHack/main = LFG/main exactly) +4. AceHack/main = LFG/main again โ€” 0/0/0 holds + +## Authority boundary going forward (per Amara post-reset packet) + +``` +Reversible + in-lane + PR-reviewed โ†’ proceed autonomously +Irreversible / deletion / force-push / authority config / identity canon โ†’ ask Aaron +Unclear โ†’ stop, report exact uncertainty, propose one safe action +``` + +## Test plan + +- [x] Stale "Currently NOT signoff-eligible" โ†’ in-force 0/0/0-achieved language +- [x] Stale "Hard-reset is NOT YET signoff-eligible" โ†’ "Hard-reset complete" language +- [x] Memory file written with corrected gh CLI syntax + MEMORY.md index updated +- [x] Tick shard 1410Z appended +- [x] Branch opened AceHack-first per double-hop discipline +- [ ] CI green +- [ ] Codex / Copilot reviews resolved if any threads land +- [ ] LFG forward-sync PR opened after merge +- [ ] AceHack absorbs LFG squash-SHA after forward-sync merge + +๐Ÿค– Generated with [Claude Code](https://claude.com/claude-code) + +## Reviews + +### COMMENTED โ€” @copilot-pull-request-reviewer (2026-04-29T14:24:13Z) + +## Pull request overview + +Post-0/0/0 hard-reset cleanup PR that updates current-state docs/memory to reflect the achieved 0/0/0 status and captures a durable debugging note about GitHubโ€™s dual-layer protection enforcement (legacy branch protection + rulesets) on AceHack/Zeta. + +**Changes:** +- Add a new protection-config memory documenting GH013 vs GH006 and a `gh api` audit/diagnostic sequence. +- Update `docs/active-trajectory.md` prose to reflect that the 0/0/0 hard-reset has completed. +- Append a tick shard row and add a new `MEMORY.md` index entry pointing to the new memory. + +### Reviewed changes + +Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments. + +| File | Description | +| ---- | ----------- | +| memory/feedback_protection_config_dual_layer_legacy_deleted_rulesets_canonical_2026_04_29.md | New memory documenting dual-layer protection enforcement + commands/error-code mapping. | +| memory/MEMORY.md | Adds newest-first index entry pointing to the new protection-config memory. | +| docs/hygiene-history/ticks/2026/04/29/1410Z.md | New tick shard entry recording the 0/0/0 reset arc + follow-up PR. | +| docs/active-trajectory.md | Flips stale โ€œnot signoff-eligibleโ€ / โ€œnot yetโ€ language to post-reset โ€œcomplete/achievedโ€ state. | + +## Review threads + +### Thread 1: memory/feedback_protection_config_dual_layer_legacy_deleted_rulesets_canonical_2026_04_29.md:101 (unresolved) + +**@copilot-pull-request-reviewer** (2026-04-29T14:24:11Z): + +P1: This file references `memory/feedback_aaron_visibility_constraint_no_changes_he_cant_see_2026_04_28.md`, but that file does not exist in-repo (the path 404s). This leaves a broken cross-reference in the new memory. Either add the missing memory file in this PR, or update the reference to the correct existing in-repo memory that captures the same rule. + +### Thread 2: memory/feedback_protection_config_dual_layer_legacy_deleted_rulesets_canonical_2026_04_29.md:41 (unresolved) + +**@copilot-pull-request-reviewer** (2026-04-29T14:24:12Z): + +P1: The โ€œDelete legacy branch protectionโ€ example is confusing/internally inconsistent: the comment says legacy protection was deleted, but the shown DELETE call returns โ€œBranch not protectedโ€ (404), which indicates there was nothing to delete at that moment. Consider clarifying the sequence (e.g., DELETE returns 204 when protection exists; 404 means it was already removed) or adjusting the narrative so readers donโ€™t infer that 404 = successful deletion. + +### Thread 3: memory/feedback_protection_config_dual_layer_legacy_deleted_rulesets_canonical_2026_04_29.md:18 (unresolved) + +**@copilot-pull-request-reviewer** (2026-04-29T14:24:12Z): + +P2: Minor wording issue: โ€œthe only rulesets rulesetโ€ reads like a duplicated word and is easy to misread. Consider simplifying to โ€œthe only rulesetโ€ (or โ€œthe only repository rulesetโ€). + +### Thread 4: memory/MEMORY.md:5 (unresolved) + +**@copilot-pull-request-reviewer** (2026-04-29T14:24:12Z): + +P2: `MEMORY.md` index entries are expected to be terse (memory/README.md notes the index is capped at ~200 lines and should stay short). This new entry is very long for a single-line index item; consider trimming the summary here and leaving the detailed narrative inside the linked memory file. diff --git a/docs/pr-preservation/acehack-101-drain-log.md b/docs/pr-preservation/acehack-101-drain-log.md new file mode 100644 index 00000000..9f195eed --- /dev/null +++ b/docs/pr-preservation/acehack-101-drain-log.md @@ -0,0 +1,82 @@ +# PR-preservation drain-log โ€” AceHack #101 + +**PR:** AceHack/Zeta#101 +**Title:** ops(0-0-0): post-reset cleanup โ€” stale-prose fixes + protection-config memory +**Opened:** 2026-04-29T14:18Z +**Merged:** 2026-04-29T14:19:41Z (squash; merge commit `5485772e87d74f3b96cdac4f39063cb0e82d7839`) +**Branch:** post-0-0-0-cleanup-2026-04-29 โ†’ main +**Status checks:** 17 ran; AceHack has no required-status-checks rule, so auto-merge fired ~2 min after open + +## Threads (4 unresolved Copilot threads at merge โ€” filed 14:24:11Z, AFTER auto-merge fired at 14:19:41Z) + +The threads landed AFTER the merge because AceHack has no required-conversation-resolution rule and no required-status-checks rule โ€” auto-merge didn't wait for Copilot's review. Copilot's findings still apply to the merged content; corrected in the post-#101 follow-up double-hop cycle. + +### Thread 1 โ€” Copilot P1 โ€” broken xref to user-scope memory file + +**Path:** memory/feedback_protection_config_dual_layer_legacy_deleted_rulesets_canonical_2026_04_29.md +**Filed:** 2026-04-29T14:24:11Z +**Outcome class:** FIX (real broken-xref) + +> P1: This file references `memory/feedback_aaron_visibility_constraint_no_changes_he_cant_see_2026_04_28.md`, but that file does not exist in-repo (the path 404s). This leaves a broken cross-reference in the new memory. Either add the missing memory file in this PR, or update the reference to the correct existing in-repo memory that captures the same rule. + +**Resolution path (post-#101 follow-up cycle):** The visibility-constraint memory exists in user-scope memory only (`~/.claude/projects/-Users-acehack-Documents-src-repos-Zeta/memory/`), not in-repo. The xref was therefore broken from an in-repo file pointing at a user-scope-only file. Replaced with a generic prose pointer to the underlying principle + a note that the existing `MEMORY.md` index entry has the same broken-pointer issue (pre-existing) and should be either backfilled to in-repo or removed in a future audit pass. + +### Thread 2 โ€” Copilot P1 โ€” internal consistency on legacy DELETE response + +**Path:** memory/feedback_protection_config_dual_layer_legacy_deleted_rulesets_canonical_2026_04_29.md +**Filed:** 2026-04-29T14:24:12Z +**Outcome class:** FIX (already-applied โ€” was duplicate of LFG #844 Thread 3) + +> P1: The "Delete legacy branch protection" example is confusing/internally inconsistent: the comment says legacy protection was deleted, but the shown DELETE call returns "Branch not protected" (404), which indicates there was nothing to delete at that moment. Consider clarifying the sequence (e.g., DELETE returns 204 when protection exists; 404 means it was already removed) or adjusting the narrative so readers don't infer that 404 = successful deletion. + +**Resolution path:** Already addressed by the carried-forward fix from LFG #844 Thread 3 (in commit `19f8f0b` on the LFG forward-sync side). The post-fix memory file shows DELETE returned rc=0 (success / 204 No Content) with the 404 coming from a separate verification GET. AceHack #101 merged BEFORE this fix landed, so the merged AceHack/main has the pre-fix text. The post-#101 follow-up cycle carries the fix to AceHack via the next AceHack-first PR. + +### Thread 3 โ€” Copilot P2 โ€” wording "the only rulesets ruleset" + +**Filed:** 2026-04-29T14:24:12Z +**Outcome class:** FIX (already-applied โ€” same path as Thread 2) + +> P2: Minor wording issue: "the only rulesets ruleset" reads like a duplicated word and is easy to misread. Consider simplifying to "the only ruleset" (or "the only repository ruleset"). + +**Resolution path:** Same as Thread 2 โ€” already fixed in LFG #845 (carried forward in commit on the LFG-side branch); AceHack/main currently has the pre-fix text; carried into post-#101 follow-up cycle. + +### Thread 4 โ€” Copilot P2 โ€” MEMORY.md index entry too long + +**Path:** memory/MEMORY.md +**Filed:** 2026-04-29T14:24:12Z +**Outcome class:** FIX + +> P2: `MEMORY.md` index entries are expected to be terse (memory/README.md notes the index is capped at ~200 lines and should stay short). This new entry is very long for a single-line index item; consider trimming the summary here and leaving the detailed narrative inside the linked memory file. + +**Resolution path (post-#101 follow-up cycle):** Trimmed the index entry from a 4-line dense paragraph to a single concise line per `memory/README.md` discipline. Detail stays in the linked memory file. + +## Issue-level comments + +(none โ€” auto-merged before any landed) + +## Reviews + +- **Copilot โ€” COMMENTED at 14:24:13Z**: PR-overview review enumerating the 4 review-thread findings (consolidated review summary). + +## Outcome class summary + +- 4 threads total: ALL UNRESOLVED at merge time (because auto-merge fired before review landed) +- Outcome classes: 1 P1 broken-xref (FIX), 1 P1 internal-consistency (FIX, already-applied), 1 P2 wording (FIX, already-applied), 1 P2 MEMORY.md verbose (FIX) +- All 4 fixes carry into the post-#101 follow-up double-hop cycle + +## Lessons for future PRs + +1. **AceHack auto-merge races Copilot review** โ€” without required-conversation-resolution + required-status-checks on AceHack, auto-merge can fire BEFORE reviewers land their threads. The threads still apply to the merged content; just need a follow-up cycle to land fixes. Worth flagging that AceHack's review surface is "best effort, post-hoc" while LFG's is "pre-merge gating." + +2. **The double-hop captures BOTH waves of review** โ€” even when AceHack auto-merges fast, the LFG forward-sync PR re-runs review and catches the same findings (LFG #844 caught the same internal-consistency + wording issues). The double-hop is also a *redundancy mechanism* against fast-merge-on-AceHack. + +3. **`gh repo view` doesn't accept `GH_REPO` env var override** โ€” the existing `tools/pr-preservation/archive-pr.sh` uses `gh repo view --json owner,name` which resolves to current-clone origin. To archive cross-fork PRs, either run from a clone with the right origin, run `gh repo set-default /` first, or write the archive manually with fork-prefixed filename. Captured here as a tool-improvement candidate. + +4. **Cross-fork archive filename collision** โ€” if AceHack and LFG both have a PR #101, single-namespace `PR-0101-.md` filenames collide. Use fork-prefixed naming for cross-fork: `PR-acehack-0101-.md` / `PR-lfg-0101-.md`. Until tool supports `--repo` arg, manual archive with fork-prefixed name is the workaround. + +## Relationship to other PRs in this round + +- LFG #844 โ€” opened LFG-first by mistake, closed; threads documented at `lfg-844-drain-log.md`. Most threads' fixes carried into LFG #845. +- LFG #845 โ€” forward-sync of AceHack #101 + LFG #844 fixes + this drain-log; merged 14:27:35Z (squash โ†’ `3785124...`). +- This PR (AceHack #101) โ€” first canonical hop; merged 14:19:41Z. The 4 Copilot threads landed AFTER merge and are corrected in the post-#101 follow-up double-hop. +- Pending โ€” AceHack absorbs LFG squash-SHA `3785124...` to restore 0/0/0 (gates on Aaron's `EXECUTE`). diff --git a/docs/pr-preservation/lfg-844-drain-log.md b/docs/pr-preservation/lfg-844-drain-log.md new file mode 100644 index 00000000..ef600e6d --- /dev/null +++ b/docs/pr-preservation/lfg-844-drain-log.md @@ -0,0 +1,104 @@ +# PR-preservation drain-log โ€” LFG #844 + +**PR:** Lucent-Financial-Group/Zeta#844 +**Title:** ops(0-0-0): post-reset cleanup โ€” stale-prose fixes + protection-config memory +**Opened:** 2026-04-29T14:14Z +**Closed:** 2026-04-29T14:18:52Z (NOT MERGED โ€” closed in favor of canonical AceHack-first reopening) +**Reason for close:** Aaron correction โ€” *"without the double-hop in a few hours we'll be right back to where we started โ€” that's load-bearing to get right"*. PR went LFG-first; canonical pattern is AceHack-first โ†’ LFG forward-sync โ†’ AceHack absorbs LFG squash-SHA. Reopened on AceHack as #101. + +## Threads (5 total: 1 resolved, 4 unresolved at close) + +### Thread 1 โ€” Codex P2 โ€” `gh api --input` syntax (RESOLVED via commit f6d6a94) + +**Author:** chatgpt-codex-connector +**Path:** memory/feedback_protection_config_dual_layer_legacy_deleted_rulesets_canonical_2026_04_29.md +**Filed:** 2026-04-29T14:16:33Z +**Outcome class:** FIX + +> **![P2 Badge](https://img.shields.io/badge/P2-yellow?style=flat) Use supported gh api request-body syntax** +> +> The `Executed` commands document `gh api ... --input '{"enforcement": "disabled"}'`, but `gh api` treats `--input` as a file argument (manual: `--input `, use `-` for stdin), so this form is interpreted as a filename and is not reproducible as written. Because this memory file is positioned as an operational reference for future protection toggles, the current command text can cause failed retries during incident handling; use a real file/stdin body or field flags instead. + +**My response (commit f6d6a94, 2026-04-29T14:17:34Z):** Fixed memory-file documentation. Replaced `gh api --input '{json}'` with the actual heredoc-from-stdin pattern that was used live: `gh api ... --input - <<'EOF'` + JSON body + `EOF`. Added clarifying note about gh CLI flag semantics (`--input `, `--input -` for stdin, `-f`/`-F` for typed inline fields). + +### Thread 2 โ€” Copilot โ€” `gh api --input` (UNRESOLVED at close, addressed in carry-forward to #101 + LFG forward-sync) + +**Author:** copilot-pull-request-reviewer +**Path:** memory/feedback_protection_config_dual_layer_legacy_deleted_rulesets_canonical_2026_04_29.md (line 42) +**Filed:** 2026-04-29T14:19:27Z +**Outcome class:** FIX (duplicate finding, same root cause as Codex Thread 1) + +> The `gh api ... --input '{"enforcement": ...}'` invocations won't work as written: `gh api --input` expects a file path (or stdin via `--input -`), not an inline JSON string. Use `-f enforcement=...`/`-F enforcement=...`, or pass JSON via stdin (e.g., `--input -`) so this is copy/paste-correct for future audits. + +**Resolution path:** Already addressed by the same f6d6a94 commit (which Copilot didn't see at filing time). The memory file now shows the correct heredoc-stdin pattern AND mentions `-f`/`-F` as alternatives. Carry-forward to AceHack #101 means the corrected text is already on the branch. + +### Thread 3 โ€” Copilot โ€” internal consistency on legacy DELETE response (UNRESOLVED, FIX in carry-forward) + +**Author:** copilot-pull-request-reviewer +**Path:** memory/feedback_protection_config_dual_layer_legacy_deleted_rulesets_canonical_2026_04_29.md (line 43) +**Filed:** 2026-04-29T14:19:28Z +**Outcome class:** FIX + +> The step list appears internally inconsistent: the earlier GH006 rejection indicates legacy branch protection was active, but the subsequent `gh api -X DELETE .../branches/main/protection` line claims a 404 "Branch not protected" response (which typically means there was no classic protection to delete). To keep this memory reliable, please reconcile this (e.g., clarify an intermediate UI/API change, confirm the endpoint/repo/branch used, or update the recorded responses). +> +> ```suggestion +> # Delete legacy branch protection (this removed the GH006 blocker) +> gh api -X DELETE repos/AceHack/Zeta/branches/main/protection +> # โ†’ 204 No Content +> ``` + +**Resolution path (commit forthcoming on LFG forward-sync):** Real bug โ€” the 404 came from my POST-DELETE verification GET, not from the DELETE itself. The DELETE returned rc=0 (success / 204 No Content); a subsequent `gh api repos/AceHack/Zeta/branches/main/protection` (GET) returned `{"message":"Branch not protected","status":"404"}` because the branch was no longer protected. The memory file now reflects this two-step accurately: +> ```bash +> # Delete legacy branch protection (this removed the GH006 blocker) +> gh api -X DELETE repos/AceHack/Zeta/branches/main/protection +> # โ†’ success (rc=0, no body printed; GitHub returns 204 No Content) +> # Subsequent verification GET returns 404 "Branch not protected": +> # gh api repos/AceHack/Zeta/branches/main/protection +> # โ†’ {"message":"Branch not protected", "status":"404"} +> ``` + +### Thread 4 โ€” Copilot โ€” "Task #305" ambiguous reference (UNRESOLVED, FIX in carry-forward) + +**Author:** copilot-pull-request-reviewer +**Path:** memory/feedback_protection_config_dual_layer_legacy_deleted_rulesets_canonical_2026_04_29.md (line 82) +**Filed:** 2026-04-29T14:19:28Z +**Outcome class:** FIX (real ambiguity โ€” wrong reference) + +> References to "Task #305" here are ambiguous in-repo (this repo already has a PR #305, and backlog rows use `B-####` IDs under `docs/backlog/**`). Consider replacing "Task #305"/"#305-adjacent" with the actual backlog-row ID (if any) or a direct URL so readers don't chase the wrong artifact. + +**Resolution path (commit forthcoming on LFG forward-sync):** Two-part real fix: +1. The reference was actually wrong โ€” should be **task #275** ("Set up acehack-first development workflow") in the in-session TaskList tracker, not #305. Updated. +2. Added clarifying parenthetical noting the distinction between the in-session TaskList numbers vs PR numbers vs backlog `B-####` row IDs โ€” different namespaces, easy to confuse. + +### Thread 5 โ€” Copilot โ€” wording nit "the only rulesets ruleset" (UNRESOLVED, FIX in carry-forward) + +**Author:** copilot-pull-request-reviewer +**Path:** memory/feedback_protection_config_dual_layer_legacy_deleted_rulesets_canonical_2026_04_29.md (line 18) +**Filed:** 2026-04-29T14:19:28Z +**Outcome class:** FIX (small) + +> Minor wording nit: "the only rulesets ruleset" reads like a duplication. Consider rephrasing to "the only ruleset" / "the only rulesets entry" for clarity. + +**Resolution path (commit forthcoming on LFG forward-sync):** Adopted the suggested rephrasing โ€” "the only ruleset (id=15524390 "Default"...)". + +## Issue-level comments + +- **Otto/AceHack 14:17:34Z** โ€” fix-note for Codex P2 thread (commit f6d6a94) +- **Otto/AceHack 14:18:51Z** โ€” close-note explaining double-hop pivot per Aaron's correction + +## Outcome class summary + +- 5 threads total: 1 RESOLVED-AS-FIXED + 4 UNRESOLVED-CARRIED-FORWARD-AS-FIX +- 0 threads classified STALE-RESOLVED-BY-REALITY / OTTO-279-SURFACE-CLASS / DEFERRED-TO-MAINTAINER / VERBATIM-PRESERVATION-DECLINED +- All threads are operational-correctness / documentation-accuracy class; no policy or attribution disputes + +## Lessons for future PRs + +1. **Documented commands need to be runnable as-written.** Memory files act as operational reference at cold-start; bad command syntax becomes muscle-memory hazard. (Echoes _patterns.md FIX class.) +2. **Two-step API operations need explicit step recording** โ€” DELETE vs verification GET responses look different; conflating them creates false internal-inconsistency findings. +3. **Cross-namespace reference ambiguity** โ€” repo has PR numbers, backlog `B-####` rows, in-session TaskList #####, hygiene-history shards, all using different conventions. Always disambiguate when referencing a numbered artifact. +4. **"The only X X"** โ€” duplication patterns in attempted-precise prose. The Codex/Copilot review pass catches these reliably; worth a self-pass-before-commit if writing dense technical doc. + +## Carry-forward to AceHack #101 + LFG forward-sync PR + +All four UNRESOLVED Copilot findings + the one already-RESOLVED Codex finding produced corrections that are now committed to the `post-0-0-0-cleanup-2026-04-29` branch. The branch is on AceHack as #101 (merged 14:19:41Z) and is being repushed to LFG as the forward-sync PR. diff --git a/memory/MEMORY.md b/memory/MEMORY.md index af84d0c9..dfc71294 100644 --- a/memory/MEMORY.md +++ b/memory/MEMORY.md @@ -2,7 +2,7 @@ **๐Ÿ“Œ Fast path: read `CURRENT-aaron.md` and `CURRENT-amara.md` first.** -- [**0/0/0 ACHIEVED + AceHack/Zeta protection-config dual-layer surprise โ€” legacy deleted, rulesets canonical (Aaron decision, 2026-04-29T14:04:50Z)**](feedback_acehack_zeta_protection_config_dual_layer_legacy_deleted_rulesets_canonical_2026_04_29.md) โ€” Hard-reset of `acehack/main` to LFG `621aae0...` succeeded after dual-layer protection surprise: AceHack/Zeta had BOTH legacy branch protection AND repository rulesets on `main`; both enforced independently; GitHub UI doesn't surface the dual-layer state. Aaron: *"I knew there were two but I was confused why."* Maintainer call: legacy DELETED, rulesets canonical going forward. Error-code mapping: GH013 = rulesets surface, GH006 = legacy surface. Old AceHack tip preserved at `archive/acehack-main-pre-000-reset-2026-04-29`. +- [**0/0/0 ACHIEVED + AceHack/Zeta protection-config dual-layer (Aaron, 2026-04-29)**](feedback_protection_config_dual_layer_legacy_deleted_rulesets_canonical_2026_04_29.md) โ€” Hard-reset succeeded after dual-layer surprise (legacy + rulesets on AceHack/main, both enforcing). Aaron: legacy DELETED, rulesets canonical. GH013 = rulesets, GH006 = legacy. Old tip preserved at `archive/acehack-main-pre-000-reset-2026-04-29`. - [**Bare `main` is ambiguous โ€” automation uses explicit refs (Amara, 2026-04-29)**](feedback_bare_main_ambiguity_automation_discipline_explicit_refs_required_amara_2026_04_29.md) โ€” Generic multi-remote-repo automation rule: scripts use `refs/remotes//` (or `refs/heads/`); bare branch names only for interactive humans. Hard-stop on fatal base-ref errors. Caught when bare `git checkout main` was hitting `fatal: matched multiple (2) remote tracking branches` and the loop continued past the failure with wrong downstream state. diff --git a/memory/feedback_acehack_zeta_protection_config_dual_layer_legacy_deleted_rulesets_canonical_2026_04_29.md b/memory/feedback_protection_config_dual_layer_legacy_deleted_rulesets_canonical_2026_04_29.md similarity index 80% rename from memory/feedback_acehack_zeta_protection_config_dual_layer_legacy_deleted_rulesets_canonical_2026_04_29.md rename to memory/feedback_protection_config_dual_layer_legacy_deleted_rulesets_canonical_2026_04_29.md index a9450a99..2b6c470b 100644 --- a/memory/feedback_acehack_zeta_protection_config_dual_layer_legacy_deleted_rulesets_canonical_2026_04_29.md +++ b/memory/feedback_protection_config_dual_layer_legacy_deleted_rulesets_canonical_2026_04_29.md @@ -15,7 +15,7 @@ remote: error: GH013: Repository rule violations found for refs/heads/main. remote: - Cannot force-push to this branch ``` -After disabling the only rulesets ruleset (id=15524390 "Default", `enforcement: disabled`) and retrying, the push was rejected AGAIN with a **different error code**: +After disabling the only ruleset (id=15524390 "Default", `enforcement: disabled`) and retrying, the push was rejected AGAIN with a **different error code**: ``` remote: error: GH006: Protected branch update failed for refs/heads/main. @@ -38,9 +38,12 @@ So both layers had been configured at different times, both enforced together, a Executed: ```bash -# Delete legacy branch protection +# Delete legacy branch protection (this removed the GH006 blocker) gh api -X DELETE repos/AceHack/Zeta/branches/main/protection -# โ†’ "Branch not protected" (404) +# โ†’ success (rc=0, no body printed; GitHub returns 204 No Content) +# Subsequent verification GET returns 404 "Branch not protected": +# gh api repos/AceHack/Zeta/branches/main/protection +# โ†’ {"message":"Branch not protected", "status":"404"} # Disable rulesets enforcement (--input - reads JSON body from stdin via heredoc) gh api -X PUT repos/AceHack/Zeta/rulesets/15524390 --input - <<'EOF' @@ -91,11 +94,11 @@ gh api repos/{owner}/{repo}/branches/{branch} --jq '.protected' 1. **Operational diagnosis**: future force-push or branch-policy issues should check BOTH surfaces. Don't trust `branch.protected` flag alone. 2. **Config drift**: future config changes must go through rulesets only; never re-create legacy branch protection on AceHack/Zeta. 3. **Cross-org applicability**: this is a GitHub-wide UI confusion (not specific to AceHack). Other repos in Lucent-Financial-Group / etc. might have the same dual-layer config. Worth checking on cadence. -4. **CLAUDE.md protocol verification**: CLAUDE.md says *"Force-push to AceHack main is part of the protocol"*. The rulesets `non_fast_forward` rule blocks this, which means **the rulesets config still doesn't match the documented protocol**. Either the protocol gets revised (no force-push, only sync via PR) or the ruleset's `non_fast_forward` rule needs a bypass-actor allowlist for the maintainer credential. Task #305-adjacent ("Set up acehack-first development workflow") is the home for that decision. +4. **CLAUDE.md protocol verification**: CLAUDE.md says *"Force-push to AceHack main is part of the protocol"*. The rulesets `non_fast_forward` rule blocks this, which means **the rulesets config still doesn't match the documented protocol**. Either the protocol gets revised (no force-push, only sync via PR) or the ruleset's `non_fast_forward` rule needs a bypass-actor allowlist for the maintainer credential. task #275-adjacent ("Set up acehack-first development workflow") is the home for that decision. ## Composes with - `memory/feedback_destructive_git_op_5_pre_flight_disciplines_codex_gemini_2026_04_28.md` โ€” pre-flight disciplines for destructive git ops (force-push needs `--force-with-lease=ref:exact-old-sha`) - `docs/active-trajectory.md` โ€” 0/0/0 hard-reset gate spec + post-reset state -- Task #305 (BACKLOG, pending) โ€” set up acehack-first development workflow; protection-config protocol-vs-ruleset alignment goes here -- `memory/feedback_aaron_visibility_constraint_no_changes_he_cant_see_2026_04_28.md` โ€” Aaron's visibility constraint; this case satisfied it because Aaron was repo admin on AceHack/Zeta and could see the toggles in UI (even if confused by the dual-layer surface) +- task #275 (TaskList, pending: "Set up acehack-first development workflow") โ€” protection-config protocol-vs-ruleset alignment goes under that lane. Note: distinct from PR numbers #305/etc. which are unrelated artifacts; this is the in-session TaskCreate/TaskList tracker. +- Aaron's standing visibility-constraint principle (don't change shared-production things he can't see) โ€” satisfied here because Aaron is repo admin on AceHack/Zeta and the rulesets toggles are visible in the GitHub UI (even if confused by the dual-layer surface). The detailed memory for this principle currently lives in user-scope memory (not in-repo); a future audit pass should either backfill it to in-repo or remove the existing index pointer in `memory/MEMORY.md` that references the non-in-repo file. diff --git a/tools/pr-preservation/archive-pr.sh b/tools/pr-preservation/archive-pr.sh index f53f91fc..0b019bdf 100755 --- a/tools/pr-preservation/archive-pr.sh +++ b/tools/pr-preservation/archive-pr.sh @@ -112,13 +112,24 @@ if ! REPO_ROOT="$(git rev-parse --show-toplevel 2>/dev/null)"; then fi # Dynamic owner / name โ€” works from forks or after rename. -# Requires `gh repo view` to succeed; the script hard-fails -# with exit 1 rather than silently defaulting to a baked-in -# NWO (better to fail loud than archive to the wrong repo -# path on a fork). -REPO_NWO="$(gh repo view --json nameWithOwner --jq .nameWithOwner 2>/dev/null || true)" -if [ -z "${REPO_NWO}" ]; then - echo "error: could not detect repo via 'gh repo view'. Is gh authenticated and this a GitHub repo?" >&2 +# Resolution order: +# 1. GH_REPO env var (e.g. GH_REPO=AceHack/Zeta) โ€” needed for cross-fork +# archives where the local clone's `gh repo view` resolves to a +# different repo than the PR's home (e.g. local origin = LFG but +# archiving an AceHack PR). +# 2. `gh repo view --json nameWithOwner` โ€” falls back to whichever repo +# gh-cli resolves for the current working directory (typically +# the local clone's `origin` remote, or the explicit `gh repo +# set-default` setting if one is in effect). +# The script hard-fails with exit 1 rather than silently defaulting to a +# baked-in NWO (better to fail loud than archive to the wrong repo path). +if [ -n "${GH_REPO:-}" ]; then + REPO_NWO="${GH_REPO}" +else + REPO_NWO="$(gh repo view --json nameWithOwner --jq .nameWithOwner 2>/dev/null || true)" +fi +if [ -z "${REPO_NWO}" ] || [ "${REPO_NWO}" = "${REPO_NWO#*/}" ]; then + echo "error: could not detect repo (need GH_REPO=/ env var or 'gh repo view' to succeed). Is gh authenticated and this a GitHub repo?" >&2 exit 1 fi REPO_OWNER="${REPO_NWO%/*}"