@intentius/chant 0.124.5 → 0.124.6

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.
@@ -3,9 +3,17 @@
3
3
  * the CI job that waits at a gate again once its approval has arrived. See
4
4
  * `../../op/gate-resume.ts` for what each forge is asked and the token it
5
5
  * needs. Neither approves anything.
6
+ *
7
+ * A gate that asks a decision point (#3170) waits on a question, not on an
8
+ * approval: its pending fact cites the question, and the gate's resolution is
9
+ * only written when the run asks again. So such a fact is resumable once the
10
+ * question has an answer that passes the gate (`pointGateResumable`, #3835),
11
+ * and `chant workspace points answer --resume` resumes the job right after
12
+ * the answer.
6
13
  */
7
14
  import { type GateResolutionRecord, type PendingGateRecord } from "../../lifecycle/gate-ledger.js";
8
15
  import { type GateResumeOutcome } from "../../op/gate-resume.js";
16
+ import { type PointQuestionState } from "../../point-decision.js";
9
17
  import type { ForgeFetch } from "../../pr-forge.js";
10
18
  import type { CommandContext } from "../registry.js";
11
19
  /** One waiting gate and what resuming it did. */
@@ -24,7 +32,15 @@ export interface ResumeGateOptions {
24
32
  fetch?: ForgeFetch;
25
33
  now?: string;
26
34
  dryRun?: boolean;
35
+ /**
36
+ * The workspace's questions by id, for a fact a gate that asks a decision
37
+ * point recorded (#3835). Read from the workspace at the working directory
38
+ * when a fact needs them and none are given.
39
+ */
40
+ questions?: ReadonlyMap<string, PointQuestionState>;
27
41
  }
42
+ /** Every question the workspace at `cwd` lists, by id, the lifecycle ledger's included. Empty when the workspace can't be read. */
43
+ export declare function workspaceQuestions(cwd: string): Promise<Map<string, PointQuestionState>>;
28
44
  /** Resume the job behind one standing pending fact, when an approval answers it. */
29
45
  export declare function resumeStanding(standing: PendingGateRecord, resolutions: readonly GateResolutionRecord[], opts?: ResumeGateOptions, pending?: readonly PendingGateRecord[]): Promise<GateResumeReport>;
30
46
  /** Resume every job waiting on `op`'s gates (or one gate) whose approval arrived. */
@@ -35,10 +51,25 @@ export declare function resumeOpGates(op: string, gate: string | undefined, opts
35
51
  * resume, 1 when a forge call failed or no token was found.
36
52
  */
37
53
  export declare function resumeAfterApproval(op: string, gate: string, environment: string | undefined, pushed: boolean): Promise<number>;
54
+ /**
55
+ * What `chant workspace points answer --resume` runs once the answer is
56
+ * written (#3835): resume the job waiting at the gate the question names in
57
+ * its subject (`gate:<op>/<gate>`), when the answer passes it. The answer has
58
+ * to be on the remote for the resumed job to see it: one held on
59
+ * `chant/lifecycle` is pushed again here, and one in the working tree is
60
+ * not resumed on, since the job reads it only once it is committed and pushed.
61
+ * Returns the exit code, as {@link resumeAfterApproval} does.
62
+ */
63
+ export declare function resumeAfterAnswer(question: {
64
+ id: string;
65
+ subject: string | null;
66
+ ledger: string | null;
67
+ }, cwd?: string): Promise<number>;
38
68
  /**
39
69
  * `chant run resume [--op <op>] [--dry-run] [--json]`: the scheduled job.
40
70
  * Reads every gate ledger on `chant/lifecycle` (or `--op`'s), and starts
41
- * again each CI job that waits at a gate an approval now answers.
71
+ * again each CI job that waits at a gate an approval now answers, or at a
72
+ * gate whose decision point now has an answer that passes it (#3835).
42
73
  */
43
74
  export declare function runResumeCommand(ctx: CommandContext): Promise<number>;
44
75
  //# sourceMappingURL=gate-resume.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"gate-resume.d.ts","sourceRoot":"","sources":["../../../src/cli/handlers/gate-resume.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAIL,KAAK,oBAAoB,EACzB,KAAK,iBAAiB,EACvB,MAAM,6BAA6B,CAAC;AAErC,OAAO,EAKL,KAAK,iBAAiB,EACvB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAEjD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAElD,iDAAiD;AACjD,MAAM,WAAW,gBAAgB;IAC/B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IAC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ACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,MAAM,CAAC,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,CAuB5E"}
1
+ {"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../../src/cli/main.ts"],"names":[],"mappings":";AAMA,OAAO,EAAkB,KAAK,UAAU,EAAE,KAAK,UAAU,EAAE,MAAM,YAAY,CAAC;AA2G9E;;GAEG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,UAAU,CA4rBpD;AA87BD;;;;;;;;;;GAUG;AACH,wBAAsB,mBAAmB,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,MAAM,CAAC,CAuBzE;AAID;;;;;;;;;GASG;AACH,eAAO,MAAM,eAAe,EAAE,UAAU,EA2KvC,CAAC;AAqLF;;;;;;;;GAQG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,MAAM,CAAC,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,CAuB5E"}
@@ -20,6 +20,13 @@ export interface GateAnswerRef {
20
20
  /** `table`, `model` or `quorum`. */
21
21
  decider?: string;
22
22
  answeredBy?: string[];
23
+ /**
24
+ * On a pending fact: the answers the gate passes on, when the gate names
25
+ * them (`point.pass`); absent means a noul point's yes. `chant run resume`
26
+ * reads it to tell an answer that passes the gate from one that does not,
27
+ * without the Op's config (#3835).
28
+ */
29
+ pass?: Array<string | boolean>;
23
30
  }
24
31
  /** One immutable gate-resolution record. */
25
32
  export interface GateResolutionRecord {
@@ -1 +1 @@
1
- {"version":3,"file":"gate-ledger.d.ts","sourceRoot":"","sources":["../../src/lifecycle/gate-ledger.ts"],"names":[],"mappings":"AA6CA,OAAO,EAAqB,KAAK,UAAU,EAAE,MAAM,eAAe,CAAC;AACnE,OAAO,KAAK,EAAE,YAAY,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAClG,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,m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AAoB,CACxC,KAAK,EAAE,mBAAmB,EAC1B,IAAI,CAAC,EAAE;IAAE,GAAG,CAAC,EAAE,MAAM,CAAA;CAAE,GACtB,OAAO,CAAC;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,oBAAoB,CAAA;CAAE,CAAC,CAI3D;AAED;;;;;GAKG;AACH,wBAAsB,iBAAiB,CACrC,KAAK,EAAE,gBAAgB,EACvB,IAAI,CAAC,EAAE;IAAE,GAAG,CAAC,EAAE,MAAM,CAAA;CAAE,GACtB,OAAO,CAAC;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,iBAAiB,CAAA;CAAE,CAAC,CAiBxD;AA2BD;;;;;GAKG;AACH,wBAAsB,cAAc,CAClC,EAAE,EAAE,MAAM,EACV,IAAI,CAAC,EAAE;IAAE,GAAG,CAAC,EAAE,MAAM,CAAA;CAAE,GACtB,OAAO,CAAC;IAAE,WAAW,EAAE,oBAAoB,EAAE,CAAC;IAAC,OAAO,EAAE,iBAAiB,EAAE,CAAC;IAAC,SAAS,EAAE,MAAM,CAAA;CAAE,CAAC,CAInG;AAED;;;;;GAKG;AACH,wBAAgB,eAAe,CAC7B,OAAO,EAAE,MAAM,GACd;IAAE,WAAW,EAAE,oBAAoB,EAAE,CAAC;IAAC,OAAO,EAAE,iBAAiB,EAAE,CAAC;IAAC,SAAS,EAAE,MAAM,CAAA;CAAE,CAmD1F;AAED,oNAAoN;AACpN,wBAAsB,mBAAmB,CACvC,EAAE,EAAE,MAAM,EACV,IAAI,CAAC,EAAE;IAAE,GAAG,CAAC,EAAE,MAAM,CAAA;CAAE,GACtB,OAAO,CAAC;IAAE,OAAO,EAAE,oBAAoB,EAAE,CAAC;IAAC,SAAS,EAAE,MAAM,CAAA;CAAE,CAAC,CAGjE"}
@@ -25,7 +25,7 @@
25
25
  * and, when the point declares them, in its `gate.*` inputs.
26
26
  */
27
27
  import type { GatePointAsker } from "../point-decision.js";
28
- export { evaluatePointGate, type GatePointAsker, type GatePointQuestion, type GatePointRequest, type PointGateCheck, type PointGateInput, type PointGateLedgerPort, } from "../point-decision.js";
28
+ export { evaluatePointGate, pointGateResumable, type GatePointAsker, type PointQuestionState, type PointResumeCheck, type GatePointQuestion, type GatePointRequest, type PointGateCheck, type PointGateInput, type PointGateLedgerPort, } from "../point-decision.js";
29
29
  /**
30
30
  * The real asker: the workspace that holds `cwd`. It reads the point's
31
31
  * declared inputs from `points`, adds the `gate.*` ones the point declares,
@@ -1 +1 @@
1
- {"version":3,"file":"gate-point-run.d.ts","sourceRoot":"","sources":["../../src/op/gate-point-run.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAIH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAGxD,OAAO,EACL,iBAAiB,EACjB,KAAK,cAAc,EACnB,KAAK,iBAAiB,EACtB,KAAK,gBAAgB,EACrB,KAAK,cAAc,EACnB,KAAK,cAAc,EACnB,KAAK,mBAAmB,GACzB,MAAM,mBAAmB,CAAC;AAE3B;;;;;;;GAOG;AACH,wBAAgB,uBAAuB,CAAC,GAAG,EAAE,MAAM,GAAG,cAAc,CAyBnE"}
1
+ {"version":3,"file":"gate-point-run.d.ts","sourceRoot":"","sources":["../../src/op/gate-point-run.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAIH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAGxD,OAAO,EACL,iBAAiB,EACjB,kBAAkB,EAClB,KAAK,cAAc,EACnB,KAAK,kBAAkB,EACvB,KAAK,gBAAgB,EACrB,KAAK,iBAAiB,EACtB,KAAK,gBAAgB,EACrB,KAAK,cAAc,EACnB,KAAK,cAAc,EACnB,KAAK,mBAAmB,GACzB,MAAM,mBAAmB,CAAC;AAE3B;;;;;;;GAOG;AACH,wBAAgB,uBAAuB,CAAC,GAAG,EAAE,MAAM,GAAG,cAAc,CAyBnE"}
@@ -85,4 +85,10 @@ export declare function gatePointInputs(point: string, declared: readonly string
85
85
  * names the gate ledger entry that cites it.
86
86
  */
87
87
  export declare function gateSubject(op: string, gate: string, env?: string | null): string;
88
+ /** The gate a {@link gateSubject} names, or undefined for a subject that names none (#3835). */
89
+ export declare function parseGateSubject(subject: string | null | undefined): {
90
+ op: string;
91
+ gate: string;
92
+ env?: string;
93
+ } | undefined;
88
94
  //# sourceMappingURL=gate-point.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"gate-point.d.ts","sourceRoot":"","sources":["../../src/op/gate-point.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH;;;GAGG;AACH,MAAM,WAAW,SAAS;IACxB,oEAAoE;IACpE,IAAI,EAAE,MAAM,CAAC;IACb;;;;OAIG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACjC,6GAA6G;IAC7G,IAAI,CAAC,EAAE,KAAK,CAAC,MAAM,GAAG,OAAO,CAAC,CAAC;IAC/B;;;;;;OAMG;IACH,KAAK,CAAC,EAAE,cAAc,CAAC;CACxB;AAED,8EAA8E;AAC9E,MAAM,MAAM,cAAc,GAAG,MAAM,GAAG,QAAQ,CAAC;AAE/C;;;;;;GAMG;AACH,wBAAgB,qBAAqB,CAAC,GAAG,GAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAAe,GAAG,cAAc,GAAG,SAAS,CAGjI;AAED,2EAA2E;AAC3E,eAAO,MAAM,uBAAuB,EAAE,aAAa,CAAC,MAAM,GAAG,OAAO,CAAU,CAAC;AAE/E,8EAA8E;AAC9E,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,GAAG,SAAS,GAAG,SAAS,GAAG,SAAS,CAGxF;AAID,+HAA+H;AAC/H,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,OAAO,EAAE,YAAY,UAA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,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,GAAG,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,SAAS,CAQ3H"}
@@ -33,37 +33,8 @@
33
33
  */
34
34
  import { type ForgeFetch, type ForgeKind } from "../pr-forge.js";
35
35
  import type { GateResolutionRecord, PendingGateRecord } from "../lifecycle/gate-ledger.js";
36
- /** Where the job that recorded a pending fact runs, and what its forge needs to start it again. */
37
- export interface GateRunLocator {
38
- forge: ForgeKind;
39
- /** The forge's API base: `$GITHUB_API_URL` (GitHub and Forgejo) or `$CI_API_V4_URL` (GitLab). */
40
- api: string;
41
- /** `owner/name` on GitHub and Forgejo, the project id on GitLab. */
42
- repo: string;
43
- /** The run: GitHub's and Forgejo's run id, GitLab's pipeline id. */
44
- run: string;
45
- /** GitHub: the run attempt that waited. A later attempt means it was already re-run. */
46
- attempt?: number;
47
- /** GitLab: the job that waited. */
48
- job?: string;
49
- /** GitLab: that job's name, to find a retry of it. */
50
- jobName?: string;
51
- /** Forgejo: the workflow file the run came from, which a dispatch names. */
52
- workflow?: string;
53
- /** Forgejo: the branch a dispatch runs on. */
54
- ref?: string;
55
- /** The run's page, for a person. */
56
- url?: string;
57
- }
58
- /**
59
- * The locator of the CI job this process runs in, or undefined outside CI or
60
- * when the environment lacks a part a resume needs. Forgejo Actions sets the
61
- * `GITHUB_*` variables too, and is told apart by `FORGEJO_ACTIONS` or
62
- * `GITEA_ACTIONS`.
63
- */
64
- export declare function resolveGateRunLocator(env?: Record<string, string | undefined>): GateRunLocator | undefined;
65
- /** Whether `value` is a {@link GateRunLocator} a resume can use. */
66
- export declare function isGateRunLocator(value: unknown): value is GateRunLocator;
36
+ import type { GateRunLocator } from "./gate-run-locator.js";
37
+ export { isGateRunLocator, resolveGateRunLocator, type GateRunLocator } from "./gate-run-locator.js";
67
38
  /** What {@link resumeGateRun} did. */
68
39
  export type GateResumeOutcome = {
69
40
  status: "resumed";
@@ -1 +1 @@
1
- {"version":3,"file":"gate-resume.d.ts","sourceRoot":"","sources":["../../src/op/gate-resume.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AAEH,OAAO,EAAiB,KAAK,UAAU,EAAE,KAAK,SAAS,EAAE,MAAM,aAAa,CAAC;AAC7E,OAAO,KAAK,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAIxF,mGAAmG;AACnG,MAAM,WAAW,cAAc;IAC7B,KAAK,EAAE,SAAS,CAAC;IACjB,iGAAiG;IACjG,GAAG,EAAE,MAAM,CAAC;IACZ,oEAAoE;IACpE,IAAI,EAAE,MAAM,CAAC;IACb,oEAAoE;IACpE,GAAG,EAAE,MAAM,CAAC;IACZ,wFAAwF;IACxF,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,mCAAmC;IACnC,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,sDAAsD;IACtD,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,4EAA4E;IAC5E,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,8CAA8C;IAC9C,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,oCAAoC;IACpC,GAAG,CAAC,EAAE,MAAM,CAAC;CACd;AAID;;;;;GAKG;AACH,wBAAgB,qBAAqB,CAAC,GAAG,GAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAe,GAAG,cAAc,GAAG,SAAS,CAwCvH;AAcD,oEAAoE;AACpE,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,cAAc,CAQxE;AAED,sCAAsC;AACtC,MAAM,MAAM,iBAAiB,GACzB;IAAE,MAAM,EAAE,SAAS,CAAC;IAAC,KAAK,EAAE,SAAS,CAAC;IAAC,GAAG,EAAE,MAAM,CAAC;IAA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C;AACtC,MAAM,MAAM,iBAAiB,GACzB;IAAE,MAAM,EAAE,SAAS,CAAC;IAAC,KAAK,EAAE,SAAS,CAAC;IAAC,GAAG,EAAE,MAAM,CAAC;IAAC,GAAG,CAAC,EAAE,MAAM,CAAA;CAAE,GAClE;IAAE,MAAM,EAAE,SAAS,CAAC;IAAC,KAAK,EAAE,SAAS,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,GAAG,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AAE1E,MAAM,WAAW,oBAAoB;IACnC,KAAK,EAAE,MAAM,CAAC;IACd,6GAA6G;IAC7G,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,UAAU,CAAC;CACpB;AAyBD;;;;GAIG;AACH,wBAAsB,aAAa,CAAC,GAAG,EAAE,cAAc,EAAE,IAAI,EAAE,oBAAoB,GAAG,OAAO,CAAC,iBAAiB,CAAC,CA8D/G;AAED;;;;;;;GAOG;AACH,wBAAgB,mBAAmB,CACjC,WAAW,EAAE,SAAS,oBAAoB,EAAE,EAC5C,QAAQ,EAAE,iBAAiB,EAC3B,OAAO,GAAE,SAAS,iBAAiB,EAAe,GACjD,oBAAoB,GAAG,SAAS,CASlC;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,SAAS,EAAE,GAAG,GAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAe,GAAG,MAAM,GAAG,SAAS,CAG9H"}
@@ -0,0 +1,40 @@
1
+ /**
2
+ * Where a CI job that waits at a gate runs, and what its forge needs to start
3
+ * it again (#3683). Read from the job's environment when a pending fact is
4
+ * recorded; `./gate-resume.ts` uses it to resume the job. It imports nothing
5
+ * at run time, so `@intentius/chant/point-decision` records it on the pending
6
+ * fact of a gate that asks a decision point too (#3835).
7
+ */
8
+ import type { ForgeKind } from "../pr-forge.js";
9
+ /** Where the job that recorded a pending fact runs, and what its forge needs to start it again. */
10
+ export interface GateRunLocator {
11
+ forge: ForgeKind;
12
+ /** The forge's API base: `$GITHUB_API_URL` (GitHub and Forgejo) or `$CI_API_V4_URL` (GitLab). */
13
+ api: string;
14
+ /** `owner/name` on GitHub and Forgejo, the project id on GitLab. */
15
+ repo: string;
16
+ /** The run: GitHub's and Forgejo's run id, GitLab's pipeline id. */
17
+ run: string;
18
+ /** GitHub: the run attempt that waited. A later attempt means it was already re-run. */
19
+ attempt?: number;
20
+ /** GitLab: the job that waited. */
21
+ job?: string;
22
+ /** GitLab: that job's name, to find a retry of it. */
23
+ jobName?: string;
24
+ /** Forgejo: the workflow file the run came from, which a dispatch names. */
25
+ workflow?: string;
26
+ /** Forgejo: the branch a dispatch runs on. */
27
+ ref?: string;
28
+ /** The run's page, for a person. */
29
+ url?: string;
30
+ }
31
+ /**
32
+ * The locator of the CI job this process runs in, or undefined outside CI or
33
+ * when the environment lacks a part a resume needs. Forgejo Actions sets the
34
+ * `GITHUB_*` variables too, and is told apart by `FORGEJO_ACTIONS` or
35
+ * `GITEA_ACTIONS`.
36
+ */
37
+ export declare function resolveGateRunLocator(env?: Record<string, string | undefined>): GateRunLocator | undefined;
38
+ /** Whether `value` is a {@link GateRunLocator} a resume can use. */
39
+ export declare function isGateRunLocator(value: unknown): value is GateRunLocator;
40
+ //# sourceMappingURL=gate-run-locator.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"gate-run-locator.d.ts","sourceRoot":"","sources":["../../src/op/gate-run-locator.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAE7C,mGAAmG;AACnG,MAAM,WAAW,cAAc;IAC7B,KAAK,EAAE,SAAS,CAAC;IACjB,iGAAiG;IACjG,GAAG,EAAE,MAAM,CAAC;IACZ,oEAAoE;IACpE,IAAI,EAAE,MAAM,CAAC;IACb,oEAAoE;IACpE,GAAG,EAAE,MAAM,CAAC;IACZ,wFAAwF;IACxF,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,mCAAmC;IACnC,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,sDAAsD;IACtD,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,4EAA4E;IAC5E,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,8CAA8C;IAC9C,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,oCAAoC;IACpC,GAAG,CAAC,EAAE,MAAM,CAAC;CACd;AAID;;;;;GAKG;AACH,wBAAgB,qBAAqB,CAAC,GAAG,GAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAe,GAAG,cAAc,GAAG,SAAS,CAwCvH;AAcD,oEAAoE;AACpE,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,cAAc,CAQxE"}
@@ -20,14 +20,21 @@
20
20
  * TypeScript, zod or git code, which `point-decision-bundle.test.ts` holds
21
21
  * it to. `./op/gate-point-run.ts` re-exports it, and chant's own runs decide
22
22
  * by it.
23
+ *
24
+ * A gate's resolution is written only when its run asks again, so a resume
25
+ * job asks {@link pointGateResumable} whether a waiting job's question now
26
+ * has an answer that passes the gate (#3835), with the questions
27
+ * {@link chantPointQuestions} reads. `chant run resume` makes the same check.
23
28
  */
24
29
  import type { GateAnswerRef, GateResolutionRecord, PendingGateRecord } from "./lifecycle/gate-ledger.js";
25
30
  import type { GateLedgerPort } from "./op/gate.js";
26
31
  import { type GatePoint, type GatePointFacts, type GatePointStore } from "./op/gate-point.js";
27
32
  import type { WaitingPoint } from "./op/steward-points.js";
28
- export { DEFAULT_GATE_POINT_PASS, GATE_POINT_INPUTS, defaultGatePointStore, gatePointInputs, gatePointOf, gatePointProblems, gateSubject, type GatePoint, type GatePointFacts, type GatePointStore, } from "./op/gate-point.js";
33
+ import { type GateRunLocator } from "./op/gate-run-locator.js";
34
+ export { DEFAULT_GATE_POINT_PASS, GATE_POINT_INPUTS, defaultGatePointStore, gatePointInputs, gatePointOf, gatePointProblems, gateSubject, parseGateSubject, type GatePoint, type GatePointFacts, type GatePointStore, } from "./op/gate-point.js";
29
35
  export type { GateAnswerRef, GateResolutionRecord, GateResolutionInput, PendingGateInput, PendingGateRecord } from "./lifecycle/gate-ledger.js";
30
36
  export type { WaitingPoint } from "./op/steward-points.js";
37
+ export { isGateRunLocator, resolveGateRunLocator, type GateRunLocator } from "./op/gate-run-locator.js";
31
38
  /**
32
39
  * The gate ledger as {@link evaluatePointGate} uses it: read an op's facts,
33
40
  * append a pending fact, append a resolution. chant's own is
@@ -84,6 +91,12 @@ export interface PointGateInput {
84
91
  /** The environment the run was started for: the `gate.env` input. Op gate facts on the ledger record none. */
85
92
  env?: string;
86
93
  now?: string;
94
+ /**
95
+ * Where this job runs, for `chant run resume` to start it again once the
96
+ * question is answered (#3835). Default: read from the CI environment
97
+ * ({@link resolveGateRunLocator}); false records none.
98
+ */
99
+ resume?: GateRunLocator | false;
87
100
  }
88
101
  /** What reaching a gate that asks a point decided. */
89
102
  export type PointGateCheck = {
@@ -112,6 +125,47 @@ export type PointGateCheck = {
112
125
  };
113
126
  /** Decide a gate that asks a point: ask it, then record the pending fact or the resolution that cites the answer. */
114
127
  export declare function evaluatePointGate(port: PointGateLedgerPort, asker: GatePointAsker, input: PointGateInput): Promise<PointGateCheck>;
128
+ /**
129
+ * A question's state as a resume reads it: what `chant workspace points
130
+ * --json` lists for it. {@link chantPointQuestions} reads them through the
131
+ * chant bin; chant's own resume reads the workspace.
132
+ */
133
+ export interface PointQuestionState {
134
+ id: string;
135
+ state: "escalated" | "proposed" | "answered";
136
+ /** The answer, or null while the question is open. */
137
+ answer: string | boolean | null;
138
+ answeredBy: string[];
139
+ /** When it was answered, as the record says, or null. */
140
+ answeredOn: string | null;
141
+ }
142
+ /** Whether a waiting point-asking gate can be resumed, and why not. */
143
+ export type PointResumeCheck = {
144
+ resumable: true;
145
+ /** The answer that passes the gate, as the resumed run will cite it. */
146
+ answer: GateAnswerRef;
147
+ /** Who answered: the people, joined, or `quorum` when the record names none. */
148
+ answeredBy: string;
149
+ /** When it was answered, or null. A resume reads a run started after it as already resumed. */
150
+ answeredOn: string | null;
151
+ } | {
152
+ resumable: false;
153
+ /** `open`: nobody has answered; `refused`: the answer does not pass the gate; `unknown`: no question with the id was read; `not-a-point`: the pending fact cites no question. */
154
+ why: "open" | "refused" | "unknown" | "not-a-point";
155
+ message: string;
156
+ };
157
+ /**
158
+ * Whether the job behind `standing`, a pending fact a gate that asks a
159
+ * decision point recorded, can be started again (#3835): its question is
160
+ * answered with an answer the gate passes on (the pending fact's
161
+ * `answer.pass`, default a noul point's yes). A gate only writes its
162
+ * resolution when its run asks the point again, so nothing on the gate
163
+ * ledger says an answered question passes; this is the check
164
+ * `chant run resume` makes, and a product's own resume job makes the same
165
+ * call with the questions it read (`chantPointQuestions`). It approves
166
+ * nothing: the resumed run asks again and decides.
167
+ */
168
+ export declare function pointGateResumable(standing: Pick<PendingGateRecord, "answer">, question: PointQuestionState | undefined): PointResumeCheck;
115
169
  /** How {@link chantGatePointAsker} runs chant. */
116
170
  export interface ChantGatePointAskerOptions {
117
171
  /** The chant command and its leading arguments, such as `["npx", "chant"]` or `[process.execPath, "/path/to/chant"]`. */
@@ -131,4 +185,12 @@ export interface ChantGatePointAskerOptions {
131
185
  * quorum decide as in chant's own runs.
132
186
  */
133
187
  export declare function chantGatePointAsker(opts: ChantGatePointAskerOptions): GatePointAsker;
188
+ /**
189
+ * Every question the workspace lists, by id, read through the chant bin with
190
+ * `chant workspace points --json` (the questions held on `chant/lifecycle`
191
+ * included), for {@link pointGateResumable} in a tool that bundles this
192
+ * module (#3835). Fetch `chant/lifecycle` first, as reading the gate ledger
193
+ * does, so an answer given from another clone is seen.
194
+ */
195
+ export declare function chantPointQuestions(opts: ChantGatePointAskerOptions): Promise<Map<string, PointQuestionState>>;
134
196
  //# sourceMappingURL=point-decision.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"point-decision.d.ts","sourceRoot":"","sources":["../src/point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MAAM,CAAC;CACf;AAED,0HAA0H;AAC1H,wBAAsB,eAAe,CAAC,KAAK,EAAE,WAAW,GAAG,OAAO,CAAC,cAAc,CAAC,CA+EjF;AAED;;;;;;GAMG;AACH,wBAAsB,kBAAkB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,YAAY,CAAC,OAAO,CAAC,CAAC,GAAG,IAAI,CAAC,CASxG;AAED,0CAA0C;AAC1C,wBAAgB,YAAY,CAAC,GAAG,EAAE,OAAO,CAAC,cAAc,EAAE;IAAE,MAAM,EAAE,OAAO,CAAA;CAAE,CAAC,GAAG,MAAM,CAatF;AAED,8GAA8G;AAC9G,wBAAgB,WAAW,CAAC,QAAQ,EAAE,OAAO,GAAG,QAAQ,CASvD;AA+BD,6EAA6E;AAC7E,wBAAsB,kBAAkB,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CAwD7E"}
@@ -55,6 +55,13 @@ export interface RecordsQuery {
55
55
  workGaps?: boolean;
56
56
  /** List only the records that are modified or new against `HEAD` (#3160). Needs git and a working-tree read. */
57
57
  uncommitted?: boolean;
58
+ /**
59
+ * For an answer kind read in the working tree (#3833): fetch `chant/lifecycle`
60
+ * first, best effort, as `points answer` does, so an answer held there by
61
+ * another clone or a CI job is listed. The command sets it; other readers
62
+ * read the local ledger as it is.
63
+ */
64
+ fetchLedger?: boolean;
58
65
  }
59
66
  /**
60
67
  * A record as the output carries it: the entry plus its provenance (#2547),
@@ -106,6 +113,14 @@ export type RecordView = RecordEntry & {
106
113
  * steward keeps on the lifecycle ledger (#2786) laid over it.
107
114
  */
108
115
  answers?: WorkAnswer[];
116
+ /**
117
+ * For a record of an answer kind (one with an `answers` block) read in the
118
+ * working tree (#3833): where the record is held on the lifecycle ledger,
119
+ * `chant/lifecycle:<path>`, as `points` names it for a question, or null
120
+ * when it is the working tree's file. A record held on the ledger has no
121
+ * `worktree` or `lastWrite`, since the checkout doesn't hold it.
122
+ */
123
+ ledger?: string | null;
109
124
  };
110
125
  /** The role in the trust policy whose holders' verdicts the quorum does not count (#2671). */
111
126
  export declare const AGENT_ROLE = "agent";
@@ -1 +1 @@
1
- {"version":3,"file":"records-cli.d.ts","sourceRoot":"","sources":["../../src/workspace/records-cli.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAMH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAGtD,OAAO,EAAkB,KAAK,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAClE,OAAO,EAAkE,KAAK,YAAY,EAAE,MAAM,iBAAiB,CAAC;AACpH,OAAO,EAA4D,KAAK,qBAAqB,EAAE,MAAM,eAAe,CAAC;AAGrH,OAAO,EASL,KAAK,gBAAgB,EACrB,KAAK,MAAM,EACX,KAAK,aAAa,EAClB,KAAK,aAAa,EAClB,KAAK,iBAAiB,EACtB,KAAK,WAAW,EAChB,KAAK,YAAY,EAGjB,KAAK,kBAAkB,EACxB,MAAM,WAAW,CAAC;AACnB,OAAO,EAAoC,KAAK,YAAY,EAAE,KAAK,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAC7G,OAAO,EAAmB,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAS/D,OAAO,EAAwB,KAAK,aAAa,EAAE,MAAM,QAAQ,CAAC;AAClE,OAAO,KAAK,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AACvD,OAAO,EAAwC,KAAK,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAC9F,OAAO,EAA+C,KAAK,UAAU,EAAE,KAAK,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACzH,OAAO,EAAkB,KAAK,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAGlE,6DAA6D;AAC7D,eAAO,MAAM,wBAAwB,IAAI,CAAC;AAE1C,kFAAkF;AAClF,eAAO,MAAM,wBAAwB,gFAAgF,CAAC;AAKtH,2E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C,MAAM,EAAE,YAAY,EAAE,IAAI,EAAE;QAAE,MAAM,EAAE,gBAAgB,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,KAAK,OAAO,CAAC,YAAY,CAAC,CAAC;CAC7G,GACA,OAAO,CAAC,WAAW,CAAC,CAuBtB;AAED,oGAAoG;AACpG,wBAAsB,YAAY,CAAC,KAAK,EAAE,YAAY,GAAG,OAAO,CAAC,eAAe,CAAC,CAsHhF;AAyGD;;;;GAIG;AACH,wBAAgB,OAAO,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,GAAG;IAAE,KAAK,EAAE,MAAM,CAAA;CAAE,CAUvG;AAED,wBAAsB,mBAAmB,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CAsE9E;AAoGD,wBAAgB,UAAU,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAM9C;AAED,wFAAwF;AACxF,wBAAgB,aAAa,CAAC,OAAO,EAAE,UAAU,EAAE,EAAE,QAAQ,EAAE,eAAe,GAAG,UAAU,EAAE,CAE5F;AA0DD,yCAAyC;AACzC,wBAAsB,mBAAmB,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CAS9E"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@intentius/chant",
3
- "version": "0.124.5",
3
+ "version": "0.124.6",
4
4
  "description": "Declarative infrastructure-as-code toolkit — TypeScript on Node.js",
5
5
  "license": "Apache-2.0",
6
6
  "homepage": "https://intentius.io/chant",
@@ -3,6 +3,13 @@
3
3
  * the CI job that waits at a gate again once its approval has arrived. See
4
4
  * `../../op/gate-resume.ts` for what each forge is asked and the token it
5
5
  * needs. Neither approves anything.
6
+ *
7
+ * A gate that asks a decision point (#3170) waits on a question, not on an
8
+ * approval: its pending fact cites the question, and the gate's resolution is
9
+ * only written when the run asks again. So such a fact is resumable once the
10
+ * question has an answer that passes the gate (`pointGateResumable`, #3835),
11
+ * and `chant workspace points answer --resume` resumes the job right after
12
+ * the answer.
6
13
  */
7
14
 
8
15
  import {
@@ -12,7 +19,8 @@ import {
12
19
  type GateResolutionRecord,
13
20
  type PendingGateRecord,
14
21
  } from "../../lifecycle/gate-ledger";
15
- import { listFilesInDir, requireLifecycleLedger } from "../../lifecycle/git";
22
+ import { listFilesInDir, pushLifecycleStatus, requireLifecycleLedger } from "../../lifecycle/git";
23
+ import { parseGateSubject } from "../../op/gate-point";
16
24
  import {
17
25
  isGateRunLocator,
18
26
  resolutionAnswering,
@@ -20,6 +28,7 @@ import {
20
28
  resumeTokenFromEnv,
21
29
  type GateResumeOutcome,
22
30
  } from "../../op/gate-resume";
31
+ import { pointGateResumable, type PointQuestionState } from "../../point-decision";
23
32
  import type { ForgeFetch } from "../../pr-forge";
24
33
  import { formatError, formatInfo, formatSuccess, formatWarning } from "../format";
25
34
  import type { CommandContext } from "../registry";
@@ -53,6 +62,20 @@ export interface ResumeGateOptions {
53
62
  fetch?: ForgeFetch;
54
63
  now?: string;
55
64
  dryRun?: boolean;
65
+ /**
66
+ * The workspace's questions by id, for a fact a gate that asks a decision
67
+ * point recorded (#3835). Read from the workspace at the working directory
68
+ * when a fact needs them and none are given.
69
+ */
70
+ questions?: ReadonlyMap<string, PointQuestionState>;
71
+ }
72
+
73
+ /** Every question the workspace at `cwd` lists, by id, the lifecycle ledger's included. Empty when the workspace can't be read. */
74
+ export async function workspaceQuestions(cwd: string): Promise<Map<string, PointQuestionState>> {
75
+ const { workspacePoints } = await import("../../workspace/points-cli");
76
+ const doc = await workspacePoints({ cwd }).catch(() => undefined);
77
+ if (!doc || !("questions" in doc)) return new Map();
78
+ return new Map(doc.questions.map((q) => [q.id, { id: q.id, state: q.state, answer: q.answer, answeredBy: q.answeredBy, answeredOn: q.answeredOn }]));
56
79
  }
57
80
 
58
81
  /** Resume the job behind one standing pending fact, when an approval answers it. */
@@ -68,9 +91,20 @@ export async function resumeStanding(
68
91
  ...(standing.environment !== undefined ? { environment: standing.environment } : {}),
69
92
  ...(standing.resume?.url ? { url: standing.resume.url } : {}),
70
93
  };
71
- const answer = resolutionAnswering(resolutions, standing, pending);
72
- if (!answer) return { ...base, status: "not-approved", message: "no approval answers it yet" };
73
- const approvedBy = { approvedBy: answer.resolvedBy };
94
+ let approvedBy: { approvedBy: string };
95
+ let since: string | undefined;
96
+ if (standing.answer) {
97
+ // A gate that asks a decision point waits on its question (#3835).
98
+ const check = pointGateResumable(standing, opts.questions?.get(standing.answer.id));
99
+ if (!check.resumable) return { ...base, status: "not-approved", message: check.message };
100
+ approvedBy = { approvedBy: check.answeredBy };
101
+ since = check.answeredOn ?? undefined;
102
+ } else {
103
+ const answer = resolutionAnswering(resolutions, standing, pending);
104
+ if (!answer) return { ...base, status: "not-approved", message: "no approval answers it yet" };
105
+ approvedBy = { approvedBy: answer.resolvedBy };
106
+ since = answer.timestamp;
107
+ }
74
108
  if (!isGateRunLocator(standing.resume)) {
75
109
  return { ...base, ...approvedBy, status: "no-job", message: "its pending fact names no CI job (it was recorded outside CI); run it again by hand" };
76
110
  }
@@ -86,7 +120,7 @@ export async function resumeStanding(
86
120
  };
87
121
  }
88
122
  try {
89
- const outcome = await resumeGateRun(loc, { token, since: answer.timestamp, ...(opts.fetch ? { fetch: opts.fetch } : {}) });
123
+ const outcome = await resumeGateRun(loc, { token, ...(since ? { since } : {}), ...(opts.fetch ? { fetch: opts.fetch } : {}) });
90
124
  return { ...base, ...approvedBy, status: outcome.status, message: outcome.status === "resumed" ? outcome.how : outcome.reason };
91
125
  } catch (err) {
92
126
  return { ...base, ...approvedBy, status: "failed", message: err instanceof Error ? err.message : String(err) };
@@ -98,10 +132,10 @@ export async function resumeOpGates(op: string, gate: string | undefined, opts:
98
132
  const ledger = await readGateLedger(op);
99
133
  const now = opts.now ?? new Date().toISOString();
100
134
  const reports: GateResumeReport[] = [];
101
- for (const standing of standingFacts(ledger.pending, gate)) {
102
- if (isPendingGateExpired(standing, now)) continue;
103
- reports.push(await resumeStanding(standing, ledger.resolutions, opts, ledger.pending));
104
- }
135
+ const standing = standingFacts(ledger.pending, gate).filter((p) => !isPendingGateExpired(p, now));
136
+ // Read the workspace's questions once, and only when a fact waits on one (#3835).
137
+ const questions = opts.questions ?? (standing.some((p) => p.answer) ? await workspaceQuestions(process.cwd()) : undefined);
138
+ for (const p of standing) reports.push(await resumeStanding(p, ledger.resolutions, { ...opts, ...(questions ? { questions } : {}) }, ledger.pending));
105
139
  return reports;
106
140
  }
107
141
 
@@ -140,10 +174,49 @@ export async function resumeAfterApproval(op: string, gate: string, environment:
140
174
  return reports.some((r) => r.status === "failed" || r.status === "no-token") ? 1 : 0;
141
175
  }
142
176
 
177
+ /**
178
+ * What `chant workspace points answer --resume` runs once the answer is
179
+ * written (#3835): resume the job waiting at the gate the question names in
180
+ * its subject (`gate:<op>/<gate>`), when the answer passes it. The answer has
181
+ * to be on the remote for the resumed job to see it: one held on
182
+ * `chant/lifecycle` is pushed again here, and one in the working tree is
183
+ * not resumed on, since the job reads it only once it is committed and pushed.
184
+ * Returns the exit code, as {@link resumeAfterApproval} does.
185
+ */
186
+ export async function resumeAfterAnswer(question: { id: string; subject: string | null; ledger: string | null }, cwd: string = process.cwd()): Promise<number> {
187
+ const named = parseGateSubject(question.subject);
188
+ if (!named) {
189
+ console.error(formatInfo(`Question ${question.id} names no gate in its subject, so there is nothing to resume.`));
190
+ return 0;
191
+ }
192
+ if (question.ledger === null) {
193
+ console.error(formatWarning({
194
+ message: `Not resuming: the answer to ${question.id} is in the working tree, and the resumed job would not see it.`,
195
+ hint: `Commit and push it, then run \`chant run resume --op ${named.op}\`.`,
196
+ }));
197
+ return 1;
198
+ }
199
+ if ((await pushLifecycleStatus({ cwd })).status !== "pushed") {
200
+ console.error(formatWarning({
201
+ message: "Not resuming: the answer did not reach the remote, so the resumed job would not see it.",
202
+ hint: `Push chant/lifecycle, then run \`chant run resume --op ${named.op}\`.`,
203
+ }));
204
+ return 1;
205
+ }
206
+ const reports = (await resumeOpGates(named.op, named.gate)).filter((r) => r.environment === undefined);
207
+ if (reports.length === 0) {
208
+ console.error(formatInfo(`No pending fact for ${named.op} / ${named.gate} is waiting, so there is nothing to resume.`));
209
+ return 0;
210
+ }
211
+ for (const r of reports) printReport(r);
212
+ return reports.some((r) => r.status === "failed" || r.status === "no-token") ? 1 : 0;
213
+ }
214
+
143
215
  /**
144
216
  * `chant run resume [--op <op>] [--dry-run] [--json]`: the scheduled job.
145
217
  * Reads every gate ledger on `chant/lifecycle` (or `--op`'s), and starts
146
- * again each CI job that waits at a gate an approval now answers.
218
+ * again each CI job that waits at a gate an approval now answers, or at a
219
+ * gate whose decision point now has an answer that passes it (#3835).
147
220
  */
148
221
  export async function runResumeCommand(ctx: CommandContext): Promise<number> {
149
222
  try {
@@ -161,7 +234,7 @@ export async function runResumeCommand(ctx: CommandContext): Promise<number> {
161
234
  else {
162
235
  for (const r of reports.filter((r) => r.status !== "not-approved")) printReport(r);
163
236
  const waiting = reports.filter((r) => r.status === "not-approved").length;
164
- console.error(formatInfo(`${reports.filter((r) => r.status === "resumed").length} resumed, ${waiting} still waiting for an approval.`));
237
+ console.error(formatInfo(`${reports.filter((r) => r.status === "resumed").length} resumed, ${waiting} still waiting for an approval or a passing answer.`));
165
238
  }
166
239
  return reports.some((r) => r.status === "failed" || r.status === "no-token") ? 1 : 0;
167
240
  }
package/src/cli/main.ts CHANGED
@@ -1226,10 +1226,12 @@ Workspace (level 1, #2524):
1226
1226
  candidates, { question, criteria }. --store ledger
1227
1227
  holds the question on chant/lifecycle and pushes it,
1228
1228
  for a checkout that does not outlive the run (CI)
1229
- workspace points answer <id> --answer <value> --by <name>... [--note <text>] [--relayed-by <principal>] [--kind <kind file>] [--dry-run]
1229
+ workspace points answer <id> --answer <value> --by <name>... [--note <text>] [--relayed-by <principal>] [--kind <kind file>] [--resume] [--dry-run]
1230
1230
  Record people's answer to an open question, or confirm
1231
1231
  a model's proposal, once the point's quorum is met,
1232
- with their note and who relayed it
1232
+ with their note and who relayed it. --resume then
1233
+ starts again the CI job waiting at the gate the
1234
+ question names, when the answer passes it
1233
1235
  workspace points retract <id> --by <name>... [--note <text>] [--kind <kind file>] [--dry-run]
1234
1236
  Take an answer back: the question is open for people
1235
1237
  again, and the answer stays in its retractions