iterate-kernel 0.1.3 → 0.1.4

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.
package/README.md CHANGED
@@ -36,6 +36,7 @@ APIs it actually uses.
36
36
  | `evidence-decision` | the **transcription**: evidence (attribution level, circuit-breaker level, pass/fail/inconclusive) → a decision outcome and a human summary. It reads fields the engine already decided; it never infers. |
37
37
  | `decision-log-entry` / `decision-log` | the append-only decision-log entry and the `opID ↔ entry` hash chain that makes it auditable |
38
38
  | `dimension-context` / `parse` | the dimension-coverage transcription: a plan plus what the engine actually recorded → verified / unverified / unplanned, and one line to put in a summary. It validates id *shape*, never which ids exist — that list belongs to whoever configured the run. |
39
+ | `run-plan` / `parse` | the plan that `dimension-context` needs and refuses to invent: which dimensions a run intends to cover, in the caller's order, with the declared source. It carries a **digest** (`rp_` + sha256 of the canonical form) so a ledger line can state which plan a run was held to, and a reader can notice the plan changed mid-run. Nothing here reads a config file — producing a plan is whoever configures the run's job, and that keeps the kernel from learning a consumer's file format. |
39
40
  | `errors` / `schemas` / `canonical-json` / `recipe-config` | `KernelSchemaError`, the JSON Schemas, canonical serialisation, recipe validation |
40
41
 
41
42
  ## A runnable example
package/dist/index.d.ts CHANGED
@@ -6,13 +6,14 @@
6
6
  * the single source of truth; the zod mirrors in src/ must stay in sync
7
7
  * with them via the shared truth fixtures (assertion C35).
8
8
  */
9
- export { EVIDENCE_PACK_SCHEMA_ID, DECISION_LOG_ENTRY_SCHEMA_ID, RECIPE_CONFIG_SCHEMA_ID, EVIDENCE_PACK_JSON_SCHEMA, DECISION_LOG_ENTRY_JSON_SCHEMA, RECIPE_CONFIG_JSON_SCHEMA, type JsonSchemaObject } from "./schemas.js";
9
+ export { EVIDENCE_PACK_SCHEMA_ID, DECISION_LOG_ENTRY_SCHEMA_ID, RECIPE_CONFIG_SCHEMA_ID, RUN_PLAN_SCHEMA_ID, EVIDENCE_PACK_JSON_SCHEMA, DECISION_LOG_ENTRY_JSON_SCHEMA, RECIPE_CONFIG_JSON_SCHEMA, RUN_PLAN_JSON_SCHEMA, type JsonSchemaObject } from "./schemas.js";
10
10
  export { EVIDENCE_SCHEMA_VERSION, OPERATION_ID_PATTERN, ISO_MILLIS_PATTERN, TREE_DIGEST_PATTERN, SELECTOR_MAX_LENGTH, AttributionLevelSchema, CircuitBreakerLevelSchema, SelectorSchema, ActionSchema, AssertionPropertySchema, StringOrBoolSchema, BoundsSchema, AxEventSignalSchema, PixelDiffSignalSchema, ResponsivenessSignalSchema, CrashSignalSchema, ActSignalSchema, HandlerRefSchema, HandlerProbeSignalSchema, StateEntrySchema, StateDiffSignalSchema, SignalsSchema, AttributionSchema, CircuitBreakerSchema, AssertionSchema, DiagnosisClassSchema, DiagnosisReportSchema, DiagnosisSchema, EvidencePackSchema, EvidencePackReadSchema, type AttributionLevel, type CircuitBreakerLevel, type Selector, type Action, type AssertionProperty, type StringOrBool, type Bounds, type AxEventSignal, type PixelDiffSignal, type ResponsivenessSignal, type CrashSignal, type ActSignal, type HandlerRef, type HandlerProbeSignal, type StateEntry, type StateDiffSignal, type Signals, type Attribution, type CircuitBreaker, type Assertion, type DiagnosisClass, type DiagnosisReport, type Diagnosis, type EvidencePack } from "./evidence-pack.js";
11
11
  export { DECISION_ENTRY_ID_PATTERN, PREV_ENTRY_HASH_PATTERN, SUMMARY_MAX_LENGTH, DecisionOutcomeSchema, DecisionLogEntrySchema, type DecisionOutcome, type DecisionLogEntry } from "./decision-log-entry.js";
12
12
  export { RECIPE_SCHEMA_VERSION, RECIPE_NAME_MAX_LENGTH, RECIPE_MIN_STEPS, RECIPE_MAX_STEPS, RecipeStepKindSchema, RecipeStepSchema, RecipeConfigSchema, type RecipeStepKind, type RecipeStep, type RecipeConfig } from "./recipe-config.js";
13
13
  export { DIMENSION_ID_PATTERN, DIMENSION_ID_MAX_LENGTH, DIMENSION_LABEL_MAX_LENGTH, DIMENSION_FOCUS_MAX_LENGTH, DIMENSION_MIN_PLANNED, DIMENSION_MAX_PLANNED, DIMENSION_MAX_OPERATION_IDS, DIMENSION_CONTEXT_CODES, PlannedDimensionSchema, DimensionEvidenceSchema, DimensionStatusSchema, DimensionContextEntrySchema, DimensionContextTotalsSchema, DimensionContextSchema, DimensionContextInputSchema, KernelDimensionError, dimensionContext, formatDimensionContext, type DimensionEvidence, type DimensionStatus, type DimensionContextEntry, type DimensionContextTotals, type DimensionContext, type DimensionContextInput, type KernelDimensionCode } from "./dimension-context.js";
14
- export { parseEvidencePack, parseEvidencePackRead, parseDecisionLogEntry, parseRecipeConfig, parseDimensionContext, parseDimensionContextInput } from "./parse.js";
14
+ export { parseEvidencePack, parseEvidencePackRead, parseDecisionLogEntry, parseRecipeConfig, parseRunPlan, parseDimensionContext, parseDimensionContextInput } from "./parse.js";
15
15
  export { canonicalJson } from "./canonical-json.js";
16
+ export { RUN_PLAN_SCHEMA_VERSION, RUN_PLAN_SOURCES, RunPlanSchema, RunPlanSourceSchema, RunPlanSourceKindSchema, plannedIds, plannedDimensionsOf, runPlanDigest, type RunPlan, type RunPlanSource, type RunPlanSourceKind } from "./run-plan.js";
16
17
  export { decisionOutcomeFromEvidence, decisionSummaryFromEvidence } from "./evidence-decision.js";
