@intentius/chant 0.90.0 → 0.91.0
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/dist/cli/handlers/components.d.ts +8 -0
- package/dist/cli/handlers/components.d.ts.map +1 -1
- package/dist/cli/handlers/operator.d.ts +14 -0
- package/dist/cli/handlers/operator.d.ts.map +1 -1
- package/dist/cli/handlers/run.d.ts.map +1 -1
- package/dist/cli/main.d.ts.map +1 -1
- package/dist/cli/mcp/workspace-tools.d.ts +6 -4
- package/dist/cli/mcp/workspace-tools.d.ts.map +1 -1
- package/dist/cli/registry.d.ts +31 -0
- package/dist/cli/registry.d.ts.map +1 -1
- package/dist/components/verbs/vuln-scan.d.ts +72 -0
- package/dist/components/verbs/vuln-scan.d.ts.map +1 -1
- package/dist/lifecycle/git.d.ts +40 -5
- package/dist/lifecycle/git.d.ts.map +1 -1
- package/dist/lifecycle/lease.d.ts +72 -16
- package/dist/lifecycle/lease.d.ts.map +1 -1
- package/dist/lifecycle/member-ledger.d.ts +3 -2
- package/dist/lifecycle/member-ledger.d.ts.map +1 -1
- package/dist/lifecycle/plan-ledger.d.ts +114 -0
- package/dist/lifecycle/plan-ledger.d.ts.map +1 -0
- package/dist/lifecycle/work-lease.d.ts +140 -0
- package/dist/lifecycle/work-lease.d.ts.map +1 -0
- package/dist/op/activities/activity-contracts.d.ts +2 -2
- package/dist/op/builders.d.ts.map +1 -1
- package/dist/op/discover.d.ts +25 -0
- package/dist/op/discover.d.ts.map +1 -1
- package/dist/op/index.d.ts +9 -3
- package/dist/op/index.d.ts.map +1 -1
- package/dist/op/lifecycle-receipt-store.d.ts +34 -0
- package/dist/op/lifecycle-receipt-store.d.ts.map +1 -0
- package/dist/op/local-executor.d.ts +19 -0
- package/dist/op/local-executor.d.ts.map +1 -1
- package/dist/op/local-output.d.ts.map +1 -1
- package/dist/op/op-ir.d.ts +10 -1
- package/dist/op/op-ir.d.ts.map +1 -1
- package/dist/op/operator.d.ts +29 -0
- package/dist/op/operator.d.ts.map +1 -1
- package/dist/op/runtime.d.ts +9 -0
- package/dist/op/runtime.d.ts.map +1 -1
- package/dist/op/runtimes/local.d.ts.map +1 -1
- package/dist/op/step-output-ref.d.ts +2 -2
- package/dist/op/step-output-ref.d.ts.map +1 -1
- package/dist/op/steward.d.ts +140 -0
- package/dist/op/steward.d.ts.map +1 -0
- package/dist/op/types.d.ts +51 -0
- package/dist/op/types.d.ts.map +1 -1
- package/dist/op/work-lease-decl.d.ts +18 -0
- package/dist/op/work-lease-decl.d.ts.map +1 -0
- package/dist/op/work-lease-run.d.ts +173 -0
- package/dist/op/work-lease-run.d.ts.map +1 -0
- package/dist/workspace/box-isolation.d.ts +99 -0
- package/dist/workspace/box-isolation.d.ts.map +1 -0
- package/dist/workspace/checks/box-isolation.d.ts +18 -0
- package/dist/workspace/checks/box-isolation.d.ts.map +1 -0
- package/dist/workspace/checks/boxes.d.ts +71 -0
- package/dist/workspace/checks/boxes.d.ts.map +1 -0
- package/dist/workspace/checks/records.d.ts +1 -0
- package/dist/workspace/checks/records.d.ts.map +1 -1
- package/dist/workspace/checks.d.ts +10 -1
- package/dist/workspace/checks.d.ts.map +1 -1
- package/dist/workspace/decide.d.ts +184 -0
- package/dist/workspace/decide.d.ts.map +1 -0
- package/dist/workspace/decision-points.schema.json +137 -0
- package/dist/workspace/declaration.d.ts +51 -0
- package/dist/workspace/declaration.d.ts.map +1 -1
- package/dist/workspace/declaration.schema.json +172 -0
- package/dist/workspace/declared-kinds.d.ts +12 -0
- package/dist/workspace/declared-kinds.d.ts.map +1 -1
- package/dist/workspace/points-cli.d.ts +113 -0
- package/dist/workspace/points-cli.d.ts.map +1 -0
- package/dist/workspace/points.d.ts +320 -0
- package/dist/workspace/points.d.ts.map +1 -0
- package/dist/workspace/reason-codes.d.ts +26 -0
- package/dist/workspace/reason-codes.d.ts.map +1 -1
- package/dist/workspace/record-assets.d.ts.map +1 -1
- package/dist/workspace/records-cli.d.ts +12 -0
- package/dist/workspace/records-cli.d.ts.map +1 -1
- package/dist/workspace/records.d.ts +8 -2
- package/dist/workspace/records.d.ts.map +1 -1
- package/dist/workspace/status-stewards.d.ts +121 -0
- package/dist/workspace/status-stewards.d.ts.map +1 -0
- package/dist/workspace/status.d.ts +52 -1
- package/dist/workspace/status.d.ts.map +1 -1
- package/dist/workspace/work-cli.d.ts +78 -0
- package/dist/workspace/work-cli.d.ts.map +1 -0
- package/package.json +1 -1
- package/src/cli/handlers/components.test.ts +93 -0
- package/src/cli/handlers/components.ts +44 -3
- package/src/cli/handlers/operator.ts +107 -2
- package/src/cli/handlers/run.test.ts +19 -0
- package/src/cli/handlers/run.ts +53 -1
- package/src/cli/main.test.ts +40 -0
- package/src/cli/main.ts +78 -2
- package/src/cli/mcp/workspace-tools.test.ts +14 -1
- package/src/cli/mcp/workspace-tools.ts +49 -5
- package/src/cli/registry.ts +31 -0
- package/src/components/verbs/vuln-scan.test.ts +124 -1
- package/src/components/verbs/vuln-scan.ts +142 -1
- package/src/lifecycle/git.ts +65 -15
- package/src/lifecycle/lease.test.ts +22 -0
- package/src/lifecycle/lease.ts +133 -29
- package/src/lifecycle/member-ledger.ts +3 -2
- package/src/lifecycle/plan-ledger.test.ts +148 -0
- package/src/lifecycle/plan-ledger.ts +158 -0
- package/src/lifecycle/work-lease.test.ts +236 -0
- package/src/lifecycle/work-lease.ts +426 -0
- package/src/op/builders.ts +5 -0
- package/src/op/discover.ts +71 -0
- package/src/op/index.ts +16 -3
- package/src/op/lifecycle-receipt-store.test.ts +60 -0
- package/src/op/lifecycle-receipt-store.ts +61 -0
- package/src/op/local-executor.ts +216 -18
- package/src/op/local-output.ts +13 -0
- package/src/op/op-ir.ts +14 -0
- package/src/op/operator.ts +75 -4
- package/src/op/runtime.ts +6 -0
- package/src/op/runtimes/local.ts +3 -0
- package/src/op/step-output-ref.ts +6 -2
- package/src/op/steward.test.ts +212 -0
- package/src/op/steward.ts +253 -0
- package/src/op/types.ts +53 -0
- package/src/op/work-lease-decl.ts +80 -0
- package/src/op/work-lease-run.test.ts +326 -0
- package/src/op/work-lease-run.ts +395 -0
- package/src/workspace/box-isolation.test.ts +261 -0
- package/src/workspace/box-isolation.ts +205 -0
- package/src/workspace/check-contract.test.ts +3 -1
- package/src/workspace/check.schema.json +15 -7
- package/src/workspace/checks/box-isolation.ts +68 -0
- package/src/workspace/checks/boxes.test.ts +197 -0
- package/src/workspace/checks/boxes.ts +307 -0
- package/src/workspace/checks/records.ts +25 -0
- package/src/workspace/checks.test.ts +7 -0
- package/src/workspace/checks.ts +19 -2
- package/src/workspace/decide.test.ts +224 -0
- package/src/workspace/decide.ts +576 -0
- package/src/workspace/decision-points.schema.json +137 -0
- package/src/workspace/declaration.schema.json +172 -0
- package/src/workspace/declaration.ts +137 -0
- package/src/workspace/declared-kinds.ts +25 -2
- package/src/workspace/intent.schema.json +4 -1
- package/src/workspace/point-answer.schema.json +95 -0
- package/src/workspace/points-cli.ts +273 -0
- package/src/workspace/points-write.schema.json +489 -0
- package/src/workspace/points.schema.json +710 -0
- package/src/workspace/points.test.ts +264 -0
- package/src/workspace/points.ts +564 -0
- package/src/workspace/read-contract.test.ts +18 -1
- package/src/workspace/reason-codes.test.ts +14 -1
- package/src/workspace/reason-codes.ts +33 -0
- package/src/workspace/record-assets.test.ts +3 -2
- package/src/workspace/record-assets.ts +4 -1
- package/src/workspace/records-cli.ts +15 -2
- package/src/workspace/records-contract.test.ts +3 -2
- package/src/workspace/records.schema.json +17 -0
- package/src/workspace/records.ts +33 -3
- package/src/workspace/status-contract.test.ts +178 -0
- package/src/workspace/status-stewards.ts +225 -0
- package/src/workspace/status.schema.json +230 -4
- package/src/workspace/status.ts +106 -5
- package/src/workspace/work-cli.test.ts +180 -0
- package/src/workspace/work-cli.ts +246 -0
- package/src/workspace/work-lease.schema.json +233 -0
- package/src/workspace/work-readiness-chud.test.ts +145 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"operator.d.ts","sourceRoot":"","sources":["../../src/op/operator.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AACH,OAAO,KAAK,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACvE,OAAO,EAAe,KAAK,YAAY,EAAE,MAAM,YAAY,CAAC;AAC5D,OAAO,EAA8B,KAAK,WAAW,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"operator.d.ts","sourceRoot":"","sources":["../../src/op/operator.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AACH,OAAO,KAAK,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACvE,OAAO,EAAe,KAAK,YAAY,EAAE,MAAM,YAAY,CAAC;AAC5D,OAAO,EAA8B,KAAK,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAChF,OAAO,EAA0F,KAAK,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAErJ,OAAO,EAAoB,KAAK,kBAAkB,EAAE,MAAM,WAAW,CAAC;AAKtE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAErD;;;;;;;;GAQG;AACH,eAAO,MAAM,4BAA4B,QAAS,CAAC;AAWnD,uRAAuR;AACvR,wBAAsB,mBAAmB,CACvC,IAAI,CAAC,EAAE;IAAE,GAAG,CAAC,EAAE,MAAM,CAAC;IAAC,GAAG,CAAC,EAAE,MAAM,CAAA;CAAE,GACpC,OAAO,CAAC;IAAE,GAAG,EAAE,YAAY,EAAE,CAAC;IAAC,MAAM,EAAE,MAAM,EAAE,CAAA;CAAE,CAAC,CAKpD;AAED,oIAAoI;AACpI,MAAM,MAAM,iBAAiB,GACzB;IAAE,IAAI,EAAE,QAAQ,CAAC;IAAC,EAAE,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,WAAW,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,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE;AAC/D,iFAAiF;GAC/E;IAAE,IAAI,EAAE,OAAO,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAAC;AAEvC,oEAAoE;AACpE,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,mBAAmB,GAAG,MAAM,CAWnE;AAED,MAAM,WAAW,mBAAoB,SAAQ,oBAAoB;IAC/D,4CAA4C;IAC5C,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,wKAAwK;IACxK,OAAO,CAAC,EAAE,CAAC,MAAM,EAAE,iBAAiB,EAAE,KAAK,IAAI,CAAC;IAChD;;;OAGG;IACH,WAAW,CAAC,EAAE,SAAS,gBAAgB,EAAE,CAAC;IAC1C,gGAAgG;IAChG,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,gFAAgF;IAChF,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,mBAAmB,KAAK,IAAI,CAAC;CACtD;AAED;;;;;;;;;;;;GAYG;AACH,wBAAsB,kBAAkB,CAAC,IAAI,EAAE,mBAAmB,GAAG,OAAO,CAAC,IAAI,CAAC,CAqFjF;AAED,wiBAAwiB;AACxiB,wBAAgB,eAAe,CAAC,KAAK,EAAE,iBAAiB,GAAG,MAAM,CAkBhE"}
|
package/dist/op/runtime.d.ts
CHANGED
|
@@ -160,6 +160,15 @@ export interface OpRunStartOptions {
|
|
|
160
160
|
progress?: (record: StepRecord) => void;
|
|
161
161
|
/** Aborts in-flight work (Ctrl-C). */
|
|
162
162
|
signal?: AbortSignal;
|
|
163
|
+
/**
|
|
164
|
+
* For an Op that declares `workLease` (#2748): the work item this run is
|
|
165
|
+
* for (`--work <id>`) and who holds its lease (`--holder`). Only the local
|
|
166
|
+
* runtime takes it; a hosted run's lease is taken where the run executes.
|
|
167
|
+
*/
|
|
168
|
+
work?: {
|
|
169
|
+
item?: string;
|
|
170
|
+
holder?: string;
|
|
171
|
+
};
|
|
163
172
|
}
|
|
164
173
|
/**
|
|
165
174
|
* The contract a runtime implements to host Op runs.
|
package/dist/op/runtime.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runtime.d.ts","sourceRoot":"","sources":["../../src/op/runtime.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AACxC,OAAO,KAAK,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAChE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AACrE,OAAO,KAAK,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAE3F;;;;;;;;GAQG;AACH,MAAM,MAAM,UAAU,GAAG,SAAS,GAAG,WAAW,GAAG,QAAQ,GAAG,OAAO,GAAG,WAAW,CAAC;AAEpF,wEAAwE;AACxE,wBAAgB,UAAU,CAAC,MAAM,EAAE,WAAW,CAAC,QAAQ,CAAC,GAAG,UAAU,CAEpE;AAED,gHAAgH;AAChH,MAAM,WAAW,eAAe;IAC9B,sEAAsE;IACtE,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,UAAU,CAAC,QAAQ,CAAC,CAAC;IAC7B,UAAU,EAAE,MAAM,CAAC;IACnB,mEAAmE;IACnE,OAAO,CAAC,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,OAAO,CAAA;KAAE,CAAC;IAC3C,8EAA8E;IAC9E,QAAQ,CAAC,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,UAAU,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,MAAM,CAAC;QAAC,GAAG,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IACjF,iDAAiD;IACjD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,kHAAkH;IAClH,OAAO,CAAC,EAAE,MAAM,CAAC;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EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,UAAU,EAAE,oBAAoB,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAExF;;;OAGG;IACH,aAAa,CAAC,CACZ,WAAW,EAAE,MAAM,EACnB,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,oBAAoB,GAC5B,OAAO,CAAC,mBAAmB,CAAC,CAAC;CACjC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"local.d.ts","sourceRoot":"","sources":["../../../src/op/runtimes/local.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAUH,OAAO,EAML,KAAK,iBAAiB,EACvB,MAAM,YAAY,CAAC;AAwCpB;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,GAAE;IAAE,WAAW,CAAC,EAAE,MAAM,CAAA;CAAO,GAAG,iBAAiB,
|
|
1
|
+
{"version":3,"file":"local.d.ts","sourceRoot":"","sources":["../../../src/op/runtimes/local.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAUH,OAAO,EAML,KAAK,iBAAiB,EACvB,MAAM,YAAY,CAAC;AAwCpB;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,GAAE;IAAE,WAAW,CAAC,EAAE,MAAM,CAAA;CAAO,GAAG,iBAAiB,CAkJ3F"}
|
|
@@ -186,7 +186,7 @@ export declare function collectStepOutputRefs(value: unknown): StepOutputRef[];
|
|
|
186
186
|
* (a later phase, a later step in the same phase, itself, or a step in
|
|
187
187
|
* the same parallel phase).
|
|
188
188
|
*/
|
|
189
|
-
export declare function validateStepOutputRefScope(config: Pick<OpConfig, "name" | "phases" | "onFailure">): ActivityContractIssue[];
|
|
189
|
+
export declare function validateStepOutputRefScope(config: Pick<OpConfig, "name" | "phases" | "onFailure"> & Partial<Pick<OpConfig, "workLease">>): ActivityContractIssue[];
|
|
190
190
|
/**
|
|
191
191
|
* Validate every step-output reference in an Op's main phases against a
|
|
192
192
|
* contract map and the Op's own step ordering. Scope: `config.phases` only
|
|
@@ -201,6 +201,6 @@ export declare function validateStepOutputRefScope(config: Pick<OpConfig, "name"
|
|
|
201
201
|
* - a `path` that does not resolve on the producer's declared return
|
|
202
202
|
* schema (an empty `path` — the whole return value — is always valid).
|
|
203
203
|
*/
|
|
204
|
-
export declare function validateStepOutputRefs(config: Pick<OpConfig, "name" | "phases" | "onFailure"
|
|
204
|
+
export declare function validateStepOutputRefs(config: Pick<OpConfig, "name" | "phases" | "onFailure"> & Partial<Pick<OpConfig, "workLease">>, contracts: ReadonlyMap<string, ActivityContract>): ActivityContractIssue[];
|
|
205
205
|
export {};
|
|
206
206
|
//# sourceMappingURL=step-output-ref.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"step-output-ref.d.ts","sourceRoot":"","sources":["../../src/op/step-output-ref.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqFG;AAGH,OAAO,KAAK,EAAE,YAAY,EAAE,QAAQ,EAAmB,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"step-output-ref.d.ts","sourceRoot":"","sources":["../../src/op/step-output-ref.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqFG;AAGH,OAAO,KAAK,EAAE,YAAY,EAAE,QAAQ,EAAmB,MAAM,SAAS,CAAC;AAEvE,OAAO,EAAqD,KAAK,gBAAgB,EAAE,KAAK,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AAE3I,QAAA,MAAM,qBAAqB,eAAuC,CAAC;AAEnE;;;;;;GAMG;AACH,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,CAAC,qBAAqB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;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,0BAA0B,CACxC,MAAM,EAAE,IAAI,CAAC,QAAQ,EAAE,MAAM,GAAG,QAAQ,GAAG,WAAW,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,QAAQ,EAAE,WAAW,CAAC,CAAC,GAC7F,qBAAqB,EAAE,CAwEzB;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,sBAAsB,CACpC,MAAM,EAAE,IAAI,CAAC,QAAQ,EAAE,MAAM,GAAG,QAAQ,GAAG,WAAW,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,QAAQ,EAAE,WAAW,CAAC,CAAC,EAC9F,SAAS,EAAE,WAAW,CAAC,MAAM,EAAE,gBAAgB,CAAC,GAC/C,qBAAqB,EAAE,CA4EzB"}
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A steward's declaration (#2731): the one writer for an environment, as data
|
|
3
|
+
* core can read without any lexicon loaded.
|
|
4
|
+
*
|
|
5
|
+
* A steward runs a fixed list of Ops, each on its own `schedule` when it has
|
|
6
|
+
* one, one Op at a time. Where it runs is its form:
|
|
7
|
+
*
|
|
8
|
+
* - `fountain`: the fountain lexicon's `Steward` composite, an `acp` Agent on
|
|
9
|
+
* a persistent sandbox bound to a Teammate, with a Fountain `Schedule` per
|
|
10
|
+
* scheduled Op. A turn is one `chant run <op>` on the teammate's thread.
|
|
11
|
+
* - `local`: `chant operator --steward <name>` in the box itself, for a box
|
|
12
|
+
* with no Fountain behind it (a docker compose box, a Sprites box). The same
|
|
13
|
+
* Ops on the same crons, each run under its operator lease, and the steward
|
|
14
|
+
* itself under a lease of its own so a second local operator is refused.
|
|
15
|
+
*
|
|
16
|
+
* One declaration covers both. `form` is either one of the two, or a default
|
|
17
|
+
* with per-environment exceptions, so a box whose `minimal` environment has no
|
|
18
|
+
* Fountain and whose `fountain-k3d` one does still has exactly one steward:
|
|
19
|
+
*
|
|
20
|
+
* ```ts
|
|
21
|
+
* // ops/steward.op.ts
|
|
22
|
+
* export const steward = declareSteward({
|
|
23
|
+
* name: "box-steward",
|
|
24
|
+
* ops: [converge, dispatch, release, upgrade],
|
|
25
|
+
* form: { default: "local", environments: { "fountain-k3d": "fountain" } },
|
|
26
|
+
* });
|
|
27
|
+
* ```
|
|
28
|
+
*
|
|
29
|
+
* The fountain composite builds this same declaration from its own options and
|
|
30
|
+
* returns it as `declaration`, so a project that declares its steward there
|
|
31
|
+
* exports that object from an `*.op.ts` file instead of calling this function.
|
|
32
|
+
*
|
|
33
|
+
* ## Discovery
|
|
34
|
+
*
|
|
35
|
+
* A steward is discovered from the same `*.op.ts` files Ops are
|
|
36
|
+
* (`./discover.ts`), because it is chant's own run-time declaration and sits
|
|
37
|
+
* beside the Ops it runs. It is plain data with a `kind` marker, not a
|
|
38
|
+
* Declarable, so `chant build` never serializes it and a copy of core linked
|
|
39
|
+
* twice still recognises it.
|
|
40
|
+
*
|
|
41
|
+
* ## What a steward writes
|
|
42
|
+
*
|
|
43
|
+
* A steward's writes are chant writes: run, converge and gate records on the
|
|
44
|
+
* `chant/lifecycle` branch and lease refs under `refs/chant/lease/`, all made
|
|
45
|
+
* with git plumbing (`../lifecycle/git.ts`: `hash-object`, `mktree`,
|
|
46
|
+
* `commit-tree`, `update-ref`). None of them reads or writes the checkout's
|
|
47
|
+
* index or working tree, so a coding agent editing the app in the same
|
|
48
|
+
* checkout, and holding git's index lock while it commits, never collides with
|
|
49
|
+
* a steward turn. The app's files are the coding agent's; the steward does not
|
|
50
|
+
* edit them.
|
|
51
|
+
*
|
|
52
|
+
* An Op that has to change the checkout (applying a build, a workspace
|
|
53
|
+
* upgrade) says so with `changesCheckout` and runs under a work item's lease
|
|
54
|
+
* (`workLease`, #2748): its leased steps get a worktree of their own on
|
|
55
|
+
* `chant/work/<item>`. `declareSteward` refuses such an Op without the lease,
|
|
56
|
+
* and a scheduled Op whose lease leaves the item to the run.
|
|
57
|
+
*/
|
|
58
|
+
import type { OpConfig } from "./types.js";
|
|
59
|
+
/** The entity marker a steward declaration carries. */
|
|
60
|
+
export declare const STEWARD_KIND = "Chant::Steward";
|
|
61
|
+
/** Where a steward runs. */
|
|
62
|
+
export declare const STEWARD_FORMS: readonly ["local", "fountain"];
|
|
63
|
+
export type StewardForm = (typeof STEWARD_FORMS)[number];
|
|
64
|
+
/** The form a declaration asks for, as given: one form, or a default with per-environment exceptions. */
|
|
65
|
+
export type StewardFormSpec = StewardForm | {
|
|
66
|
+
default: StewardForm;
|
|
67
|
+
environments?: Record<string, StewardForm>;
|
|
68
|
+
};
|
|
69
|
+
/** The environment a form is chosen for when none is named: the same default a run ledger uses. */
|
|
70
|
+
export declare const DEFAULT_STEWARD_ENV = "local";
|
|
71
|
+
/** Names a steward's lease ref and a ledger path can hold. */
|
|
72
|
+
export declare const STEWARD_NAME_PATTERN: RegExp;
|
|
73
|
+
/**
|
|
74
|
+
* An Op a steward runs, however the project holds it: the `Op()` declaration
|
|
75
|
+
* (config behind `.props`), or the bare config.
|
|
76
|
+
*/
|
|
77
|
+
export type StewardOpInput = OpConfig | {
|
|
78
|
+
props: unknown;
|
|
79
|
+
};
|
|
80
|
+
export interface StewardDeclarationConfig {
|
|
81
|
+
/** The steward's name. On Fountain, the Agent's and the Teammate's. */
|
|
82
|
+
name: string;
|
|
83
|
+
/** The Ops it runs. A scheduled one runs on its cron; any other runs when asked. */
|
|
84
|
+
ops: StewardOpInput[];
|
|
85
|
+
/** Where it runs. Default `local`. */
|
|
86
|
+
form?: StewardFormSpec;
|
|
87
|
+
/**
|
|
88
|
+
* The box capabilities its Ops reach through the box's broker (#2726), by
|
|
89
|
+
* the names the member's `box` block in the workspace declaration gives
|
|
90
|
+
* them, such as `fountain` or `inference`. A steward that names any holds no
|
|
91
|
+
* credential of its own, so it takes no `vault`.
|
|
92
|
+
*/
|
|
93
|
+
capabilities?: string[];
|
|
94
|
+
/** The vault the steward holds on Fountain, by name, for a steward that isn't behind a broker. */
|
|
95
|
+
vault?: string;
|
|
96
|
+
}
|
|
97
|
+
/** A steward's declaration, normalised. Plain data: see the module doc. */
|
|
98
|
+
export interface StewardDeclaration {
|
|
99
|
+
readonly kind: typeof STEWARD_KIND;
|
|
100
|
+
readonly name: string;
|
|
101
|
+
readonly ops: readonly OpConfig[];
|
|
102
|
+
readonly form: {
|
|
103
|
+
readonly default: StewardForm;
|
|
104
|
+
readonly environments: Readonly<Record<string, StewardForm>>;
|
|
105
|
+
};
|
|
106
|
+
/** Brokered box capabilities its Ops use (#2726). Empty when it names none. */
|
|
107
|
+
readonly capabilities: readonly string[];
|
|
108
|
+
/** The vault it holds, by name, or null. Never set together with `capabilities`. */
|
|
109
|
+
readonly vault: string | null;
|
|
110
|
+
}
|
|
111
|
+
/** The config inside an op, whether it arrived as a declaration or as itself. */
|
|
112
|
+
export declare function stewardOpConfig(op: StewardOpInput): OpConfig;
|
|
113
|
+
/** Normalise a form spec, refusing an unknown form or an environment name no ledger could hold. */
|
|
114
|
+
export declare function normaliseStewardForm(steward: string, spec: StewardFormSpec | undefined): StewardDeclaration["form"];
|
|
115
|
+
/**
|
|
116
|
+
* Declare a steward. Refuses what would make it more than one writer or a
|
|
117
|
+
* promise it can't keep: an Op listed twice, a schedule whose overlap isn't
|
|
118
|
+
* `skip` (a fire while a turn runs is dropped in both forms), a cron that
|
|
119
|
+
* doesn't parse, and a name a lease ref can't hold.
|
|
120
|
+
*/
|
|
121
|
+
export declare function declareSteward(config: StewardDeclarationConfig): StewardDeclaration;
|
|
122
|
+
/** Is this value a steward declaration? Duck-typed, like `isOpEntity`. */
|
|
123
|
+
export declare function isStewardDeclaration(value: unknown): value is StewardDeclaration;
|
|
124
|
+
/** The form a steward takes in `env` (`local` when none is named). */
|
|
125
|
+
export declare function stewardFormFor(steward: StewardDeclaration, env?: string): StewardForm;
|
|
126
|
+
/**
|
|
127
|
+
* The lease a local steward holds for as long as it runs, so a second
|
|
128
|
+
* `chant operator --steward` for the same steward is refused. It sits under
|
|
129
|
+
* `refs/chant/lease/_stewards/`, beside the per-Op leases, which a leading
|
|
130
|
+
* `_` keeps out of any Op's name.
|
|
131
|
+
*/
|
|
132
|
+
export declare function stewardLeaseName(steward: string): string;
|
|
133
|
+
/**
|
|
134
|
+
* Pick the steward `--steward [<name>]` names, or the project's only one.
|
|
135
|
+
* Returns the steward, or the message to refuse with.
|
|
136
|
+
*/
|
|
137
|
+
export declare function pickSteward(stewards: Map<string, {
|
|
138
|
+
declaration: StewardDeclaration;
|
|
139
|
+
}>, name: string): StewardDeclaration | string;
|
|
140
|
+
//# sourceMappingURL=steward.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"steward.d.ts","sourceRoot":"","sources":["../../src/op/steward.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwDG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAIxC,uDAAuD;AACvD,eAAO,MAAM,YAAY,mBAAmB,CAAC;AAE7C,4BAA4B;AAC5B,eAAO,MAAM,aAAa,gCAAiC,CAAC;AAC5D,MAAM,MAAM,WAAW,GAAG,CAAC,OAAO,aAAa,CAAC,CAAC,MAAM,CAAC,CAAC;AAEzD,yGAAyG;AACzG,MAAM,MAAM,eAAe,GAAG,WAAW,GAAG;IAAE,OAAO,EAAE,WAAW,CAAC;IAAC,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,CAAA;CAAE,CAAC;AAEjH,mGAAmG;AACnG,eAAO,MAAM,mBAAmB,UAAU,CAAC;AAE3C,8DAA8D;AAC9D,eAAO,MAAM,oBAAoB,QAAsC,CAAC;AAExE;;;GAGG;AACH,MAAM,MAAM,cAAc,GAAG,QAAQ,GAAG;IAAE,KAAK,EAAE,OAAO,CAAA;CAAE,CAAC;AAE3D,MAAM,WAAW,wBAAwB;IACvC,uEAAuE;IACvE,IAAI,EAAE,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AW,CAE1G;AAED;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAExD;AAED;;;GAGG;AACH,wBAAgB,WAAW,CACzB,QAAQ,EAAE,GAAG,CAAC,MAAM,EAAE;IAAE,WAAW,EAAE,kBAAkB,CAAA;CAAE,CAAC,EAC1D,IAAI,EAAE,MAAM,GACX,kBAAkB,GAAG,MAAM,CAU7B"}
|
package/dist/op/types.d.ts
CHANGED
|
@@ -40,6 +40,57 @@ export interface OpConfig {
|
|
|
40
40
|
* local one-shot executor ignores it.
|
|
41
41
|
*/
|
|
42
42
|
schedule?: OpSchedule;
|
|
43
|
+
/**
|
|
44
|
+
* The work item this Op runs under (#2748, ws-055). The executor claims the
|
|
45
|
+
* item's work lease (`../lifecycle/work-lease.ts`) before the steps that run
|
|
46
|
+
* under it, renews it as a heartbeat while they run, stops the run when the
|
|
47
|
+
* lease is lost, and gives it back when the run ends. See
|
|
48
|
+
* {@link OpWorkLease} and `./work-lease-run.ts`.
|
|
49
|
+
*/
|
|
50
|
+
workLease?: OpWorkLease;
|
|
51
|
+
/**
|
|
52
|
+
* The Op changes the checkout: it applies a build, or upgrades the
|
|
53
|
+
* workspace (#2748). Such an Op must declare {@link OpConfig.workLease}: the
|
|
54
|
+
* executor refuses to run it otherwise, and `declareSteward` refuses to list
|
|
55
|
+
* it. Its leased steps get a git worktree of their own, on the branch
|
|
56
|
+
* `chant/work/<item>`, so the change never lands in the working tree a
|
|
57
|
+
* coding agent is editing.
|
|
58
|
+
*/
|
|
59
|
+
changesCheckout?: boolean;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* The id under which a run's work lease is published to its steps (#2748):
|
|
63
|
+
* `stepOutput(WORK_LEASE_STEP_ID, "token")`, or `workLeaseOutput("token")`
|
|
64
|
+
* from `./work-lease-run.ts`. No step of an Op with a `workLease` may use it.
|
|
65
|
+
*/
|
|
66
|
+
export declare const WORK_LEASE_STEP_ID = "workLease";
|
|
67
|
+
/**
|
|
68
|
+
* Which work item an Op runs under, and how (#2748).
|
|
69
|
+
*
|
|
70
|
+
* `item` is an id, a list of candidate ids (the first one nobody holds is
|
|
71
|
+
* claimed, as chud's dispatcher took the first ready contract nobody held), a
|
|
72
|
+
* reference to an earlier step's output that resolves to either, or omitted,
|
|
73
|
+
* in which case the run names it (`chant run <op> --work <id>`). A literal or
|
|
74
|
+
* run-time item is claimed before the first step; a referenced one right
|
|
75
|
+
* after the step that produces it. A run that finds nothing to claim (the
|
|
76
|
+
* reference resolved to nothing, or every candidate is held) ends `ok` with
|
|
77
|
+
* the rest of its steps skipped, and the claim's record says why.
|
|
78
|
+
*/
|
|
79
|
+
export interface OpWorkLease {
|
|
80
|
+
item?: string | string[] | StepOutputRef;
|
|
81
|
+
/**
|
|
82
|
+
* The work kind file whose member owns the lease (#2524 D7), relative to
|
|
83
|
+
* the project directory. Omitted, the lease is in the project's own ledger.
|
|
84
|
+
*/
|
|
85
|
+
kind?: string;
|
|
86
|
+
/** How long a claim lasts unless renewed, as a duration ("10m"). Renewed every third of it. Default 10m. */
|
|
87
|
+
ttl?: string;
|
|
88
|
+
/**
|
|
89
|
+
* How the release records a run that ended `ok`: a reference to a step
|
|
90
|
+
* output holding a short string (`done`, `not_done`, ...). Default `done`;
|
|
91
|
+
* a failed run releases `not_done` and a gated one `gated`.
|
|
92
|
+
*/
|
|
93
|
+
outcome?: StepOutputRef;
|
|
43
94
|
}
|
|
44
95
|
/**
|
|
45
96
|
* An Op's cadence (#2120). The cron is validated at `Op()` construction by
|
package/dist/op/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/op/types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACxD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAC/D,OAA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
|
|
1
|
+
/**
|
|
2
|
+
* The rules an Op's `workLease` and `changesCheckout` declaration keeps
|
|
3
|
+
* (#2748), with no imports beyond the Op model, so `Op()` and
|
|
4
|
+
* `declareSteward` can check them without loading the lease machinery in
|
|
5
|
+
* `./work-lease-run.ts`.
|
|
6
|
+
*/
|
|
7
|
+
import { type OpConfig } from "./types.js";
|
|
8
|
+
/** A work item id a lease can be keyed by: the same pattern as `WORK_ITEM_ID_PATTERN` in `../lifecycle/work-lease.ts`. */
|
|
9
|
+
export declare const WORK_LEASE_ITEM_PATTERN: RegExp;
|
|
10
|
+
/**
|
|
11
|
+
* What is wrong with an Op's `workLease` and `changesCheckout`, or an empty
|
|
12
|
+
* list. The executor refuses to start a run with any of these, and
|
|
13
|
+
* `declareSteward` refuses to list the Op.
|
|
14
|
+
*/
|
|
15
|
+
export declare function workLeaseProblems(config: Pick<OpConfig, "name" | "phases" | "workLease" | "changesCheckout">): string[];
|
|
16
|
+
/** Whether a run of this Op has to be told its work item (`--work <id>`). */
|
|
17
|
+
export declare function workLeaseNeedsRunItem(config: Pick<OpConfig, "workLease">): boolean;
|
|
18
|
+
//# sourceMappingURL=work-lease-decl.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"work-lease-decl.d.ts","sourceRoot":"","sources":["../../src/op/work-lease-decl.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,OAAO,EAAsB,KAAK,QAAQ,EAAwB,MAAM,SAAS,CAAC;AAElF,0HAA0H;AAC1H,eAAO,MAAM,uBAAuB,QAAsC,CAAC;AAW3E;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,IAAI,CAAC,QAAQ,EAAE,MAAM,GAAG,QAAQ,GAAG,WAAW,GAAG,iBAAiB,CAAC,GAAG,MAAM,EAAE,CA6CvH;AAED,6EAA6E;AAC7E,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,IAAI,CAAC,QAAQ,EAAE,WAAW,CAAC,GAAG,OAAO,CAElF"}
|
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* An Op run under a work item's lease (#2748, the Steward's gap 4 in #2731).
|
|
3
|
+
*
|
|
4
|
+
* An Op that declares `workLease` (`./types.ts`) runs its steps under the work
|
|
5
|
+
* lease of one work item (`../lifecycle/work-lease.ts`, ws-055). The local
|
|
6
|
+
* executor (`./local-executor.ts`) drives the {@link RunWorkLease} here:
|
|
7
|
+
*
|
|
8
|
+
* - Claim. Before the first step when the item is a literal or named by the
|
|
9
|
+
* run (`chant run <op> --work <id>`); right after the producing step when
|
|
10
|
+
* the item is a reference to a step's output. A list of candidates is tried
|
|
11
|
+
* in order and the first one nobody holds is taken. When nothing can be
|
|
12
|
+
* claimed the run ends `ok` with its remaining steps skipped, and the claim's
|
|
13
|
+
* record carries the refusal, which names who holds the item.
|
|
14
|
+
* - Heartbeat. While the steps run, the lease is renewed every third of its
|
|
15
|
+
* time to live, keeping its fencing token. A renewal the lease refuses (it
|
|
16
|
+
* ran out and someone else claimed it, or it was released) means the lease
|
|
17
|
+
* is lost: the in-flight step's abort signal fires, no further step starts,
|
|
18
|
+
* and the run fails with `lease-lost`. A renewal that fails for any other
|
|
19
|
+
* reason (the remote didn't answer) is retried at the next beat; if that
|
|
20
|
+
* goes on past the expiry, the next renewal is refused and the lease is lost
|
|
21
|
+
* then. These are the semantics of chud's dispatcher
|
|
22
|
+
* (packages/runtime/src/dispatch.mjs), which this replaces.
|
|
23
|
+
* - Fence. Before the run's record is written, one last renewal checks that
|
|
24
|
+
* the lease is still this run's, with the same token. Refused, the run is
|
|
25
|
+
* recorded as failed with `lease-lost`, never as done.
|
|
26
|
+
* - Release. When the run ends, the lease is given back with the run's
|
|
27
|
+
* outcome (`done`, `not_done`, `gated`, or the Op's own `outcome`), which
|
|
28
|
+
* lands on `_leases/<id>.jsonl`. A lost lease is not released: it isn't
|
|
29
|
+
* this run's to give back.
|
|
30
|
+
*
|
|
31
|
+
* Steps read the lease through {@link workLeaseOutput}: its item, holder,
|
|
32
|
+
* token and expiry, and for an Op that changes the checkout, the worktree and
|
|
33
|
+
* branch it works in. An activity that writes somewhere a token can fence
|
|
34
|
+
* (another ledger, a remote) passes the token along.
|
|
35
|
+
*
|
|
36
|
+
* ## Changing the checkout
|
|
37
|
+
*
|
|
38
|
+
* An Op with `changesCheckout` (applying a build, `chant workspace upgrade`)
|
|
39
|
+
* must declare `workLease`, and its leased steps get a git worktree of their
|
|
40
|
+
* own: `chant/work/<item>` checked out under the repository's git directory,
|
|
41
|
+
* from the checkout's HEAD, or from the branch as an earlier run left it. The
|
|
42
|
+
* worktree is removed when the run ends and the branch keeps whatever the
|
|
43
|
+
* steps committed, for the runner to deliver. The checkout a coding agent is
|
|
44
|
+
* editing, its index and its uncommitted files, are never touched.
|
|
45
|
+
*/
|
|
46
|
+
import { type StepOutputRef } from "./step-output-ref.js";
|
|
47
|
+
import { type OpConfig } from "./types.js";
|
|
48
|
+
export { WORK_LEASE_STEP_ID } from "./types.js";
|
|
49
|
+
export { workLeaseProblems, workLeaseNeedsRunItem } from "./work-lease-decl.js";
|
|
50
|
+
/** Why a run under a work lease failed when the lease was lost: chud's reason, kept. */
|
|
51
|
+
export declare const LEASE_LOST = "lease-lost";
|
|
52
|
+
/** The branch prefix an Op that changes the checkout works on. */
|
|
53
|
+
export declare const WORK_BRANCH_PREFIX = "chant/work/";
|
|
54
|
+
/** What a run's steps read about its work lease, via {@link workLeaseOutput}. */
|
|
55
|
+
export interface WorkLeaseOutput {
|
|
56
|
+
item: string;
|
|
57
|
+
holder: string;
|
|
58
|
+
/** The fencing token: the same for the whole run unless the lease is lost. */
|
|
59
|
+
token: string;
|
|
60
|
+
acquiredAt: string;
|
|
61
|
+
expiresAt: string;
|
|
62
|
+
/** The lease ref. */
|
|
63
|
+
ref: string;
|
|
64
|
+
/** For an Op that changes the checkout: the worktree its steps work in. Otherwise null. */
|
|
65
|
+
worktree: string | null;
|
|
66
|
+
/** For an Op that changes the checkout: the worktree's branch. Otherwise null. */
|
|
67
|
+
branch: string | null;
|
|
68
|
+
}
|
|
69
|
+
/** How a run's work lease ended, on `OpRunResult.workLease`. */
|
|
70
|
+
export interface WorkLeaseRunResult {
|
|
71
|
+
/** The item claimed, or null when the run claimed nothing. */
|
|
72
|
+
item: string | null;
|
|
73
|
+
holder: string;
|
|
74
|
+
token: string | null;
|
|
75
|
+
/** The branch an Op that changes the checkout worked on, or null. */
|
|
76
|
+
branch: string | null;
|
|
77
|
+
/** Whether the lease was given back. False when it was lost, or never claimed. */
|
|
78
|
+
released: boolean;
|
|
79
|
+
/** The outcome the release recorded, or null when there was no release. */
|
|
80
|
+
outcome: string | null;
|
|
81
|
+
/** Why the lease was lost, or null when it wasn't. */
|
|
82
|
+
lost: string | null;
|
|
83
|
+
/** Why nothing was claimed, or null when something was. */
|
|
84
|
+
refusal: string | null;
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* A reference to the run's work lease, for a step's args:
|
|
88
|
+
* `workLeaseOutput("token")`, `workLeaseOutput("worktree")`, or the whole
|
|
89
|
+
* {@link WorkLeaseOutput} with no path.
|
|
90
|
+
*/
|
|
91
|
+
export declare function workLeaseOutput(path?: keyof WorkLeaseOutput): StepOutputRef;
|
|
92
|
+
/**
|
|
93
|
+
* The holder a steward's turn claims work leases as:
|
|
94
|
+
* `<steward>/<op>@<process>`. `chant workspace status --json` reads it back
|
|
95
|
+
* to show the lease a steward's current turn holds beside its Ops.
|
|
96
|
+
*/
|
|
97
|
+
export declare function stewardWorkHolder(steward: string, op: string, process?: string): string;
|
|
98
|
+
/** What a claim attempt came to, for the executor to record. */
|
|
99
|
+
export type WorkClaimOutcome = {
|
|
100
|
+
kind: "claimed";
|
|
101
|
+
lease: WorkLeaseOutput;
|
|
102
|
+
tried: string[];
|
|
103
|
+
}
|
|
104
|
+
/** Nothing to claim, or every candidate is held. `refusal` says which. */
|
|
105
|
+
| {
|
|
106
|
+
kind: "unclaimed";
|
|
107
|
+
refusal: string;
|
|
108
|
+
tried: string[];
|
|
109
|
+
};
|
|
110
|
+
export interface RunWorkLeaseOptions {
|
|
111
|
+
/** The project directory: where the run's ledger is, and what `workLease.kind` is relative to. */
|
|
112
|
+
cwd: string;
|
|
113
|
+
holder?: string;
|
|
114
|
+
/** The item the run names (`--work`), which takes the place of the Op's own. */
|
|
115
|
+
item?: string;
|
|
116
|
+
/** Called with a renewal's error that didn't lose the lease, which the next beat retries. */
|
|
117
|
+
onRenewError?: (message: string) => void;
|
|
118
|
+
}
|
|
119
|
+
/** One run's hold on one work item's lease. Created by the executor for an Op with `workLease`. */
|
|
120
|
+
export declare class RunWorkLease {
|
|
121
|
+
private readonly config;
|
|
122
|
+
private readonly opts;
|
|
123
|
+
readonly holder: string;
|
|
124
|
+
readonly ttlMs: number;
|
|
125
|
+
/** Aborts when the lease is lost, so the step in flight stops. */
|
|
126
|
+
readonly lostSignal: AbortSignal;
|
|
127
|
+
/** Set once the claim was made or given up on. */
|
|
128
|
+
attempted: boolean;
|
|
129
|
+
lease: WorkLeaseOutput | undefined;
|
|
130
|
+
refusal: string | undefined;
|
|
131
|
+
lost: string | undefined;
|
|
132
|
+
private readonly spec;
|
|
133
|
+
private readonly abort;
|
|
134
|
+
private timer;
|
|
135
|
+
private beat;
|
|
136
|
+
constructor(config: Pick<OpConfig, "name" | "workLease" | "changesCheckout">, opts: RunWorkLeaseOptions);
|
|
137
|
+
/** The directory whose ledger holds the lease: the kind file's, or the project's. */
|
|
138
|
+
private get ledgerCwd();
|
|
139
|
+
/** Whether the claim is due at a step boundary, given the results so far. */
|
|
140
|
+
due(resultsById: ReadonlyMap<string, unknown>): boolean;
|
|
141
|
+
/** The candidate ids, in order. Empty when the reference resolved to nothing. */
|
|
142
|
+
private candidates;
|
|
143
|
+
/**
|
|
144
|
+
* Claim the first candidate nobody holds. On a claim, the heartbeat starts,
|
|
145
|
+
* and for an Op that changes the checkout its worktree is made. Throws when
|
|
146
|
+
* the claim could not be made for a reason other than someone holding it
|
|
147
|
+
* (git failed): the run fails, as for any failing step.
|
|
148
|
+
*/
|
|
149
|
+
claim(resultsById: ReadonlyMap<string, unknown>): Promise<WorkClaimOutcome>;
|
|
150
|
+
/**
|
|
151
|
+
* A worktree for `id` on `chant/work/[<member>/]<id>`, under the git
|
|
152
|
+
* directory so the checkout's own `git status` never lists it. Starts from
|
|
153
|
+
* the branch when an earlier run left it, from HEAD otherwise.
|
|
154
|
+
*/
|
|
155
|
+
private makeWorktree;
|
|
156
|
+
private lose;
|
|
157
|
+
/** One renewal. Refused, the lease is lost; failed otherwise, the next beat retries. */
|
|
158
|
+
private renew;
|
|
159
|
+
private startHeartbeat;
|
|
160
|
+
private stopHeartbeat;
|
|
161
|
+
/**
|
|
162
|
+
* The last renewal before the run's record is written, after the heartbeat
|
|
163
|
+
* stops. Returns whether the lease is still this run's.
|
|
164
|
+
*/
|
|
165
|
+
fence(): Promise<boolean>;
|
|
166
|
+
/**
|
|
167
|
+
* End the run's hold: stop the heartbeat, remove the worktree (the branch
|
|
168
|
+
* keeps what was committed), and give the lease back with the outcome
|
|
169
|
+
* unless it was lost.
|
|
170
|
+
*/
|
|
171
|
+
finish(status: "ok" | "fail" | "gated", resultsById: ReadonlyMap<string, unknown>): Promise<WorkLeaseRunResult>;
|
|
172
|
+
}
|
|
173
|
+
//# sourceMappingURL=work-lease-run.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"work-lease-run.d.ts","sourceRoot":"","sources":["../../src/op/work-lease-run.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4CG;AAiBH,OAAO,EAA+B,KAAK,aAAa,EAAE,MAAM,mBAAmB,CAAC;AACpF,OAAO,EAAsB,KAAK,QAAQ,EAAE,MAAM,SAAS,CAAC;AAE5D,OAAO,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAC7C,OAAO,EAAE,iBAAiB,EAAE,qB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,WAAW,EAAE,WAAW,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,OAAO;IAOvD,iFAAiF;IACjF,OAAO,CAAC,UAAU;IAclB;;;;;OAKG;IACG,KAAK,CAAC,WAAW,EAAE,WAAW,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,OAAO,CAAC,gBAAgB,CAAC;IAwCjF;;;;OAIG;YACW,YAAY;IAqB1B,OAAO,CAAC,IAAI;IAOZ,wFAAwF;YAC1E,KAAK;IAyBnB,OAAO,CAAC,cAAc;IAWtB,OAAO,CAAC,aAAa;IAKrB;;;OAGG;IACG,KAAK,IAAI,OAAO,CAAC,OAAO,CAAC;IAgB/B;;;;OAIG;IACG,MAAM,CAAC,MAAM,EAAE,IAAI,GAAG,MAAM,GAAG,OAAO,EAAE,WAAW,EAAE,WAAW,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,OAAO,CAAC,kBAAkB,CAAC;CAkCtH"}
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Box isolation (#2727): the ports, state paths and cookie names each box
|
|
3
|
+
* uses, derived from its identity and its host, never chosen by a runtime.
|
|
4
|
+
*
|
|
5
|
+
* A box is a member with a `box` block (#2726), and its name is the
|
|
6
|
+
* member's. A box's identity is its host, its name and its slot, from the
|
|
7
|
+
* block's `host` and `slot`. Everything else
|
|
8
|
+
* follows from those and the host's declaration, and nothing else goes in:
|
|
9
|
+
*
|
|
10
|
+
* - port `p` is `host.ports.from + slot * host.ports.perBox + offset(p)`;
|
|
11
|
+
* - the state directory is `<host.stateRoot>/<box name>`, and state entry
|
|
12
|
+
* `k` is that directory joined with the entry's relative path;
|
|
13
|
+
* - cookie `c` is `<c>_<box name>`.
|
|
14
|
+
*
|
|
15
|
+
* So the same declaration gives the same values on every machine and every
|
|
16
|
+
* run, and adding or removing a box changes no other box's values. The state
|
|
17
|
+
* paths keep their environment reference (`${XDG_STATE_HOME}` by default):
|
|
18
|
+
* the runtime that sets them expands it on its machine, and chant never
|
|
19
|
+
* reads the machine.
|
|
20
|
+
*
|
|
21
|
+
* Distinct names on one host give distinct state paths and cookie names by
|
|
22
|
+
* construction (a member name has no `_`, so `<c>_<box>` splits one way).
|
|
23
|
+
* Ports are the only value two boxes can share: two boxes on one host with
|
|
24
|
+
* the same slot, or two ports in one box at the same offset. `chant
|
|
25
|
+
* workspace check` compares every value anyway (WSP123), so an entry whose
|
|
26
|
+
* path escapes its directory is caught too.
|
|
27
|
+
*/
|
|
28
|
+
import { type BoxIsolationDeclaration, type Declaration, type Host, type Member } from "./declaration.js";
|
|
29
|
+
/** A box's isolation, resolved: what `chant workspace status --json` prints in the member's box block. */
|
|
30
|
+
export interface ResolvedIsolation {
|
|
31
|
+
host: string;
|
|
32
|
+
slot: number;
|
|
33
|
+
/** The box's block of its host's range, inclusive. */
|
|
34
|
+
portRange: {
|
|
35
|
+
from: number;
|
|
36
|
+
to: number;
|
|
37
|
+
};
|
|
38
|
+
/** Each declared port's number, in file order. */
|
|
39
|
+
ports: Record<string, number>;
|
|
40
|
+
/** `<stateRoot>/<box name>`, with the environment reference unexpanded. */
|
|
41
|
+
stateDir: string;
|
|
42
|
+
/** Each declared state entry's path, under `stateDir`. */
|
|
43
|
+
state: Record<string, string>;
|
|
44
|
+
/** Each declared cookie's name for this box. */
|
|
45
|
+
cookies: Record<string, string>;
|
|
46
|
+
}
|
|
47
|
+
/** The host's state root as written, or the default. */
|
|
48
|
+
export declare function stateRootOf(host: Host): string;
|
|
49
|
+
/** Resolve the isolation of the box named `name` on its host. */
|
|
50
|
+
export declare function resolveIsolation(name: string, box: BoxIsolationDeclaration, host: Host): ResolvedIsolation;
|
|
51
|
+
/** A member whose box block declares its isolation, with it resolved. */
|
|
52
|
+
export interface IsolatedBox {
|
|
53
|
+
member: Member;
|
|
54
|
+
isolation: ResolvedIsolation;
|
|
55
|
+
}
|
|
56
|
+
/** Every box that declares its isolation, resolved, in member order. The declaration read already checked each box's host exists. */
|
|
57
|
+
export declare function resolveBoxes(declaration: Declaration): IsolatedBox[];
|
|
58
|
+
/**
|
|
59
|
+
* Why a host's `stateRoot` is a literal machine path, or undefined when it is
|
|
60
|
+
* not. A state root starts with an environment reference the runtime expands,
|
|
61
|
+
* and that reference is not `$HOME`: a path under a home directory names one
|
|
62
|
+
* person's machine layout (`${HOME}/<user>/...`), where `${XDG_STATE_HOME}`
|
|
63
|
+
* names the place the machine keeps state.
|
|
64
|
+
*/
|
|
65
|
+
export declare function stateRootLiteral(root: string): string | undefined;
|
|
66
|
+
/**
|
|
67
|
+
* Why a state entry's path is not one relative to the box's state directory,
|
|
68
|
+
* or undefined when it is: absolute, home-relative, starting with an
|
|
69
|
+
* environment reference, a Windows drive path, or with a `..` segment.
|
|
70
|
+
*/
|
|
71
|
+
export declare function statePathLiteral(path: string): string | undefined;
|
|
72
|
+
export interface BoxLiteral {
|
|
73
|
+
/** The box, or null for a host's state root. */
|
|
74
|
+
box: string | null;
|
|
75
|
+
message: string;
|
|
76
|
+
pointer: string;
|
|
77
|
+
}
|
|
78
|
+
/** Every literal machine path in the hosts and boxes. */
|
|
79
|
+
export declare function boxLiterals(declaration: Declaration): BoxLiteral[];
|
|
80
|
+
export interface BoxCollision {
|
|
81
|
+
host: string;
|
|
82
|
+
what: "port" | "state" | "cookie";
|
|
83
|
+
/** The shared value. */
|
|
84
|
+
value: string;
|
|
85
|
+
/** Each holder as `<box>.<name>`, in declaration order. */
|
|
86
|
+
holders: {
|
|
87
|
+
box: string;
|
|
88
|
+
name: string;
|
|
89
|
+
pointer: string;
|
|
90
|
+
}[];
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* Every value two holders on one host resolve to. Ports collide within a box
|
|
94
|
+
* too, since two listeners can't share a port; state entries in one box may
|
|
95
|
+
* name one file on purpose (a runtime and the door both reading hud's
|
|
96
|
+
* identity), and cookies are unique in a box by the schema.
|
|
97
|
+
*/
|
|
98
|
+
export declare function boxCollisions(declaration: Declaration): BoxCollision[];
|
|
99
|
+
//# sourceMappingURL=box-isolation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"box-isolation.d.ts","sourceRoot":"","sources":["../../src/workspace/box-isolation.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH,OAAO,EAAsB,KAAK,uBAAuB,EAAE,KAAK,WAAW,EAAE,KAAK,IAAI,EAAE,KAAK,MAAM,EAAE,MAAM,eAAe,CAAC;AAG3H,0GAA0G;AAC1G,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,sDAAsD;IACtD,SAAS,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,EAAE,EAAE,MAAM,CAAA;KAAE,CAAC;IACxC,kDAAkD;IAClD,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC9B,2EAA2E;IAC3E,QAAQ,EAAE,MAAM,CAAC;IACjB,0DAA0D;IAC1D,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC9B,gDAAgD;IAChD,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACjC;AAED,wDAAwD;AACxD,wBAAgB,WAAW,CAAC,IAAI,EAAE,IAAI,GAAG,MAAM,CAE9C;AAID,iEAAiE;AACjE,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,uBAAuB,EAAE,IAAI,EAAE,IAAI,GAAG,iBAAiB,CAY1G;AAED,yEAAyE;AACzE,MAAM,WAAW,WAAW;IAC1B,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,iBAAiB,CAAC;CAC9B;AAED,qIAAqI;AACrI,wBAAgB,YAAY,CAAC,WAAW,EAAE,WAAW,GAAG,WAAW,EAAE,CAQpE;AAOD;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAKjE;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAOjE;AAED,MAAM,WAAW,UAAU;IACzB,gDAAgD;IAChD,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,yDAAyD;AACzD,wBAAgB,WAAW,CAAC,WAAW,EAAE,WAAW,GAAG,UAAU,EAAE,CAoBlE;AAID,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,GAAG,OAAO,GAAG,QAAQ,CAAC;IAClC,wBAAwB;IACxB,KAAK,EAAE,MAAM,CAAC;IACd,2DAA2D;IAC3D,OAAO,EAAE;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;CAC3D;AAaD;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,WAAW,EAAE,WAAW,GAAG,YAAY,EAAE,CA2BtE"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The box isolation checks, WSP123 and WSP124 (#2727).
|
|
3
|
+
*
|
|
4
|
+
* | Id | Code | Fails when |
|
|
5
|
+
* |---|---|---|
|
|
6
|
+
* | WSP123 | `box-isolation-collision` | two boxes on one host, or two ports in one box, resolve to the same port, state path or cookie name |
|
|
7
|
+
* | WSP124 | `box-isolation-literal` | a host's state root or a box's state entry is a literal machine path |
|
|
8
|
+
*
|
|
9
|
+
* Both are fixed errors. A collision means one box signs another's people out
|
|
10
|
+
* or reads another's identity (arugula-salad/studio#39), and a literal path
|
|
11
|
+
* means the declaration only holds on one machine. Neither has a case where
|
|
12
|
+
* turning the check down is the fix.
|
|
13
|
+
*/
|
|
14
|
+
import type { WorkspaceCheck } from "../checks.js";
|
|
15
|
+
export declare const WSP_BOX_COLLISION = "WSP123";
|
|
16
|
+
export declare const WSP_BOX_LITERAL = "WSP124";
|
|
17
|
+
export declare const BOX_ISOLATION_CHECKS: readonly WorkspaceCheck[];
|
|
18
|
+
//# sourceMappingURL=box-isolation.d.ts.map
|