iterate-kernel 0.1.7 → 0.1.8

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.
@@ -21,24 +21,33 @@ export declare const RoundStateSchema: z.ZodObject<{
21
21
  openFindings: z.ZodNumber;
22
22
  /** False when the engine never got to evidence something (refused, crashed, unattached). */
23
23
  evidenceComplete: z.ZodBoolean;
24
- /** The engine's own circuit-breaker level for this run; 3 is tripped. */
25
- breakerLevel: z.ZodNumber;
24
+ /**
25
+ * The engine's own circuit-breaker level for this run; 3 is tripped.
26
+ *
27
+ * OPTIONAL, and absence is not the same claim as 0. `0` says "a breaker exists and it has
28
+ * not tripped"; absence says "this run has no breaker channel at all" — which is the normal
29
+ * shape of an iterate loop that never touched the GUI engine. The distinction changes no
30
+ * verdict today (only `>= 3` halts), but collapsing it would force a producer that never
31
+ * looked to assert a measurement it did not take, and that is the exact failure this
32
+ * contract's `unmeasured` state exists to prevent.
33
+ */
34
+ breakerLevel: z.ZodOptional<z.ZodNumber>;
26
35
  }, "strict", z.ZodTypeAny, {
27
36
  round: number;
28
37
  maxRounds: number;
29
38
  invariantState: "pass" | "fail" | "error" | "unmeasured";
30
39
  openFindings: number;
31
40
  evidenceComplete: boolean;
32
- breakerLevel: number;
33
41
  schemaVersion?: "iterate.convergence/0.1" | undefined;
42
+ breakerLevel?: number | undefined;
34
43
  }, {
35
44
  round: number;
36
45
  maxRounds: number;
37
46
  invariantState: "pass" | "fail" | "error" | "unmeasured";
38
47
  openFindings: number;
39
48
  evidenceComplete: boolean;
40
- breakerLevel: number;
41
49
  schemaVersion?: "iterate.convergence/0.1" | undefined;
50
+ breakerLevel?: number | undefined;
42
51
  }>;
43
52
  export type RoundState = z.infer<typeof RoundStateSchema>;
44
53
  export declare const ConvergenceActionSchema: z.ZodEnum<["fix", "verify", "converged", "halt"]>;
@@ -1 +1 @@
1
- {"version":3,"file":"convergence.d.ts","sourceRoot":"","sources":["../src/convergence.ts"],"names":[],"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O,oBAAoB,CAAC,CAAC;AAElE,+DAA+D;AAC/D,eAAO,MAAM,gBAAgB;;;;;;IAM3B,4FAA4F;;IAE5F;;;;;;;;;OASG;;;;;;;;;;;;;;;;;;EAEH,CAAC;AACH,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAE1D,eAAO,MAAM,uBAAuB,mDAAiD,CAAC;AACtF,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AAExE,eAAO,MAAM,mBAAmB;;;;;;;;;CAStB,CAAC;AACX,MAAM,MAAM,iBAAiB,GAAG,CAAC,OAAO,mBAAmB,CAAC,CAAC,MAAM,OAAO,mBAAmB,CAAC,CAAC;AAE/F,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;EAcpC,CAAC;AACH,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC;AAE5E;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,UAAU,GAAG,mBAAmB,CAyB1E"}
@@ -21,8 +21,17 @@ export const RoundStateSchema = z.strictObject({
21
21
  openFindings: z.number().int().min(0),
22
22
  /** False when the engine never got to evidence something (refused, crashed, unattached). */
23
23
  evidenceComplete: z.boolean(),
24
- /** The engine's own circuit-breaker level for this run; 3 is tripped. */
25
- breakerLevel: z.number().int().min(0).max(3)
24
+ /**
25
+ * The engine's own circuit-breaker level for this run; 3 is tripped.
26
+ *
27
+ * OPTIONAL, and absence is not the same claim as 0. `0` says "a breaker exists and it has
28
+ * not tripped"; absence says "this run has no breaker channel at all" — which is the normal
29
+ * shape of an iterate loop that never touched the GUI engine. The distinction changes no
30
+ * verdict today (only `>= 3` halts), but collapsing it would force a producer that never
31
+ * looked to assert a measurement it did not take, and that is the exact failure this
32
+ * contract's `unmeasured` state exists to prevent.
33
+ */
34
+ breakerLevel: z.number().int().min(0).max(3).optional()
26
35
  });
27
36
  export const ConvergenceActionSchema = z.enum(["fix", "verify", "converged", "halt"]);
28
37
  export const CONVERGENCE_REASONS = {
@@ -77,8 +86,9 @@ export function convergenceDecision(state) {
77
86
  round: input.round,
78
87
  maxRounds: input.maxRounds
79
88
  });