17
18
  export { DECISION_LOG_CODES, DecisionLogDraftSchema, KernelDecisionLogError, appendDecisionLogEntry, buildDecisionLogEntry, decisionLogEntryHash, decisionLogHead, newDecisionEntryId, readDecisionLog, serializeDecisionLogEntry, verifyDecisionLogText, type AppendedDecisionLogEntry, type DecisionLogDraft, type DecisionLogVerification, type KernelDecisionLogCode } from "./decision-log.js";
18
19
  export { KernelSchemaError, type KernelSchemaIssue } from "./errors.js";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EACL,uBAAuB,EACvB,4BAA4B,EAC5B,uBAAuB,EACvB,yBAAyB,EACzB,8BAA8B,EAC9B,yBAAyB,EACzB,KAAK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AK,qBAAqB,EAC3B,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAAE,iBAAiB,EAAE,KAAK,iBAAiB,EAAE,MAAM,aAAa,CAAC"}
package/dist/index.js CHANGED
@@ -6,13 +6,14 @@
6
6
  * the single source of truth; the zod mirrors in src/ must stay in sync
7
7
  * with them via the shared truth fixtures (assertion C35).
8
8
  */
9
- export { EVIDENCE_PACK_SCHEMA_ID, DECISION_LOG_ENTRY_SCHEMA_ID, RECIPE_CONFIG_SCHEMA_ID, EVIDENCE_PACK_JSON_SCHEMA, DECISION_LOG_ENTRY_JSON_SCHEMA, RECIPE_CONFIG_JSON_SCHEMA } from "./schemas.js";
9
+ export { EVIDENCE_PACK_SCHEMA_ID, DECISION_LOG_ENTRY_SCHEMA_ID, RECIPE_CONFIG_SCHEMA_ID, RUN_PLAN_SCHEMA_ID, EVIDENCE_PACK_JSON_SCHEMA, DECISION_LOG_ENTRY_JSON_SCHEMA, RECIPE_CONFIG_JSON_SCHEMA, RUN_PLAN_JSON_SCHEMA } from "./schemas.js";
10
10
  export { EVIDENCE_SCHEMA_VERSION, OPERATION_ID_PATTERN, ISO_MILLIS_PATTERN, TREE_DIGEST_PATTERN, SELECTOR_MAX_LENGTH, AttributionLevelSchema, CircuitBreakerLevelSchema, SelectorSchema, ActionSchema, AssertionPropertySchema, StringOrBoolSchema, BoundsSchema, AxEventSignalSchema, PixelDiffSignalSchema, ResponsivenessSignalSchema, CrashSignalSchema, ActSignalSchema, HandlerRefSchema, HandlerProbeSignalSchema, StateEntrySchema, StateDiffSignalSchema, SignalsSchema, AttributionSchema, CircuitBreakerSchema, AssertionSchema, DiagnosisClassSchema, DiagnosisReportSchema, DiagnosisSchema, EvidencePackSchema, EvidencePackReadSchema } from "./evidence-pack.js";
11
11
  export { DECISION_ENTRY_ID_PATTERN, PREV_ENTRY_HASH_PATTERN, SUMMARY_MAX_LENGTH, DecisionOutcomeSchema, DecisionLogEntrySchema } from "./decision-log-entry.js";
12
12
  export { RECIPE_SCHEMA_VERSION, RECIPE_NAME_MAX_LENGTH, RECIPE_MIN_STEPS, RECIPE_MAX_STEPS, RecipeStepKindSchema, RecipeStepSchema, RecipeConfigSchema } from "./recipe-config.js";
13
13
  export { DIMENSION_ID_PATTERN, DIMENSION_ID_MAX_LENGTH, DIMENSION_LABEL_MAX_LENGTH, DIMENSION_FOCUS_MAX_LENGTH, DIMENSION_MIN_PLANNED, DIMENSION_MAX_PLANNED, DIMENSION_MAX_OPERATION_IDS, DIMENSION_CONTEXT_CODES, PlannedDimensionSchema, DimensionEvidenceSchema, DimensionStatusSchema, DimensionContextEntrySchema, DimensionContextTotalsSchema, DimensionContextSchema, DimensionContextInputSchema, KernelDimensionError, dimensionContext, formatDimensionContext } from "./dimension-context.js";
14
- export { parseEvidencePack, parseEvidencePackRead, parseDecisionLogEntry, parseRecipeConfig, parseDimensionContext, parseDimensionContextInput } from "./parse.js";
14
+ export { parseEvidencePack, parseEvidencePackRead, parseDecisionLogEntry, parseRecipeConfig, parseRunPlan, parseDimensionContext, parseDimensionContextInput } from "./parse.js";
15
15
  export { canonicalJson } from "./canonical-json.js";
16
+ export { RUN_PLAN_SCHEMA_VERSION, RUN_PLAN_SOURCES, RunPlanSchema, RunPlanSourceSchema, RunPlanSourceKindSchema, plannedIds, plannedDimensionsOf, runPlanDigest } from "./run-plan.js";
16
17
  export { decisionOutcomeFromEvidence, decisionSummaryFromEvidence } from "./evidence-decision.js";
17
18
  export { DECISION_LOG_CODES, DecisionLogDraftSchema, KernelDecisionLogError, appendDecisionLogEntry, buildDecisionLogEntry, decisionLogEntryHash, decisionLogHead, newDecisionEntryId, readDecisionLog, serializeDecisionLogEntry, verifyDecisionLogText } from "./decision-log.js";
