instar 1.3.476 → 1.3.478

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 (35) hide show
  1. package/dist/config/ConfigDefaults.d.ts.map +1 -1
  2. package/dist/config/ConfigDefaults.js +34 -0
  3. package/dist/config/ConfigDefaults.js.map +1 -1
  4. package/dist/core/CartographerNavigator.d.ts +89 -0
  5. package/dist/core/CartographerNavigator.d.ts.map +1 -0
  6. package/dist/core/CartographerNavigator.js +354 -0
  7. package/dist/core/CartographerNavigator.js.map +1 -0
  8. package/dist/core/CartographerTree.d.ts +7 -0
  9. package/dist/core/CartographerTree.d.ts.map +1 -1
  10. package/dist/core/CartographerTree.js +9 -0
  11. package/dist/core/CartographerTree.js.map +1 -1
  12. package/dist/core/PostUpdateMigrator.d.ts.map +1 -1
  13. package/dist/core/PostUpdateMigrator.js +9 -0
  14. package/dist/core/PostUpdateMigrator.js.map +1 -1
  15. package/dist/core/StageTransitionValidator.d.ts +15 -0
  16. package/dist/core/StageTransitionValidator.d.ts.map +1 -1
  17. package/dist/core/StageTransitionValidator.js +23 -2
  18. package/dist/core/StageTransitionValidator.js.map +1 -1
  19. package/dist/core/types.d.ts +10 -0
  20. package/dist/core/types.d.ts.map +1 -1
  21. package/dist/core/types.js.map +1 -1
  22. package/dist/server/CapabilityIndex.d.ts.map +1 -1
  23. package/dist/server/CapabilityIndex.js +1 -0
  24. package/dist/server/CapabilityIndex.js.map +1 -1
  25. package/dist/server/routes.d.ts.map +1 -1
  26. package/dist/server/routes.js +55 -0
  27. package/dist/server/routes.js.map +1 -1
  28. package/package.json +1 -1
  29. package/scripts/instar-dev-precommit.js +69 -5
  30. package/scripts/lib/convergence-recognition.mjs +126 -0
  31. package/src/data/builtin-manifest.json +63 -63
  32. package/upgrades/1.3.477.md +63 -0
  33. package/upgrades/1.3.478.md +44 -0
  34. package/upgrades/side-effects/cartographer-subtree-nav.md +81 -0
  35. package/upgrades/side-effects/converging-audit-default.md +82 -0
