instar 1.3.282 → 1.3.283

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "instar",
3
- "version": "1.3.282",
3
+ "version": "1.3.283",
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",
@@ -780,6 +780,15 @@ function blockCommit(files, reason) {
780
780
  // Append exactly one JSON line to .instar/instar-dev-decisions.jsonl for every
781
781
  // in-scope commit (regardless of tier branch). Best-effort: a logging failure
782
782
  // must never crash the gate.
783
+ //
784
+ // The line is then STAGED so it rides the very commit it describes. Without
785
+ // this, a pre-commit-hook append always lands AFTER staging, leaving the line
786
+ // uncommitted in the building worktree's tracked decisions file — one-PR
787
+ // worktrees never commit it, worktree reclaim deletes it, and the audit trail
788
+ // silently leaks (the task-#62 "decision-audit didn't fire" mystery: it DID
789
+ // fire, the line just evaporated with the worktree). If the commit is later
790
+ // blocked by the gate, the staged line simply rides the retry commit — both
791
+ // lines describe real gate evaluations.
783
792
  function writeDecisionAudit({ slug, suggestedTier, declaredTier, riskFloor, riskFloorReasons, belowFloor, files, loc }) {
784
793
  try {
785
794
  fs.mkdirSync(path.dirname(DECISIONS_LOG), { recursive: true });
@@ -799,6 +808,7 @@ function writeDecisionAudit({ slug, suggestedTier, declaredTier, riskFloor, risk
799
808
  loc,
800
809
  }) + '\n',
801
810
  );
811
+ execSync(`git add ${JSON.stringify(path.relative(ROOT, DECISIONS_LOG))}`, { cwd: ROOT });
802
812
  } catch {
803
813
  // best-effort — never block on audit I/O
804
814
  }
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "$schema": "./builtin-manifest.schema.json",
3
3
  "schemaVersion": 1,
4
- "generatedAt": "2026-06-05T09:21:22.569Z",
5
- "instarVersion": "1.3.282",
4
+ "generatedAt": "2026-06-05T09:56:36.782Z",
5
+ "instarVersion": "1.3.283",
6
6
  "entryCount": 198,
7
7
  "entries": {
8
8
  "hook:session-start": {
@@ -0,0 +1,21 @@
1
+ # Upgrade Guide — vNEXT
2
+
3
+ <!-- assembled-by: assemble-next-md -->
4
+ <!-- bump: patch -->
5
+
6
+ ## What Changed
7
+
8
+ One change in `writeDecisionAudit` (auto-stage after append) + a regression test (`tests/unit/instar-dev-precommit-audit-staging.test.ts`) pinning that the line is written AND staged even when the gate blocks. Root cause of the task-#62 "decision-audit didn't fire" mystery: it fired; the line sat uncommitted in the building worktree and was deleted with it.
9
+
10
+ ## What to Tell Your User
11
+
12
+ Nothing user-visible. An internal audit-trail leak is closed: the per-commit build-decision record (tier declared vs suggested) used to evaporate with reclaimed worktrees; it now travels inside the commit it describes.
13
+
14
+ ## Summary of New Capabilities
15
+
16
+ - `scripts/instar-dev-precommit.js` stages `.instar/instar-dev-decisions.jsonl` right after appending the audit line, so the line lands in the same commit it audits.
17
+ - A gate-blocked commit leaves the line staged; it rides the retry commit (both evaluations were real).
18
+
19
+ ## Evidence
20
+
21
+ Reproduced live twice on 2026-06-05 before the fix: two build worktrees (`keychain-per-agent`, then `dev-claim-check`) each held an orphaned, uncommitted `+{"ts":"2026-06-05T08:49:24Z","slug":"keychain-per-agent-master-key",...}` line in the tracked `.instar/instar-dev-decisions.jsonl` after their PR commit — `git status` showed ` M .instar/instar-dev-decisions.jsonl` post-commit, and removing the worktree would have deleted the only copy (one line was hand-rescued before reclaim). After the fix, observed on PR #814's own commit: `git status --short .instar/instar-dev-decisions.jsonl` is CLEAN immediately post-commit and the commit diff contains the gate's own audit line for that very commit — the dogfood proof quoted in the PR body.
@@ -0,0 +1,3 @@
1
+ # Decision-audit lines now ride their own commit
2
+
3
+ Every gated commit writes one audit line recording what tier was declared vs suggested — the accountability record for build decisions. But the line was written DURING the commit (by the pre-commit hook), which means it landed just after the files were staged — so it sat uncommitted in the building worktree. Most worktrees produce exactly one PR and then get deleted, taking the audit line with them. The record looked like it "never fired" when it actually fired and evaporated. Now the hook stages the audit file right after writing it, so the line travels inside the very commit it describes. If the gate blocks the commit, the staged line simply rides the retry — both lines describe real evaluations.
@@ -0,0 +1,40 @@
1
+ # Side-Effects Review — decision-audit self-commit
2
+
3
+ **Version / slug:** `decision-audit-self-commit`
4
+ **Date:** `2026-06-05`
5
+ **Author:** `echo`
6
+ **Second-pass reviewer:** `self-review under the Tier-1 lite lane (one-line hook change, audit-integrity fix)`
7
+
8
+ ## Summary of the change
9
+
10
+ `writeDecisionAudit` in `scripts/instar-dev-precommit.js` now stages `.instar/instar-dev-decisions.jsonl` immediately after appending the audit line, so the line rides the very commit it describes. Closes the task-#62 audit leak: pre-commit-hook appends land after staging, leaving the line uncommitted in the building worktree; one-PR worktrees never commit it and worktree reclaim deletes it (confirmed live twice on 2026-06-05).
11
+
12
+ ## Decision-point inventory
13
+
14
+ - `writeDecisionAudit` — modified — `git add <decisions file>` inside the existing best-effort try block, after a successful append.
15
+
16
+ ## 1. Over-block
17
+
18
+ None. The `git add` lives inside the existing best-effort catch — any failure (git unavailable, index lock) is swallowed exactly like an audit-write failure today; the gate never blocks on audit I/O.
19
+
20
+ ## 2. Over-permit
21
+
22
+ None. Staging one known repo-tracked file adds no permissive path. The file was already tracked and union-style appended; lines now simply become part of commits.
23
+
24
+ ## 3. Behavioral notes
25
+
26
+ - **Blocked commit:** the audit line is written + staged, then the gate may block. The staged line rides the author's retry commit — both evaluations were real; the record gains fidelity, not noise.
27
+ - **Out-of-scope commits** (docs/tests-only) still exit before the audit by design — unchanged.
28
+ - **Merge-conflict surface:** parallel PRs already both append to this tracked file; lines now actually LAND, so conflicts become possible where silent loss was before. The file is append-only JSONL — union-merge resolution is trivial and already practiced.
29
+
30
+ ## 4. Migration parity
31
+
32
+ None needed — `scripts/` ships with the repo; agents get it on update like any source change. No config/hook-template/skill changes.
33
+
34
+ ## 5. Token/cost impact
35
+
36
+ None. One `git add` of one file per gated commit.
37
+
38
+ ## 6. Rollback
39
+
40
+ Revert the commit; audit lines return to being orphaned working-tree modifications (the prior, leaky behavior).