18
19
  export { KernelSchemaError } from "./errors.js";
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EACL,uBAAuB,EACv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AEpB,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEpD,OAAO,EAAE,2BAA2B,EAAE,2BAA2B,EAAE,MAAM,wBAAwB,CAAC;AAElG,OAAO,EACL,kBAAkB,EAClB,sBAAsB,EACtB,sBAAsB,EACtB,sBAAsB,EACtB,qBAAqB,EACrB,oBAAoB,EACpB,eAAe,EACf,kBAAkB,EAClB,eAAe,EACf,yBAAyB,EACzB,qBAAqB,EAKtB,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAAE,iBAAiB,EAA0B,MAAM,aAAa,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EACL,uBAAuB,EACvB,4BAA4B,EAC5B,uBAAuB,EACvB,kBAAkB,EAClB,yBAAyB,EACzB,8BAA8B,EAC9B,yBAAyB,EACzB,oBAAoB,EAErB,MAAM,cAAc,CAAC;AAEtB,OAAO,EACL,uBAAuB,EACvB,oBAAoB,EACpB,kBAAkB,EAClB,mBAAmB,EACnB,mBAAmB,EACnB,sBAAsB,EACtB,yBAAyB,EACzB,cAAc,EACd,YAAY,EACZ,uBAAuB,EACvB,kBAAkB,EAClB,YAAY,EACZ,mBAAmB,EACnB,qBAAqB,EACrB,0BAA0B,EAC1B,iBAAiB,EACjB,eAAe,EACf,gBAAgB,EAChB,wBAAwB,EACxB,gBAAgB,EAChB,qBAAqB,EACrB,aAAa,EACb,iBAAiB,EACjB,oBAAoB,EACpB,eAAe,EACf,oBAAoB,EACpB,qBAAqB,EACrB,eAAe,EACf,kBAAkB,EAClB,sBAAsB,EAyBvB,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EACL,yBAAyB,EACzB,uBAAuB,EACvB,kBAAkB,EAClB,qBAAqB,EACrB,sBAAsB,EAGvB,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EACL,qBAAqB,EACrB,sBAAsB,EACtB,gBAAgB,EAChB,gBAAgB,EAChB,oBAAoB,EACpB,gBAAgB,EAChB,kBAAkB,EAInB,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EACL,oBAAoB,EACpB,uBAAuB,EACvB,0BAA0B,EAC1B,0BAA0B,EAC1B,qBAAqB,EACrB,qBAAqB,EACrB,2BAA2B,EAC3B,uBAAuB,EACvB,sBAAsB,EACtB,uBAAuB,EACvB,qBAAqB,EACrB,2BAA2B,EAC3B,4BAA4B,EAC5B,sBAAsB,EACtB,2BAA2B,EAC3B,oBAAoB,EACpB,gBAAgB,EAChB,sBAAsB,EAQvB,MAAM,wBAAwB,CAAC;AAEhC,OAAO,EACL,iBAAiB,EACjB,qBAAqB,EACrB,qBAAqB,EACrB,iBAAiB,EACjB,YAAY,EACZ,qBAAqB,EACrB,0BAA0B,EAC3B,MAAM,YAAY,CAAC;AAEpB,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEpD,OAAO,EACL,uBAAuB,EACvB,gBAAgB,EAChB,aAAa,EACb,mBAAmB,EACnB,uBAAuB,EACvB,UAAU,EACV,mBAAmB,EACnB,aAAa,EAId,MAAM,eAAe,CAAC;AAEvB,OAAO,EAAE,2BAA2B,EAAE,2BAA2B,EAAE,MAAM,wBAAwB,CAAC;AAElG,OAAO,EACL,kBAAkB,EAClB,sBAAsB,EACtB,sBAAsB,EACtB,sBAAsB,EACtB,qBAAqB,EACrB,oBAAoB,EACpB,eAAe,EACf,kBAAkB,EAClB,eAAe,EACf,yBAAyB,EACzB,qBAAqB,EAKtB,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAAE,iBAAiB,EAA0B,MAAM,aAAa,CAAC"}
package/dist/parse.d.ts CHANGED
@@ -2,6 +2,7 @@ import { type EvidencePack } from "./evidence-pack.js";
2
2
  import { type DecisionLogEntry } from "./decision-log-entry.js";
3
3
  import { type DimensionContext, type DimensionContextInput } from "./dimension-context.js";
4
4
  import { type RecipeConfig } from "./recipe-config.js";
5
+ import { type RunPlan } from "./run-plan.js";
5
6
  export declare function parseEvidencePack(input: unknown): EvidencePack;
