instar 1.3.283 → 1.3.284

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":"MentorAutonomousGuardian.d.ts","sourceRoot":"","sources":["../../src/scheduler/MentorAutonomousGuardian.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAEH,MAAM,WAAW,sBAAsB;IACrC,6EAA6E;IAC7E,SAAS,EAAE,MAAM,CAAC;IAClB,gFAAgF;IAChF,OAAO,EAAE,OAAO,CAAC;IACjB;oFACgF;IAChF,QAAQ,EAAE,OAAO,CAAC;IAClB;8EAC0E;IAC1E,gBAAgB,EAAE,OAAO,CAAC;IAC1B,0EAA0E;IAC1E,kBAAkB,EAAE,OAAO,CAAC;IAC5B,8EAA8E;IAC9E,KAAK,EAAE,MAAM,CAAC;IACd;;qCAEiC;IACjC,SAAS,EAAE,MAAM,MAAM,CAAC;IACxB;0EACsE;IACtE,gBAAgB,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC;QAAE,WAAW,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IACpF,8BAA8B;IAC9B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,GAAG,CAAC,EAAE,MAAM,MAAM,CAAC;CACpB;AAED,MAAM,MAAM,wBAAwB,GAChC,UAAU,GACV,QAAQ,GACR,aAAa,GACb,iBAAiB,GACjB,SAAS,GACT,cAAc,CAAC;AAEnB,MAAM,WAAW,wBAAwB;IACvC,GAAG,EAAE,OAAO,CAAC;IACb,MAAM,EAAE,wBAAwB,CAAC;IACjC,wEAAwE;IACxE,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,sEAAsE;IACtE,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;;;GAIG;AACH,wBAAsB,qBAAqB,CACzC,IAAI,EAAE,sBAAsB,GAC3B,OAAO,CAAC,wBAAwB,CAAC,CAyBnC;AAED,MAAM,WAAW,kBAAkB;IACjC,8DAA8D;IAC9D,eAAe,EAAE,MAAM,CAAC;IACxB,+CAA+C;IAC/C,eAAe,EAAE,MAAM,CAAC;IACxB,+EAA+E;IAC/E,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,4DAA4D;IAC5D,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED;;;;;;;GAOG;AACH,wBAAgB,iBAAiB,CAAC,CAAC,EAAE,kBAAkB,GAAG,MAAM,CAoB/D"}
1
+ {"version":3,"file":"MentorAutonomousGuardian.d.ts","sourceRoot":"","sources":["../../src/scheduler/MentorAutonomousGuardian.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAEH,MAAM,WAAW,sBAAsB;IACrC,6EAA6E;IAC7E,SAAS,EAAE,MAAM,CAAC;IAClB,gFAAgF;IAChF,OAAO,EAAE,OAAO,CAAC;IACjB;oFACgF;IAChF,QAAQ,EAAE,OAAO,CAAC;IAClB;8EAC0E;IAC1E,gBAAgB,EAAE,OAAO,CAAC;IAC1B,0EAA0E;IAC1E,kBAAkB,EAAE,OAAO,CAAC;IAC5B,8EAA8E;IAC9E,KAAK,EAAE,MAAM,CAAC;IACd;;qCAEiC;IACjC,SAAS,EAAE,MAAM,MAAM,CAAC;IACxB;0EACsE;IACtE,gBAAgB,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC;QAAE,WAAW,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IACpF,8BAA8B;IAC9B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,GAAG,CAAC,EAAE,MAAM,MAAM,CAAC;CACpB;AAED,MAAM,MAAM,wBAAwB,GAChC,UAAU,GACV,QAAQ,GACR,aAAa,GACb,iBAAiB,GACjB,SAAS,GACT,cAAc,CAAC;AAEnB,MAAM,WAAW,wBAAwB;IACvC,GAAG,EAAE,OAAO,CAAC;IACb,MAAM,EAAE,wBAAwB,CAAC;IACjC,wEAAwE;IACxE,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,sEAAsE;IACtE,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;;;GAIG;AACH,wBAAsB,qBAAqB,CACzC,IAAI,EAAE,sBAAsB,GAC3B,OAAO,CAAC,wBAAwB,CAAC,CAyBnC;AAED,MAAM,WAAW,kBAAkB;IACjC,8DAA8D;IAC9D,eAAe,EAAE,MAAM,CAAC;IACxB,+CAA+C;IAC/C,eAAe,EAAE,MAAM,CAAC;IACxB,+EAA+E;IAC/E,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,4DAA4D;IAC5D,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED;;;;;;;GAOG;AACH,wBAAgB,iBAAiB,CAAC,CAAC,EAAE,kBAAkB,GAAG,MAAM,CAqB/D"}
@@ -84,6 +84,7 @@ export function buildAutoloopGoal(p) {
84
84
  ``,
85
85
  `Discipline (non-negotiable): verify before you claim — never write a result or a number before the producing tool has returned it. Never narrate a tool call you did not make. One cycle, then exit cleanly — do NOT spawn another copy of this loop or schedule a follow-up; the guardian starts the next cycle on its own heartbeat.`,
86
86
  `Gate compliance (ratchet gates): an intentional best-effort/fail-open catch must either report through DegradationReporter or carry an inline @silent-fallback-ok justification — never bump a ratchet baseline to pass CI. When you author a task brief or spec for another agent, spell these gate notes out explicitly: a spec that says "best-effort, never throws" without them invites the exact ratchet failure it is trying to avoid.`,
87
+ `Before you build (parallel-claim check): run \`instar dev:claim-check <paths you intend to touch> [--keywords ...]\` FIRST — if an open/recently-merged PR or a spec already owns a layer of the problem, claim a DIFFERENT layer explicitly (division-of-labor; earned 2026-06-05 when two parallel sessions built the same incident fix twice). And every PR DESCRIPTION must include an \`## ELI16\` section (a required CI gate) — write it in from the start, not after the gate goes red.`,
87
88
  ].join('\n');
88
89
  }