@@ -0,0 +1,81 @@
1
+ # Side-Effects Review — Cartographer Subtree Navigation (spec #5, Tier 2)
2
+
3
+ **Version / slug:** `cartographer-subtree-nav`
4
+ **Date:** `2026-06-10`
5
+ **Author:** `Echo`
6
+ **Spec:** `docs/specs/CARTOGRAPHER-SUBTREE-NAV.md` (converged 1 round + a focused buildability review, approved)
7
+ **Second-pass reviewer:** `not required — convergence pinned the collapse rule, the two-phase scoring, batched fresh, and the migrator-only classification; this review covers the seven dimensions on the as-built deterministic code`
8
+
9
+ ## Summary of the change
10
+
11
+ The capstone of cartographer-conformance: a **deterministic recursive navigator** over
12
+ the doc-tree. Given a query, it walks the tree's summaries top-down (a bounded frontier,
13
+ not all N nodes), scores nodes by relevance, and returns the **minimal relevant
14
+ subtree** — the paths a sub-agent should be scoped to instead of the whole repo.
15
+ `GET /cartographer/navigate`. Observe-only, deterministic-first; an optional LLM re-rank
16
+ is a dark structural stub. Dark behind `cartographer.enabled`.
17
+
18
+ ## Files touched
19
+
20
+ - NEW `src/core/CartographerNavigator.ts` (scoring + the bounded recursive walk + collapse + sanitization).
21
+ - MODIFIED (additive): `src/core/CartographerTree.ts` (one public `currentOidMap()` accessor exposing the existing batched `currentOids()` — for batched `fresh`), `src/config/ConfigDefaults.ts` (`cartographer.subtreeNav`), `src/server/routes.ts` (the navigate route), `src/server/CapabilityIndex.ts`, `src/core/PostUpdateMigrator.ts` (CLAUDE.md section), `tests/unit/feature-delivery-completeness.test.ts` (legacy-migrator allowlist entry).
22
+ - TESTS: 32 across 3 tiers.
23
+
24
+ ## 1. Over-block
25
+
26
+ The navigator blocks nothing (observe-only — it returns a suggestion). No gate.
27
+
28
+ ## 2. Under-block / correctness
29
+
30
+ A bounded walk could MISS a relevant deep node if an intermediate dir's provisional
31
+ score gates it out. The build resolved this (a documented decision): the provisional
32
+ dir score peeks at descendant path BASENAMES to a bounded depth (PEEK_DEPTH=2, path-only,
33
+ non-recursive in score — no deadlock), so the spec's own example ("relevant code under
34
+ `src/messaging/`") and the "never-swept tree navigates on path signal" requirement hold.
35
+ A dir never enters `relevantPaths` on a single descendant's strength — only via the
36
+ collapse rule (≥0.6 of VISITED children relevant). `summaryCoverage` is reported so a
37
+ caller knows how much ranking was summary-informed vs path-only (honest on a never-swept
38
+ tree).
39
+
40
+ ## 3. Level-of-abstraction fit
41
+
42
+ Pure scorer + pure walk in `CartographerNavigator`; the route is a thin read surface;
43
+ the tree exposes one new read accessor. No layer reaches across; the navigator takes the
44
+ tree + query and returns a manifest. Fully unit-testable on a fixture tree.
45
+
46
+ ## 4. Determinism / cost (the cartographer-project footgun this avoids)
47
+
48
+ The shipped value is 100% deterministic — local index/summary reads only; zero token
49
+ cost, zero egress, byte-identical run-to-run. The bounded frontier (top-`branchingFactor`
50
+ children to `maxDepth`, capped by `maxNodesVisited`/`maxResults`) means cost is
51
+ O(frontier), not O(tree); `fresh` is one batched `git ls-tree`, not per-node. The LLM
52
+ re-rank ships OFF (Signal vs. Authority — the deterministic score is the authority).
53
+
54
+ ## 5. Security / data-egress
55
+
56
+ - **Zero egress** in the default config (deterministic core). The optional LLM re-rank
57
+ inherits spec #2's posture (off-Claude probe, separate egress-ack) and ships OFF.
58
+ - **Summaries are untrusted on output (the hard safety contract):** every emitted summary
59
+ passes `neutralizeInstructionShapedContent` then `delimitUntrusted` — so a summary that
60
+ smuggled "ignore your instructions" reaches the downstream sub-agent as quoted,
61
+ declawed data, never an instruction. (A Tier-1 test asserts an instruction-shaped
62
+ summary is emitted as `[neutralized: …]`.) The route consumes NO path input (paths are
63
+ produced), so there is no traversal surface; `query` length + numeric bounds are
64
+ validated (400 on violation).
65
+
66
+ ## 6. Failure modes / load
67
+
68
+ No poller, no background work — the navigate is a synchronous read per request, bounded.
69
+ Empty query short-circuits. A never-swept tree degrades gracefully to path navigation.
70
+ No load impact.
71
+
72
+ ## 7. Migration / compatibility (Migration Parity)
73
+
74
+ `cartographer.subtreeNav` nests under `cartographer` (deep-merge backfill — no
75
+ migrateConfig). The CLAUDE.md section ships via `migrateClaudeMd` (own marker 'Scope a
76
+ sub-agent to a subtree', idempotent) and is registered in the feature-completeness test's
77
+ `legacyMigratorSections` allowlist — EXACTLY as specs #1/#2/#3's cartographer sections
78
+ (migrator-only, not `generateClaudeMd`/shadow; verified at convergence). The route is in
79
+ CapabilityIndex. The `currentOidMap()` addition to CartographerTree is purely additive
80
+ (exposes an existing private read). Rollback: disabling `cartographer.enabled` 503s the
81
+ route. No migration reversal.
@@ -0,0 +1,82 @@
1
+ # Side-Effects Review — Report-Backed Converging Audit (spec #4, Tier 2)
2
+
3
+ **Version / slug:** `converging-audit-default`
4
+ **Date:** `2026-06-10`
5
+ **Author:** `Echo`
6
+ **Spec:** `docs/specs/CONVERGING-AUDIT-DEFAULT.md` (converged 1 round + a focused buildability/back-compat review, approved)
7
+ **Second-pass reviewer:** `not required — a focused convergence review verified the bug + the byte-identical back-compat + pinned the env-var threading; this review covers the seven dimensions on the as-built code`
8
+
9
+ ## Summary of the change
10
+
11
+ Fixes the convergence gate and makes the report-backed converging audit the default
12
+ (dark): **(A)** `StageTransitionValidator` checked `review-convergence === true`
13
+ (boolean) but the real tooling writes a timestamp string — so the formal gate
14
+ **rejected every properly-converged spec**; fixed via a pure `isConvergenceTagPresent`
15
+ predicate that accepts the canonical timestamp (and boolean `true` for back-compat).
16
+ **(B)** A default-off `specReview.requireConvergenceReport` flag that, when on, makes
17
+ the precommit gate also require the convergence **report** file (proof the audit ran)
18
+ — the precommit reads it via an env var (it runs pre-compile and reads no config).
19
+ **(C)** A cross-gate consistency test so the formal validator and the precommit gate
20
+ cannot drift apart. **(D)** Surfaces the `cross-model-review` value in diagnostics
21
+ (observe-only).
22
+
23
+ ## Files touched
24
+
25
+ - `src/core/StageTransitionValidator.ts` — `isConvergenceTagPresent` predicate (Part A). The existing `CONVERGENCE_REPORT_MISSING` check is UNCHANGED + unconditional.
26
+ - `src/config/ConfigDefaults.ts` + `src/core/types.ts` — `specReview.requireConvergenceReport: false` (deep-merge backfill).
27
+ - `scripts/instar-dev-precommit.js` — Step-6 recognition routed through the new pure module; env-gated report check (Part B); cross-model surfacing (Part D).
28
+ - `.husky/pre-commit` — fail-open one-liner exporting the env from config.
29
+ - NEW `scripts/lib/convergence-recognition.mjs` — the pure recognizer both the precommit and the consistency test use.
30
+ - Tests: validator (timestamp acceptance), consistency, `/projects/:id/advance` integration, the real-precommit E2E.
31
+
32
+ ## 1. Over-block
33
+
34
+ Part A makes the formal gate accept MORE (the timestamp it should always have
35
+ accepted) — it can never over-block more than before. Part B's report requirement can
36
+ over-block only when the flag is ON (default off); and the formal gate already
37
+ required the report unconditionally, so Part B merely brings the precommit to parity.
38
+
39
+ ## 2. Under-block
40
+
41
+ Could a spec fake convergence? With the flag on, the report file must exist — a
42
+ hand-added tag alone no longer passes the precommit. With the flag off, behavior is
43
+ unchanged from today (the report requirement is inert). The predicate rejects
44
+ empty/false/missing tags (tested).
45
+
46
+ ## 3. Level-of-abstraction fit
47
+
48
+ The recognition logic is factored into one pure module (`convergence-recognition.mjs`)
49
+ the precommit imports; the validator has its own pure predicate; a consistency test
50
+ binds them. This is the right shape given the compile boundary (the precommit `.js`
51
+ cannot import the TS validator).
52
+
53
+ ## 4. Back-compat safety (the critical dimension — this gate runs on every commit)
54
+
55
+ The flag defaults false and the precommit's new branch is gated on the env var being
56
+ `1`; when unset, the report `fs.existsSync` probe is skipped and the Step-6 checks
57
+ reuse the IDENTICAL regexes as before — byte-identical. The `.husky/pre-commit` config
58
+ read is fail-open (any error → env unset → today's behavior). **An E2E test runs the
59
+ REAL precommit script and proves: env unset → a timestamp-tagged+approved spec with no
60
+ report commits cleanly; env=1 + no report → blocked; env=1 + report → commits.** This
61
+ very PR's own commit goes through the modified precommit with the flag off — a live
62
+ proof the default path works.
63
+
64
+ ## 5. Tier-1 exemption
65
+
66
+ The precommit's `tier1-lite` path exits before Step 6, so the new report check
67
+ correctly does not apply to Tier-1 commits; the consistency test scopes its precommit
68
+ fixtures to the tier-2/3 path.
69
+
70
+ ## 6. Security / load
71
+
72
+ None — build-time gate only. The new checks are local `fs.existsSync`; no network, no
73
+ LLM in-gate. No load impact.
74
+
75
+ ## 7. Migration / compatibility
76
+
77
+ `specReview.requireConvergenceReport` rides `applyDefaults` add-missing deep-merge
78
+ (Migration Parity automatic — no `migrateConfig` block). This is a dev-process gate,
79
+ NOT an agent-facing runtime capability — so no CLAUDE.md template / migrateClaudeMd
80
+ section is required (the feature-completeness test governs only agent-facing
81
+ capabilities; verified it stays green) and no new route. Rollback: the flag
82
+ default-false IS the rollback.