instar 1.3.1022 → 1.3.1024

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"file":"devCiFailures.d.ts","sourceRoot":"","sources":["../../src/commands/devCiFailures.ts"],"names":[],"mappings":"AAiBA,8DAA8D;AAC9D,MAAM,WAAW,YAAY;IAC3B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,gBAAgB;IAC/B,KAAK,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,KAAK,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;CAC3B;AAED,oFAAoF;AACpF,MAAM,WAAW,cAAc;IAC7B,0EAA0E;IAC1E,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;CAC1C;AAED,MAAM,WAAW,oBAAoB;IACnC,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,gBAAgB,CAAC;IAC1B,IAAI,CAAC,EAAE,cAAc,CAAC;CACvB;AAKD;;;;;;;GAOG;AACH,wBAAgB,mBAAmB,CAAC,WAAW,EAAE,YAAY,EAAE,GAAG,MAAM,EAAE,CAczE;AAqBD;;;;;GAKG;AACH,wBAAsB,gBAAgB,CAAC,IAAI,EAAE,oBAAoB,GAAG,OAAO,CAAC,MAAM,CAAC,CAqElF"}
1
+ {"version":3,"file":"devCiFailures.d.ts","sourceRoot":"","sources":["../../src/commands/devCiFailures.ts"],"names":[],"mappings":"AAiBA,8DAA8D;AAC9D,MAAM,WAAW,YAAY;IAC3B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,gBAAgB;IAC/B,KAAK,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,KAAK,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;CAC3B;AAED,oFAAoF;AACpF,MAAM,WAAW,cAAc;IAC7B,0EAA0E;IAC1E,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;CAC1C;AAED,MAAM,WAAW,oBAAoB;IACnC,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,gBAAgB,CAAC;IAC1B,IAAI,CAAC,EAAE,cAAc,CAAC;CACvB;AAKD;;;;;;;GAOG;AACH,wBAAgB,mBAAmB,CAAC,WAAW,EAAE,YAAY,EAAE,GAAG,MAAM,EAAE,CAczE;AA2CD;;;;;GAKG;AACH,wBAAsB,gBAAgB,CAAC,IAAI,EAAE,oBAAoB,GAAG,OAAO,CAAC,MAAM,CAAC,CAqElF"}
@@ -43,6 +43,28 @@ export function extractFailureLines(annotations) {
43
43
  }
44
44
  return lines;
45
45
  }