89
90
  //# sourceMappingURL=MentorAutonomous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AAe,KAAK,CAAC,CAAC,eAAe,4BAA4B;QACpJ,6KAA6K;QAC7K,EAAE;QACF,eAAe;QACf,0BAA0B,CAAC,CAAC,eAAe,+OAA+O;QAC1R,+GAA+G,OAAO,+CAA+C;QACrK,+PAA+P;QAC/P,6BAA6B,CAAC,CAAC,eAAe,4YAA4Y;QAC1b,MAAM,UAAU,EAAE;QAClB,EAAE;QACF,wUAAwU;QACxU,+aAA+a;QAC/a,ieAAie;KACle,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACf,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "instar",
3
- "version": "1.3.283",
3
+ "version": "1.3.284",
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",
@@ -12,6 +12,15 @@
12
12
  * 2. No fixture stowaway files at the repo root. file-0.txt and
13
13
  * seed are signature artifacts of the test-fixture pollution
14
14
  * class; they should never exist on main.
15
+ * 3. Release-note fragments (upgrades/next/*.md + legacy NEXT.md)
16
+ * assemble and validate cleanly — using the SAME assembler +
17
+ * validator the pre-push gate and publish workflow use. The
18
+ * pre-push gate already catches this locally, but local hooks are
19
+ * bypassable (admin/web merges, pre-guard history): a malformed
20
+ * fragment that reaches main jams EVERY subsequent fleet release
21
+ * at publish-time (lived twice: the v1.3.180 jam and #781 on
22
+ * 2026-06-05). This server-side check runs on every PR and on
23
+ * main, so the jam is loud and attributable instead of silent.
15
24
  *
16
25
  * Exit 0 = invariants hold. Exit 1 = at least one violated; the
17
26
  * specific failures are printed to stderr.
@@ -19,6 +28,8 @@
19
28
 
20
29
  import fs from 'node:fs';
21
30
  import path from 'node:path';
31
+ import { validateGuideContent } from './upgrade-guide-validator.mjs';
32
+ import { assembleNextMd, gatherFragmentInputs } from './assemble-next-md.mjs';
22
33
 
23
34
  const ROOT = process.cwd();
24
35
  const MIN_README_LINES = Number(process.env.INSTAR_README_MIN_LINES || 100);
@@ -55,6 +66,35 @@ for (const name of FIXTURE_STOWAWAYS) {
55
66
  }
56
67
  }
57
68
 
69
+ // ── Release-note fragments assemble + validate ────────────────────
70
+ // Mirrors scripts/pre-push-gate.js §1 exactly (same shared functions), so a
71
+ // fragment that would jam publish.yml can never sit quietly on main. No
72
+ // fragments at all is FINE here — "src changed without a fragment" is the
73
+ // pre-push gate's per-branch concern; this invariant only asserts that
74
+ // whatever fragments DO exist are publishable.
75
+ {
76
+ const upgradesDir = path.join(ROOT, 'upgrades');
77
+ if (fs.existsSync(upgradesDir)) {
78
+ try {
79
+ const { inputs } = gatherFragmentInputs(upgradesDir);
80
+ if (inputs.length > 0) {
81
+ const assembled = assembleNextMd(inputs);
82
+ for (const issue of validateGuideContent(assembled)) {
83
+ failures.push(
84
+ `Release-note fragments (upgrades/next/*.md + NEXT.md) fail validation: ${issue} ` +
85
+ `— this would jam the publish workflow for EVERY release until fixed.`,
86
+ );
87
+ }
88
+ }
89
+ } catch (err) {
90
+ failures.push(
91
+ `Release-note fragments are malformed (assembly failed): ${err instanceof Error ? err.message : err} ` +
92
+ `— this would jam the publish workflow for EVERY release until fixed.`,
93
+ );
94
+ }
95
+ }
96
+ }
97
+
58
98
  if (failures.length === 0) {
59
99
  console.log('✅ Repository invariants hold.');
60
100
  process.exit(0);
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "$schema": "./builtin-manifest.schema.json",
3
3
  "schemaVersion": 1,
4
- "generatedAt": "2026-06-05T09:56:36.782Z",
5
- "instarVersion": "1.3.283",
4
+ "generatedAt": "2026-06-05T10:00:50.492Z",
5
+ "instarVersion": "1.3.284",
6
6
  "entryCount": 198,
7
7
  "entries": {
8
8
  "hook:session-start": {
@@ -5,17 +5,30 @@
5
5
 
6
6
  ## What Changed
7
7
 
8
+ `scripts/check-repo-invariants.mjs` gains invariant #3 (assemble + validate fragments in-memory; throws and validator issues are failures; zero fragments passes). Reuses `assembleNextMd` + `validateGuideContent` — no duplicated rules, no drift. Tests cover all four boundary states (valid, malformed-assembly, missing-section, empty). Task #42.
9
+
8
10
  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
11
 
12
+ One discipline line appended in `buildAutoloopGoal` (`src/scheduler/MentorAutonomousGuardian.ts`), pinned by the existing deterministic prompt-assembly unit test (2 new assertions). Earned from the 2026-06-05 double parallel-collision and the live #813 eli16-gate hit.
13
+
10
14
  ## What to Tell Your User
11
15
 
16
+ Nothing user-visible. A release-pipeline failure mode is closed: a malformed release-note fragment can no longer sit silently on the main branch and jam every subsequent release — it now turns CI red immediately on the PR that carries it (or on main itself, loudly attributable).
17
+
12
18
  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
19
 
20
+ Nothing user-visible. The autonomous mentor-development loop's built-in working instructions now include two recently-earned ship rules, so future cycles don't rediscover them the hard way.
21
+
14
22
  ## Summary of New Capabilities
15
23
 
24
+ - The Repo Invariants required CI check now assembles and validates all release-note fragments (`upgrades/next/*.md` + legacy `NEXT.md`) using the same shared validators the publish workflow uses.
25
+ - Admin/web merges can no longer bypass fragment validation (the pre-push hook was local-only).
26
+
16
27
  - `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
28
  - A gate-blocked commit leaves the line staged; it rides the retry commit (both evaluations were real).
18
29
 
30
+ - The mentor autoloop goal prompt instructs each cycle to run `instar dev:claim-check` before starting a build (parallel-claim collision prevention) and to include the `## ELI16` section in every PR description from the start (the required CI gate).
31
+
19
32
  ## Evidence
20
33
 
21
34
  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
+ # Release-note fragments are now checked by CI, not just local hooks
2
+
3
+ Every release ships with release notes assembled from per-PR fragment files. If one fragment is malformed, the release pipeline jams — and not just for that one change: EVERY release for EVERY agent stops until someone finds and fixes the bad fragment. We had local protection (a check that runs on your machine before you push), but local checks can be bypassed — merging from the GitHub website or with admin rights skips them entirely, which is exactly how a bad fragment reached the main branch twice. Now the same fragment validation also runs on GitHub's servers as part of the required CI checks on every PR and on main itself: a bad fragment turns the checks red immediately, named and attributable, instead of silently waiting to jam the next release.
@@ -0,0 +1,3 @@
1
+ # The autonomous-mentor loop now teaches two new ship rules
2
+
3
+ The mentor system can run an autonomous develop-and-fix loop whose working instructions are encoded in code (so every cycle gets the same discipline, not whatever someone remembers to type). Two rules earned the hard way on 2026-06-05 are now part of those durable instructions: (1) before starting any build, run the new claim-check command so two parallel builders never construct the same fix twice — that exact collision happened twice in one night and wasted hours; (2) every PR description must include a plain-English ELI16 section from the start, because a required CI gate now rejects PRs without one — better to write it up front than to discover the red check after pushing.
@@ -0,0 +1,46 @@
1
+ # Side-Effects Review — CI fragment invariant (server-side publish-jam guard)
2
+
3
+ **Version / slug:** `ci-fragment-invariant`
4
+ **Date:** `2026-06-05`
5
+ **Author:** `echo`
6
+ **Second-pass reviewer:** `self-review under the Tier-1 lite lane (CI check addition reusing existing shared validators; no runtime surface)`
7
+
8
+ ## Summary of the change
9
+
10
+ `scripts/check-repo-invariants.mjs` (the Repo Invariants required CI check) gains invariant #3: release-note fragments (`upgrades/next/*.md` + legacy `NEXT.md`) must assemble and validate cleanly, using the SAME `assembleNextMd` + `validateGuideContent` the pre-push gate and publish workflow use. Closes the bypass path of the publish-jam class (task #42): local pre-push hooks are skipped by admin/web merges, so a malformed fragment could reach main and jam every subsequent fleet release at publish-time (lived twice: v1.3.180, #781 on 2026-06-05).
11
+
12
+ ## Decision-point inventory
13
+
14
+ - `check-repo-invariants.mjs` invariant #3 — add — assemble-in-memory + validate; assembly throw → failure; validator issues → failures; no upgrades dir / zero fragments → pass.
15
+
16
+ ## 1. Over-block
17
+
18
+ Two considered cases:
19
+ - **Inherited red:** a malformed fragment already on main turns Repo Invariants red on EVERY open PR until fixed (same blast shape as tonight's ratchet debt). Intentional — Zero-Failure treats main breakage as everyone's loudest problem; the alternative (silent until publish) jams the whole fleet's release train invisibly.
20
+ - **Cross-fragment validator coupling:** validation runs on the ASSEMBLED guide, so one PR's red can be caused by another's fragment. This mirrors the pre-push gate's long-standing behavior exactly (same functions), so no NEW over-block class is introduced.
21
+ - "src changed without any fragment" is deliberately NOT asserted here (stays a per-branch pre-push concern); docs-only states and post-release-cut states (no fragments) pass.
22
+
23
+ ## 2. Over-permit
24
+
25
+ None — purely additive check; nothing previously blocked becomes allowed.
26
+
27
+ ## 3. Drift risk
28
+
29
+ Validation logic is imported from the shared modules (`assemble-next-md.mjs`, `upgrade-guide-validator.mjs`) — no duplicated rules, so the CI check can never drift from what publish actually enforces.
30
+
31
+ ## 4. Failure modes
32
+
33
+ - Validator/assembler module missing or broken → the invariants script itself fails to load → Repo Invariants red (loud, correct).
34
+ - Empty `upgrades/next/` dir or absent `upgrades/` dir → pass (post-release-cut normal state; verified on the live tree and pinned by test).
35
+
36
+ ## 5. Migration parity
37
+
38
+ None needed — repo-internal CI script; ships with the repo.
39
+
40
+ ## 6. Token/cost impact
41
+
42
+ None. Pure-node in-memory assembly per CI run (milliseconds).
43
+
44
+ ## 7. Rollback
45
+
46
+ Revert the commit; the invariant disappears, local pre-push remains the only fragment guard (the prior, bypassable state).
@@ -0,0 +1,34 @@
1
+ # Side-Effects Review — mentor autoloop prompt: claim-check + ELI16-body rules
2
+
3
+ **Version / slug:** `mentor-prompt-tonight-gates`
4
+ **Date:** `2026-06-05`
5
+ **Author:** `echo`
6
+ **Second-pass reviewer:** `self-review under the Tier-1 lite lane (one prompt line in a pure, unit-tested string builder; no control-flow change)`
7
+
8
+ ## Summary of the change
9
+
10
+ `buildAutoloopGoal` (the durable goal prompt for the mentor autonomous-fix loop, `MentorAutonomousGuardian.ts`) gains one discipline line encoding two 2026-06-05 lessons: run `instar dev:claim-check` before starting a build (the double parallel-collision night — #802 vs the keychain spec, #810 vs #808), and write the `## ELI16` section into the PR DESCRIPTION from the start (the new required CI gate, hit live on #813).
11
+
12
+ ## Decision-point inventory
13
+
14
+ - `buildAutoloopGoal` — modified — one appended prompt line; pure function, no behavioral branch added.
15
+
16
+ ## 1. Over-block / 2. Over-permit
17
+
18
+ None — prompt text only. The loop's gates (budget, single-instance, dark-by-default `mentor.autonomousFix.enabled`) are untouched. A host overriding via `mentor.autonomousFix.goalTemplate` is unaffected (the override path bypasses the built-in string entirely, unchanged).
19
+
20
+ ## 3. Drift note
21
+
22
+ The prompt references the `dev:claim-check` CLI (shipped in #813) and the ELI16 PR-body gate (shipped 2026-06-05). If either is ever removed, this line goes stale — both are referenced by name so a grep finds them.
23
+
24
+ ## 4. Migration parity
25
+
26
+ None — src-internal constant; ships with the package.
27
+
28
+ ## 5. Token/cost impact
29
+
30
+ ~90 extra prompt tokens per autoloop cycle spawn. Negligible.
31
+
32
+ ## 6. Rollback
33
+
34
+ Revert the commit; the prompt loses the two reminders (structural gates still enforce both server-side — this line just saves the cycle from discovering them red).