@intentius/chant 0.106.4 → 0.107.1

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 (54) hide show
  1. package/dist/cli/commands/check-lexicon.d.ts +7 -0
  2. package/dist/cli/commands/check-lexicon.d.ts.map +1 -1
  3. package/dist/cli/handlers/operator.d.ts.map +1 -1
  4. package/dist/lifecycle/gate-ledger.d.ts +29 -0
  5. package/dist/lifecycle/gate-ledger.d.ts.map +1 -1
  6. package/dist/op/activities/apply.d.ts +40 -6
  7. package/dist/op/activities/apply.d.ts.map +1 -1
  8. package/dist/op/builders.d.ts +7 -0
  9. package/dist/op/builders.d.ts.map +1 -1
  10. package/dist/op/composites/apply-op.d.ts +21 -3
  11. package/dist/op/composites/apply-op.d.ts.map +1 -1
  12. package/dist/op/gate-approval.d.ts +10 -2
  13. package/dist/op/gate-approval.d.ts.map +1 -1
  14. package/dist/op/gate-plan-context.d.ts +101 -0
  15. package/dist/op/gate-plan-context.d.ts.map +1 -0
  16. package/dist/op/gate-point-run.d.ts +110 -0
  17. package/dist/op/gate-point-run.d.ts.map +1 -0
  18. package/dist/op/gate-point.d.ts +70 -0
  19. package/dist/op/gate-point.d.ts.map +1 -0
  20. package/dist/op/gate.d.ts +12 -1
  21. package/dist/op/gate.d.ts.map +1 -1
  22. package/dist/op/index.d.ts +6 -0
  23. package/dist/op/index.d.ts.map +1 -1
  24. package/dist/op/local-executor.d.ts +11 -3
  25. package/dist/op/local-executor.d.ts.map +1 -1
  26. package/dist/op/op-ir.d.ts +2 -0
  27. package/dist/op/op-ir.d.ts.map +1 -1
  28. package/dist/op/types.d.ts +11 -0
  29. package/dist/op/types.d.ts.map +1 -1
  30. package/dist/workspace/status-gates.d.ts +15 -1
  31. package/dist/workspace/status-gates.d.ts.map +1 -1
  32. package/package.json +1 -1
  33. package/src/cli/commands/check-lexicon.test.ts +21 -5
  34. package/src/cli/commands/check-lexicon.ts +14 -3
  35. package/src/cli/handlers/operator.ts +9 -0
  36. package/src/lifecycle/gate-ledger.ts +30 -0
  37. package/src/op/activities/apply.test.ts +43 -0
  38. package/src/op/activities/apply.ts +111 -6
  39. package/src/op/builders.ts +13 -1
  40. package/src/op/composites/apply-op.ts +24 -4
  41. package/src/op/gate-approval.ts +18 -2
  42. package/src/op/gate-plan-context.test.ts +186 -0
  43. package/src/op/gate-plan-context.ts +229 -0
  44. package/src/op/gate-point-run.ts +207 -0
  45. package/src/op/gate-point.e2e.test.ts +166 -0
  46. package/src/op/gate-point.test.ts +235 -0
  47. package/src/op/gate-point.ts +119 -0
  48. package/src/op/gate.ts +26 -1
  49. package/src/op/index.ts +8 -0
  50. package/src/op/local-executor.ts +96 -3
  51. package/src/op/op-ir.ts +4 -0
  52. package/src/op/types.ts +11 -0
  53. package/src/workspace/status-gates.ts +13 -2
  54. package/src/workspace/status.schema.json +11 -1
package/src/op/types.ts CHANGED
@@ -9,6 +9,7 @@ import type { EffectReceiptRef } from "./receipt-store";
9
9
  import type { ActivityProfileName } from "./activity-profiles";
10
10
  import type { StepOutputRef } from "./step-output-ref";
11
11
  import type { GateApproval } from "./gate-approval";
12
+ import type { GatePoint } from "./gate-point";
12
13
 