6
7
  /**
7
8
  * Reads an evidence pack produced by the engine, tolerating only the two
@@ -17,6 +18,7 @@ export declare function parseEvidencePack(input: unknown): EvidencePack;
17
18
  export declare function parseEvidencePackRead(input: unknown): EvidencePack;
18
19
  export declare function parseDecisionLogEntry(input: unknown): DecisionLogEntry;
19
20
  export declare function parseRecipeConfig(input: unknown): RecipeConfig;
21
+ export declare function parseRunPlan(input: unknown): RunPlan;
20
22
  export declare function parseDimensionContext(input: unknown): DimensionContext;
21
23
  export declare function parseDimensionContextInput(input: unknown): DimensionContextInput;
22
24
  //# sourceMappingURL=parse.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"parse.d.ts","sourceRoot":"","sources":["../src/parse.ts"],"names":[],"mappings":"AAEA,OAAO,EAGL,KAAK,YAAY,EAClB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAA0B,KAAK,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AACxF,OAAO,EAGL,KAAK,gBAAgB,EACrB,KAAK,qBAAqB,EAC3B,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAsB,KAAK,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAkB3E,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,OAAO,GAAG,YAAY,CAE9D;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,OAAO,GAAG,YAAY,CAMlE;AAED,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,OAAO,GAAG,gBAAgB,CAEtE;AAED,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,OAAO,GAAG,YAAY,CAE9D;AAED,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,OAAO,GAAG,gBAAgB,CAEtE;AAED,wBAAgB,0BAA0B,CAAC,KAAK,EAAE,OAAO,GAAG,qBAAqB,CAEhF"}
1
+ {"version":3,"file":"parse.d.ts","sourceRoot":"","sources":["../src/parse.ts"],"names":[],"mappings":"AAEA,OAAO,EAGL,KAAK,YAAY,EAClB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAA0B,KAAK,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AACxF,OAAO,EAGL,KAAK,gBAAgB,EACrB,KAAK,qBAAqB,EAC3B,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAsB,KAAK,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAC3E,OAAO,EAAiB,KAAK,OAAO,EAAE,MAAM,eAAe,CAAC;AAkB5D,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,OAAO,GAAG,YAAY,CAE9D;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,OAAO,GAAG,YAAY,CAMlE;AAED,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,OAAO,GAAG,gBAAgB,CAEtE;AAED,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,OAAO,GAAG,YAAY,CAE9D;AAED,wBAAgB,YAAY,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAEpD;AAED,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,OAAO,GAAG,gBAAgB,CAEtE;AAED,wBAAgB,0BAA0B,CAAC,KAAK,EAAE,OAAO,GAAG,qBAAqB,CAEhF"}
package/dist/parse.js CHANGED
@@ -3,6 +3,7 @@ import { EvidencePackReadSchema, EvidencePackSchema } from "./evidence-pack.js";
3
3
  import { DecisionLogEntrySchema } from "./decision-log-entry.js";
4
4
  import { DimensionContextInputSchema, DimensionContextSchema } from "./dimension-context.js";
5
5
  import { RecipeConfigSchema } from "./recipe-config.js";
6
+ import { RunPlanSchema } from "./run-plan.js";
6
7
  function schemaError(label, error) {
7
8
  const issues = error.issues.map((issue) => ({
8
9
  path: issue.path.map((segment) => String(segment)).join("."),
@@ -44,6 +45,9 @@ export function parseDecisionLogEntry(input) {
44
45
  export function parseRecipeConfig(input) {
45
46
  return parseOrThrow(RecipeConfigSchema, input, "recipe config");
46
47
  }
48
+ export function parseRunPlan(input) {
49
+ return parseOrThrow(RunPlanSchema, input, "run plan");
50
+ }
47
51
  export function parseDimensionContext(input) {
48
52
  return parseOrThrow(DimensionContextSchema, input, "dimension context");
49
53
  }
package/dist/parse.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"parse.js","sourceRoot":"","sources":["../src/parse.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,EACL,sBAAsB,EACtB,kBAAkB,EAEnB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,sBAAsB,EAAyB,MAAM,yBAAyB,CAAC;AACxF,OAAO,EACL,2BAA2B,EAC3B,sBAAsB,EAGvB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,kBAAkB,EAAqB,MAAM,oBAAoB,CAAC;AAE3E,SAAS,WAAW,CAAC,KAAa,EAAE,KAAiB;IACnD,MAAM,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;QAC1C,IAAI,EAAE,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC;QAC5D,OAAO,EAAE,KAAK,CAAC,OAAO;KACvB,CAAC,CAAC,CAAC;IACJ,OAAO,IAAI,iBAAiB,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;AAC9C,CAAC;AAED,SAAS,YAAY,CAAI,MAAoB,EAAE,KAAc,EAAE,KAAa;IAC1E,MAAM,MAAM,GAAG,MAAM,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;IACvC,IAAI,MAAM,CAAC,OAAO,EAAE,CAAC;QACnB,OAAO,MAAM,CAAC,IAAI,CAAC;IACrB,CAAC;IACD,MAAM,WAAW,CAAC,KAAK,EAAE,MAAM,CAAC,KAAK,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AAM,UAAU,qBAAqB,CAAC,KAAc;IAClD,OAAO,YAAY,CAAC,sBAAsB,EAAE,KAAK,EAAE,oBAAoB,CAAC,CAAC;AAC3E,CAAC;AAED,MAAM,UAAU,iBAAiB,CAAC,KAAc;IAC9C,OAAO,YAAY,CAAC,kBAAkB,EAAE,KAAK,EAAE,eAAe,CAAC,CAAC;AAClE,CAAC;AAED,MAAM,UAAU,YAAY,CAAC,KAAc;IACzC,OAAO,YAAY,CAAC,aAAa,EAAE,KAAK,EAAE,UAAU,CAAC,CAAC;AACxD,CAAC;AAED,MAAM,UAAU,qBAAqB,CAAC,KAAc;IAClD,OAAO,YAAY,CAAC,sBAAsB,EAAE,KAAK,EAAE,mBAAmB,CAAC,CAAC;AAC1E,CAAC;AAED,MAAM,UAAU,0BAA0B,CAAC,KAAc;IACvD,OAAO,YAAY,CAAC,2BAA2B,EAAE,KAAK,EAAE,yBAAyB,CAAC,CAAC;AACrF,CAAC"}
@@ -0,0 +1,142 @@
1
+ import { z } from "zod";
2
+ import { type PlannedDimension } from "./dimension-context.js";
3
+ /**
4
+ * The run plan: which review dimensions this run intends to cover, in what order,
5
+ * with what focus each was asked for.
6
+ *
7
+ * WHY THIS EXISTS. The dimension-coverage contract (`dimension-context`) accounts
8
+ * a plan against what was recorded, and it refuses to invent the plan — that is
9
+ * correct for an accountant and useless without a source. Today the plan exists
10
+ * only inside `iterate.config.yaml` on one side and nowhere on the other: the
11
+ * GlassPane harness renders a coverage line from `planned: []`, which reads as
12
+ * "nothing was verified" forever. So the plan gets its own contract, and whoever
13
+ * configures a run writes it while whoever renders it reads it.
14
+ *
15
+ * THE DIRECTION RULE, STATED SO IT DOES NOT ROT: nothing here reads a config file,
16
+ * a session, or an environment variable. This module validates and digests a value
17
+ * somebody else produced. Pulling `iterate.config.yaml` (or a recipe) in here would
18
+ * weld one consumer's file format into the shared layer, which is the dependency
19
+ * direction the kernel exists to forbid.
20
+ */
21
+ export declare const RUN_PLAN_SCHEMA_VERSION: "iterate.run-plan/0.1";
22
+ /**
23
+ * Not `-draft`, unlike the recipe and decision-entry contracts. Those carry a draft
24
+ * label because archived bytes predate the freeze and must stay distinguishable;
25
+ * a brand-new contract has no such archive, and a draft label on it would only
26
+ * become a compatibility burden with nothing yet to be compatible with.
27
+ */
28
+ export declare const RUN_PLAN_SOURCES: readonly ["config", "recipe", "session", "manual"];
29
+ export declare const RunPlanSourceKindSchema: z.ZodEnum<["config", "recipe", "session", "manual"]>;
30
+ export type RunPlanSourceKind = z.infer<typeof RunPlanSourceKindSchema>;
31
+ export declare const RunPlanSourceSchema: z.ZodObject<{
32
+ kind: z.ZodEnum<["config", "recipe", "session", "manual"]>;
33
+ /**
34
+ * What produced the plan — a config path, a recipe name, a session id. Optional:
35
+ * the rendering must never invent one, and an honest "source kind only" beats a
36
+ * guessed filename.
37
+ */
38
+ name: z.ZodOptional<z.ZodString>;
39
+ }, "strict", z.ZodTypeAny, {
40
+ kind: "config" | "recipe" | "session" | "manual";
41
+ name?: string | undefined;
42
+ }, {
43
+ kind: "config" | "recipe" | "session" | "manual";
44
+ name?: string | undefined;
45
+ }>;
46
+ export type RunPlanSource = z.infer<typeof RunPlanSourceSchema>;
47
+ export declare const RunPlanSchema: z.ZodEffects<z.ZodObject<{
48
+ schemaVersion: z.ZodLiteral<"iterate.run-plan/0.1">;
49
+ dimensions: z.ZodArray<z.ZodObject<{
50
+ id: z.ZodString;
51
+ label: z.ZodOptional<z.ZodString>;
52
+ focus: z.ZodOptional<z.ZodString>;
53
+ }, "strict", z.ZodTypeAny, {
54
+ id: string;
55
+ label?: string | undefined;
56
+ focus?: string | undefined;
57
+ }, {
58
+ id: string;
59
+ label?: string | undefined;
60
+ focus?: string | undefined;
61
+ }>, "many">;
62
+ source: z.ZodOptional<z.ZodObject<{
63
+ kind: z.ZodEnum<["config", "recipe", "session", "manual"]>;
64
+ /**
65
+ * What produced the plan — a config path, a recipe name, a session id. Optional:
66
+ * the rendering must never invent one, and an honest "source kind only" beats a
67
+ * guessed filename.
68
+ */
69
+ name: z.ZodOptional<z.ZodString>;
70
+ }, "strict", z.ZodTypeAny, {
71
+ kind: "config" | "recipe" | "session" | "manual";
72
+ name?: string | undefined;
73
+ }, {
74
+ kind: "config" | "recipe" | "session" | "manual";
75
+ name?: string | undefined;
76
+ }>>;
77
+ }, "strict", z.ZodTypeAny, {
78
+ schemaVersion: "iterate.run-plan/0.1";
79
+ dimensions: {
80
+ id: string;
81
+ label?: string | undefined;
82
+ focus?: string | undefined;
83
+ }[];
84
+ source?: {
85
+ kind: "config" | "recipe" | "session" | "manual";
86
+ name?: string | undefined;
87
+ } | undefined;
88
+ }, {
89
+ schemaVersion: "iterate.run-plan/0.1";
90
+ dimensions: {
91
+ id: string;
92
+ label?: string | undefined;
93
+ focus?: string | undefined;
94
+ }[];
95
+ source?: {
96
+ kind: "config" | "recipe" | "session" | "manual";
97
+ name?: string | undefined;
98
+ } | undefined;
99
+ }>, {
100
+ schemaVersion: "iterate.run-plan/0.1";
101
+ dimensions: {
102
+ id: string;
103
+ label?: string | undefined;
104
+ focus?: string | undefined;
105
+ }[];
106
+ source?: {
107
+ kind: "config" | "recipe" | "session" | "manual";
108
+ name?: string | undefined;
109
+ } | undefined;
110
+ }, {
111
+ schemaVersion: "iterate.run-plan/0.1";
112
+ dimensions: {
113
+ id: string;
114
+ label?: string | undefined;
115
+ focus?: string | undefined;
116
+ }[];
117
+ source?: {
118
+ kind: "config" | "recipe" | "session" | "manual";
119
+ name?: string | undefined;
120
+ } | undefined;
121
+ }>;
122
+ export type RunPlan = z.infer<typeof RunPlanSchema>;
123
+ /** The plan's ids, in planned order. Order is the caller's, never sorted. */
124
+ export declare function plannedIds(plan: RunPlan): string[];
125
+ /**
126
+ * Feed a plan to the dimension-coverage contract without the caller re-shaping it.
127
+ * Kept as one function because the two contracts must not be allowed to develop
128
+ * private conversions between them.
129
+ */
130
+ export declare function plannedDimensionsOf(plan: RunPlan): PlannedDimension[];
131
+ /**
132
+ * A digest of the plan, so a ledger line can say which plan a run was held to —
133
+ * and a reader can notice the plan changed mid-run.
134
+ *
135
+ * `rp_` + sha256 over the canonical form (keys sorted, no insignificant
136
+ * whitespace), so two producers that serialise differently still agree on the
137
+ * digest. Numbers are rendered by the host's shortest roundtrip form, which is
138
+ * why the same rules live in the engine and in the Python half rather than in a
139
+ * format string here.
140
+ */
141
+ export declare function runPlanDigest(plan: RunPlan): string;
142
+ //# sourceMappingURL=run-plan.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"run-plan.d.ts","sourceRoot":"","sources":["../src/run-plan.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,OAAO,EAIL,KAAK,gBAAgB,EACtB,MAAM,wBAAwB,CAAC;AAEhC;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,uBAAuB,EAAG,sBAA+B,CAAC;AAEvE;;;;;GAKG;AACH,eAAO,MAAM,gBAAgB,oDAAqD,CAAC;AAEnF,eAAO,MAAM,uBAAuB,sDAA2B,CAAC;AAChE,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AAExE,eAAO,MAAM,mBAAmB;;IAE9B;;;;OAIG;;;;;;;;EAEH,CAAC;AACH,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAEhE,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;QATxB;;;;WAIG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAgCD,CAAC;AACL,MAAM,MAAM,OAAO,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAC;AAEpD,6EAA6E;AAC7E,wBAAgB,UAAU,CAAC,IAAI,EAAE,OAAO,GAAG,MAAM,EAAE,CAElD;AAED;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,OAAO,GAAG,gBAAgB,EAAE,CAErE;AAED;;;;;;;;;GASG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,OAAO,GAAG,MAAM,CAEnD"}
@@ -0,0 +1,92 @@
1
+ import { createHash } from "node:crypto";
2
+ import { z } from "zod";
3
+ import { canonicalJson } from "./canonical-json.js";
4
+ import { DIMENSION_MAX_PLANNED, DIMENSION_MIN_PLANNED, PlannedDimensionSchema } from "./dimension-context.js";
5
+ /**
6
+ * The run plan: which review dimensions this run intends to cover, in what order,
7
+ * with what focus each was asked for.
8
+ *
9
+ * WHY THIS EXISTS. The dimension-coverage contract (`dimension-context`) accounts
10
+ * a plan against what was recorded, and it refuses to invent the plan — that is
11
+ * correct for an accountant and useless without a source. Today the plan exists
12
+ * only inside `iterate.config.yaml` on one side and nowhere on the other: the
13
+ * GlassPane harness renders a coverage line from `planned: []`, which reads as
14
+ * "nothing was verified" forever. So the plan gets its own contract, and whoever
15
+ * configures a run writes it while whoever renders it reads it.
16
+ *
17
+ * THE DIRECTION RULE, STATED SO IT DOES NOT ROT: nothing here reads a config file,
18
+ * a session, or an environment variable. This module validates and digests a value
19
+ * somebody else produced. Pulling `iterate.config.yaml` (or a recipe) in here would
20
+ * weld one consumer's file format into the shared layer, which is the dependency
21
+ * direction the kernel exists to forbid.
22
+ */
23
+ export const RUN_PLAN_SCHEMA_VERSION = "iterate.run-plan/0.1";
24
+ /**
25
+ * Not `-draft`, unlike the recipe and decision-entry contracts. Those carry a draft
26
+ * label because archived bytes predate the freeze and must stay distinguishable;
27
+ * a brand-new contract has no such archive, and a draft label on it would only
28
+ * become a compatibility burden with nothing yet to be compatible with.
29
+ */
30
+ export const RUN_PLAN_SOURCES = ["config", "recipe", "session", "manual"];
31
+ export const RunPlanSourceKindSchema = z.enum(RUN_PLAN_SOURCES);
32
+ export const RunPlanSourceSchema = z.strictObject({
33
+ kind: RunPlanSourceKindSchema,
34
+ /**
35
+ * What produced the plan — a config path, a recipe name, a session id. Optional:
36
+ * the rendering must never invent one, and an honest "source kind only" beats a
37
+ * guessed filename.
38
+ */
39
+ name: z.string().min(1).max(512).optional()
40
+ });
41
+ export const RunPlanSchema = z
42
+ .strictObject({
43
+ schemaVersion: z.literal(RUN_PLAN_SCHEMA_VERSION),
44
+ // `PlannedDimensionSchema` is reused rather than re-specified: id shape, label and
45
+ // focus limits belong to the dimension contract, and a second copy of them is a
46
+ // second place to disagree.
47
+ dimensions: z.array(PlannedDimensionSchema).min(DIMENSION_MIN_PLANNED).max(DIMENSION_MAX_PLANNED),
48
+ source: RunPlanSourceSchema.optional()
49
+ })
50
+ .superRefine((plan, ctx) => {
51
+ // Duplicate ids are refused, not collapsed. JSON Schema cannot express id-level
52
+ // uniqueness (`uniqueItems` compares whole objects, so `{id:"security"}` twice with
53
+ // different focus passes it), which makes this the documented place where the zod
54
+ // side is *stricter* than the published schema — not a drift to be fixed later.
55
+ const seen = new Set();
56
+ plan.dimensions.forEach((dimension, index) => {
57
+ if (seen.has(dimension.id)) {
58
+ ctx.addIssue({
59
+ code: z.ZodIssueCode.custom,
60
+ path: ["dimensions", index, "id"],
61
+ message: `duplicate planned dimension "${dimension.id}" (first seen at index ${plan.dimensions.findIndex((other) => other.id === dimension.id)}); a plan that names a dimension twice has two different intents, and this contract cannot tell them apart`
62
+ });
63
+ }
64
+ seen.add(dimension.id);
65
+ });
66
+ });
67
+ /** The plan's ids, in planned order. Order is the caller's, never sorted. */
68
+ export function plannedIds(plan) {
69
+ return plan.dimensions.map((dimension) => dimension.id);
70
+ }
71
+ /**
72
+ * Feed a plan to the dimension-coverage contract without the caller re-shaping it.
73
+ * Kept as one function because the two contracts must not be allowed to develop
74
+ * private conversions between them.
75
+ */
76
+ export function plannedDimensionsOf(plan) {
77
+ return plan.dimensions;
78
+ }
79
+ /**
80
+ * A digest of the plan, so a ledger line can say which plan a run was held to —
81
+ * and a reader can notice the plan changed mid-run.
82
+ *
83
+ * `rp_` + sha256 over the canonical form (keys sorted, no insignificant
84
+ * whitespace), so two producers that serialise differently still agree on the
85
+ * digest. Numbers are rendered by the host's shortest roundtrip form, which is
86
+ * why the same rules live in the engine and in the Python half rather than in a
87
+ * format string here.
88
+ */
89
+ export function runPlanDigest(plan) {
90
+ return `rp_${createHash("sha256").update(canonicalJson(plan)).digest("hex")}`;
91
+ }
92
+ //# sourceMappingURL=run-plan.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"run-plan.js","sourceRoot":"","sources":["../src/run-plan.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EACL,qBAAqB,EACrB,qBAAqB,EACrB,sBAAsB,EAEvB,MAAM,wBAAwB,CAAC;AAEhC;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG,sBAA+B,CAAC;AAEvE;;;;;GAKG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,QAAQ,EAAE,QAAQ,EAAE,SAAS,EAAE,QAAQ,CAAU,CAAC;AAEnF,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC;AAGhE,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,CAAC,YAAY,CAAC;IAChD,IAAI,EAAE,uBAAuB;IAC7B;;;;OAIG;IACH,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE;CAC5C,CAAC,CAAC;AAGH,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC;KAC3B,YAAY,CAAC;IACZ,aAAa,EAAE,CAAC,CAAC,OAAO,CAAC,uBAAuB,CAAC;IACjD,mFAAmF;IACnF,gFAAgF;IAChF,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AED;;;;;;;;;GASG;AACH,MAAM,UAAU,aAAa,CAAC,IAAa;IACzC,OAAO,MAAM,UAAU,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC;AAChF,CAAC"}
package/dist/schemas.d.ts CHANGED
@@ -1,6 +1,7 @@
1
1
  export declare const EVIDENCE_PACK_SCHEMA_ID: "https://schemas.iterate.dev/evidence-pack-0.1.json";
