instar 1.3.192 → 1.3.194

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.
Files changed (30) hide show
  1. package/.claude/skills/autonomous/hooks/autonomous-stop-hook.sh +61 -10
  2. package/dist/core/CompletionEvaluator.d.ts +29 -0
  3. package/dist/core/CompletionEvaluator.d.ts.map +1 -1
  4. package/dist/core/CompletionEvaluator.js +80 -0
  5. package/dist/core/CompletionEvaluator.js.map +1 -1
  6. package/dist/core/MessagingToneGate.d.ts +2 -2
  7. package/dist/core/MessagingToneGate.d.ts.map +1 -1
  8. package/dist/core/MessagingToneGate.js +23 -2
  9. package/dist/core/MessagingToneGate.js.map +1 -1
  10. package/dist/core/PostUpdateMigrator.d.ts.map +1 -1
  11. package/dist/core/PostUpdateMigrator.js +10 -8
  12. package/dist/core/PostUpdateMigrator.js.map +1 -1
  13. package/dist/core/reviewers/standards-conformance.d.ts +45 -0
  14. package/dist/core/reviewers/standards-conformance.d.ts.map +1 -1
  15. package/dist/core/reviewers/standards-conformance.js +100 -0
  16. package/dist/core/reviewers/standards-conformance.js.map +1 -1
  17. package/dist/server/routes.d.ts.map +1 -1
  18. package/dist/server/routes.js +19 -0
  19. package/dist/server/routes.js.map +1 -1
  20. package/dist/server/specReviewRoutes.d.ts +6 -0
  21. package/dist/server/specReviewRoutes.d.ts.map +1 -1
  22. package/dist/server/specReviewRoutes.js +27 -0
  23. package/dist/server/specReviewRoutes.js.map +1 -1
  24. package/package.json +1 -1
  25. package/scripts/instar-dev-precommit.js +59 -0
  26. package/src/data/builtin-manifest.json +62 -62
  27. package/upgrades/1.3.193.md +29 -0
  28. package/upgrades/1.3.194.md +39 -0
  29. package/upgrades/side-effects/autonomous-operation-judgment-and-approval-as-data.md +98 -0
  30. package/upgrades/side-effects/tiered-dev-awareness-stepCD.md +84 -0