13
14
  export interface OpConfig {
14
15
  /** Kebab-case identifier. Names the Op's output directory (`dist/ops/<name>/`), and is the name `chant run <name>` and another Op's `depends` refer to. */
@@ -276,6 +277,16 @@ export interface GateStepBase {
276
277
  * `./gate-approval.ts`.
277
278
  */
278
279
  approval?: GateApproval;
280
+ /**
281
+ * A declared decision point this gate asks (#3170), by name or as a
282
+ * {@link GatePoint}. Reaching the gate asks the point: its deciders and
283
+ * quorum decide, the answer is an answer record, and `chant workspace
284
+ * points answer` answers an open question. The run passes the gate on an
285
+ * answer in `pass`, and the resolution it writes cites the record. A gate
286
+ * with a point takes no `approval`: the point's quorum is the gate's. See
287
+ * `./gate-point.ts`.
288
+ */
289
+ point?: string | GatePoint;
279
290
  }
280
291
 
281
292
  /**
@@ -72,8 +72,18 @@ export interface StatusGate {
72
72
  * `--sign`. Null when any approval counts.
73
73
  */
74
74
  signed: { class: string | null } | null;
75
- /** The command that approves it, run in the member's directory. */
75
+ /**
76
+ * The command that approves it, run in the member's directory. For a gate
77
+ * that asks a decision point (#3170), the `chant workspace points answer`
78
+ * line for its open question.
79
+ */
76
80
  approve: string;
81
+ /**
82
+ * The open question the gate waits on, when it asks a decision point
83
+ * (#3170): the point, the answer record's id and its path. Absent on a
84
+ * gate `chant approve` passes.
85
+ */
86
+ answer?: { point: string; id: string; path: string };
77
87
  }
78
88
 
79
89
  /** The rule for a gate, by name, as `identity.gates` at base sets it (#3163). Null when it sets none. */
@@ -171,7 +181,8 @@ function decide(component: string, standing: PendingGateRecord, all: GateResolut
171
181
  approvals: approvals.map(approvalOf),
172
182
  needed,
173
183
  signed: rule === null ? null : { class: rule.requirement.class },
174
- approve: approveCommand(component, gate, env, planDigest, rule !== null),
184
+ approve: standing.answer ? `chant workspace points answer ${standing.answer.id} --answer <value> --by <name>` : approveCommand(component, gate, env, planDigest, rule !== null),
185
+ ...(standing.answer ? { answer: { point: standing.answer.point, id: standing.answer.id, path: standing.answer.path } } : {}),
175
186
  };
176
187
  }
177
188
 
@@ -848,7 +848,17 @@
848
848
  }
849
849
  ]
850
850
  },
851
- "approve": { "type": "string", "description": "The chant approve line for the gate, run in the member's directory: chant approve <component> <gate>, with --env <env> when env is not null and --plan <planDigest> when planDigest is not null (#2832), so the line approves the plan this read showed, and --sign when signed is not null (#3163). The caller adds --actor <principal>." }
851
+ "approve": { "type": "string", "description": "The chant approve line for the gate, run in the member's directory: chant approve <component> <gate>, with --env <env> when env is not null and --plan <planDigest> when planDigest is not null (#2832), so the line approves the plan this read showed, and --sign when signed is not null (#3163). The caller adds --actor <principal>. For a gate that asks a decision point (#3170), the chant workspace points answer line for the question in answer." },
852
+ "answer": {
853
+ "type": "object",
854
+ "description": "The open question the gate waits on, when it asks a decision point (#3170): absent on a gate chant approve passes. Answered with chant workspace points answer <id>; the run that passes the gate then cites the answer record on the ledger.",
855
+ "required": ["point", "id", "path"],
856
+ "properties": {
857
+ "point": { "type": "string" },
858
+ "id": { "type": "string", "description": "The answer record's id." },
859
+ "path": { "type": "string", "description": "The answer record, from the repository root." }
860
+ }
861
+ }
852
862
  }
853
863
  },
854
864
  "environment": {