instar 1.3.456 → 1.3.457

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.
@@ -0,0 +1,41 @@
1
+ /**
2
+ * devGatedFeatures.ts — the registry of features that follow the
3
+ * standard_development_agent_dark_feature_gate convention: config OMITS
4
+ * `enabled`, the runtime resolves it via `resolveDevAgentGate` (live on a
5
+ * development agent, dark on the fleet).
6
+ *
7
+ * WHY (DEV-AGENT-DARK-GATE-CONFORMANCE-SPEC, Slice 2): Slice 1's lint catches a
8
+ * hand-rolled gate and a hardcoded `enabled: false` under a marker comment, but
9
+ * it cannot prove that a feature's *actual config + construction* resolves live
10
+ * on a dev agent. This registry drives the both-sides wiring test
11
+ * (`tests/unit/devGatedFeatures-wiring.test.ts`): for each entry, the REAL
12
+ * ConfigDefaults are applied and `resolveDevAgentGate(<configPath>)` must be
13
+ * true under a dev-agent config and false under a fleet config. A feature whose
14
+ * default hardcodes `enabled: false` (the literal #1001 mechanism — `applyDefaults`
15
+ * would inject the `false`) fails the test. Adding a dev-gated feature here is
16
+ * the natural checklist step; the test then guards it permanently.
17
+ *
18
+ * NOT every site that calls `resolveDevAgentGate` belongs here — only features
19
+ * whose intent is "dark fleet / LIVE on dev". Deliberately EXCLUDED:
20
+ * - `monitoring.mcpProcessReaper` — destructive (kills processes); ships OFF +
21
+ * dry-run for EVERYONE incl. dev agents by design (`enabled: false` default).
22
+ * - `monitoring.resourceLedger` — the ledger itself defaults `enabled: true`
23
+ * (on for everyone); only its sampling rides the gate off the same key, so
24
+ * it is not cleanly a dark-on-fleet feature.
25
+ */
26
+ /** A feature governed by the developmentAgent dark-feature gate. */
27
+ export interface DevGatedFeature {
28
+ /** Stable identifier (matches the feature's name in code/docs). */
29
+ name: string;
30
+ /** Dotted path to the feature's `enabled` flag in the agent config. */
31
+ configPath: string;
32
+ /** One-line description of what runs live on a dev agent. */
33
+ description: string;
34
+ }
35
+ export declare const DEV_GATED_FEATURES: DevGatedFeature[];
36
+ /**
37
+ * Read a dotted path off a config object, returning the value or undefined.
38
+ * Used by the wiring test and the spec-intent cross-check (Slice 3).
39
+ */
40
+ export declare function getConfigByPath(config: unknown, dottedPath: string): unknown;
41
+ //# sourceMappingURL=devGatedFeatures.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"devGatedFeatures.d.ts","sourceRoot":"","sources":["../../src/core/devGatedFeatures.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH,oEAAoE;AACpE,MAAM,WAAW,eAAe;IAC9B,mEAAmE;IACnE,IAAI,EAAE,MAAM,CAAC;IACb,uEAAuE;IACvE,UAAU,EAAE,MAAM,CAAC;IACnB,6DAA6D;IAC7D,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,eAAO,MAAM,kBAAkB,EAAE,eAAe,EAoC/C,CAAC;AAEF;;;GAGG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,GAAG,OAAO,CAO5E"}
@@ -0,0 +1,76 @@
1
+ /**
2
+ * devGatedFeatures.ts — the registry of features that follow the
3
+ * standard_development_agent_dark_feature_gate convention: config OMITS
4
+ * `enabled`, the runtime resolves it via `resolveDevAgentGate` (live on a
5
+ * development agent, dark on the fleet).
6
+ *
7
+ * WHY (DEV-AGENT-DARK-GATE-CONFORMANCE-SPEC, Slice 2): Slice 1's lint catches a
8
+ * hand-rolled gate and a hardcoded `enabled: false` under a marker comment, but
9
+ * it cannot prove that a feature's *actual config + construction* resolves live
10
+ * on a dev agent. This registry drives the both-sides wiring test
11
+ * (`tests/unit/devGatedFeatures-wiring.test.ts`): for each entry, the REAL
12
+ * ConfigDefaults are applied and `resolveDevAgentGate(<configPath>)` must be
13
+ * true under a dev-agent config and false under a fleet config. A feature whose
14
+ * default hardcodes `enabled: false` (the literal #1001 mechanism — `applyDefaults`
15
+ * would inject the `false`) fails the test. Adding a dev-gated feature here is
16
+ * the natural checklist step; the test then guards it permanently.
17
+ *
18
+ * NOT every site that calls `resolveDevAgentGate` belongs here — only features
19
+ * whose intent is "dark fleet / LIVE on dev". Deliberately EXCLUDED:
20
+ * - `monitoring.mcpProcessReaper` — destructive (kills processes); ships OFF +
21
+ * dry-run for EVERYONE incl. dev agents by design (`enabled: false` default).
22
+ * - `monitoring.resourceLedger` — the ledger itself defaults `enabled: true`
23
+ * (on for everyone); only its sampling rides the gate off the same key, so
24
+ * it is not cleanly a dark-on-fleet feature.
25
+ */
26
+ export const DEV_GATED_FEATURES = [
27
+ {
28
+ name: 'growthAnalyst',
29
+ configPath: 'monitoring.growthAnalyst.enabled',
30
+ description: 'Proactive growth & milestone analyst (/growth/*).',
31
+ },
32
+ {
33
+ name: 'coherenceJournal',
34
+ configPath: 'multiMachine.coherenceJournal.enabled',
35
+ description: 'Cross-machine coherence journal.',
36
+ },
37
+ {
38
+ name: 'warmSessionA2A',
39
+ configPath: 'threadline.warmSessionA2A.enabled',
40
+ description: 'Warm-session pool for agent-to-agent delivery.',
41
+ },
42
+ {
43
+ name: 'secretSync',
44
+ configPath: 'multiMachine.secretSync.enabled',
45
+ description: 'Cross-machine secret sync (receive side).',
46
+ },
47
+ {
48
+ name: 'geminiLoopDriver',
49
+ configPath: 'autonomousSessions.geminiLoopDriver.enabled',
50
+ description: 'Gemini autonomous-loop driver.',
51
+ },
52
+ {
53
+ name: 'respawnBuildContext',
54
+ configPath: 'sessions.respawnBuildContext.enabled',
55
+ description: 'Respawn build-context capture on session restart.',
56
+ },
57
+ {
58
+ name: 'selfKnowledgeSessionContext',
59
+ configPath: 'selfKnowledge.sessionContext.enabled',
60
+ description: 'Session-boot self-knowledge context injection.',
61
+ },
62
+ ];
63
+ /**
64
+ * Read a dotted path off a config object, returning the value or undefined.
65
+ * Used by the wiring test and the spec-intent cross-check (Slice 3).
66
+ */
67
+ export function getConfigByPath(config, dottedPath) {
68
+ let cur = config;
69
+ for (const key of dottedPath.split('.')) {
70
+ if (cur == null || typeof cur !== 'object')
71
+ return undefined;
72
+ cur = cur[key];
73
+ }
74
+ return cur;
75
+ }
76
+ //# sourceMappingURL=devGatedFeatures.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"devGatedFeatures.js","sourceRoot":"","sources":["../../src/core/devGatedFeatures.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAYH,MAAM,CAAC,MAAM,kBAAkB,GAAsB;IACnD;QACE,IAAI,EAAE,eAAe;QACrB,UAAU,EAAE,kCAAkC;QAC9C,WAAW,EAAE,mDAAmD;KACjE;IACD;QACE,IAAI,EAAE,kBAAkB;QACxB,UAAU,EAAE,uCAAuC;QACnD,WAAW,EAAE,kCAAkC;KAChD;IACD;QACE,IAAI,EAAE,gBAAgB;QACtB,UAAU,EAAE,mCAAmC;QAC/C,WAAW,EAAE,gDAAgD;KAC9D;IACD;QACE,IAAI,EAAE,YAAY;QAClB,UAAU,EAAE,iCAAiC;QAC7C,WAAW,EAAE,2CAA2C;KACzD;IACD;QACE,IAAI,EAAE,kBAAkB;QACxB,UAAU,EAAE,6CAA6C;QACzD,WAAW,EAAE,gCAAgC;KAC9C;IACD;QACE,IAAI,EAAE,qBAAqB;QAC3B,UAAU,EAAE,sCAAsC;QAClD,WAAW,EAAE,mDAAmD;KACjE;IACD;QACE,IAAI,EAAE,6BAA6B;QACnC,UAAU,EAAE,sCAAsC;QAClD,WAAW,EAAE,gDAAgD;KAC9D;CACF,CAAC;AAEF;;;GAGG;AACH,MAAM,UAAU,eAAe,CAAC,MAAe,EAAE,UAAkB;IACjE,IAAI,GAAG,GAAY,MAAM,CAAC;IAC1B,KAAK,MAAM,GAAG,IAAI,UAAU,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE,CAAC;QACxC,IAAI,GAAG,IAAI,IAAI,IAAI,OAAO,GAAG,KAAK,QAAQ;YAAE,OAAO,SAAS,CAAC;QAC7D,GAAG,GAAI,GAA+B,CAAC,GAAG,CAAC,CAAC;IAC9C,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "instar",
3
- "version": "1.3.456",
3
+ "version": "1.3.457",
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",
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "$schema": "./builtin-manifest.schema.json",
3
3
  "schemaVersion": 1,