80
- if (input.breakerLevel >= 3)
89
+ if (input.breakerLevel !== undefined && input.breakerLevel >= 3) {
81
90
  return decided("halt", CONVERGENCE_REASONS.breakerTripped);
91
+ }
82
92
  if (input.round >= input.maxRounds)
83
93
  return decided("halt", CONVERGENCE_REASONS.budgetExhausted);
84
94
  if (input.invariantState === "error")
@@ -1 +1 @@
1
- {"version":3,"file":"convergence.js","sourceRoot":"","sources":["../src/convergence.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAE9C;;;;;;;;;GASG;AACH,MAAM,CAAC,MAAM,0BAA0B,GAAG,yBAAkC,CAAC;AAE7E,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,YAAY,CAAC,CAAC,CAAC;AAGpF,+DAA+D;AAC/D,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,CAAC,YAAY,CAAC;IAC7C,aAAa,EAAE,CAAC,CAAC,OAAO,CAAC,0BAA0B,CAAC,CAAC,QAAQ,EAAE;IAC/D,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IAC9B,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IAClC,cAAc,EAAE,oBAAoB;IACpC,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,CA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about itself, what the loop does next (5.7 R40 scenario 4). This is policy arithmetic over verdicts somebody else produced — nothing here verifies anything. Rules a second implementation must reproduce, stated here so it need not read the TypeScript: (1) the input object is `iterate.convergence/0.1` (the version key is optional) with required `round` (integer >=1), `maxRounds` (integer >=1), `invariantState` in `pass|fail|error|unmeasured`, `openFindings` (integer >=0), `evidenceComplete` (boolean), `breakerLevel` (integer 0..3, where 3 is tripped); no other keys. (2) PRECEDENCE, first match wins: breakerLevel >= 3 -> halt, reason `circuit-breaker-tripped`; round >= maxRounds -> halt, reason `round-budget-exhausted`; invariantState `error` -> halt, reason `invariant-check-errored`; openFindings > 0 -> fix, reason `open-findings`; invariantState `fail` -> fix, reason `invariants-failed`; evidenceComplete false -> verify, reason `evidence-incomplete`; invariantState `unmeasured` -> verify, reason `invariants-unmeasured`; otherwise -> converged, reason `all-gates-green`. (3) WHY that order: a limit the harness set on itself is not the app's failure, so the breaker halts before anything is counted; the budget is checked before the work so a run cannot buy another round by re-reporting findings it already had; a check that errored yields no verdict, and retrying it is the runner's job, not the loop's; `verify` rather than `converged` for unlooked-or-unmeasured states is the whole point — 'we could not look' and 'we looked and it holds' must not collapse into the same line. (4) The decision echoes `round` and `maxRounds` unchanged, so a ledger line says which round was judged. (5) `breakerLevel` is the engine's own circuit-breaker level for the run; 3 is the policy limit, which is why the range stops there. PROVENANCE: max_rounds 7 is the repo's own `config/iterate.config.yaml`; the breaker ceiling of 3 is `CircuitBreakerLevelSchema` in the evidence-pack contract; each case below states its inputs and the reason the precedence gives, and the expected values were derived from the rule text in this file — not by running the TypeScript.",
2
+ "comment": "Cross-implementation anchor for the convergence rules (kernel/src/convergence.ts): given what a round states about itself, what the loop does next (5.7 R40 scenario 4). This is policy arithmetic over verdicts somebody else produced — nothing here verifies anything. Rules a second implementation must reproduce, stated here so it need not read the TypeScript: (1) the input object is `iterate.convergence/0.1` (the version key is optional) with required `round` (integer >=1), `maxRounds` (integer >=1), `invariantState` in `pass|fail|error|unmeasured`, `openFindings` (integer >=0), `evidenceComplete` (boolean), `breakerLevel` (integer 0..3, where 3 is tripped); no other keys. (2) PRECEDENCE, first match wins: breakerLevel >= 3 -> halt, reason `circuit-breaker-tripped`; round >= maxRounds -> halt, reason `round-budget-exhausted`; invariantState `error` -> halt, reason `invariant-check-errored`; openFindings > 0 -> fix, reason `open-findings`; invariantState `fail` -> fix, reason `invariants-failed`; evidenceComplete false -> verify, reason `evidence-incomplete`; invariantState `unmeasured` -> verify, reason `invariants-unmeasured`; otherwise -> converged, reason `all-gates-green`. (3) WHY that order: a limit the harness set on itself is not the app's failure, so the breaker halts before anything is counted; the budget is checked before the work so a run cannot buy another round by re-reporting findings it already had; a check that errored yields no verdict, and retrying it is the runner's job, not the loop's; `verify` rather than `converged` for unlooked-or-unmeasured states is the whole point — 'we could not look' and 'we looked and it holds' must not collapse into the same line. (4) The decision echoes `round` and `maxRounds` unchanged, so a ledger line says which round was judged. (5) `breakerLevel` is the engine's own circuit-breaker level for the run; 3 is the policy limit, which is why the range stops there. PROVENANCE: max_rounds 7 is the repo's own `config/iterate.config.yaml`; the breaker ceiling of 3 is `CircuitBreakerLevelSchema` in the evidence-pack contract; each case below states its inputs and the reason the precedence gives, and the expected values were derived from the rule text in this file — not by running the TypeScript. AMENDMENT (0.1.8): `breakerLevel` is OPTIONAL. Absent means this run has no circuit-breaker channel at all and the first precedence rule is skipped; it is NOT the same claim as 0, which asserts a breaker exists and reports it untripped. A producer that never looked must omit the key rather than write 0.",
3
3
  "input": {
4
4
  "schemaVersion": "iterate.convergence/0.1",
5
5
  "round": 3,
@@ -247,6 +247,38 @@
247
247
  "expect": "refused",
248
248
  "path": "",
249
249
  "messageIncludes": "confidence"
250
+ },
251
+ {
252
+ "name": "no-breaker-channel-absent-not-zero",
253
+ "state": {
254
+ "round": 2,
255
+ "maxRounds": 7,
256
+ "invariantState": "pass",
257
+ "openFindings": 0,
258
+ "evidenceComplete": true
259
+ },
260
+ "expect": {
261
+ "action": "converged",
262
+ "reason": "all-gates-green",
263
+ "round": 2,
264
+ "maxRounds": 7
265
+ }
266
+ },
267
+ {
268
+ "name": "absent-breaker-still-halts-on-budget",
269
+ "state": {
270
+ "round": 7,
271
+ "maxRounds": 7,
272
+ "invariantState": "pass",
273
+ "openFindings": 4,
274
+ "evidenceComplete": true
275
+ },
276
+ "expect": {
277
+ "action": "halt",
278
+ "reason": "round-budget-exhausted",
279
+ "round": 7,
280
+ "maxRounds": 7
281
+ }
250
282
  }
251
283
  ]
252
284
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "iterate-kernel",
3
- "version": "0.1.7",
3
+ "version": "0.1.8",
4
4
  "private": false,
5
5
  "description": "iterate ecosystem shared kernel: schemas, the evidence->decision transcription, the decision-log audit chain and public validators. Verification reasoning stays in the engine; this layer transcribes.",
6
6
  "type": "module",
@@ -5,7 +5,13 @@
5
5
  "description": "What a caller states about the round that just finished, which the convergence rules turn into an action (5.7 R40 scenario 4). Every field is a verdict somebody else produced; this contract moves none of them. NOTE ON SOURCE OF TRUTH: the field constraints are duplicated from `src/convergence.ts`, which is the definition; this file mirrors it. The ordering that decides which verdict wins (breaker, then budget, then errored check, then findings, then evidence, then invariants, then converged) is arithmetic in the validator and cannot be expressed in JSON Schema — a schema-only implementation must re-implement `convergenceDecision` and be tested against the cases in `fixtures/convergence.ok-01.json`.",
6
6
  "type": "object",
7
7
  "additionalProperties": false,
8
- "required": ["round", "maxRounds", "invariantState", "openFindings", "evidenceComplete", "breakerLevel"],
8
+ "required": [
9
+ "round",
10
+ "maxRounds",
11
+ "invariantState",
12
+ "openFindings",
13
+ "evidenceComplete"
14
+ ],
9
15
  "properties": {
10
16
  "schemaVersion": {
11
17
  "const": "iterate.convergence/0.1"
@@ -19,7 +25,12 @@
19
25
  "minimum": 1
20
26
  },
21
27
  "invariantState": {
22
- "enum": ["pass", "fail", "error", "unmeasured"]
28
+ "enum": [
29
+ "pass",
30
+ "fail",
31
+ "error",
32
+ "unmeasured"
33
+ ]
23
34
  },
24
35
  "openFindings": {
25
36
  "type": "integer",
@@ -31,7 +42,8 @@
31
42
  "breakerLevel": {
32
43
  "type": "integer",
33
44
  "minimum": 0,
34
- "maximum": 3
45
+ "maximum": 3,
46
+ "description": "Optional. 0..3 is a measured level; absence means this run has no circuit-breaker channel at all. Absence is not 0: 0 asserts an untripped breaker. The first precedence rule only fires on a measured level, so skipping an absent breaker and halting on 0 are different outcomes by construction, and no producer has to invent a number."
35
47
  }
36
48
  }
37
49
  }