@@ -0,0 +1,98 @@
1
+ # Side-Effects Review — Autonomous Operation: Stop Reason Is the Work + Constitutional Traceability (Stage 1)
2
+
3
+ **Version / slug:** `autonomous-operation-judgment-and-approval-as-data`
4
+ **Date:** `2026-06-01`
5
+ **Author:** `echo`
6
+ **Second-pass reviewer:** `independent lessons-aware convergence review (2 passes → converged)`
7
+ **Spec:** `docs/specs/AUTONOMOUS-OPERATION-JUDGMENT-AND-APPROVAL-AS-DATA-SPEC.md` (approved: true)
8
+
9
+ ## Summary of the change
10
+
11
+ Stage 1 of the autonomy-governance spec. Ships TWO constitutional standards + their
12
+ real enforcement; Approval-as-Data (Part B / ApprovalLedger) is Phase 2 and is NOT
13
+ in this change.
14
+
15
+ 1. **P13 "The Stop Reason Is the Work"** (constitution: `STANDARDS-REGISTRY.md`
16
+ Substrate article + `INSTAR-DESIGN-PRINCIPLES-AND-LESSONS.md` P13). An autonomous
17
+ stop for "I need a judgment call" or "this needs real engineering" is a work item,
18
+ not an endpoint. PRIMARY enforcement: `CompletionEvaluator.evaluateStopRationale`
19
+ (a fail-open LLM guard) exposed at `POST /autonomous/evaluate-stop` and consulted
20
+ by `autonomous-stop-hook.sh` at both stop-approve points before permitting a stop.
21
+ SECONDARY backstop: `B18_AUTONOMY_STOP` in `MessagingToneGate` (sibling to
22
+ B15/B16/B17, precedence `B15 > B16 > B17 > B18`).
23
+ 2. **Constitutional Traceability "No Unconstitutional Work"** (constitution:
24
+ `STANDARDS-REGISTRY.md` Building article). Every spec must trace to a constitutional
25
+ standard with an indisputable fit. Commit-time STRUCTURAL gate (`instar-dev-precommit.js`
26
+ Step 7.6): a staged spec's `parent-principle` must resolve to a real registry
27
+ article. Review-time QUALITATIVE gate: `StandardsConformanceReviewer.judgeFit` →
28
+ `fit`/`weak`/`none`, returned by `POST /spec/conformance-check` as `report.fit`.
29
+
30
+ Behavior is **build+test only**: nothing is activated in production; no session-pool
31
+ stage, lease, or config is flipped.
32
+
33
+ ## Decision-point inventory
34
+
35
+ - `evaluateStopRationale` STOP_OK vs STOP_BLOCKED (LLM judgment; fail-OPEN to allow on
36
+ error/ambiguity — a secondary guard must never trap a genuine completion).
37
+ - `judgeFit` fit/weak/none (structural parent-resolution → `none` block; LLM qualitative
38
+ → fit/weak/none; fail-OPEN to `fit` when degraded).
39
+ - B18 block/pass (LLM; favors false-negatives).
40
+
41
+ ## 1. Over-block risk
42
+ The completion evaluator could trap a legitimately-finished run; B18 could hold a
43
+ genuine completion message. Both favor false-negatives (permit when uncertain). The
44
+ evaluator only re-injects when the stop *classifies* as judgment/engineering AND no
45
+ artifact/derived-standard/operator-residual is shown. Tested: STOP_OK/empty/error →
46
+ stopAllowed:true.
47
+
48
+ ## 2. Under-block risk
49
+ A silent stop emitting no message evades B18 — which is exactly why the PRIMARY surface
50
+ is the completion evaluator (the stop-hook), not the message gate. The conformance gate
51
+ could pass a hand-wave parent — mitigated by judging fit with a full-context reviewer,
52
+ not a string match.
53
+
54
+ ## 3. Level-of-abstraction fit
55
+ Enforcement sits at the stop decision (the structural Stop-hook event) and the commit
56
+ boundary (pre-commit), not buried in prompt prose — the strongest available surfaces.
57
+
58
+ ## 4. Signal vs Authority
59
+ Arithmetic/structural checks (parent-resolution string match) are signals/preconditions;
60
+ the LLM conformance reviewer is the authority for the qualitative fit. No brittle
61
+ deterministic check acquires blocking authority over the *qualitative* judgment.
62
+
63
+ ## 5. External surfaces
64
+ Adds `POST /autonomous/evaluate-stop` (thin wrapper over the evaluator; 503 when absent)
65
+ and a `fit` field on `POST /spec/conformance-check`. No new outbound external calls.
66
+ Both routes classified INTERNAL/build-time.
67
+
68
+ ## 6. Interactions with existing primitives
69
+ B18 de-conflicted from B15 via citation precedence `B15 > B16 > B17 > B18`. The
70
+ completion-evaluator P13 guard EXTENDS (does not replace) the existing
71
+ `/autonomous/evaluate-completion` flow — it only adds a check before an *approve*. The
72
+ conformance fit composes with the existing trace/approved/eli16 ship-gate checks.
73
+ `judgeFit` reuses the existing reviewer + registry parser. The new Constitutional
74
+ Traceability article was placed in the **Building** family (the registry parser
75
+ `STANDARDS_FAMILY_RE` only recognizes Root/Substrate/Building/Shipping/Interaction — a
76
+ Fractal placement would not have parsed; caught by unit test).
77
+
78
+ ## 7. Rollback cost
79
+ All additive + default-safe. B18 disable = remove from `VALID_RULES` (fail-open). The
80
+ stop-hook P13 guard fails-open (server down / 503 / missing field → permit). The
81
+ conformance fit fails-open to `fit` when degraded. Step 7.6 fails-open if the registry
82
+ is unreadable. No production state is changed by this commit.
83
+
84
+ ## Migration parity
85
+ - P13 + Constitutional Traceability registry/principles text reach existing agents via
86
+ the normal dist update (pure docs); the conformance gate + completion evaluator are
87
+ shipped code.
88
+ - The `autonomous-stop-hook.sh` change reaches existing agents via
89
+ `PostUpdateMigrator` (`upgrade()` marker bumped to `p13_stop_allowed`,
90
+ customization-safe, idempotent).
91
+
92
+ ## Tests
93
+ 105 green across 3 tiers: unit (`CompletionEvaluator`, `standards-conformance-gate`,
94
+ `messaging-tone-gate-b18`), integration (`standards-conformance-gate` fit,
95
+ `autonomous-evaluate-stop`), e2e (`standards-conformance-gate-lifecycle` fit-alive).
96
+ `tsc --noEmit` clean. B15/B16/MessagingToneGate regression-green. Test-writing caught
97
+ two real bugs (the Fractal-family parse exclusion above; the B18 response-format
98
+ enumeration omission at MessagingToneGate response-format line).
@@ -0,0 +1,84 @@
1
+ # Side-Effects Review — Tiered-dev awareness + migration parity (Steps C + D)
2
+
3
+ **Slug:** `tiered-dev-awareness-stepCD`
4
+ **Date:** 2026-06-01
5
+ **Author:** echo
6
+ **Spec:** `docs/specs/tiered-dev-awareness-stepCD-spec.md`
7
+ **Project:** Steps C + D (final) of the Tiered Development Process
8
+
9
+ ## Summary of the change
10
+
11
+ Makes the instar-*developing* agent **aware** of the tier system shipped in Step A (#666) —
12
+ the gate's size+risk tier SIGNAL, the agent's tier DECLARATION in the trace, the Tier-1
13
+ light path (ELI16 + side-effects, no converged spec), the Tier-1 auto-merge policy, and the
14
+ `belowFloor` decision audit — and records the **migration-parity** analysis closing the
15
+ project. Documentation-only; no runtime code, no gate/classifier/trace-writer change.
16
+
17
+ **Files changed (in-scope):**
18
+ - `skills/instar-dev/SKILL.md` — adds one focused **"Tiered development (tier signal → you
19
+ decide → audited)"** section before "What this skill explicitly does NOT do". It states:
20
+ the gate prints `suggestedTier` (size + risk floor, from `scripts/lib/classify-tier.mjs`)
21
+ but the agent declares the tier (`write-trace.mjs --tier <1|2|3> --tier-reasoning ...`,
22
+ `--eli16-path`/`--side-effects-path` for Tier-1); Tier-1 requirement set (ELI16 +
23
+ side-effects, no pre-approved converged spec) vs Tier-2+ (the full chain); no-declared-tier
24
+ → Tier-2 (back-compat); the Tier-1 auto-merge policy (clean Tier-1 on green CI + operator
25
+ spot-check); the audit (`.instar/instar-dev-decisions.jsonl`, the loud `belowFloor`
26
+ override). Cross-links **The Body and the Mind**. 9 added lines (Tier-1 by the very
27
+ classifier it documents).
28
+
29
+ **Files changed (not in-scope for the commit gate):**
30
+ - `docs/STANDARDS-REGISTRY.md` — adds a concise **Tiered Development** standard in the
31
+ **Building — engineering discipline** family (house format: Rule / Derives from / In
32
+ practice / Earned from / Traces to the goal / Applied through), framed as deriving from
33
+ **The Body and the Mind** (the gate informs, the agent decides, the decision is audited;
34
+ formality scales with size AND risk).
35
+ - `docs/specs/tiered-dev-awareness-stepCD-spec.md` + `.eli16.md` — the design record.
36
+ - `upgrades/next/tiered-dev-awareness-stepCD.md` — the release fragment.
37
+
38
+ ## The seven side-effects questions
39
+
40
+ 1. **Over-block** — N/A. No filter, gate, or block is added or changed. This is prose.
41
+ 2. **Under-block** — N/A. No detection logic. The Step-A audit's honest blind spot
42
+ (heuristic-evasion is not flagged) is unchanged and already documented in the Step-A spec.
43
+ 3. **Level-of-abstraction fit** — Correct layer. Awareness for the *developing* agent
44
+ belongs in its skill (`/instar-dev`) and the constitution it is governed by, not in the
45
+ end-agent CLAUDE.md template (a customer bot never runs the instar-dev gate). Confirmed
46
+ against code (see Migration parity).
47
+ 4. **Signal vs authority compliance** — Compliant, and the documented system *is* the
48
+ canonical instance: the gate informs (signal), the agent decides (authority), the
49
+ decision is audited. The docs add no authority of their own.
50
+ 5. **Interactions** — None. The SKILL.md section sits beside the existing phases; it does
51
+ not change any phase or the gate's behavior. The constitution entry derives from an
52
+ existing standard (The Body and the Mind) whose "Applied through" already names the
53
+ tier-classifier, so the cross-link is consistent both directions — no contradiction.
54
+ 6. **External surfaces** — None visible to end users, other agents, or other systems. No
55
+ runtime, no API, no timing or conversation-state dependency. Dev-facing docs only.
56
+ 7. **Rollback cost** — Trivial. Revert two documentation edits + the artifacts. No deployed
57
+ state to repair, no migration to unwind.
58
+
59
+ ## Migration parity
60
+
61
+ **None needed — verified against code.** This is dev-tooling, not an agent-installed file.
62
+
63
+ - **`package.json` `files[]`** ships only `.claude/skills/{setup-wizard,secret-setup,autonomous,build}`.
64
+ The top-level `skills/` directory (home of `skills/instar-dev/SKILL.md`) is **not** in
65
+ `files[]`, so it is never published to npm or landed in an end-agent home.
66
+ - **`installBuiltinSkills()`** (`src/commands/init.ts`) installs a fixed end-agent allowlist
67
+ (`evolve`, `learn`, `gaps`, `commit-action`, `feedback`, `triage-findings`, `reflect`,
68
+ `coherence-audit`, `degradation-digest`, `state-integrity-check`, `memory-hygiene`,
69
+ `guardian-pulse`, `session-continuity-check`, `git-sync`, `rollback-from-artifact`).
70
+ `instar-dev` and `spec-converge` are **not** in it.
71
+ - **`generateClaudeMd()`** (`src/scaffold/templates.ts`) is **untouched** and the tiered
72
+ process is absent from it today. The Agent-Awareness Standard it serves governs *end-agent*
73
+ capabilities; the instar-dev commit gate is not one, so it correctly stays out.
74
+
75
+ Therefore **no `PostUpdateMigrator` / `migrateClaudeMd` change is required** — every changed
76
+ file is dev-repo-only (skill, constitution doc, spec) or a release artifact, and no
77
+ agent-installed file is touched. (Mirrors Step B's `/spec-converge` migration-parity
78
+ conclusion.)
79
+
80
+ ## Tests / lint
81
+
82
+ `npx tsc --noEmit` exit 0 (no TS changed); `npm run lint` green. No runtime behavior changed,
83
+ so no new unit/integration/E2E tests — the SKILL.md section was verified for accuracy against
84
+ the live gate (`scripts/instar-dev-precommit.js` Steps 3.5/4.5/4.6 + `classify-tier.mjs`).