instar 1.2.67 → 1.2.69

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 (68) hide show
  1. package/dist/commands/server.d.ts.map +1 -1
  2. package/dist/commands/server.js +50 -1
  3. package/dist/commands/server.js.map +1 -1
  4. package/dist/config/ConfigDefaults.d.ts.map +1 -1
  5. package/dist/config/ConfigDefaults.js +9 -0
  6. package/dist/config/ConfigDefaults.js.map +1 -1
  7. package/dist/core/PostUpdateMigrator.d.ts +12 -0
  8. package/dist/core/PostUpdateMigrator.d.ts.map +1 -1
  9. package/dist/core/PostUpdateMigrator.js +138 -0
  10. package/dist/core/PostUpdateMigrator.js.map +1 -1
  11. package/dist/core/SessionManager.d.ts.map +1 -1
  12. package/dist/core/SessionManager.js +3 -0
  13. package/dist/core/SessionManager.js.map +1 -1
  14. package/dist/core/StandardsRegistryParser.d.ts +50 -0
  15. package/dist/core/StandardsRegistryParser.d.ts.map +1 -0
  16. package/dist/core/StandardsRegistryParser.js +120 -0
  17. package/dist/core/StandardsRegistryParser.js.map +1 -0
  18. package/dist/core/reviewers/standards-conformance.d.ts +49 -0
  19. package/dist/core/reviewers/standards-conformance.d.ts.map +1 -0
  20. package/dist/core/reviewers/standards-conformance.js +120 -0
  21. package/dist/core/reviewers/standards-conformance.js.map +1 -0
  22. package/dist/core/types.d.ts +10 -0
  23. package/dist/core/types.d.ts.map +1 -1
  24. package/dist/core/types.js.map +1 -1
  25. package/dist/providers/adapters/anthropic-headless/transport/agenticSessionHeadless.d.ts.map +1 -1
  26. package/dist/providers/adapters/anthropic-headless/transport/agenticSessionHeadless.js +1 -0
  27. package/dist/providers/adapters/anthropic-headless/transport/agenticSessionHeadless.js.map +1 -1
  28. package/dist/providers/adapters/openai-codex/transport/agenticSessionHeadless.d.ts.map +1 -1
  29. package/dist/providers/adapters/openai-codex/transport/agenticSessionHeadless.js +1 -0
  30. package/dist/providers/adapters/openai-codex/transport/agenticSessionHeadless.js.map +1 -1
  31. package/dist/providers/adapters/openai-codex/transport/codexSpawn.d.ts +2 -0
  32. package/dist/providers/adapters/openai-codex/transport/codexSpawn.d.ts.map +1 -1
  33. package/dist/providers/adapters/openai-codex/transport/codexSpawn.js +4 -0
  34. package/dist/providers/adapters/openai-codex/transport/codexSpawn.js.map +1 -1
  35. package/dist/server/AgentServer.d.ts +6 -0
  36. package/dist/server/AgentServer.d.ts.map +1 -1
  37. package/dist/server/AgentServer.js +21 -0
  38. package/dist/server/AgentServer.js.map +1 -1
  39. package/dist/server/CapabilityIndex.d.ts.map +1 -1
  40. package/dist/server/CapabilityIndex.js +1 -0
  41. package/dist/server/CapabilityIndex.js.map +1 -1
  42. package/dist/server/routes.d.ts +6 -0
  43. package/dist/server/routes.d.ts.map +1 -1
  44. package/dist/server/routes.js +60 -1
  45. package/dist/server/routes.js.map +1 -1
  46. package/dist/server/specReviewRoutes.d.ts +32 -0
  47. package/dist/server/specReviewRoutes.d.ts.map +1 -0
  48. package/dist/server/specReviewRoutes.js +120 -0
  49. package/dist/server/specReviewRoutes.js.map +1 -0
  50. package/dist/threadline/ConversationStore.d.ts +158 -0
  51. package/dist/threadline/ConversationStore.d.ts.map +1 -0
  52. package/dist/threadline/ConversationStore.js +341 -0
  53. package/dist/threadline/ConversationStore.js.map +1 -0
  54. package/dist/threadline/ThreadlineRouter.d.ts.map +1 -1
  55. package/dist/threadline/ThreadlineRouter.js +24 -0
  56. package/dist/threadline/ThreadlineRouter.js.map +1 -1
  57. package/dist/threadline/WarrantsReplyGate.d.ts +110 -0
  58. package/dist/threadline/WarrantsReplyGate.d.ts.map +1 -0
  59. package/dist/threadline/WarrantsReplyGate.js +263 -0
  60. package/dist/threadline/WarrantsReplyGate.js.map +1 -0
  61. package/dist/threadline/mcp-http-client.d.ts.map +1 -1
  62. package/dist/threadline/mcp-http-client.js +6 -0
  63. package/dist/threadline/mcp-http-client.js.map +1 -1
  64. package/package.json +1 -1
  65. package/src/data/builtin-manifest.json +63 -63
  66. package/upgrades/1.2.68.md +97 -0
  67. package/upgrades/1.2.69.md +73 -0
  68. package/upgrades/side-effects/standards-conformance-gate.md +87 -0