4
- "generatedAt": "2026-06-10T01:10:23.066Z",
5
- "instarVersion": "1.3.456",
4
+ "generatedAt": "2026-06-10T01:54:06.043Z",
5
+ "instarVersion": "1.3.457",
6
6
  "entryCount": 199,
7
7
  "entries": {
8
8
  "hook:session-start": {
@@ -0,0 +1,45 @@
1
+ # Upgrade Guide — vNEXT
2
+
3
+ <!-- assembled-by: assemble-next-md -->
4
+ <!-- bump: patch -->
5
+
6
+ ## What Changed
7
+
8
+ Added Slice 2 of the dev-agent dark-gate conformance guard: a
9
+ `DEV_GATED_FEATURES` registry (`src/core/devGatedFeatures.ts`) and a both-sides
10
+ wiring test that applies the REAL config defaults and asserts each registered
11
+ dev-gated feature resolves LIVE under a `developmentAgent: true` config and DARK
12
+ under a fleet config. This catches the half of the #1001 bug that Slice 1's lint
13
+ can't see — a feature whose shipped default hardcodes `enabled: false` (so
14
+ `applyDefaults` injects it) now fails the build, because the feature would be dark
15
+ on dev agents. Seven features are registered; two (`mcpProcessReaper`,
16
+ `resourceLedger`) are deliberately excluded with documented reasons (intentionally
17
+ not dark-on-fleet).
18
+
19
+ ## What to Tell Your User
20
+
21
+ Nothing user-facing — internal developer/CI tooling (audience: agent-only). No
22
+ runtime behavior changes; it only adds a test that guards the dev-gate convention.
23
+
24
+ ## Summary of New Capabilities
25
+
26
+ - `DEV_GATED_FEATURES` registry + `getConfigByPath` (`src/core/devGatedFeatures.ts`).
27
+ - `tests/unit/devGatedFeatures-wiring.test.ts` — both-sides wiring test (+ a teeth
28
+ test proving it catches a planted `enabled: false` regression).
29
+ - Honest limit: Slice 3 (spec-intent cross-check) still catches the
30
+ forgot-the-gate-entirely case; tracked as CMT-1253. <!-- tracked: CMT-1253 -->
31
+
32
+ ## Evidence
33
+
34
+ This is a preventive CI guard, not a runtime bug fix — so "evidence" is a
35
+ demonstration that the guard has teeth on the #1001 mechanism:
36
+ - **Before (no guard):** a dev-gated feature whose shipped default hardcodes
37
+ `enabled: false` ships dark on dev agents undetected — exactly #1001, which was
38
+ caught only by operator review.
39
+ - **Reproduction (guard fires):** copied `src/config/ConfigDefaults.ts`, injected
40
+ `enabled: false` as the first field of the real `growthAnalyst` block, and ran
41
+ the both-sides test → the live-on-dev assertion **FAILS** (red). A baked-in
42
+ `enabled: true` would fail the dark-on-fleet assertion instead.
43
+ - **After (clean tree):** the unmodified tree → **16/16 green** (no registered
44
+ feature currently hardcodes a default). So the guard fires on the regression and
45
+ stays quiet otherwise.
@@ -0,0 +1,70 @@
1
+ # Side-Effects Review — Dev-Gated-Feature Registry + Both-Sides Wiring Test (Slice 2)
2
+
3
+ **Change:** Slice 2 of DEV-AGENT-DARK-GATE-CONFORMANCE-SPEC (the converged +
4
+ operator-approved spec). Adds the layer that catches a dev-gated feature wired to
5
+ resolve **dark on a dev agent** — the gap Slice 1's lint cannot see.
6
+
7
+ - `src/core/devGatedFeatures.ts` (new) — `DEV_GATED_FEATURES` registry (name +
8
+ config path + description) and a `getConfigByPath` reader.
9
+ - `tests/unit/devGatedFeatures-wiring.test.ts` (new) — for each registered
10
+ feature, applies the REAL `getMigrationDefaults` and asserts
11
+ `resolveDevAgentGate(<configPath>)` is **true** under a `developmentAgent: true`
12
+ config and **false** under a fleet config, plus a "teeth" test confirming an
13
+ injected `enabled: false` default fails the live-on-dev assertion (the literal
14
+ #1001 mechanism).
15
+
16
+ **Registry membership (the design decision in this slice):** only features whose
17
+ intent is "dark fleet / LIVE on dev" are included (growthAnalyst, coherenceJournal,
18
+ warmSessionA2A, secretSync, geminiLoopDriver, respawnBuildContext,
19
+ selfKnowledgeSessionContext — verified to omit `enabled` in defaults). Deliberately
20
+ EXCLUDED, with reasons in code: `monitoring.mcpProcessReaper` (destructive — ships
21
+ OFF + dry-run for everyone incl. dev by design) and `monitoring.resourceLedger`
22
+ (ledger defaults `enabled: true`; only sampling rides the gate off the same key).
23
+
24
+ ## 1. Over-block — what legitimate inputs does this reject that it shouldn't?
25
+ The test asserts every registered feature is live-on-dev / dark-on-fleet. A
26
+ feature that legitimately ships dark-everywhere or live-everywhere would fail if
27
+ wrongly added to the registry — but membership is a deliberate, reviewed choice
28
+ (the two non-conforming features are explicitly excluded with documented reasons),
29
+ so the test only constrains features that genuinely follow the convention.
30
+
31
+ ## 2. Under-block — what failure modes does this still miss?
32
+ Catches the hardcoded-default half of the #1001 shape (a `false` baked into the
33
+ feature's default → `applyDefaults` injects it → live-on-dev assertion fails) for
34
+ **registered** features. Still misses: (a) a dev-gated feature never added to the
35
+ registry; (b) the construction-side half where a site reads `enabled === true`
36
+ without any gate (no default to catch) — that is Slice 3's spec-intent cross-check.
37
+ Both limits are named in the spec's layer table.
38
+
39
+ ## 3. Level-of-abstraction fit — right layer?
40
+ Yes — a unit test over the real config-default assembly (`applyDefaults` +
41
+ `getMigrationDefaults`), the same path PostUpdateMigrator uses. It exercises the
42
+ actual default→gate resolution, not a source regex, so it catches the mechanism
43
+ rather than a spelling.
44
+
45
+ ## 4. Signal vs authority compliance
46
+ The test is CI authority (fails the build) over a deterministic, mechanical
47
+ property — same posture as the rest of the suite. The registry is inert data; it
48
+ holds no runtime authority (Slice 3 consumes it read-only).
49
+
50
+ ## 5. Interactions — shadowing, double-fire, races?
51
+ None. `devGatedFeatures.ts` is pure data + a pure path reader; the test builds
52
+ throwaway config objects. No shared state, no runtime wiring in this slice.
53
+
54
+ ## 6. External surfaces — visible to other agents/users/systems?
55
+ None. No routes, no config, no agent-installed files. Repo-internal source + test.
56
+ No Migration Parity entry needed.
57
+
58
+ ## 7. Rollback cost — back-out if wrong?
59
+ Trivial — delete the two files. No runtime behavior, no state, no deployed artifact.
60
+
61
+ ## No deferrals
62
+ Slice 3 (spec-intent cross-check) is the next slice of the same approved spec,
63
+ tracked under CMT-1253 — not a deferral of this slice's scope. <!-- tracked: CMT-1253 -->
64
+
65
+ ## Second-pass review (independent)
66
+ The registry membership was derived by auditing each `resolveDevAgentGate` site's
67
+ default against the convention: the 7 included features verified to omit `enabled`
68
+ (test green on all = no hidden hardcoded default); the 2 excluded features
69
+ (mcpProcessReaper, resourceLedger) inspected and confirmed intentionally NOT
70
+ dark-on-fleet. The teeth test confirms the guard fires on a planted regression.