46
+ /**
47
+ * RULE 3.1 rationale — criticality x frequency x stability x fallback.
48
+ *
49
+ * CRITICALITY: lowest band. This reads a PR's failed check-runs and their
50
+ * annotations to print what broke. It is a DIAGNOSTIC, never a gate — the
51
+ * command returns 0 even when it finds failures. A wrong answer costs a
52
+ * contributor one confusing terminal read, never a merge decision.
53
+ * FREQUENCY: once per `instar dev:ci-failures <pr>` invocation, run by hand
54
+ * against a red PR. No loop, no polling, no retry amplification.
55
+ * STABILITY: `gh --json` / the check-run annotations endpoint is GitHub's
56
+ * documented machine-readable contract, requested with explicit fields —
57
+ * not prose scraped from stdout. An upstream shape change surfaces as a `gh`
58
+ * error or a parse failure, not as a silently reshaped object. Deterministic
59
+ * parsing is acceptable here without a canary.
60
+ * FALLBACK: loud on every path, which is why this detector needs no partial
61
+ * caveat. A non-zero `gh` exit rejects with the captured stderr; empty or
62
+ * malformed stdout throws inside JSON.parse and rejects as "gh returned
63
+ * non-JSON" (note there is no `|| \'null\'` default here, so empty output
64
+ * cannot degrade into a successful-looking empty result); and every caller
65
+ * catches, writes the reason via out.error, and returns exit 1. There is no
66
+ * path on which a failed read renders as a clean one.
67
+ */
46
68
  function defaultDeps() {
47
69
  return {
48
70
  ghJson: (args) => new Promise((resolve, reject) => {
@@ -1 +1 @@
1
- {"version":3,"file":"devCiFailures.js","sourceRoot":"","sources":["../../src/commands/devCiFailures.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,MAAM,YAAY,CAAC;AA4B5B,MAAM,YAAY,GAAG,kBAAkB,CAAC;AACxC,MAAM,iBAAiB,GAAG,CAAC,CAAC;AAE5B;;;;;;;GAOG;AACH,MAAM,UAAU,mBAAmB,CAAC,WAA2B;IAC7D,MAAM,KAAK,GAAa,EAAE,CAAC;IAC3B,KAAK,MAAM,CAAC,IAAI,WAAW,EAAE,CAAC;QAC5B,IAAI,CAAC,CAAC,CAAC,gBAAgB,IAAI,EAAE,CAAC,KAAK,SAAS;YAAE,SAAS;QACvD,MAAM,IAAI,GAAG,CAAC,CAAC,IAAI,IAAI,EAAE,CAAC;QAC1B,IAAI,IAAI,KAAK,SAAS,IAAI,IAAI,CAAC,UAAU,CAAC,UAAU,CAAC;YAAE,SAAS;QAChE,MAAM,GAAG,GAAG,CAAC,CAAC,CAAC,OAAO,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC;QACrC,IAAI,CAAC,GAAG;YAAE,SAAS;QACnB,IAAI,2CAA2C,CAAC,IAAI,CAAC,GAAG,CAAC;YAAE,SAAS;QACpE,MAAM,GAAG,GAA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,CAAC,MAAM,CAAC,CAkErF"}
@@ -99,6 +99,29 @@ export function readSpecHeads(specsDir) {
99
99
  }
100
100
  return out;
101
101
  }
102
+ /**
103
+ * RULE 3.1 rationale — criticality x frequency x stability x fallback.
104
+ *
105
+ * CRITICALITY: lowest band. This detector answers "is another PR or approved spec already
106
+ * claiming these files?" before a build starts. It is ADVISORY — it never gates, blocks,
107
+ * or decides. A wrong answer costs a duplicated build (the 2026-06-05 collision this
108
+ * command exists to prevent), never a wrong verdict on someone else's change.
109
+ * FREQUENCY: once per `instar dev:claim-check` invocation, at build start. Not a hot path,
110
+ * no loop, no retry amplification.
111
+ * STABILITY: the highest available for an external read. `gh --json <fields>` is GitHub
112
+ * CLI's documented machine-readable contract, not prose scraped from stdout, and the
113
+ * fields are requested explicitly — so an upstream format change surfaces as a `gh`
114
+ * error rather than as a silently reshaped object. Deterministic parsing is therefore
115
+ * acceptable here without a canary or an LLM check.
116
+ * FALLBACK: asymmetric, and the asymmetry is the reason this rationale is worth reading.
117
+ * A THROWN error (gh missing, auth, network, malformed JSON) degrades LOUDLY — the
118
+ * caller records `ghDegraded` and reports spec-scan-only, so the user knows the PR half
119
+ * of the check did not run. But EMPTY stdout parses to `null`, which the caller's
120
+ * `?? []` renders as "zero PRs claim these files" with no degradation flag: a check that
121
+ * could not run becomes indistinguishable from one that ran clean. That path is narrow
122
+ * (`gh pr list --json` emits `[]` on success, not empty) but real, and it is tracked
123
+ * separately rather than papered over here.
124
+ */
102
125
  function defaultGhJson(args) {
103
126
  return new Promise((resolve, reject) => {
104
127
  execFile('gh', args, { maxBuffer: 32 * 1024 * 1024, timeout: 30_000 }, (err, stdout) => {
@@ -1 +1 @@
1
- {"version":3,"file":"devClaimCheck.js","sourceRoot":"","sources":["../../src/commands/devClaimCheck.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,MA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G,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,eAAe,CAAC,CAAC,IAAI,IAAI,EAAE,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IAC5G,CAAC;IACD,IAAI,KAAK,GAAG,CAAC,EAAE,CAAC;QACd,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC,IAAI,CAClB,KAAK,KAAK,wJAAwJ,CACnK,CAAC,CAAC;IACL,CAAC;IACD,OAAO,OAAO,CAAC,MAAM,IAAI,KAAK,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,UAAU,IAAI,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAChF,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "instar",
3
- "version": "1.3.1022",
3
+ "version": "1.3.1024",
4
4
  "description": "Coherence infrastructure for self-evolving AI agents — on the Claude Code or Codex subscription you already have.",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -113,7 +113,50 @@ const STATE_DETECTION_PATTERNS = [
113
113
  const RULE3_EXEMPT_COMMENT_RE = /RULE\s*3\s*:\s*EXEMPT/i;
114
114
  const RULE3_RATIONALE_COMMENT_RE = /RULE\s*3\.1\s*RATIONALE/i;
115
115
 
116
+ /**
117
+ * The incoming ref, if a merge is in progress. `MERGE_HEAD` exists only between
118
+ * `git merge` starting and the merge commit being written — exactly the window
119
+ * this hook runs in.
120
+ */
121
+ function mergeHeadIfMerging() {
122
+ try {
123
+ const out = execSync('git rev-parse -q --verify MERGE_HEAD', {
124
+ encoding: 'utf-8',
125
+ stdio: ['ignore', 'pipe', 'ignore'],
126
+ });
127
+ return out.trim() || null;
128
+ } catch {
129
+ return null; // not a merge — `rev-parse -q --verify` exits non-zero
130
+ }
131
+ }
132
+
116
133
  function getStagedFiles() {
134
+ // During a MERGE the index holds every file that differs between the branch
135
+ // base and the incoming ref — i.e. effectively all of the incoming branch.
136
+ // Judging that as the committer's work makes anyone merging `main` into an
137
+ // older branch the author of all of `main`, so they are refused for
138
+ // pre-existing violations that are absent from their own diff and that they
139
+ // did not write. That refusal names a file they cannot see, so the natural
140
+ // responses are to edit someone else's code or reach for --no-verify.
141
+ //
142
+ // A committer's real contribution to a merge is what differs from the
143
+ // INCOMING ref: a file taken verbatim from MERGE_HEAD was not authored here.
144
+ // A conflict resolution DOES differ from MERGE_HEAD, so genuinely authored
145
+ // content is still evaluated — see the merge-semantics tests, which assert
146
+ // both directions.
147
+ const mergeHead = mergeHeadIfMerging();
148
+ if (mergeHead) {
149
+ try {
150
+ const out = execSync(
151
+ `git diff --cached --name-only --diff-filter=ACMR ${mergeHead}`,
152
+ { encoding: 'utf-8' },
153
+ );
154
+ return out.split('\n').filter((l) => l.trim().length > 0);
155
+ } catch {
156
+ // Fall through to the full staged list — the STRICTER reading, so a
157
+ // failure here can only over-report, never silently let code past.
158
+ }
159
+ }
117
160
  try {
118
161
  const out = execSync('git diff --cached --name-only --diff-filter=ACMR', {
119
162
  encoding: 'utf-8',
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "$schema": "./builtin-manifest.schema.json",
3
3
  "schemaVersion": 1,
4
- "generatedAt": "2026-07-28T09:26:52.565Z",
5
- "instarVersion": "1.3.1022",
4
+ "generatedAt": "2026-07-28T09:55:54.824Z",
5
+ "instarVersion": "1.3.1024",
6
6
  "entryCount": 202,
7
7
  "entries": {
8
8
  "hook:session-start": {
@@ -0,0 +1,74 @@
1
+ # Upgrade Guide — vNEXT
2
+
3
+ <!-- assembled-by: assemble-next-md -->
4
+ <!-- bump: patch -->
5
+
6
+ ## What Changed
7
+
8
+ `src/commands/devClaimCheck.ts` reads GitHub by running `gh` and parsing its `--json` output —
9
+ textbook state detection under Rule 3 — but it entered `main` via #813 (2026-06-05) carrying
10
+ neither of the two things Rule 3 requires: an in-file Rule 3.1 rationale and a state-detector
11
+ registry row. Both are added here.
12
+
13
+ It survived because the pre-commit Rule 3 gate evaluates **staged** files only, so a file that
14
+ entered `main` without tripping the gate at its own commit time is never re-examined.
15
+
16
+ That is not a cosmetic gap. A merge stages everything, so anyone merging `main` into an older
17
+ branch is judged as the author of all of `main` and hits this refusal for a violation absent
18
+ from their own diff — a hard blocker on locally refreshing older open PRs. It blocked exactly
19
+ that work on 2026-07-28 and is the reason this was found at all.
20
+
21
+ The registry row is deliberately **🟡 Partial rather than 🔵 Exempt**, unlike the neighbouring
22
+ `gh --json` reads that are exempt on "versioned structured contract" reasoning. The difference
23
+ is the fallback. A thrown error (gh missing, auth, network) degrades loudly — the caller sets
24
+ `ghDegraded` and reports spec-scan-only. But empty stdout parses to `null`, and the caller's
25
+ `?? []` renders that as "zero PRs claim these files" with no degradation flag: a check that
26
+ could not run reading identically to one that ran clean. Narrow (`gh pr list --json` emits `[]`
27
+ on success, not empty) and advisory-only, so the blast radius is a false all-clear on a
28
+ pre-build hint — but it is named in both the rationale and the registry rather than papered
29
+ over, and the row flips to Exempt once that path degrades as loudly as the throw path.
30
+
31
+ Fixing the silent-empty path is a behaviour change and is tracked separately, not bundled into
32
+ a comment-only commit.
33
+
34
+ ## What to Tell Your User
35
+
36
+ Nothing. No user-visible change, no new command, no behaviour difference in any conversation.
37
+ This is a documentation and registry fix to a contributor-facing CLI helper.
38
+
39
+ ## Summary of New Capabilities
40
+
41
+ None. `instar dev:claim-check` behaves exactly as before — same flags, same output, same exit
42
+ codes. The only functional effect is that `main` stops failing its own Rule 3 gate, which
43
+ unblocks locally merging `main` into older branches.
44
+
45
+ ## Evidence
46
+
47
+ - The violation was confirmed on `main`, not inferred: `grep -c "RULE 3"
48
+ src/commands/devClaimCheck.ts` on `origin/main` returns 0, and the file is absent from the
49
+ diff of the branch that hit the refusal.
50
+ - The refusal is reproducible, and so is the fix: the same staged change was **blocked** by the
51
+ Rule 3 gate before the rationale comment, blocked again for the missing registry row after it,
52
+ and **passed** once both halves were present. Each verdict was observed, not predicted.
53
+ - Comment-and-registry only — no statement, signature, export, or type is modified, so `tsc`
54
+ emits identical JS.
55
+ - Side-effects review: `upgrades/side-effects/rule3-rationale-devclaimcheck.md`.
56
+ - ELI16: `upgrades/rule3-rationale-devclaimcheck.eli16.md`.
57
+
58
+ ## Correction after opening: this was TWO files, not one
59
+
60
+ The first version of this change covered only `devClaimCheck.ts` and claimed that unblocked merging
61
+ `main` into an older branch. **That claim was false**, and an A/B test caught it: branching from a
62
+ pre-#813 `main` commit and staging a merge of current `main` flagged **two** files —
63
+ `devCiFailures.ts` as well. Fixing one of two blockers unblocks nothing.
64
+
65
+ `devCiFailures.ts` now carries its own rationale and registry row. It is marked **🔵 Exempt** rather
66
+ than Partial, because unlike its sibling every failure path is loud: a non-zero `gh` exit rejects
67
+ with captured stderr, and its `JSON.parse(stdout)` carries no `|| 'null'` default, so empty output
68
+ throws rather than degrading into a successful-looking empty result.
69
+
70
+ **How the check nearly fooled me.** My first A/B run reported the fixed side PASSING — but the merge
71
+ had failed (a ref I had not fetched), so nothing was staged and the checker exited 0 over an empty
72
+ file list. A vacuous pass is indistinguishable from a real one unless you assert the check had input.
73
+ The re-run prints staged counts: 7,499 files / 905 `src/*.ts` on the failing side, and refuses to
74
+ read 0 staged files as a pass.
@@ -0,0 +1,42 @@
1
+ # Upgrade Guide — vNEXT
2
+
3
+ <!-- assembled-by: assemble-next-md -->
4
+ <!-- bump: patch -->
5
+
6
+ ## What Changed
7
+
8
+ The Rule 3 pre-commit gate judged **everything a merge stages** as the committer's work.
9
+
10
+ An ordinary commit's index is the author's change. A merge's index is every file that differs between
11
+ the branch base and the incoming ref — so merging `main` into an older branch made the committer the
12
+ author of all of `main`, and they were refused for pre-existing violations absent from their own diff.
13
+ Measured on a branch based at 2026-06-01: 905 staged `src/*.ts`, refused on two files the merger never
14
+ touched.
15
+
16
+ While a merge is in progress the gate now diffs against `MERGE_HEAD`. A file taken verbatim from the
17
+ incoming ref was not authored by the committer; a conflict resolution was, and is still evaluated.
18
+ Outside a merge nothing changes. If the comparison fails, the gate falls back to the full index — the
19
+ stricter reading, so a failure can only over-report.
20
+
21
+ ## What to Tell Your User
22
+
23
+ Nothing. A contributor-facing pre-commit script — not shipped, not executed at runtime, no
24
+ user-visible behaviour.
25
+
26
+ ## Summary of New Capabilities
27
+
28
+ None. This narrows *who* a rule is enforced against, not what the rule requires. It removes a class of
29
+ refusal that named a file the author could not see — the response to which was to edit someone else's
30
+ code or skip the check.
31
+
32
+ ## Evidence
33
+
34
+ - Red → green with a control: the verbatim-from-incoming test failed while the author-resolved control
35
+ passed (1 failed / 25 passed); 26/26 after. The control is what distinguishes scoping the gate from
36
+ weakening it — content matching neither parent is still judged.
37
+ - The verbatim test asserts the offending file **is staged** before expecting a pass, so the pass
38
+ cannot come from an empty file list.
39
+ - All 24 pre-existing tests pass unchanged.
40
+ - Harness bug fixed en route: the new tests hardcoded `master` while `init.defaultBranch` is `main`
41
+ here; the branch name is now read from the repo rather than assumed.
42
+ - Side-effects review: `upgrades/side-effects/rule3-gate-judges-author-contribution.md`.
@@ -0,0 +1,34 @@
1
+ # ELI16 — you were being judged as the author of everything you merged
2
+
3
+ A pre-commit check looks at "the files you are committing" to decide whether new code that reads
4
+ outside systems ships with its required justification. It gets that list from the git index.
5
+
6
+ For an ordinary edit, the index *is* your change. **For a merge it is not.** Merging `main` into an
7
+ older branch stages every file that differs between your branch and `main` — hundreds or thousands of
8
+ them. The check then treats all of it as yours.
9
+
10
+ So you get refused for a rule broken by a file you have never opened, which does not appear in your
11
+ diff, in code somebody else wrote months ago. Measured on a branch based at 1 June: the merge stages
12
+ 905 TypeScript files and the check refuses on two of them, neither touched by the merger.
13
+
14
+ That refusal is worse than annoying. It names a file you cannot see, so the two natural responses are
15
+ to go and edit someone else's code, or to reach for the flag that skips the check. Neither is what
16
+ anyone wanted.
17
+
18
+ **The fix.** While a merge is in progress git records the incoming side as `MERGE_HEAD`. Your actual
19
+ contribution to a merge is whatever differs from *that* — a file taken verbatim from the incoming
20
+ branch was not written by you. So during a merge the check now compares against the incoming ref
21
+ instead of the whole index.
22
+
23
+ **It does not go soft.** If you resolve a conflict, your resolution matches neither parent, so it is
24
+ still yours and still checked. There is a test for exactly that, and it fails if the fix is too
25
+ permissive. Outside a merge nothing changes at all — same list, same behaviour, and the 24 existing
26
+ tests pass untouched.
27
+
28
+ If the comparison itself fails for any reason, the check falls back to the old full list. That is the
29
+ stricter reading, so a failure can only ever over-report — it can never quietly let something past.
30
+
31
+ **Why this is the right layer.** A sweep finds 26 files on `main` that would trip this rule. Which of
32
+ them bites you depends on how old your branch is, because only files changed since your branch point
33
+ get staged. Adding justifications one file at a time is chasing a moving target; making the check
34
+ judge your own work fixes every version of the problem at once.
@@ -0,0 +1,55 @@
1
+ # ELI16 — the missing rationale that was blocking old pull requests
2
+
3
+ There is a rule in this repo (Rule 3.1) that says: if your code looks at some outside system
4
+ to figure out what state it's in, you have to write a short paragraph explaining *why it's OK*
5
+ to detect it that way. Four questions: how much damage does a wrong answer do, how often does
6
+ this run, how likely is the outside thing to change shape on you, and what happens when it
7
+ fails.
8
+
9
+ A pre-commit check enforces that rule. But it only inspects the files you are committing
10
+ *right now*. So a file that slipped into `main` without ever tripping the check is never
11
+ looked at again.
12
+
13
+ That's what happened to `src/commands/devClaimCheck.ts`. It arrived in June, it reads GitHub
14
+ by running `gh` and parsing the JSON that comes back — textbook state detection — and it has
15
+ no rationale at all.
16
+
17
+ **Why that stopped being merely untidy.** Merging `main` into an older branch stages *every
18
+ file in main*. Git then treats you as the author of all of it, so the check inspects the whole
19
+ thing, finds this file, and refuses your commit — for a violation you did not write and cannot
20
+ see in your own diff. Anyone trying to bring an old pull request up to date walks into it. It
21
+ blocked me last night.
22
+
23
+ **The change is one comment.** It adds the rationale that should have been there in June.
24
+
25
+ The one part worth reading is the "what happens when it fails" answer, because it is not
26
+ flattering. If `gh` genuinely breaks — missing, not logged in, no network — the tool says so
27
+ out loud and tells you it only managed to scan the specs. Good. But if `gh` returns *nothing
28
+ at all*, that empty result quietly becomes "zero pull requests claim these files", with no
29
+ warning. A check that could not run ends up looking exactly like a check that ran and found
30
+ everything clear.
31
+
32
+ That path is narrow, and this change does not fix it. It writes it down instead of leaving it
33
+ unmentioned, and it is tracked separately. A rationale that only lists reassuring facts is
34
+ worth very little — the point of the rule is to surface the part someone should worry about.
35
+
36
+ No behaviour changes. Nothing runs differently.
37
+
38
+
39
+ ## Correction after opening: this was TWO files, not one
40
+
41
+ The first version of this change covered only `devClaimCheck.ts` and claimed that unblocked merging
42
+ `main` into an older branch. **That claim was false**, and an A/B test caught it: branching from a
43
+ pre-#813 `main` commit and staging a merge of current `main` flagged **two** files —
44
+ `devCiFailures.ts` as well. Fixing one of two blockers unblocks nothing.
45
+
46
+ `devCiFailures.ts` now carries its own rationale and registry row. It is marked **🔵 Exempt** rather
47
+ than Partial, because unlike its sibling every failure path is loud: a non-zero `gh` exit rejects
48
+ with captured stderr, and its `JSON.parse(stdout)` carries no `|| 'null'` default, so empty output
49
+ throws rather than degrading into a successful-looking empty result.
50
+
51
+ **How the check nearly fooled me.** My first A/B run reported the fixed side PASSING — but the merge
52
+ had failed (a ref I had not fetched), so nothing was staged and the checker exited 0 over an empty
53
+ file list. A vacuous pass is indistinguishable from a real one unless you assert the check had input.
54
+ The re-run prints staged counts: 7,499 files / 905 `src/*.ts` on the failing side, and refuses to
55
+ read 0 staged files as a pass.
@@ -0,0 +1,53 @@
1
+ # Side-effects review — Rule 3 gate judges the author's contribution
2
+
3
+ **Change:** `getStagedFiles()` in `scripts/check-rule3-coverage.cjs` diffs against `MERGE_HEAD` while
4
+ a merge is in progress; a new `mergeHeadIfMerging()` helper detects that state. Two merge-semantics
5
+ tests added.
6
+
7
+ ## Direction of effect — the only question that matters for a gate
8
+
9
+ More permissive **during a merge only**, so the risk to weigh is a false ACCEPT.
10
+
11
+ | situation | before | after |
12
+ |---|---|---|
13
+ | Ordinary commit (no merge) | full index | **identical** — `MERGE_HEAD` absent, original path taken |
14
+ | Merge: file verbatim from incoming ref | judged as yours ❌ | not judged ✅ **(the fix)** |
15
+ | Merge: file you resolved / authored | judged | **still judged** — differs from `MERGE_HEAD` |
16
+ | Merge: unrelated file you also staged | judged | **still judged** — differs from `MERGE_HEAD` |
17
+ | `git diff` against `MERGE_HEAD` fails | n/a | falls back to the full index — the **stricter** reading |
18
+
19
+ The load-bearing claim is row 3, and it is asserted by a test that fails if the fix is too permissive.
20
+ It is the reason this is scoping rather than weakening: content that exists on neither parent is
21
+ authored content, and it is still evaluated.
22
+
23
+ ## What could go wrong, honestly
24
+
25
+ **A file the author deliberately reverts to the incoming version.** If you resolve a conflict by
26
+ taking the incoming side wholesale, that file no longer differs from `MERGE_HEAD` and is not judged.
27
+ That is correct by the definition used here — you contributed no content — but it does mean a merge
28
+ cannot be used to *re-introduce* an incoming violation under your name. Since the incoming ref already
29
+ contains it, the rule was already not being enforced there; this changes who is asked to fix it, not
30
+ whether it exists.
31
+
32
+ **Octopus merges** (>1 `MERGE_HEAD`) — `rev-parse --verify MERGE_HEAD` returns the first only. Rare in
33
+ this repo and it degrades toward the stricter side.
34
+
35
+ **Not addressed:** the 26 latent violators on `main` remain. This stops them landing on whoever merges
36
+ next; it does not add their missing justifications.
37
+
38
+ ## Blast radius
39
+
40
+ Pre-commit script only. Not in `src/`, not bundled, not executed at runtime, no state, no migration,
41
+ no config. `git revert` restores the previous behaviour exactly.
42
+
43
+ ## Verification
44
+
45
+ - **Red → green with a control**: before the fix the verbatim-from-incoming test failed while the
46
+ author-resolved control passed (1 failed / 25 passed) — the control is what proves the fix targets
47
+ the right thing rather than disabling the check. 26/26 after.
48
+ - The verbatim test asserts the file **is staged** before expecting a pass, so a pass cannot come from
49
+ an empty file list.
50
+ - All 24 pre-existing tests pass unchanged.
51
+ - A harness bug found and fixed en route: the tests hardcoded `master`, but `init.defaultBranch` is
52
+ `main` here. The branch name is now read from the repo, so the tests do not depend on the author's
53
+ git config.
@@ -0,0 +1,73 @@
1
+ # Side-effects review — Rule 3.1 rationale for `devClaimCheck`'s gh detector
2
+
3
+ **Change:** one doc-comment added above `defaultGhJson` in `src/commands/devClaimCheck.ts`.
4
+ 23 lines, comment-only. No statement, expression, signature, export, or type is modified.
5
+
6
+ ## What the change can affect
7
+
8
+ | Surface | Effect | Why |
9
+ |---|---|---|
10
+ | Runtime behaviour | **None** | A block comment. `tsc` emits identical JS; no code path is reachable through it. |
11
+ | Public API / CLI | **None** | `dev:claim-check` flags, output, and exit codes are untouched. |
12
+ | Tests | **None expected** | No test asserts on this file's source text. |
13
+ | The Rule 3 pre-commit gate | **Intended change** | This file stops being a violation. Verified: the gate refused this exact commit before the comment and accepted it after. |
14
+ | Other repos / migration | **None** | Not an agent-installed file, no config default, no template, no hook. Migration Parity does not apply. |
15
+ | Multi-machine posture | **N/A** | No state surface introduced. |
16
+
17
+ ## The risk worth naming
18
+
19
+ The change is safe. The thing it *documents* is not, and I want that visible rather than
20
+ buried in a comment.
21
+
22
+ `JSON.parse(stdout || 'null')` resolves `null` on empty stdout. The caller's
23
+ `(await ghJson(...)) as ClaimPr[] ?? []` turns that into an empty array, and an empty array is
24
+ indistinguishable from "no open PR claims these files". Meanwhile a *thrown* error is handled
25
+ properly — it sets `ghDegraded` and the tool reports spec-scan-only.
26
+
27
+ So the loud path is loud and the quiet path is silently clean. That is the failure shape the
28
+ constitution calls out directly: a check that cannot run must not be indistinguishable from
29
+ one that ran clean.
30
+
31
+ **Not fixed here, deliberately.** Fixing it means changing behaviour (treating empty stdout as
32
+ a degradation), which deserves its own review and its own tests. Bundling it into a
33
+ comment-only change would hide a behaviour change inside a documentation commit. It is filed
34
+ separately.
35
+
36
+ **Reachability:** narrow. `gh pr list --json` emits `[]` on success, not empty output. It
37
+ would take a `gh` build that exits 0 while writing nothing, or truncated output. Low
38
+ likelihood, and the consequence is a false all-clear on an advisory tool — not a wrong gate
39
+ verdict.
40
+
41
+ ## Rollback
42
+
43
+ `git revert`. Nothing depends on it; reverting restores the pre-existing violation and with it
44
+ the merge blocker.
45
+
46
+ ## What I verified rather than assumed
47
+
48
+ - The file is `main`'s, not the PR's — it arrived via #813 (`144ff6122`, 2026-06-05) and is
49
+ absent from the branch diff.
50
+ - `main`'s copy carries zero `RULE 3` markers (`grep -c` → 0).
51
+ - The refusal is real and reproducible: the same staged commit was blocked before the comment
52
+ and passed the Rule 3 check after it.
53
+ - The fallback asymmetry is read from the code, not inferred — `catch` at the call site sets
54
+ `ghDegraded`; the `?? []` at lines 197/201 absorbs `null` with no flag.
55
+
56
+
57
+ ## Correction after opening: this was TWO files, not one
58
+
59
+ The first version of this change covered only `devClaimCheck.ts` and claimed that unblocked merging
60
+ `main` into an older branch. **That claim was false**, and an A/B test caught it: branching from a
61
+ pre-#813 `main` commit and staging a merge of current `main` flagged **two** files —
62
+ `devCiFailures.ts` as well. Fixing one of two blockers unblocks nothing.
63
+
64
+ `devCiFailures.ts` now carries its own rationale and registry row. It is marked **🔵 Exempt** rather
65
+ than Partial, because unlike its sibling every failure path is loud: a non-zero `gh` exit rejects
66
+ with captured stderr, and its `JSON.parse(stdout)` carries no `|| 'null'` default, so empty output
67
+ throws rather than degrading into a successful-looking empty result.
68
+
69
+ **How the check nearly fooled me.** My first A/B run reported the fixed side PASSING — but the merge
70
+ had failed (a ref I had not fetched), so nothing was staged and the checker exited 0 over an empty
71
+ file list. A vacuous pass is indistinguishable from a real one unless you assert the check had input.
72
+ The re-run prints staged counts: 7,499 files / 905 `src/*.ts` on the failing side, and refuses to
73
+ read 0 staged files as a pass.