@@ -0,0 +1,73 @@
1
+ # Upgrade Guide — the review gate now reads the constitution
2
+
3
+ <!-- bump: minor -->
4
+ <!-- minor = new features, new APIs, new capabilities (backwards-compatible) -->
5
+
6
+ ## What Changed
7
+
8
+ **The constitution stops being a doc nobody checks.**
9
+
10
+ The living constitution (`docs/STANDARDS-REGISTRY.md`) has been on main for a
11
+ while, but nothing actually *read* it when a new spec was written — the
12
+ "check this against the standards" step was a prompt the reviewer had to remember,
13
+ and on some hosts the tool that runs it isn't even installed. So a spec could
14
+ break a standard and slip through: the North Star draft quietly violated **No
15
+ Manual Work**, the review missed it, and only Justin caught it. The rulebook
16
+ existed with no inspector — the exact "shipped but asleep" trap the rulebook was
17
+ written to fight, turned on itself.
18
+
19
+ This builds the inspector:
20
+
21
+ - **A registry parser** reads the constitution into structured articles, with a
22
+ **canary** so a formatting change can't silently hide half the rulebook (it
23
+ asserts a sane article count and that anchor articles parse).
24
+ - **A conformance reviewer** checks a draft spec against every article and returns
25
+ a rule-by-rule report ("this part might break No-Manual-Work, here's why"). It
26
+ runs on the subscription LLM path (never a raw API client), is degrade-safe (a
27
+ down provider yields an empty report, never blocks spec work), and is
28
+ prompt-injection-hardened (the spec is treated as untrusted data).
29
+ - **It SIGNALS, never blocks.** The report advises; the human + the existing
30
+ approval gate decide. Blocking authority is a deliberate later step, gated on
31
+ measured precision.
32
+ - **Observability**: `GET /spec/conformance-metrics` shows runs and which standards
33
+ get flagged most — the heat map of where our drafts drift, which itself feeds
34
+ evolution.
35
+
36
+ Default-on (`specReview.conformance.enabled`); 503-stubs cleanly where the
37
+ constitution isn't present.
38
+
39
+ **Evidence**: 20 new tests across all three tiers (10 unit, 6 integration, 4 e2e)
40
+ — 117 related (discoverability/config/route) tests green; `tsc` + lint clean
41
+ (including the no-raw-LLM-HTTP guard). The Tier-3 e2e reproduces the motivating
42
+ incident in miniature: a spec whose design requires manual work is fed to the gate
43
+ and flagged against **No Manual Work**, while a conforming spec is not (no false
44
+ positive). The parser is verified against the real on-disk constitution (22
45
+ articles, canary green).
46
+
47
+ Spec: `docs/specs/standards-conformance-gate.md` (approved; Claude-authored +
48
+ manual review — full multi-model convergence tooling absent on host, caveat
49
+ ratified explicitly). ELI16: `docs/specs/standards-conformance-gate.eli16.md`.
50
+ Side-effects: `upgrades/side-effects/standards-conformance-gate.md`.
51
+
52
+ ## What to Tell Your User
53
+
54
+ - **The rulebook now checks the work**: "When I write a new plan, a checker now
55
+ reads our actual standards and flags anything that might break one — so a plan
56
+ can't quietly violate a rule and slip past. It advises; we still decide."
57
+
58
+ ## Summary of New Capabilities
59
+
60
+ | Capability | How to Use |
61
+ |-----------|-----------|
62
+ | Spec standards-conformance check | `POST /spec/conformance-check` (`{markdown}` or `{specPath}`) → rule-by-rule report |
63
+ | Conformance observability | `GET /spec/conformance-metrics` → runs + per-standard flag counts |
64
+ | Constitution parser + canary | `StandardsRegistryParser` (drift-guarded) |
65
+
66
+ ## Evidence
67
+
68
+ Not a bug fix — a new capability. Verified end-to-end (not unit-mocked) by the
69
+ Tier-3 e2e that reproduces the motivating incident: a manual-work-requiring spec
70
+ is flagged against No Manual Work, a conforming spec is not. The registry parser
71
+ is exercised against the real on-disk constitution (22 articles parsed, canary
72
+ green). Signal-only by construction (no `block` path exists). 137 tests green
73
+ across the feature + related suites; `tsc` + lint clean.
@@ -0,0 +1,87 @@
1
+ # Side-effects review — standards-conformance gate
2
+
3
+ **Scope**: Make the living constitution enforceable — a code-backed reviewer that
4
+ reads `docs/STANDARDS-REGISTRY.md` and signals possible standard-violations in a
5
+ draft spec, turning the manual/prompt-driven conformance pass into structure. The
6
+ rung-3 normative slice; directly fixes `[[feedback_spec_review_against_standards]]`
7
+ (the North Star draft violated No-Manual-Work, review missed it, Justin caught it).
8
+ Spec: `docs/specs/standards-conformance-gate.md` (approved; Claude-authored +
9
+ manual review — see honest convergence note).
10
+
11
+ **Files touched**:
12
+ - `src/core/StandardsRegistryParser.ts` — NEW. Deterministic parse of the
13
+ constitution into `{family,name,rule,inPractice}[]` (tracks the five standards
14
+ `##` families so non-article `###` sections — Genesis etc. — are excluded);
15
+ `runRegistryCanary` (state-detector: ≥15 articles + anchor articles present).
16
+ - `src/core/reviewers/standards-conformance.ts` — NEW. `StandardsConformanceReviewer`:
17
+ injected `IntelligenceProvider` (subscription path), anti-injection prompt (spec
18
+ fenced as untrusted data), degrade-safe (no provider/throw/unparseable → empty
19
+ report), drops hallucinated standards not in the registry, `capable` tier.
20
+ - `src/server/specReviewRoutes.ts` — NEW. `POST /spec/conformance-check` (markdown
21
+ or specPath, traversal-guarded) → report + registry canary; `GET
22
+ /spec/conformance-metrics`; file-backed metrics (reloads on restart); 503-stub
23
+ when disabled. Exports `runConformanceCheck` for the (deferred) CLI.
24
+ - `src/server/AgentServer.ts` — mount the routes; new optional `intelligence` in
25
+ `AgentServerOptions`.
26
+ - `src/commands/server.ts` — pass `intelligence: sharedIntelligence` to AgentServer.
27
+ - `src/server/CapabilityIndex.ts` — `spec` → `INTERNAL_PREFIXES`.
28
+ - `src/config/ConfigDefaults.ts` + `src/core/types.ts` — `specReview.conformance.enabled`
29
+ default true (auto init+migration).
30
+ - `docs/specs/06-state-detector-registry.md` — registry-parser row.
31
+ - Tests: unit/integration/e2e for the gate; updated `capabilities-discoverability`
32
+ to scan `specReviewRoutes.ts` (so the `spec` INTERNAL prefix resolves).
33
+
34
+ **Under-block**: The gate SIGNALS only — it cannot block anything in v1 (no code
35
+ path grants it authority), so it cannot wrongly stop a spec. The registry canary
36
+ runs on every check; a drifted/partial registry surfaces in the response
37
+ (`registryCanary.ok=false`) rather than silently producing a clean report. The
38
+ traversal guard rejects specPath escaping specsDir.
39
+
40
+ **Over-block**: None possible — signal-only. A false-positive finding costs one
41
+ advisory line in a report the human reads, never a blocked commit.
42
+
43
+ **Level-of-abstraction fit**: The constitution stays the single source of truth
44
+ (the parser reads it; nothing duplicates the standards). The reviewer reuses the
45
+ established LLM-reviewer pattern (injected provider, anti-injection, fail-open)
46
+ rather than a bespoke LLM client. The route is a thin surface over parser +
47
+ reviewer. Signal-vs-authority is structural: the reviewer has no `block` path.
48
+
49
+ **Signal vs authority**: The whole feature is a signal producer. The human
50
+ ratification + the instar-dev `approved:true` gate retain all authority. Promotion
51
+ to a blocking/warn signal in the precommit gate is the tracked `scg-blocking-authority`
52
+ follow-up, gated on measured precision.
53
+
54
+ **Interactions**:
55
+ - Reads `docs/STANDARDS-REGISTRY.md` from `config.projectDir/docs`. For Echo (repo
56
+ checkout) it's present; a deployed agent without the repo docs gets a clean 503
57
+ ("constitution unreadable") — correct (the gate is a build-time tool, inert where
58
+ there's no constitution).
59
+ - Adds one `capable`-tier LLM call per conformance check (per-spec, rare) through
60
+ `sharedIntelligence` — degrade-safe, never blocks spec work if the provider is down.
61
+ - New `intelligence` option on AgentServer is additive (optional); existing
62
+ construction unaffected.
63
+ - File-backed metrics at `stateDir/spec-conformance-metrics.json` (atomic
64
+ temp+rename); corrupt → fresh.
65
+
66
+ **External surfaces**:
67
+ - `POST /spec/conformance-check`, `GET /spec/conformance-metrics` (INTERNAL prefix).
68
+ - New config `specReview.conformance.enabled` (default true).
69
+ - New exported `runConformanceCheck` (for the deferred CLI).
70
+
71
+ **Deferred (tracked)**: `instar spec conformance` CLI (`scg-cli`) — thin wrapper
72
+ over `runConformanceCheck`; the route delivers the capability. Auto-blocking
73
+ authority (`scg-blocking-authority`). Richer markdown parser (`scg-richer-parser`).
74
+
75
+ **Rollback cost**: Low, strictly additive. Remove the routes + reviewer + parser;
76
+ the constitution returns to being read only by the manual `/spec-converge` pass
77
+ (today's state). No existing runtime path is modified.
78
+
79
+ **Migration parity**: New server-side code + routes + config default (init +
80
+ `migrateConfig` via ConfigDefaults) + INTERNAL prefix. The parser reads a
81
+ repo-shipped doc (no per-agent state). No hook/template/skill-file change.
82
+
83
+ **Convergence honesty**: Claude-authored + manual review only; full
84
+ `/spec-converge` + `/crossreview` multi-model tooling absent on host. Ratified by
85
+ Justin with that caveat explicit. CI + the known-violating-spec e2e are the
86
+ strongest current evidence; a fuller multi-model review remains advisable —
87
+ fittingly, this is the tool that would make that conformance pass structural.