2
2
  export declare const DECISION_LOG_ENTRY_SCHEMA_ID: "https://schemas.iterate.dev/decision-log-entry-0.1-draft.json";
3
3
  export declare const RECIPE_CONFIG_SCHEMA_ID: "https://schemas.iterate.dev/recipe-config-0.1-draft.json";
4
+ export declare const RUN_PLAN_SCHEMA_ID: "https://schemas.iterate.dev/run-plan-0.1.json";
4
5
  export interface JsonSchemaObject {
5
6
  readonly $id: string;
6
7
  readonly [key: string]: unknown;
@@ -8,4 +9,5 @@ export interface JsonSchemaObject {
8
9
  export declare const EVIDENCE_PACK_JSON_SCHEMA: JsonSchemaObject;
9
10
  export declare const DECISION_LOG_ENTRY_JSON_SCHEMA: JsonSchemaObject;
10
11
  export declare const RECIPE_CONFIG_JSON_SCHEMA: JsonSchemaObject;
12
+ export declare const RUN_PLAN_JSON_SCHEMA: JsonSchemaObject;
11
13
  //# sourceMappingURL=schemas.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../src/schemas.ts"],"names":[],"mappings":"AAWA,eAAO,MAAM,uBAAuB,EAClC,oDAA6D,CAAC;AAChE,eAAO,MAAM,4BAA4B,EACvC,+DAAwE,CAAC;AAC3E,eAAO,MAAM,uBAAuB,EAClC,0DAAmE,CAAC;AAEtE,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACjC;AAMD,eAAO,MAAM,yBAAyB,EAAE,gBAEvC,CAAC;AAEF,eAAO,MAAM,8BAA8B,EAAE,gBAE5C,CAAC;AAEF,eAAO,MAAM,yBAAyB,EAAE,gBAEvC,CAAC"}
1
+ {"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../src/schemas.ts"],"names":[],"mappings":"AAWA,eAAO,MAAM,uBAAuB,EAClC,oDAA6D,CAAC;AAChE,eAAO,MAAM,4BAA4B,EACvC,+DAAwE,CAAC;AAC3E,eAAO,MAAM,uBAAuB,EAClC,0DAAmE,CAAC;AACtE,eAAO,MAAM,kBAAkB,EAC7B,+CAAwD,CAAC;AAE3D,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACjC;AAMD,eAAO,MAAM,yBAAyB,EAAE,gBAEvC,CAAC;AAEF,eAAO,MAAM,8BAA8B,EAAE,gBAE5C,CAAC;AAEF,eAAO,MAAM,yBAAyB,EAAE,gBAEvC,CAAC;AAEF,eAAO,MAAM,oBAAoB,EAAE,gBAElC,CAAC"}
package/dist/schemas.js CHANGED
@@ -10,10 +10,12 @@ const nodeRequire = createRequire(import.meta.url);
10
10
  export const EVIDENCE_PACK_SCHEMA_ID = "https://schemas.iterate.dev/evidence-pack-0.1.json";
11
11
  export const DECISION_LOG_ENTRY_SCHEMA_ID = "https://schemas.iterate.dev/decision-log-entry-0.1-draft.json";
12
12
  export const RECIPE_CONFIG_SCHEMA_ID = "https://schemas.iterate.dev/recipe-config-0.1-draft.json";
13
+ export const RUN_PLAN_SCHEMA_ID = "https://schemas.iterate.dev/run-plan-0.1.json";
13
14
  function loadSchema(relativePath) {
14
15
  return nodeRequire(relativePath);
15
16
  }
16
17
  export const EVIDENCE_PACK_JSON_SCHEMA = loadSchema("../schemas/evidence-pack.schema.json");
17
18
  export const DECISION_LOG_ENTRY_JSON_SCHEMA = loadSchema("../schemas/decision-log-entry.schema.json");
18
19
  export const RECIPE_CONFIG_JSON_SCHEMA = loadSchema("../schemas/recipe-config.schema.json");
20
+ export const RUN_PLAN_JSON_SCHEMA = loadSchema("../schemas/run-plan.schema.json");
19
21
  //# sourceMappingURL=schemas.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"schemas.js","sourceRoot":"","sources":["../src/schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAE5C;;;;;;GAMG;AACH,MAAM,WAAW,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAEnD,MAAM,CAAC,MAAM,uBAAuB,GAClC,oDAA6D,CAAC;AAChE,MAAM,CAAC,MAAM,4BAA4B,GACvC,+DAAwE,CAAC;AAC3E,MAAM,CAAC,MAAM,uBAAuB,GAClC,0DAAmE,CAAC;AAOtE,SAAS,UAAU,CAAC,YAAoB;IACtC,OAAO,WAAW,CAAC,YAAY,CAAqB,CAAC;AACvD,CAAC;AAED,MAAM,CAAC,MAAM,yBAAyB,GAAqB,UAAU,CACnE,sCAAsC,CACvC,CAAC;AAEF,MAAM,CAAC,MAAM,8BAA8B,GAAqB,UAAU,CACxE,2CAA2C,CAC5C,CAAC;AAEF,MAAM,CAAC,MAAM,yBAAyB,GAAqB,UAAU,CACnE,sCAAsC,CACvC,CAAC"}
1
+ {"version":3,"file":"schemas.js","sourceRoot":"","sources":["../src/schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAE5C;;;;;;GAMG;AACH,MAAM,WAAW,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAEnD,MAAM,CAAC,MAAM,uBAAuB,GAClC,oDAA6D,CAAC;AAChE,MAAM,CAAC,MAAM,4BAA4B,GACvC,+DAAwE,CAAC;AAC3E,MAAM,CAAC,MAAM,uBAAuB,GAClC,0DAAmE,CAAC;AACtE,MAAM,CAAC,MAAM,kBAAkB,GAC7B,+CAAwD,CAAC;AAO3D,SAAS,UAAU,CAAC,YAAoB;IACtC,OAAO,WAAW,CAAC,YAAY,CAAqB,CAAC;AACvD,CAAC;AAED,MAAM,CAAC,MAAM,yBAAyB,GAAqB,UAAU,CACnE,sCAAsC,CACvC,CAAC;AAEF,MAAM,CAAC,MAAM,8BAA8B,GAAqB,UAAU,CACxE,2CAA2C,CAC5C,CAAC;AAEF,MAAM,CAAC,MAAM,yBAAyB,GAAqB,UAAU,CACnE,sCAAsC,CACvC,CAAC;AAEF,MAAM,CAAC,MAAM,oBAAoB,GAAqB,UAAU,CAC9D,iCAAiC,CAClC,CAAC"}
@@ -0,0 +1,152 @@
1
+ {
2
+ "comment": "Cross-implementation anchor for the run-plan contract (kernel/src/run-plan.ts): what a plan is, and how to digest one so two shells and a ledger can say 'this run was held to this plan'. Rules a second implementation must reproduce, stated here so it need not read the TypeScript: (1) schemaVersion is exactly `iterate.run-plan/0.1`. (2) `dimensions` is 1..64 entries, each an object with a required `id` matching `^[a-z0-9]+(?:-[a-z0-9]+)*$` and at most 64 chars, and optional `label` (<=256) and `focus` (<=4096); no other keys. An empty plan is refused: a run with nothing to verify has a configuration problem, and reporting 0/0 dimensions as success is how that gets hidden. (3) Planned order is the caller's and is never sorted. (4) A repeated id is refused, not collapsed — the two entries can carry different focus, so collapsing picks one silently. JSON Schema cannot express id-level uniqueness (`uniqueItems` compares whole objects), so that rule lives on the validator side; the case named `duplicate-ids-differ-only-by-focus` below is the documented shape where the published schema accepts and the validator refuses. (5) `source`, when present, has a required `kind` in `config|recipe|session|manual` and an optional non-empty `name` <=512; nothing here reads a config file to invent a source. (6) The digest is `rp_` + sha256 of the canonical JSON form: UTF-16-code-unit-sorted keys, no insignificant whitespace, arrays in order, strings as JSON escapes them; numbers use the host's shortest roundtrip form, which is why none appear in this fixture — that concern is pinned by the canonical-JSON cases in the C35 suite instead. Provenance: the nine ids and both focus strings are taken verbatim from GlassPane's own iterate.config.yaml (`dimensions:` and `dimension_sets.engine|gui.focus`), because a vocabulary invented for a fixture would let both sides agree on something neither product uses.",
3
+ "input": {
4
+ "schemaVersion": "iterate.run-plan/0.1",
5
+ "dimensions": [
6
+ {
7
+ "id": "correctness",
8
+ "focus": "归因/证据语义不可让步:不得为通过断言而伪造测量或借用他卡读数"
9
+ },
10
+ {
11
+ "id": "security"
12
+ },
13
+ {
14
+ "id": "performance",
15
+ "focus": "注意 latency budget 与快照保留上限(EngineCore 常量)"
16
+ },
17
+ {
18
+ "id": "architecture"
19
+ },
20
+ {
21
+ "id": "style-tests"
22
+ },
23
+ {
24
+ "id": "tech-debt"
25
+ },
26
+ {
27
+ "id": "spec-compliance"
28
+ },
29
+ {
30
+ "id": "frontend-backend"
31
+ },
32
+ {
33
+ "id": "ui-ux",
34
+ "label": "UI/UX"
35
+ }
36
+ ],
37
+ "source": {
38
+ "kind": "config",
39
+ "name": "iterate.config.yaml"
40
+ }
41
+ },
42
+ "expectedDigest": "rp_f90ea606d2697278fb6e0c1cfd84cc6d21536332ca88970740e48d4b2429d61a",
43
+ "expectedIds": [
44
+ "correctness",
45
+ "security",
46
+ "performance",
47
+ "architecture",
48
+ "style-tests",
49
+ "tech-debt",
50
+ "spec-compliance",
51
+ "frontend-backend",
52
+ "ui-ux"
53
+ ],
54
+ "cases": [
55
+ {
56
+ "name": "empty-plan",
57
+ "input": {
58
+ "schemaVersion": "iterate.run-plan/0.1",
59
+ "dimensions": []
60
+ },
61
+ "expect": "refused",
62
+ "path": "dimensions"
63
+ },
64
+ {
65
+ "name": "uppercase-id",
66
+ "input": {
67
+ "schemaVersion": "iterate.run-plan/0.1",
68
+ "dimensions": [
69
+ {
70
+ "id": "Security"
71
+ }
72
+ ]
73
+ },
74
+ "expect": "refused",
75
+ "path": "dimensions.0.id"
76
+ },
77
+ {
78
+ "name": "duplicate-ids-differ-only-by-focus",
79
+ "input": {
80
+ "schemaVersion": "iterate.run-plan/0.1",
81
+ "dimensions": [
82
+ {
83
+ "id": "security"
84
+ },
85
+ {
86
+ "id": "security",
87
+ "focus": "auth surface"
88
+ }
89
+ ]
90
+ },
91
+ "expect": "refused",
92
+ "path": "dimensions.1.id",
93
+ "jsonSchemaAccepts": true
94
+ },
95
+ {
96
+ "name": "unknown-source-kind",
97
+ "input": {
98
+ "schemaVersion": "iterate.run-plan/0.1",
99
+ "dimensions": [
100
+ {
101
+ "id": "correctness"
102
+ }
103
+ ],
104
+ "source": {
105
+ "kind": "vibe"
106
+ }
107
+ },
108
+ "expect": "refused",
109
+ "path": "source.kind"
110
+ },
111
+ {
112
+ "name": "extra-top-level-key",
113
+ "input": {
114
+ "schemaVersion": "iterate.run-plan/0.1",
115
+ "dimensions": [
116
+ {
117
+ "id": "correctness"
118
+ }
119
+ ],
120
+ "notes": "not part of the contract"
121
+ },
122
+ "expect": "refused",
123
+ "path": "",
124
+ "messageIncludes": "notes"
125
+ },
126
+ {
127
+ "name": "missing-schemaVersion",
128
+ "input": {
129
+ "dimensions": [
130
+ {
131
+ "id": "correctness"
132
+ }
133
+ ]
134
+ },
135
+ "expect": "refused",
136
+ "path": "schemaVersion"
137
+ },
138
+ {
139
+ "name": "minimal-plan-no-source",
140
+ "input": {
141
+ "schemaVersion": "iterate.run-plan/0.1",
142
+ "dimensions": [
143
+ {
144
+ "id": "correctness"
145
+ }
146
+ ]
147
+ },
148
+ "expect": "accepted",
149
+ "digestPrefix": "rp_"
150
+ }
151
+ ]
152
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "iterate-kernel",
3
- "version": "0.1.3",
3
+ "version": "0.1.4",
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",
@@ -50,6 +50,10 @@
50
50
  "types": "./dist/recipe-config.d.ts",
51
51
  "default": "./dist/recipe-config.js"
52
52
  },
53
+ "./run-plan": {
54
+ "types": "./dist/run-plan.d.ts",
55
+ "default": "./dist/run-plan.js"
56
+ },
53
57
  "./schemas": {
54
58
  "types": "./dist/schemas.d.ts",
55
59
  "default": "./dist/schemas.js"
@@ -0,0 +1,60 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://schemas.iterate.dev/run-plan-0.1.json",
4
+ "title": "RunPlan",
5
+ "description": "Which review dimensions a run intends to cover, in planned order (5.7 R40 scenario 2: dimension-aware context compression needs a plan to be aware of). Whoever configures the run produces this; whoever renders coverage reads it. Nothing in the kernel reads a config file to make one. NOTE ON SOURCE OF TRUTH: the id/label/focus constraints are duplicated from `src/dimension-context.ts`, which has no JSON Schema of its own — until that gap is closed, the zod side is the definition and this file mirrors it. ID-LEVEL UNIQUENESS IS ENFORCED BY ZOD ONLY: `uniqueItems` compares whole objects, so two entries with the same id but different focus pass this schema and are refused by `RunPlanSchema`.",
6
+ "type": "object",
7
+ "additionalProperties": false,
8
+ "required": ["schemaVersion", "dimensions"],
9
+ "properties": {
10
+ "schemaVersion": {
11
+ "const": "iterate.run-plan/0.1"
12
+ },
13
+ "dimensions": {
14
+ "type": "array",
15
+ "minItems": 1,
16
+ "maxItems": 64,
17
+ "uniqueItems": true,
18
+ "items": {
19
+ "$ref": "#/$defs/plannedDimension"
20
+ }
21
+ },
22
+ "source": {
23
+ "type": "object",
24
+ "additionalProperties": false,
25
+ "required": ["kind"],
26
+ "properties": {
27
+ "kind": {
28
+ "enum": ["config", "recipe", "session", "manual"]
29
+ },
30
+ "name": {
31
+ "type": "string",
32
+ "minLength": 1,
33
+ "maxLength": 512
34
+ }
35
+ }
36
+ }
37
+ },
38
+ "$defs": {
39
+ "plannedDimension": {
40
+ "type": "object",
41
+ "additionalProperties": false,
42
+ "required": ["id"],
43
+ "properties": {
44
+ "id": {
45
+ "type": "string",
46
+ "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$",
47
+ "maxLength": 64
48
+ },
49
+ "label": {
50
+ "type": "string",
51
+ "maxLength": 256
52
+ },
53
+ "focus": {
54
+ "type": "string",
55
+ "maxLength": 4096
56
+ }
57
+ }
58
+ }
59
+ }
60
+ }