@intentius/chant 0.124.108 → 0.124.110
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/__golden__/wave-loop/fan-out-applied.json +12 -6
- package/dist/__golden__/wave-loop/fan-out-apply-fails.json +8 -4
- package/dist/__golden__/wave-loop/fan-out-gated.json +4 -2
- package/dist/__golden__/wave-loop/fan-out-no-members.json +16 -8
- package/dist/__golden__/wave-loop/fan-out-plan-fails.json +8 -4
- package/dist/__golden__/wave-loop/fan-out-same-root.json +4 -2
- package/dist/agent-facts.d.ts +130 -0
- package/dist/agent-facts.js +196 -0
- package/dist/change-risk.d.ts +216 -0
- package/dist/change-risk.js +304 -0
- package/dist/change-set.d.ts +8 -0
- package/dist/ci-agent-alert.d.ts +139 -0
- package/dist/ci-agent-alert.js +342 -0
- package/dist/ci-agent-triggers.d.ts +152 -0
- package/dist/ci-agent-triggers.js +232 -0
- package/dist/ci-agent-verify-failed.d.ts +149 -0
- package/dist/ci-agent-verify-failed.js +191 -0
- package/dist/ci-agent.d.ts +136 -8
- package/dist/ci-agent.js +353 -26
- package/dist/ci-comment-commands.d.ts +8 -0
- package/dist/ci-comment-commands.js +17 -1
- package/dist/ci-comment-reject.d.ts +70 -0
- package/dist/ci-comment-reject.js +135 -0
- package/dist/ci-comment-replies.d.ts +3 -1
- package/dist/ci-comment-replies.js +6 -0
- package/dist/ci-estate/delivery.d.ts +25 -3
- package/dist/ci-estate/delivery.js +28 -9
- package/dist/ci-estate/page.d.ts +7 -3
- package/dist/ci-estate/page.js +19 -4
- package/dist/ci-estate/rows.d.ts +14 -2
- package/dist/ci-estate/rows.js +9 -1
- package/dist/ci-estate.d.ts +5 -2
- package/dist/ci-estate.js +3 -2
- package/dist/ci-handover.d.ts +2 -7
- package/dist/ci-handover.js +3 -20
- package/dist/ci-jobs.d.ts +6 -0
- package/dist/ci-jobs.js +17 -0
- package/dist/ci-note-commands.d.ts +2 -0
- package/dist/ci-note-commands.js +12 -1
- package/dist/ci-product-words.d.ts +151 -1
- package/dist/ci-product-words.js +1390 -3
- package/dist/ci-product.d.ts +100 -4
- package/dist/ci-product.js +99 -3
- package/dist/ci-respond-run.d.ts +9 -0
- package/dist/ci-respond-run.js +35 -4
- package/dist/ci-respond-summary-env.d.ts +56 -0
- package/dist/ci-respond-summary-env.js +81 -0
- package/dist/ci-respond-summary.d.ts +103 -0
- package/dist/ci-respond-summary.js +243 -0
- package/dist/ci-respond.d.ts +4 -2
- package/dist/ci-respond.js +4 -2
- package/dist/cli/command-group.js +1 -1
- package/dist/cli/commands/lint.js +21 -3
- package/dist/cli/handlers/agent.js +49 -4
- package/dist/cli/handlers/approve.js +3 -1
- package/dist/cli/handlers/build.d.ts +97 -1
- package/dist/cli/handlers/build.js +251 -3
- package/dist/cli/handlers/fan-out.js +55 -0
- package/dist/cli/handlers/graph.d.ts +14 -0
- package/dist/cli/handlers/graph.js +58 -3
- package/dist/cli/handlers/lifecycle-health.d.ts +7 -0
- package/dist/cli/handlers/lifecycle-health.js +47 -9
- package/dist/cli/handlers/lifecycle.js +4 -1
- package/dist/cli/handlers/notify-relay.d.ts +2 -2
- package/dist/cli/handlers/notify-relay.js +67 -7
- package/dist/cli/handlers/pipeline-agent.d.ts +30 -0
- package/dist/cli/handlers/pipeline-agent.js +255 -0
- package/dist/cli/handlers/pipeline-artifacts.d.ts +39 -0
- package/dist/cli/handlers/pipeline-artifacts.js +203 -0
- package/dist/cli/handlers/pipeline.d.ts +16 -0
- package/dist/cli/handlers/pipeline.js +112 -0
- package/dist/cli/handlers/pr-comment.js +4 -0
- package/dist/cli/handlers/pr-notes.js +4 -1
- package/dist/cli/handlers/pr.d.ts +20 -0
- package/dist/cli/handlers/pr.js +114 -11
- package/dist/cli/handlers/promote.js +792 -47
- package/dist/cli/handlers/reject.d.ts +84 -0
- package/dist/cli/handlers/reject.js +216 -0
- package/dist/cli/handlers/release.js +4 -2
- package/dist/cli/handlers/replan.d.ts +54 -0
- package/dist/cli/handlers/replan.js +177 -0
- package/dist/cli/handlers/run-generate.d.ts +5 -0
- package/dist/cli/handlers/run-generate.js +31 -4
- package/dist/cli/handlers/run-wave.js +15 -2
- package/dist/cli/handlers/run.js +4 -2
- package/dist/cli/handlers/stage.d.ts +35 -0
- package/dist/cli/handlers/stage.js +90 -0
- package/dist/cli/lsp/server.js +4 -0
- package/dist/cli/main.js +88 -8
- package/dist/cli/parse-args.js +35 -2
- package/dist/cli/registry.d.ts +12 -0
- package/dist/components/auto-release.d.ts +2 -0
- package/dist/components/auto-release.js +1 -0
- package/dist/components/capability.d.ts +40 -0
- package/dist/components/cli-support.d.ts +21 -1
- package/dist/components/cli-support.js +28 -6
- package/dist/components/component.d.ts +23 -4
- package/dist/components/component.schema.json +28 -0
- package/dist/components/declared-reads.d.ts +44 -4
- package/dist/components/declared-reads.js +80 -3
- package/dist/components/discover.d.ts +8 -0
- package/dist/components/discover.js +1 -1
- package/dist/components/driver.d.ts +13 -0
- package/dist/components/driver.js +23 -2
- package/dist/components/environment-sets.d.ts +229 -0
- package/dist/components/environment-sets.js +338 -0
- package/dist/components/fan-out-canary.d.ts +47 -0
- package/dist/components/fan-out-canary.js +58 -0
- package/dist/components/fan-out-run.d.ts +17 -0
- package/dist/components/fan-out-run.js +14 -1
- package/dist/components/fan-out-support.d.ts +7 -0
- package/dist/components/fan-out-support.js +1 -1
- package/dist/components/groups.d.ts +8 -1
- package/dist/components/groups.js +19 -1
- package/dist/components/index.d.ts +5 -2
- package/dist/components/index.js +4 -1
- package/dist/components/pr-cost.d.ts +28 -0
- package/dist/components/pr-cost.js +53 -0
- package/dist/components/pr-pipeline.d.ts +33 -0
- package/dist/components/pr-pipeline.js +32 -5
- package/dist/components/pr-policy.d.ts +33 -2
- package/dist/components/pr-policy.js +5 -2
- package/dist/components/pr-risk.d.ts +42 -0
- package/dist/components/pr-risk.js +74 -0
- package/dist/components/product-pipeline.d.ts +43 -0
- package/dist/components/product-pipeline.js +67 -1
- package/dist/components/promote.d.ts +6 -0
- package/dist/components/promote.js +13 -0
- package/dist/components/release-compile.js +3 -1
- package/dist/components/release-gate.d.ts +6 -1
- package/dist/components/release-gate.js +10 -2
- package/dist/components/step-environments.d.ts +236 -0
- package/dist/components/step-environments.js +392 -0
- package/dist/components/upstream-replan.d.ts +201 -0
- package/dist/components/upstream-replan.js +249 -0
- package/dist/components/verify-step.d.ts +30 -0
- package/dist/components/verify-step.js +27 -0
- package/dist/components/wave-plan.js +6 -2
- package/dist/config-environments.d.ts +4 -2
- package/dist/control/dispatch.d.ts +15 -0
- package/dist/control/dispatch.js +28 -4
- package/dist/cost-estimate.d.ts +188 -0
- package/dist/cost-estimate.js +363 -0
- package/dist/drift-record.d.ts +36 -0
- package/dist/drift-record.js +44 -0
- package/dist/engine-facts.d.ts +105 -0
- package/dist/engine-facts.js +111 -0
- package/dist/exit-codes.d.ts +4 -3
- package/dist/exit-codes.js +4 -3
- package/dist/flag-params.d.ts +2 -2
- package/dist/flag-params.js +9 -4
- package/dist/floor-table.data.js +53 -0
- package/dist/forge-token-vars.d.ts +12 -0
- package/dist/forge-token-vars.js +25 -0
- package/dist/gate-decision.d.ts +3 -1
- package/dist/gate-decision.js +3 -1
- package/dist/gated-waves.d.ts +2 -0
- package/dist/gated-waves.js +1 -0
- package/dist/graph-ir.d.ts +30 -0
- package/dist/graph-ir.js +33 -1
- package/dist/graph-refs.d.ts +26 -0
- package/dist/graph-refs.js +34 -3
- package/dist/graph-schema/graph.schema.json +136 -0
- package/dist/health.d.ts +65 -0
- package/dist/health.js +62 -0
- package/dist/lexicon.d.ts +188 -1
- package/dist/lifecycle/disruption.d.ts +14 -1
- package/dist/lifecycle/disruption.js +5 -1
- package/dist/lifecycle/gate-change-set.d.ts +8 -0
- package/dist/lifecycle/gate-change-set.js +2 -1
- package/dist/lifecycle/gate-ledger.d.ts +26 -0
- package/dist/lifecycle/gate-rejection.d.ts +82 -0
- package/dist/lifecycle/gate-rejection.js +93 -0
- package/dist/lifecycle/gate-seal.d.ts +3 -3
- package/dist/lifecycle/gate-seal.js +5 -5
- package/dist/lifecycle/observe.d.ts +17 -0
- package/dist/lifecycle/observe.js +10 -1
- package/dist/lifecycle/release-cut.js +4 -0
- package/dist/lifecycle/release-ledger.d.ts +8 -0
- package/dist/lifecycle/release-risk.d.ts +137 -0
- package/dist/lifecycle/release-risk.js +214 -0
- package/dist/lifecycle/release-store.d.ts +9 -0
- package/dist/lifecycle/release-store.js +4 -0
- package/dist/lifecycle/stage-log.d.ts +85 -0
- package/dist/lifecycle/stage-log.js +141 -0
- package/dist/lint/canary-checks.d.ts +31 -0
- package/dist/lint/canary-checks.js +45 -0
- package/dist/lint/rule.d.ts +1 -0
- package/dist/lint/rules/evl012-pipeline-fold.d.ts +14 -0
- package/dist/lint/rules/evl012-pipeline-fold.js +30 -0
- package/dist/lint/rules/index.d.ts +1 -0
- package/dist/lint/rules/index.js +3 -0
- package/dist/notify-relay-repo.d.ts +54 -0
- package/dist/notify-relay-repo.js +84 -0
- package/dist/notify-relay.d.ts +53 -3
- package/dist/notify-relay.js +96 -3
- package/dist/notify.d.ts +57 -1
- package/dist/notify.js +7 -1
- package/dist/notify.schema.json +61 -3
- package/dist/observation.d.ts +34 -0
- package/dist/observation.js +14 -1
- package/dist/op/activities/review-agent.d.ts +39 -2
- package/dist/op/activities/review-agent.js +88 -5
- package/dist/op/agent-permit.d.ts +88 -0
- package/dist/op/agent-permit.js +97 -0
- package/dist/op/gate-approval-base.d.ts +8 -0
- package/dist/op/gate-approval-base.js +9 -0
- package/dist/op/gate-approval.d.ts +30 -1
- package/dist/op/gate-approval.js +23 -2
- package/dist/op/gate-quorum.d.ts +114 -8
- package/dist/op/gate-quorum.js +198 -21
- package/dist/op/gate-reject.d.ts +79 -0
- package/dist/op/gate-reject.js +96 -0
- package/dist/op/gate-summary.js +1 -1
- package/dist/op/gate.d.ts +28 -3
- package/dist/op/gate.js +55 -13
- package/dist/op/generate-pipeline.d.ts +15 -1
- package/dist/op/generate-pipeline.js +32 -5
- package/dist/op/index.d.ts +11 -6
- package/dist/op/index.js +10 -5
- package/dist/op/local-executor.d.ts +2 -0
- package/dist/op/local-executor.js +23 -4
- package/dist/op/op-waves-after-plan.d.ts +23 -0
- package/dist/op/op-waves-after-plan.js +12 -1
- package/dist/op/op-waves-capability-spec.d.ts +14 -0
- package/dist/op/op-waves-capability-spec.js +46 -6
- package/dist/op/op-waves-capability.d.ts +21 -13
- package/dist/op/op-waves-capability.js +22 -59
- package/dist/op/op-waves-environment-sets.d.ts +41 -0
- package/dist/op/op-waves-environment-sets.js +82 -0
- package/dist/op/op-waves-quorum-warnings.d.ts +53 -0
- package/dist/op/op-waves-quorum-warnings.js +90 -0
- package/dist/op/op-waves-release-port.d.ts +7 -0
- package/dist/op/op-waves-release-port.js +15 -3
- package/dist/op/op-waves-release.d.ts +15 -0
- package/dist/op/op-waves-release.js +15 -0
- package/dist/op/op-waves-run.d.ts +37 -3
- package/dist/op/op-waves-run.js +141 -18
- package/dist/op/op-waves-soak.d.ts +57 -0
- package/dist/op/op-waves-soak.js +111 -0
- package/dist/op/op-waves-split.d.ts +4 -0
- package/dist/op/op-waves-split.js +4 -0
- package/dist/op/op-waves.d.ts +67 -4
- package/dist/op/op-waves.js +71 -3
- package/dist/pipeline/agent-ajv.d.ts +4 -0
- package/dist/pipeline/agent-ajv.js +14 -0
- package/dist/pipeline/agent-steps.d.ts +329 -0
- package/dist/pipeline/agent-steps.js +602 -0
- package/dist/pipeline/artifacts.d.ts +264 -0
- package/dist/pipeline/artifacts.js +425 -0
- package/dist/pipeline/diff.d.ts +45 -0
- package/dist/pipeline/diff.js +177 -0
- package/dist/pipeline/fold.d.ts +43 -0
- package/dist/pipeline/fold.js +140 -0
- package/dist/pipeline/generate.d.ts +52 -0
- package/dist/pipeline/generate.js +120 -0
- package/dist/pipeline/product.d.ts +225 -0
- package/dist/pipeline/product.js +257 -0
- package/dist/pipeline/promote.d.ts +404 -0
- package/dist/pipeline/promote.js +694 -0
- package/dist/pipeline/read.d.ts +37 -0
- package/dist/pipeline/read.js +58 -0
- package/dist/pipeline/rendered.d.ts +25 -0
- package/dist/pipeline/rendered.js +53 -0
- package/dist/pipeline/soak-checks.d.ts +80 -0
- package/dist/pipeline/soak-checks.js +254 -0
- package/dist/pipeline/soak-gate.d.ts +97 -0
- package/dist/pipeline/soak-gate.js +176 -0
- package/dist/pipeline/soak-sources.d.ts +17 -0
- package/dist/pipeline/soak-sources.js +42 -0
- package/dist/pipeline/soak.d.ts +260 -0
- package/dist/pipeline/soak.js +378 -0
- package/dist/pipeline/spec.d.ts +724 -0
- package/dist/pipeline/spec.js +567 -0
- package/dist/pipeline/stage-ledger.d.ts +187 -0
- package/dist/pipeline/stage-ledger.js +185 -0
- package/dist/pipeline/stage-waves.d.ts +114 -0
- package/dist/pipeline/stage-waves.js +161 -0
- package/dist/pipeline/stages.d.ts +64 -0
- package/dist/pipeline/stages.js +174 -0
- package/dist/pipeline/verify-rollback.d.ts +277 -0
- package/dist/pipeline/verify-rollback.js +393 -0
- package/dist/pipeline.d.ts +142 -0
- package/dist/pipeline.js +143 -0
- package/dist/pr-loop.d.ts +22 -0
- package/dist/pr-loop.js +8 -0
- package/dist/pr-plan-note.d.ts +15 -1
- package/dist/pr-plan-note.js +8 -0
- package/dist/pr-post.d.ts +31 -0
- package/dist/pr-post.js +89 -0
- package/dist/release-floors.d.ts +1 -1
- package/dist/release-floors.js +1 -1
- package/dist/report-store/audit.schema.json +50 -0
- package/dist/report-store/dora.schema.json +331 -0
- package/dist/report-store/estate.schema.json +96 -0
- package/dist/report-store/run.schema.json +14 -0
- package/dist/report-store.d.ts +151 -0
- package/dist/report-store.js +344 -0
- package/dist/run-event.d.ts +7 -2
- package/dist/wave-runtime.mjs +458 -404
- package/dist/workspace/catalog-edges.js +3 -3
- package/dist/workspace/change-set.schema.json +4 -0
- package/dist/workspace/ci-cloud-identity.d.ts +4 -0
- package/dist/workspace/ci-cloud-identity.js +30 -0
- package/dist/workspace/ci-run.js +17 -2
- package/dist/workspace/ci-secrets.d.ts +3 -1
- package/dist/workspace/ci-secrets.js +7 -1
- package/dist/workspace/compose-graph.d.ts +1 -1
- package/dist/workspace/compose-graph.js +3 -1
- package/dist/workspace/declaration.d.ts +27 -0
- package/dist/workspace/declaration.js +35 -0
- package/dist/workspace/declaration.schema.json +56 -0
- package/dist/workspace/graph-cli.js +26 -0
- package/dist/workspace/graph.schema.json +5 -1
- package/dist/workspace/identity-gate-rule.d.ts +4 -0
- package/dist/workspace/identity-gate-rule.js +2 -2
- package/dist/workspace/identity-reject-rule.d.ts +14 -0
- package/dist/workspace/identity-reject-rule.js +24 -0
- package/dist/workspace/identity.d.ts +3 -0
- package/dist/workspace/identity.js +2 -1
- package/dist/workspace/nested-graph.js +2 -0
- package/dist/workspace/pr-report.schema.json +65 -0
- package/dist/workspace/promotion-order.d.ts +19 -4
- package/dist/workspace/promotion-order.js +26 -4
- package/dist/workspace/release-train.d.ts +14 -0
- package/dist/workspace/release-train.js +32 -0
- package/dist/workspace/run-event.schema.json +2 -2
- package/dist/workspace/stack-read-edges.d.ts +19 -0
- package/dist/workspace/stack-read-edges.js +54 -0
- package/dist/workspace/status-gates.d.ts +51 -1
- package/dist/workspace/status-gates.js +60 -0
- package/dist/workspace/status-stages.d.ts +223 -0
- package/dist/workspace/status-stages.js +279 -0
- package/dist/workspace/status.d.ts +45 -1
- package/dist/workspace/status.js +109 -5
- package/dist/workspace/status.schema.json +283 -2
- package/dist/workspace/train-cut.js +5 -2
- package/dist/workspace/train-shell.d.ts +18 -0
- package/dist/workspace/train-shell.js +43 -0
- package/dist/workspace/trust/seal.d.ts +7 -0
- package/dist/workspace/trust/seal.js +9 -0
- package/package.json +5 -1
package/dist/ci-agent.d.ts
CHANGED
|
@@ -5,11 +5,26 @@
|
|
|
5
5
|
* moved here, so terragucci and plywood generate the same jobs in their own
|
|
6
6
|
* words.
|
|
7
7
|
*
|
|
8
|
-
*
|
|
8
|
+
* Six triggers. `comment`: `/<product> agent <ask>` on a pull request
|
|
9
9
|
* (`parseProductComment`), answered with a commit pushed to the pull
|
|
10
10
|
* request's branch. `drift`: a scheduled Op whose run exits with chant's
|
|
11
11
|
* `drift` code, answered with a pull request from the agent's own branch,
|
|
12
|
-
* opened the first time and updated after.
|
|
12
|
+
* opened the first time and updated after. `alert` (#5329): a production
|
|
13
|
+
* alert the relay recorded as a signed fact (`./agent-facts.ts`,
|
|
14
|
+
* `./ci-agent-alert.ts`), answered the way drift is, from a branch per
|
|
15
|
+
* member. `apply-failed` and `schedule` (#5357): a failed apply's fact and
|
|
16
|
+
* the agent's own cron, on the same intake as alerts
|
|
17
|
+
* (`./ci-agent-triggers.ts`), answered the same way. `verify-failed`
|
|
18
|
+
* (#5339): a failed verify step or a failing soak check, which chant
|
|
19
|
+
* records itself as a signed fact (`./ci-agent-verify-failed.ts`),
|
|
20
|
+
* answered the same way.
|
|
21
|
+
*
|
|
22
|
+
* Every trigger reads the agent's settings and caps from the default
|
|
23
|
+
* branch (#5357): the generated command lines carry a digest of the
|
|
24
|
+
* settings (`--digest`), the variables must match it, and the job's commit
|
|
25
|
+
* must be on the default branch ({@link checkAgentBase}). A pull request
|
|
26
|
+
* that changes the agent's workflow, or a pipeline variable that names
|
|
27
|
+
* another cap, does not change the agent that runs.
|
|
13
28
|
*
|
|
14
29
|
* Two jobs, so the model never shares a job with a token that can write:
|
|
15
30
|
*
|
|
@@ -34,14 +49,31 @@
|
|
|
34
49
|
*/
|
|
35
50
|
import { type CommentAllow, type CommentAllowReads } from "./ci-comment-allow.js";
|
|
36
51
|
import { type CiProductWords } from "./ci-product-words.js";
|
|
52
|
+
import { type AgentFact } from "./agent-facts.js";
|
|
37
53
|
import type { OpRunRecord, OpRunRecordInput } from "./op/runtime.js";
|
|
38
54
|
import type { RunOrigin } from "./lifecycle/release-ledger.js";
|
|
39
55
|
import type { PrForge } from "./pr-forge.js";
|
|
40
56
|
/** The first chant with the agent job and the scheduled Op spec's `agent` and `runner` (#4616). Products feature-detect on it. */
|
|
41
57
|
export declare const CI_AGENT_FLOOR = "0.124.55";
|
|
42
58
|
/** What starts an agent run. */
|
|
43
|
-
export type AgentTrigger = "comment" | "drift";
|
|
59
|
+
export type AgentTrigger = "comment" | "drift" | "alert" | "apply-failed" | "schedule" | "verify-failed";
|
|
44
60
|
export declare const AGENT_TRIGGERS: readonly AgentTrigger[];
|
|
61
|
+
/** The triggers answered from a branch of the agent's own, with a pull request it opens and updates. */
|
|
62
|
+
export declare const AGENT_BRANCH_TRIGGERS: readonly AgentTrigger[];
|
|
63
|
+
/**
|
|
64
|
+
* The triggers on the facts intake (#5329, #5357, #5339): the agent is a workflow
|
|
65
|
+
* of its own, started by hand or by its schedule, and reads its facts
|
|
66
|
+
* itself; facts for one member close together join one run.
|
|
67
|
+
*/
|
|
68
|
+
export declare const AGENT_FACT_TRIGGERS: readonly AgentTrigger[];
|
|
69
|
+
/** The fact triggers whose facts are read from the ledger and checked with the relay key. A schedule's fact is the run itself. */
|
|
70
|
+
export declare const AGENT_SIGNED_TRIGGERS: readonly AgentTrigger[];
|
|
71
|
+
/** Whether `on` reads facts: {@link AGENT_FACT_TRIGGERS}. */
|
|
72
|
+
export declare const isFactTrigger: (on: AgentTrigger) => boolean;
|
|
73
|
+
/** The variable the alert agent's jobs read the relay key from, to check the facts' signatures. */
|
|
74
|
+
export declare const AGENT_RELAY_KEY_ENV = "CHANT_RELAY_KEY";
|
|
75
|
+
/** How often the alert agent's workflow runs on its own, to pick up a fact whose start did not arrive. The failed-apply agent's schedule too. */
|
|
76
|
+
export declare const AGENT_ALERT_SCHEDULE = "*/15 * * * *";
|
|
45
77
|
/**
|
|
46
78
|
* The trigger a run record names (#4817): one of chant's {@link AgentTrigger}s,
|
|
47
79
|
* or a product's own word for a model run it records on the same ledger, such
|
|
@@ -54,7 +86,14 @@ export type AgentRunTrigger = AgentTrigger | (string & {});
|
|
|
54
86
|
* writes. With `on: "comment"` the spec is the agent's own workflow,
|
|
55
87
|
* answering `comment` on a pull request, and its trigger is not read. With
|
|
56
88
|
* `on: "drift"` the jobs follow the Op's own job and run when its run exits
|
|
57
|
-
* with chant's `drift` code.
|
|
89
|
+
* with chant's `drift` code. With `on: "alert"` (#5329) the spec is the
|
|
90
|
+
* agent's own workflow, started by the relay after it records an alert and
|
|
91
|
+
* by its own schedule, and the jobs read the alert facts themselves. With
|
|
92
|
+
* `on: "apply-failed"` and `on: "schedule"` (#5357) the spec is the agent's
|
|
93
|
+
* own workflow too: started by hand and by its schedule, reading the
|
|
94
|
+
* failed applies' facts, or taking the scheduled run as its fact. With
|
|
95
|
+
* `on: "verify-failed"` (#5339) the same, reading the facts a failed verify
|
|
96
|
+
* step or a failing soak check recorded.
|
|
58
97
|
*/
|
|
59
98
|
export interface OpAgentSpec {
|
|
60
99
|
on: AgentTrigger;
|
|
@@ -82,8 +121,19 @@ export interface OpAgentSpec {
|
|
|
82
121
|
tokenEnv?: string;
|
|
83
122
|
/** Paths beyond chant's own that the agent may not change: a product's config files and directories (a trailing `/`). */
|
|
84
123
|
guarded?: string[];
|
|
85
|
-
/** The agent's branch, for `
|
|
124
|
+
/** The agent's branch, for every trigger but `comment`. Default `<product>/agent/<name>`; facts for a member add `-<member>`. */
|
|
86
125
|
branch?: string;
|
|
126
|
+
/**
|
|
127
|
+
* For the fact triggers, `alert`, `apply-failed` and `schedule` (#5329,
|
|
128
|
+
* #5357): the minutes after a member's first fact in which later facts
|
|
129
|
+
* for that member join the same run. Default
|
|
130
|
+
* {@link AGENT_JOIN_WINDOW_MINUTES}.
|
|
131
|
+
*/
|
|
132
|
+
window?: number;
|
|
133
|
+
/** For `on: "alert"` and `on: "apply-failed"`: the secret (GitHub, Forgejo) or variable (GitLab) holding the relay key the facts are signed with. Default `CHANT_RELAY_KEY`. */
|
|
134
|
+
relayKeyEnv?: string;
|
|
135
|
+
/** For `on: "schedule"` (#5357): what the agent does on each run, in the maintainers' words. Required there. */
|
|
136
|
+
task?: string;
|
|
87
137
|
/** The ledger environment the runs are recorded under. Default `local`, the rule every Op follows (#4551 ruling A). */
|
|
88
138
|
env?: string;
|
|
89
139
|
/**
|
|
@@ -110,6 +160,12 @@ export interface AgentSettings {
|
|
|
110
160
|
maxTurns: number;
|
|
111
161
|
guarded: string[];
|
|
112
162
|
branch?: string;
|
|
163
|
+
/** See {@link OpAgentSpec.window}: minutes, for the fact triggers. */
|
|
164
|
+
window?: number;
|
|
165
|
+
/** See {@link OpAgentSpec.relayKeyEnv}, for `alert` and `apply-failed`. */
|
|
166
|
+
relayKeyEnv?: string;
|
|
167
|
+
/** See {@link OpAgentSpec.task}, for `schedule`. */
|
|
168
|
+
task?: string;
|
|
113
169
|
env: string;
|
|
114
170
|
/** See {@link OpAgentSpec.commentAllow}. */
|
|
115
171
|
commentAllow?: CommentAllow;
|
|
@@ -143,6 +199,8 @@ export declare const AGENT_ENV: {
|
|
|
143
199
|
readonly maxTurns: "CHANT_AGENT_MAX_TURNS";
|
|
144
200
|
readonly guarded: "CHANT_AGENT_GUARDED";
|
|
145
201
|
readonly branch: "CHANT_AGENT_BRANCH";
|
|
202
|
+
readonly window: "CHANT_AGENT_WINDOW";
|
|
203
|
+
readonly task: "CHANT_AGENT_TASK";
|
|
146
204
|
readonly env: "CHANT_AGENT_ENV";
|
|
147
205
|
};
|
|
148
206
|
/** GitLab starts no pipeline on a note: a pipeline of the target branch started with these runs the comment agent. */
|
|
@@ -189,8 +247,39 @@ export declare function resolveAgentSpec(name: string, spec: OpAgentSpec, produc
|
|
|
189
247
|
export declare function agentSettingsEnv(s: AgentSettings): Record<string, string>;
|
|
190
248
|
/** The settings back from the job's variables, checked as {@link resolveAgentSpec} checks a spec. */
|
|
191
249
|
export declare function agentSettingsFromEnv(env: Record<string, string | undefined>, product?: string): AgentSettings;
|
|
250
|
+
/**
|
|
251
|
+
* The digest of an agent's settings as its jobs carry them: `sha256:` of
|
|
252
|
+
* {@link agentSettingsEnv}'s variables, keys sorted. The generator writes it
|
|
253
|
+
* on each command line (`--digest`), where a pipeline variable cannot
|
|
254
|
+
* replace it, and the command refuses variables that do not match it.
|
|
255
|
+
*/
|
|
256
|
+
export declare function agentSettingsDigest(s: AgentSettings): string;
|
|
257
|
+
/** Undefined when the settings read from the variables are the ones the command line's digest names, else why not. */
|
|
258
|
+
export declare function agentDigestProblem(s: AgentSettings, digest: string | undefined): string | undefined;
|
|
259
|
+
/**
|
|
260
|
+
* The default branch: from the run's event on GitHub and Forgejo, else the
|
|
261
|
+
* `origin/HEAD` the generated checkout noted from the remote, else the
|
|
262
|
+
* remote itself.
|
|
263
|
+
*/
|
|
264
|
+
export declare function agentDefaultBranch(git: AgentGit, env: Record<string, string | undefined>, event: unknown): string | undefined;
|
|
265
|
+
/**
|
|
266
|
+
* Whether the job runs on the default branch (#5357): its commit is the
|
|
267
|
+
* default branch's tip or an earlier commit of it, so the workflow file the
|
|
268
|
+
* job's settings came from is one the default branch held. A run on a pull
|
|
269
|
+
* request's branch, whose workflow the pull request could have changed, is
|
|
270
|
+
* refused.
|
|
271
|
+
*/
|
|
272
|
+
export declare function checkAgentBase(git: AgentGit, env: Record<string, string | undefined>, event: unknown): {
|
|
273
|
+
ok: true;
|
|
274
|
+
branch: string;
|
|
275
|
+
} | {
|
|
276
|
+
ok: false;
|
|
277
|
+
reason: string;
|
|
278
|
+
};
|
|
192
279
|
/** The paths an agent's change may not touch: chant's, and the product's `guarded` (a trailing `/` names a directory). Matched without regard to case. */
|
|
193
280
|
export declare function agentForbiddenPaths(paths: readonly string[], guarded?: readonly string[]): string[];
|
|
281
|
+
/** The guarded paths as the prompt names them. */
|
|
282
|
+
export declare function guardedSentence(guarded: readonly string[]): string;
|
|
194
283
|
/** The prompt for `/<product> agent <ask>`: the ask quoted as data, and the rules the push job enforces either way. */
|
|
195
284
|
export declare function agentAskPrompt(o: {
|
|
196
285
|
product: string;
|
|
@@ -239,6 +328,17 @@ export interface AgentDecision {
|
|
|
239
328
|
branch?: string;
|
|
240
329
|
user?: string;
|
|
241
330
|
ask?: string;
|
|
331
|
+
/** For the fact triggers: no new fact, so nothing ran and nothing is recorded. */
|
|
332
|
+
idle?: boolean;
|
|
333
|
+
/** For the fact triggers: the ids of the facts the run took. */
|
|
334
|
+
facts?: string[];
|
|
335
|
+
/** For the fact triggers: the member the facts are for, "" for the repository. */
|
|
336
|
+
member?: string;
|
|
337
|
+
/** For the fact triggers: the join window the run opened. */
|
|
338
|
+
window?: {
|
|
339
|
+
from: string;
|
|
340
|
+
until: string;
|
|
341
|
+
};
|
|
242
342
|
started: string;
|
|
243
343
|
}
|
|
244
344
|
export declare function readDecision(dir: string): AgentDecision | undefined;
|
|
@@ -305,6 +405,8 @@ export interface PrepareInput {
|
|
|
305
405
|
teams?: CommentAllowReads;
|
|
306
406
|
/** The agent's earlier run records on the ledger. */
|
|
307
407
|
readRuns: () => Promise<OpRunRecord[]>;
|
|
408
|
+
/** For `on: "alert"` and `on: "apply-failed"`: the trigger's facts on the ledger. */
|
|
409
|
+
readFacts?: () => Promise<AgentFact[]>;
|
|
308
410
|
git: AgentGit;
|
|
309
411
|
now: Date;
|
|
310
412
|
}
|
|
@@ -335,7 +437,7 @@ export declare function runAgent(i: RunInput): Promise<{
|
|
|
335
437
|
changed: boolean;
|
|
336
438
|
}>;
|
|
337
439
|
/** How a run ended, as its record says. */
|
|
338
|
-
export type AgentResult = "pushed" | "opened" | "updated" | "refused" | "stopped" | "failed";
|
|
440
|
+
export type AgentResult = "pushed" | "opened" | "updated" | "summarized" | "answered" | "refused" | "stopped" | "failed" | "idle";
|
|
339
441
|
export interface LandOutcome {
|
|
340
442
|
result: AgentResult;
|
|
341
443
|
reason: string;
|
|
@@ -364,6 +466,8 @@ export interface LandInput {
|
|
|
364
466
|
lease?: string;
|
|
365
467
|
}) => void;
|
|
366
468
|
readRuns: () => Promise<OpRunRecord[]>;
|
|
469
|
+
/** For `on: "alert"` and `on: "apply-failed"`: the trigger's facts on the ledger, which this job checks the decision's against. */
|
|
470
|
+
readFacts?: () => Promise<AgentFact[]>;
|
|
367
471
|
/** Append the run's record to the ledger and push it. */
|
|
368
472
|
record: (input: OpRunRecordInput) => Promise<void>;
|
|
369
473
|
now: () => Date;
|
|
@@ -392,6 +496,29 @@ export declare function agentRunRecordInput(o: {
|
|
|
392
496
|
usage?: AgentUsage;
|
|
393
497
|
gitSha?: string;
|
|
394
498
|
runOrigin?: RunOrigin;
|
|
499
|
+
/** For the fact triggers (#5329, #5357): the facts the run took, their member and window, and each alert's source and id. */
|
|
500
|
+
facts?: string[];
|
|
501
|
+
member?: string;
|
|
502
|
+
window?: {
|
|
503
|
+
from: string;
|
|
504
|
+
until: string;
|
|
505
|
+
};
|
|
506
|
+
alerts?: Array<{
|
|
507
|
+
source: string;
|
|
508
|
+
sourceId: string;
|
|
509
|
+
}>;
|
|
510
|
+
/** For `on: "apply-failed"` (#5357): the op and member of each failed apply the run answers. */
|
|
511
|
+
failures?: Array<{
|
|
512
|
+
op: string;
|
|
513
|
+
member: string;
|
|
514
|
+
}>;
|
|
515
|
+
/** For `on: "verify-failed"` (#5339): the stage, kind, check and member of each failed verify or soak the run answers. */
|
|
516
|
+
verifies?: Array<{
|
|
517
|
+
stage: string;
|
|
518
|
+
kind: "verify" | "soak";
|
|
519
|
+
check: string;
|
|
520
|
+
member: string;
|
|
521
|
+
}>;
|
|
395
522
|
}): OpRunRecordInput;
|
|
396
523
|
/**
|
|
397
524
|
* `chant agent land`: from the agent job's patch to a pushed commit and a
|
|
@@ -401,12 +528,13 @@ export declare function agentRunRecordInput(o: {
|
|
|
401
528
|
*/
|
|
402
529
|
export declare function landAgentChange(i: LandInput): Promise<LandOutcome>;
|
|
403
530
|
/**
|
|
404
|
-
* The three commands of the agent jobs, through the product's bin
|
|
531
|
+
* The three commands of the agent jobs, through the product's bin, with
|
|
532
|
+
* the settings' digest ({@link agentSettingsDigest}) when given. `dir` is
|
|
405
533
|
* the agent directory from the job's directory, {@link AGENT_DIR} unless a
|
|
406
534
|
* workspace member's drift Op left its output under the member's directory
|
|
407
535
|
* (#4619): GitLab keeps the artifact at its path from the repository root.
|
|
408
536
|
*/
|
|
409
|
-
export declare function agentCommandLines(forge: "github" | "gitlab" | "forgejo", bin?: string, dir?: string): {
|
|
537
|
+
export declare function agentCommandLines(forge: "github" | "gitlab" | "forgejo", bin?: string, dir?: string, digest?: string): {
|
|
410
538
|
prepare: string;
|
|
411
539
|
run: string;
|
|
412
540
|
land: string;
|