@intentius/chant 0.90.0 → 0.93.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/commands/build.d.ts.map +1 -1
- package/dist/cli/commands/lint.d.ts.map +1 -1
- package/dist/cli/handlers/components.d.ts +8 -0
- package/dist/cli/handlers/components.d.ts.map +1 -1
- package/dist/cli/handlers/graph.d.ts.map +1 -1
- package/dist/cli/handlers/operator.d.ts +20 -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 +7 -4
- package/dist/cli/mcp/workspace-tools.d.ts.map +1 -1
- package/dist/cli/plugins.d.ts.map +1 -1
- package/dist/cli/registry.d.ts +42 -1
- package/dist/cli/registry.d.ts.map +1 -1
- package/dist/codegen/pinned-upgrade.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/config.d.ts +22 -0
- package/dist/config.d.ts.map +1 -1
- package/dist/lexicon-module.d.ts +22 -0
- package/dist/lexicon-module.d.ts.map +1 -1
- package/dist/lifecycle/converge-ledger.d.ts +19 -0
- package/dist/lifecycle/converge-ledger.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/run-ledger.d.ts +2 -0
- package/dist/lifecycle/run-ledger.d.ts.map +1 -1
- package/dist/lifecycle/symptoms.d.ts +51 -0
- package/dist/lifecycle/symptoms.d.ts.map +1 -1
- package/dist/lifecycle/work-lease.d.ts +140 -0
- package/dist/lifecycle/work-lease.d.ts.map +1 -0
- package/dist/lint/rules/index.d.ts +4 -2
- package/dist/lint/rules/index.d.ts.map +1 -1
- package/dist/lint/rules/op/index.d.ts +14 -3
- package/dist/lint/rules/op/index.d.ts.map +1 -1
- package/dist/lint/rules/op/ops014-converge-rule-refusals.d.ts.map +1 -1
- package/dist/lint/rules/op/sys010-key-over-plain-http.d.ts +29 -0
- package/dist/lint/rules/op/sys010-key-over-plain-http.d.ts.map +1 -0
- package/dist/lint/rules/sys001-no-literal-key.d.ts +3 -0
- package/dist/lint/rules/sys001-no-literal-key.d.ts.map +1 -0
- package/dist/op/__fixtures__/decide-stub-backend.d.ts +53 -0
- package/dist/op/__fixtures__/decide-stub-backend.d.ts.map +1 -0
- package/dist/op/activities/activity-contracts.d.ts +203 -2
- package/dist/op/activities/activity-contracts.d.ts.map +1 -1
- package/dist/op/activities/apply.d.ts.map +1 -1
- package/dist/op/activities/change-coverage.d.ts +44 -0
- package/dist/op/activities/change-coverage.d.ts.map +1 -0
- package/dist/op/activities/converge.d.ts +24 -1
- package/dist/op/activities/converge.d.ts.map +1 -1
- package/dist/op/activities/decide.d.ts +107 -0
- package/dist/op/activities/decide.d.ts.map +1 -0
- package/dist/op/activities/index.d.ts +10 -0
- package/dist/op/activities/index.d.ts.map +1 -1
- package/dist/op/activities/shell.d.ts +32 -0
- package/dist/op/activities/shell.d.ts.map +1 -1
- package/dist/op/activities/source-release.d.ts +86 -0
- package/dist/op/activities/source-release.d.ts.map +1 -0
- package/dist/op/activities/source-rollback.d.ts +100 -0
- package/dist/op/activities/source-rollback.d.ts.map +1 -0
- package/dist/op/activities/work-evidence.d.ts +42 -0
- package/dist/op/activities/work-evidence.d.ts.map +1 -0
- package/dist/op/activity-contract.d.ts +1 -0
- package/dist/op/activity-contract.d.ts.map +1 -1
- package/dist/op/activity-profiles.d.ts +16 -0
- package/dist/op/activity-profiles.d.ts.map +1 -1
- package/dist/op/builders.d.ts +84 -2
- package/dist/op/builders.d.ts.map +1 -1
- package/dist/op/composites/converge-op.d.ts +31 -4
- package/dist/op/composites/converge-op.d.ts.map +1 -1
- package/dist/op/decide-backend.d.ts +116 -0
- package/dist/op/decide-backend.d.ts.map +1 -0
- package/dist/op/decide-config.d.ts +120 -0
- package/dist/op/decide-config.d.ts.map +1 -0
- package/dist/op/decide-read-inputs.d.ts +40 -0
- package/dist/op/decide-read-inputs.d.ts.map +1 -0
- package/dist/op/discover.d.ts +25 -0
- package/dist/op/discover.d.ts.map +1 -1
- package/dist/op/gate-wait.d.ts +43 -0
- package/dist/op/gate-wait.d.ts.map +1 -0
- package/dist/op/gate.d.ts +5 -2
- package/dist/op/gate.d.ts.map +1 -1
- package/dist/op/index.d.ts +18 -5
- 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 +48 -4
- package/dist/op/local-executor.d.ts.map +1 -1
- package/dist/op/local-output.d.ts +2 -0
- package/dist/op/local-output.d.ts.map +1 -1
- package/dist/op/op-ir.d.ts +12 -1
- package/dist/op/op-ir.d.ts.map +1 -1
- package/dist/op/op-verb-class.d.ts.map +1 -1
- package/dist/op/operator.d.ts +126 -1
- package/dist/op/operator.d.ts.map +1 -1
- package/dist/op/runtime.d.ts +46 -5
- package/dist/op/runtime.d.ts.map +1 -1
- package/dist/op/runtimes/local.d.ts.map +1 -1
- package/dist/op/source-archive.d.ts +63 -0
- package/dist/op/source-archive.d.ts.map +1 -0
- 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-points.d.ts +136 -0
- package/dist/op/steward-points.d.ts.map +1 -0
- package/dist/op/steward-turn.d.ts +53 -0
- package/dist/op/steward-turn.d.ts.map +1 -0
- package/dist/op/steward.d.ts +161 -0
- package/dist/op/steward.d.ts.map +1 -0
- package/dist/op/types.d.ts +58 -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/__fixtures__/decide-workspace.d.ts +100 -0
- package/dist/workspace/__fixtures__/decide-workspace.d.ts.map +1 -0
- package/dist/workspace/answers-ledger.d.ts +76 -0
- package/dist/workspace/answers-ledger.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/changes-cli.d.ts +16 -0
- package/dist/workspace/changes-cli.d.ts.map +1 -0
- package/dist/workspace/changes.d.ts +200 -0
- package/dist/workspace/changes.d.ts.map +1 -0
- package/dist/workspace/chant-migrations/chud-lexicon-exit-fly-site.d.ts +59 -0
- package/dist/workspace/chant-migrations/chud-lexicon-exit-fly-site.d.ts.map +1 -0
- package/dist/workspace/chant-migrations/chud-lexicon-exit-live-names.d.ts +51 -0
- package/dist/workspace/chant-migrations/chud-lexicon-exit-live-names.d.ts.map +1 -0
- package/dist/workspace/chant-migrations/chud-lexicon-exit-rollback.d.ts +26 -0
- package/dist/workspace/chant-migrations/chud-lexicon-exit-rollback.d.ts.map +1 -0
- package/dist/workspace/chant-migrations/chud-lexicon-exit-ship-inputs.d.ts +59 -0
- package/dist/workspace/chant-migrations/chud-lexicon-exit-ship-inputs.d.ts.map +1 -0
- package/dist/workspace/chant-migrations/chud-lexicon-exit-ship-policy.d.ts +22 -0
- package/dist/workspace/chant-migrations/chud-lexicon-exit-ship-policy.d.ts.map +1 -0
- package/dist/workspace/chant-migrations/chud-lexicon-exit.d.ts +71 -0
- package/dist/workspace/chant-migrations/chud-lexicon-exit.d.ts.map +1 -0
- package/dist/workspace/chant-migrations.d.ts +99 -0
- package/dist/workspace/chant-migrations.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 +104 -0
- package/dist/workspace/checks/boxes.d.ts.map +1 -0
- package/dist/workspace/checks/diagrams.d.ts +31 -0
- package/dist/workspace/checks/diagrams.d.ts.map +1 -0
- package/dist/workspace/checks/records.d.ts +8 -0
- package/dist/workspace/checks/records.d.ts.map +1 -1
- package/dist/workspace/checks.d.ts +13 -1
- package/dist/workspace/checks.d.ts.map +1 -1
- package/dist/workspace/compose-graph.d.ts +2 -0
- package/dist/workspace/compose-graph.d.ts.map +1 -1
- package/dist/workspace/conformance/index.d.ts.map +1 -1
- package/dist/workspace/decide.d.ts +229 -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 +103 -0
- package/dist/workspace/declaration.d.ts.map +1 -1
- package/dist/workspace/declaration.schema.json +285 -0
- package/dist/workspace/declared-kinds.d.ts +32 -0
- package/dist/workspace/declared-kinds.d.ts.map +1 -1
- package/dist/workspace/generated-files.d.ts +7 -0
- package/dist/workspace/generated-files.d.ts.map +1 -1
- package/dist/workspace/intent.d.ts.map +1 -1
- package/dist/workspace/lineage-check.d.ts +3 -0
- package/dist/workspace/lineage-check.d.ts.map +1 -1
- package/dist/workspace/lineage-upgrade.d.ts +6 -1
- package/dist/workspace/lineage-upgrade.d.ts.map +1 -1
- package/dist/workspace/ls.d.ts +39 -1
- package/dist/workspace/ls.d.ts.map +1 -1
- package/dist/workspace/point-answer.schema.json +95 -0
- 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 +38 -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 +23 -1
- package/dist/workspace/records-cli.d.ts.map +1 -1
- package/dist/workspace/records-close.d.ts +1 -1
- package/dist/workspace/records-close.d.ts.map +1 -1
- package/dist/workspace/records-write.d.ts +11 -5
- package/dist/workspace/records-write.d.ts.map +1 -1
- package/dist/workspace/records.d.ts +42 -6
- package/dist/workspace/records.d.ts.map +1 -1
- package/dist/workspace/status-gates.d.ts +7 -2
- package/dist/workspace/status-gates.d.ts.map +1 -1
- package/dist/workspace/status-stewards.d.ts +179 -0
- package/dist/workspace/status-stewards.d.ts.map +1 -0
- package/dist/workspace/status.d.ts +68 -1
- package/dist/workspace/status.d.ts.map +1 -1
- package/dist/workspace/work-cli.d.ts +189 -0
- package/dist/workspace/work-cli.d.ts.map +1 -0
- package/dist/workspace/work-evidence.d.ts +74 -0
- package/dist/workspace/work-evidence.d.ts.map +1 -0
- package/dist/workspace/work.d.ts +43 -1
- package/dist/workspace/work.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/cli/commands/audit.test.ts +9 -1
- package/src/cli/commands/build.ts +3 -2
- package/src/cli/commands/lint.ts +7 -1
- package/src/cli/handlers/components.test.ts +93 -0
- package/src/cli/handlers/components.ts +44 -3
- package/src/cli/handlers/graph.test.ts +20 -0
- package/src/cli/handlers/graph.ts +16 -2
- package/src/cli/handlers/operator.ts +141 -4
- package/src/cli/handlers/run.test.ts +173 -2
- package/src/cli/handlers/run.ts +174 -3
- package/src/cli/main.test.ts +50 -0
- package/src/cli/main.ts +97 -2
- package/src/cli/mcp/workspace-tools.test.ts +48 -19
- package/src/cli/mcp/workspace-tools.ts +110 -8
- package/src/cli/plugins.ts +11 -3
- package/src/cli/registry.ts +42 -1
- package/src/codegen/pinned-upgrade.ts +2 -1
- package/src/codegen/release-wiring.test.ts +49 -2
- package/src/components/capability-plugin-loader.ts +3 -3
- package/src/components/cli-support.ts +2 -2
- package/src/components/verbs/vuln-scan.test.ts +124 -1
- package/src/components/verbs/vuln-scan.ts +142 -1
- package/src/config.ts +11 -0
- package/src/lexicon-module.ts +56 -1
- package/src/lexicon-package.test.ts +96 -0
- package/src/lifecycle/converge-ledger.ts +20 -0
- 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/run-ledger.ts +6 -0
- package/src/lifecycle/symptoms.ts +95 -0
- package/src/lifecycle/work-lease.test.ts +236 -0
- package/src/lifecycle/work-lease.ts +426 -0
- package/src/lint/rules/index.ts +6 -2
- package/src/lint/rules/op/index.ts +17 -4
- package/src/lint/rules/op/ops014-converge-rule-refusals.test.ts +23 -1
- package/src/lint/rules/op/ops014-converge-rule-refusals.ts +10 -6
- package/src/lint/rules/op/sys010-key-over-plain-http.test.ts +52 -0
- package/src/lint/rules/op/sys010-key-over-plain-http.ts +100 -0
- package/src/lint/rules/sys001-no-literal-key.test.ts +31 -0
- package/src/lint/rules/sys001-no-literal-key.ts +67 -0
- package/src/op/__fixtures__/decide-stub-backend.ts +143 -0
- package/src/op/activities/activity-contracts.ts +190 -1
- package/src/op/activities/apply.ts +7 -6
- package/src/op/activities/change-coverage.ts +60 -0
- package/src/op/activities/converge.test.ts +55 -1
- package/src/op/activities/converge.ts +208 -29
- package/src/op/activities/decide.live.test.ts +78 -0
- package/src/op/activities/decide.test.ts +300 -0
- package/src/op/activities/decide.ts +267 -0
- package/src/op/activities/index.ts +21 -0
- package/src/op/activities/shell.test.ts +91 -1
- package/src/op/activities/shell.ts +91 -2
- package/src/op/activities/source-release.test.ts +118 -0
- package/src/op/activities/source-release.ts +168 -0
- package/src/op/activities/source-rollback.test.ts +131 -0
- package/src/op/activities/source-rollback.ts +239 -0
- package/src/op/activities/work-evidence.ts +62 -0
- package/src/op/activity-contract-registry.test.ts +2 -0
- package/src/op/activity-contract-registry.ts +2 -2
- package/src/op/activity-contract.test.ts +12 -0
- package/src/op/activity-contract.ts +6 -1
- package/src/op/activity-profiles.ts +29 -0
- package/src/op/activity-registry.test.ts +1 -1
- package/src/op/activity-registry.ts +2 -2
- package/src/op/builders.ts +124 -5
- package/src/op/command-gate.test.ts +192 -0
- package/src/op/composites/converge-op.test.ts +27 -1
- package/src/op/composites/converge-op.ts +69 -15
- package/src/op/decide-backend.test.ts +44 -0
- package/src/op/decide-backend.ts +212 -0
- package/src/op/decide-config.test.ts +52 -0
- package/src/op/decide-config.ts +80 -0
- package/src/op/decide-read-inputs.ts +117 -0
- package/src/op/discover.ts +71 -0
- package/src/op/gate-approval.ts +2 -2
- package/src/op/gate-wait.ts +57 -0
- package/src/op/gate.ts +8 -3
- package/src/op/generate-pipeline.ts +2 -2
- package/src/op/index.ts +34 -6
- 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 +367 -33
- package/src/op/local-output.test.ts +33 -0
- package/src/op/local-output.ts +33 -2
- package/src/op/op-ir.test.ts +10 -0
- package/src/op/op-ir.ts +18 -0
- package/src/op/op-verb-class.ts +1 -0
- package/src/op/operator.ts +360 -10
- package/src/op/runtime.ts +37 -8
- package/src/op/runtimes/local.ts +6 -1
- package/src/op/source-archive.ts +161 -0
- package/src/op/step-output-ref.ts +6 -2
- package/src/op/steward-points.test.ts +313 -0
- package/src/op/steward-points.ts +194 -0
- package/src/op/steward-turn.ts +79 -0
- package/src/op/steward.test.ts +296 -0
- package/src/op/steward.ts +277 -0
- package/src/op/types.ts +60 -0
- package/src/op/work-lease-decl.ts +80 -0
- package/src/op/work-lease-run.test.ts +345 -0
- package/src/op/work-lease-run.ts +395 -0
- package/src/workspace/__fixtures__/decide-workspace.ts +129 -0
- package/src/workspace/__fixtures__/studio-template-84c8b21.json +67 -0
- package/src/workspace/answers-ledger.ts +118 -0
- package/src/workspace/box-isolation.test.ts +261 -0
- package/src/workspace/box-isolation.ts +205 -0
- package/src/workspace/changes-cli.ts +56 -0
- package/src/workspace/changes.schema.json +472 -0
- package/src/workspace/changes.test.ts +315 -0
- package/src/workspace/changes.ts +512 -0
- package/src/workspace/chant-migrations/chud-lexicon-exit-fly-site.ts +234 -0
- package/src/workspace/chant-migrations/chud-lexicon-exit-live-names.ts +164 -0
- package/src/workspace/chant-migrations/chud-lexicon-exit-rollback.ts +223 -0
- package/src/workspace/chant-migrations/chud-lexicon-exit-ship-inputs.ts +195 -0
- package/src/workspace/chant-migrations/chud-lexicon-exit-ship-policy.ts +108 -0
- package/src/workspace/chant-migrations/chud-lexicon-exit.ts +882 -0
- package/src/workspace/chant-migrations.e2e.test.ts +1089 -0
- package/src/workspace/chant-migrations.ts +164 -0
- package/src/workspace/check-contract.test.ts +5 -1
- package/src/workspace/check.schema.json +25 -7
- package/src/workspace/checks/box-isolation.ts +68 -0
- package/src/workspace/checks/boxes.test.ts +276 -0
- package/src/workspace/checks/boxes.ts +442 -0
- package/src/workspace/checks/diagrams.test.ts +134 -0
- package/src/workspace/checks/diagrams.ts +108 -0
- package/src/workspace/checks/records.ts +72 -0
- package/src/workspace/checks.test.ts +7 -0
- package/src/workspace/checks.ts +27 -3
- package/src/workspace/compose-graph.ts +2 -0
- package/src/workspace/conformance/__fixture__/decisions/decision.kind.mjs +10 -0
- package/src/workspace/conformance/__fixture__/decisions/decision.schema.json +26 -0
- package/src/workspace/conformance/index.ts +5 -0
- package/src/workspace/decide.test.ts +224 -0
- package/src/workspace/decide.ts +709 -0
- package/src/workspace/decision-points.schema.json +137 -0
- package/src/workspace/declaration.schema.json +285 -0
- package/src/workspace/declaration.test.ts +58 -0
- package/src/workspace/declaration.ts +241 -0
- package/src/workspace/declared-kinds.test.ts +5 -5
- package/src/workspace/declared-kinds.ts +71 -3
- package/src/workspace/generated-files.ts +14 -0
- package/src/workspace/graph-cli.ts +1 -1
- package/src/workspace/graph.schema.json +9 -1
- package/src/workspace/intent.schema.json +12 -3
- package/src/workspace/intent.ts +3 -10
- package/src/workspace/lineage-check.ts +16 -1
- package/src/workspace/lineage-upgrade-cli.ts +1 -1
- package/src/workspace/lineage-upgrade.test.ts +70 -0
- package/src/workspace/lineage-upgrade.ts +81 -10
- package/src/workspace/ls-contract.test.ts +57 -0
- package/src/workspace/ls.schema.json +46 -1
- package/src/workspace/ls.ts +62 -3
- package/src/workspace/point-answer.schema.json +95 -0
- package/src/workspace/points-cli.ts +284 -0
- package/src/workspace/points-write.schema.json +499 -0
- package/src/workspace/points.schema.json +743 -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 +24 -1
- package/src/workspace/reason-codes.ts +49 -0
- package/src/workspace/record-assets.test.ts +3 -2
- package/src/workspace/record-assets.ts +4 -1
- package/src/workspace/records-amend.schema.json +2 -0
- package/src/workspace/records-cli.ts +28 -5
- package/src/workspace/records-close.schema.json +2 -0
- package/src/workspace/records-contract.test.ts +3 -2
- package/src/workspace/records-new.schema.json +2 -0
- package/src/workspace/records-review.schema.json +2 -0
- package/src/workspace/records-sessions-write.e2e.test.ts +77 -0
- package/src/workspace/records-sessions-write.test.ts +2 -34
- package/src/workspace/records-write.e2e.test.ts +108 -0
- package/src/workspace/records-write.test.ts +32 -41
- package/src/workspace/records-write.ts +33 -15
- package/src/workspace/records.schema.json +53 -2
- package/src/workspace/records.test.ts +48 -3
- package/src/workspace/records.ts +142 -6
- package/src/workspace/status-contract.test.ts +189 -6
- package/src/workspace/status-gates.ts +9 -4
- package/src/workspace/status-stewards.ts +329 -0
- package/src/workspace/status.schema.json +335 -5
- package/src/workspace/status.ts +142 -6
- package/src/workspace/work-acceptance.test.ts +274 -0
- package/src/workspace/work-cli.e2e.test.ts +180 -0
- package/src/workspace/work-cli.ts +429 -0
- package/src/workspace/work-evidence.schema.json +212 -0
- package/src/workspace/work-evidence.ts +169 -0
- package/src/workspace/work-history.schema.json +349 -0
- package/src/workspace/work-history.test.ts +156 -0
- package/src/workspace/work-lease.schema.json +233 -0
- package/src/workspace/work-readiness-chud.test.ts +145 -0
- package/src/workspace/work.test.ts +3 -2
- package/src/workspace/work.ts +100 -1
- /package/src/cli/{discovery-skip.test.ts → discovery-skip.e2e.test.ts} +0 -0
- /package/src/workspace/conformance/{conformance.test.ts → conformance.e2e.test.ts} +0 -0
- /package/src/workspace/{which-chant.test.ts → which-chant.e2e.test.ts} +0 -0
|
@@ -24,12 +24,20 @@
|
|
|
24
24
|
* The JSON also lists each member's gates, read from its gate ledger on the
|
|
25
25
|
* same branch (#2674, `status-gates.ts`): the state of each, the approvals
|
|
26
26
|
* that count, and the `chant approve` line that answers it. The text view
|
|
27
|
-
* doesn't show them.
|
|
27
|
+
* doesn't show them. So does each member's box block (#2726): the
|
|
28
|
+
* capabilities it reaches through a broker, with the broker and the scope a
|
|
29
|
+
* broker enforces, and, when the block names a host, the box's ports, state
|
|
30
|
+
* paths and cookie names resolved from its identity (#2727,
|
|
31
|
+
* `box-isolation.ts`), so a runtime reads them instead of choosing its own.
|
|
28
32
|
*/
|
|
29
33
|
import type { CommandContext } from "../cli/registry.js";
|
|
30
34
|
import { type ReleaseRecord } from "../lifecycle/release-ledger.js";
|
|
35
|
+
import { type ReleasePlan } from "../lifecycle/plan-ledger.js";
|
|
36
|
+
import { type WorkLeaseState } from "../lifecycle/work-lease.js";
|
|
37
|
+
import { type ResolvedIsolation } from "./box-isolation.js";
|
|
31
38
|
import { type ErrorLocation } from "./declaration.js";
|
|
32
39
|
import { type GateLedgerReader, type StatusGate, type StatusGateLedger } from "./status-gates.js";
|
|
40
|
+
import { readMemberStewards, type StatusSteward, type StewardReasonCode } from "./status-stewards.js";
|
|
33
41
|
/** The version of the `status` output this chant writes. */
|
|
34
42
|
export declare const STATUS_CONTRACT_VERSION = 1;
|
|
35
43
|
/** `$id` of the JSON Schema for the `--json` output, shipped beside this file. */
|
|
@@ -46,6 +54,8 @@ export declare const STATUS_REASON_CODES: readonly ["ledger-unreadable", "ledger
|
|
|
46
54
|
export type StatusReasonCode = (typeof STATUS_REASON_CODES)[number];
|
|
47
55
|
/** Why a member's gates can't be listed (#2674). Closed, like {@link STATUS_REASON_CODES}. */
|
|
48
56
|
export declare const STATUS_GATE_REASON_CODES: readonly ["gates-no-ledger", "gates-no-gate-ledger", "gates-ledger-unreadable"];
|
|
57
|
+
/** Why a member's stewards can't be fully listed (#2731). Closed, like {@link STATUS_REASON_CODES}. */
|
|
58
|
+
export declare const STATUS_STEWARD_REASON_CODES: readonly ["stewards-unreadable", "stewards-conflict", "steward-runs-unreadable"];
|
|
49
59
|
/**
|
|
50
60
|
* Why the status couldn't be read at all. The declaration's own codes, except
|
|
51
61
|
* the two that only `--at` returns, and one for the environment name.
|
|
@@ -65,6 +75,15 @@ export interface StatusRelease {
|
|
|
65
75
|
actor: string;
|
|
66
76
|
/** Read flags, such as `legacy-digest` (#2514). */
|
|
67
77
|
flags: string[];
|
|
78
|
+
/**
|
|
79
|
+
* The release plan `digest` names, read from `_plans/<digest>.json` on
|
|
80
|
+
* chant/lifecycle (ws-055, #2733) — the work items and evidence this
|
|
81
|
+
* release shipped, without the runner's own files. Null when this
|
|
82
|
+
* checkout has no plan stored under that digest: an ordinary component
|
|
83
|
+
* release (most releases carry no plan at all), or a plan this checkout
|
|
84
|
+
* hasn't fetched yet.
|
|
85
|
+
*/
|
|
86
|
+
plan: ReleasePlan | null;
|
|
68
87
|
}
|
|
69
88
|
export interface StatusLedger {
|
|
70
89
|
/** `members` for `_members/<member>/<env>/releases.jsonl`, `flat` for `<env>/releases.jsonl`. */
|
|
@@ -109,6 +128,48 @@ export interface StatusMember {
|
|
|
109
128
|
gateLedger: StatusGateLedger;
|
|
110
129
|
/** Each gate in the member's gate ledger, one per environment asked for, sorted by component then gate. */
|
|
111
130
|
gates: StatusGate[];
|
|
131
|
+
/** The member's box block as declared, or null when it declares none (#2726). A broker reads the scopes it enforces here. */
|
|
132
|
+
box: StatusBox | null;
|
|
133
|
+
/** The stewards the member declares (#2731), with their form in `env`, their Ops and each Op's last run. Sorted by name. */
|
|
134
|
+
stewards: StatusSteward[];
|
|
135
|
+
/** Why a steward or a last run may be missing from `stewards`. */
|
|
136
|
+
stewardReasons: {
|
|
137
|
+
code: StewardReasonCode;
|
|
138
|
+
message: string;
|
|
139
|
+
}[];
|
|
140
|
+
}
|
|
141
|
+
/** A box's brokered capabilities, from the declaration (#2726). */
|
|
142
|
+
export interface StatusBox {
|
|
143
|
+
capabilities: {
|
|
144
|
+
name: string;
|
|
145
|
+
broker: string | null;
|
|
146
|
+
scope: string[];
|
|
147
|
+
}[];
|
|
148
|
+
/** The box's ports, state paths and cookie names, resolved from its identity, or null when the block declares no host (#2727). */
|
|
149
|
+
isolation: ResolvedIsolation | null;
|
|
150
|
+
}
|
|
151
|
+
/**
|
|
152
|
+
* One work lease (#2732): a work item's lease ref in the ledger of the member
|
|
153
|
+
* that owns its work kind, read from the local refs without fetching.
|
|
154
|
+
*/
|
|
155
|
+
export interface StatusLease extends Omit<WorkLeaseState, "ref"> {
|
|
156
|
+
/** The member whose ledger holds the lease, or null for the flat ledger (the root member, or a kind no member owns). */
|
|
157
|
+
member: string | null;
|
|
158
|
+
ref: string;
|
|
159
|
+
}
|
|
160
|
+
/**
|
|
161
|
+
* One work item's acceptance criteria, counted (#2772): each current record
|
|
162
|
+
* of a declared work kind with acceptance criteria that lists some.
|
|
163
|
+
*/
|
|
164
|
+
export interface StatusAcceptance {
|
|
165
|
+
/** The member that declares the work kind, or null for the workspace's own. */
|
|
166
|
+
member: string | null;
|
|
167
|
+
/** The work kind file, from the workspace root. */
|
|
168
|
+
kind: string;
|
|
169
|
+
item: string;
|
|
170
|
+
state: string | null;
|
|
171
|
+
met: number;
|
|
172
|
+
total: number;
|
|
112
173
|
}
|
|
113
174
|
export type StatusDocument = {
|
|
114
175
|
$schema: string;
|
|
@@ -126,6 +187,10 @@ export type StatusDocument = {
|
|
|
126
187
|
file: string;
|
|
127
188
|
};
|
|
128
189
|
members: StatusMember[];
|
|
190
|
+
/** Every work lease in the workspace's ledgers, active and expired, by member then item (#2732). A released lease has no ref and is not listed. */
|
|
191
|
+
leases: StatusLease[];
|
|
192
|
+
/** Each work item's acceptance criteria, met of total, by declared kind then item (#2772). Empty when no declared work kind has criteria. */
|
|
193
|
+
acceptance: StatusAcceptance[];
|
|
129
194
|
summary: {
|
|
130
195
|
members: number;
|
|
131
196
|
released: number;
|
|
@@ -157,6 +222,8 @@ export interface StatusQuery {
|
|
|
157
222
|
readGates?: GateLedgerReader;
|
|
158
223
|
/** The instant a gate's expiry is measured against; now by default. */
|
|
159
224
|
now?: string;
|
|
225
|
+
/** Reads one member's stewards; the declaration and ledger reader unless a test swaps it. */
|
|
226
|
+
readStewards?: typeof readMemberStewards;
|
|
160
227
|
}
|
|
161
228
|
export declare function compareEnvironments(a: StatusEnvironment, b: StatusEnvironment): StatusCompare;
|
|
162
229
|
/** Find the workspace, read every member's ledger and build the document `--json` prints. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"status.d.ts","sourceRoot":"","sources":["../../src/workspace/status.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"status.d.ts","sourceRoot":"","sources":["../../src/workspace/status.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AAMH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAGtD,OAAO,EAAyC,KAAK,aAAa,EAAE,MAAM,6BAA6B,CAAC;AACxG,OAAO,EAAmB,KAAK,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAC7E,OAAO,EAAkB,KAAK,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAE9E,OAAO,EAAgB,KAAK,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AACvE,OAAO,EAA6F,KAAK,aAAa,EAAe,MAAM,eAAe,CAAC;AAE3J,OAAO,EAAsC,KAAK,gBAAgB,EAAE,KAAK,UAAU,EAAE,KAAK,gBAAgB,EAAE,M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CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CAuC7E;AAeD,wBAAgB,YAAY,CAAC,GAAG,EAAE,OAAO,CAAC,cAAc,EAAE;IAAE,OAAO,EAAE,OAAO,CAAA;CAAE,CAAC,GAAG,MAAM,CA2DvF"}
|
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `chant workspace work claim|renew|release <id> --holder <name>` (#2732,
|
|
3
|
+
* ws-055): the work lease, who is working on which work item. And `chant
|
|
4
|
+
* workspace work history <id>` (#2785): the item's lease history, each claim
|
|
5
|
+
* and how it ended, a read-contract output (`work-history.schema.json`).
|
|
6
|
+
*
|
|
7
|
+
* The lease itself is `../lifecycle/work-lease.ts`, the operator lease under
|
|
8
|
+
* the key `work/<id>`. This file finds the work item first: in the work kind
|
|
9
|
+
* `--kind` names, or in the one work kind the declaration names that has a
|
|
10
|
+
* record with the id. A claim on an id no work record has is refused, and so
|
|
11
|
+
* is a claim on a closed item (done or dropped); renew and release are not,
|
|
12
|
+
* so a lease can always be given back.
|
|
13
|
+
*
|
|
14
|
+
* The lease lives in the ledger of the member that owns the work kind file
|
|
15
|
+
* (#2524 D7), whatever directory the command runs in: `records --json`
|
|
16
|
+
* reports it from there too.
|
|
17
|
+
*
|
|
18
|
+
* Exit codes: 0 when the lease was written, 2 when it was refused (someone
|
|
19
|
+
* holds it, it expired, another clone got there first), 1 when the command
|
|
20
|
+
* could not run (usage, an unreadable kind, an unknown item).
|
|
21
|
+
*/
|
|
22
|
+
import type { CommandContext } from "../cli/registry.js";
|
|
23
|
+
import { type WorkLease, type WorkLeaseRefusal, type LeaseHistoryWrite, type LeaseHistoryRecord, type WorkLeaseState } from "../lifecycle/work-lease.js";
|
|
24
|
+
import { type LoadedRecordKind, type RecordEntry } from "./records.js";
|
|
25
|
+
/** The version of the `work` output this chant writes. */
|
|
26
|
+
export declare const WORK_LEASE_CONTRACT_VERSION = 1;
|
|
27
|
+
/** `$id` of the JSON Schema for the `--json` output, shipped beside this file. */
|
|
28
|
+
export declare const WORK_LEASE_OUTPUT_SCHEMA_ID = "https://intentius.io/chant/schemas/workspace/work-lease/v1/work-lease.schema.json";
|
|
29
|
+
export { WORK_LEASE_REFUSALS } from "../lifecycle/work-lease.js";
|
|
30
|
+
/** Exit code when the lease was refused rather than the command failing. */
|
|
31
|
+
export declare const EXIT_LEASE_REFUSED = 2;
|
|
32
|
+
export type WorkVerb = "claim" | "renew" | "release";
|
|
33
|
+
/** Why the command could not run. Closed. */
|
|
34
|
+
export declare const WORK_ERROR_CODES: readonly ["write-usage-invalid", "kind-unreadable", "work-kind-missing", "work-kind-ambiguous", "work-item-unknown", "work-item-closed", "not-a-git-repository"];
|
|
35
|
+
export type WorkErrorCode = (typeof WORK_ERROR_CODES)[number];
|
|
36
|
+
interface DocHead {
|
|
37
|
+
$schema: string;
|
|
38
|
+
contract: number;
|
|
39
|
+
}
|
|
40
|
+
/** What `--json` prints. */
|
|
41
|
+
export type WorkLeaseDocument = DocHead & ({
|
|
42
|
+
item: string;
|
|
43
|
+
event: WorkVerb;
|
|
44
|
+
/** The work kind file, from the repository root. */
|
|
45
|
+
kind: string;
|
|
46
|
+
ref: string;
|
|
47
|
+
lease: Omit<WorkLease, "item">;
|
|
48
|
+
history: LeaseHistoryWrite;
|
|
49
|
+
} | {
|
|
50
|
+
item: string;
|
|
51
|
+
event: WorkVerb;
|
|
52
|
+
kind: string;
|
|
53
|
+
ref: string;
|
|
54
|
+
refused: {
|
|
55
|
+
code: WorkLeaseRefusal;
|
|
56
|
+
message: string;
|
|
57
|
+
heldBy: Omit<WorkLease, "item"> | null;
|
|
58
|
+
};
|
|
59
|
+
} | {
|
|
60
|
+
error: {
|
|
61
|
+
code: WorkErrorCode;
|
|
62
|
+
message: string;
|
|
63
|
+
};
|
|
64
|
+
});
|
|
65
|
+
/** Why a work command could not run, with its code. */
|
|
66
|
+
export declare class WorkError extends Error {
|
|
67
|
+
readonly code: WorkErrorCode;
|
|
68
|
+
constructor(code: WorkErrorCode, message: string);
|
|
69
|
+
}
|
|
70
|
+
/** A work item found by id: its kind, its state, its record, and the repository root its path is from. */
|
|
71
|
+
export interface FoundWorkItem {
|
|
72
|
+
loaded: LoadedRecordKind;
|
|
73
|
+
state: string | null;
|
|
74
|
+
record: RecordEntry;
|
|
75
|
+
root: string;
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* The work kind holding `id`: the one `kind` names, or the one declared work
|
|
79
|
+
* kind with a record `id`. Throws a {@link WorkError}.
|
|
80
|
+
*/
|
|
81
|
+
export declare function findWorkItem(id: string, cwd: string, kind: string | undefined): Promise<FoundWorkItem>;
|
|
82
|
+
/** Parse `--ttl`: a whole number of seconds, or a duration such as 10m. */
|
|
83
|
+
export declare function parseTtl(raw: string): number;
|
|
84
|
+
export interface WorkLeaseRequest {
|
|
85
|
+
verb: WorkVerb;
|
|
86
|
+
id: string;
|
|
87
|
+
holder: string;
|
|
88
|
+
cwd: string;
|
|
89
|
+
kind?: string;
|
|
90
|
+
ttlMs?: number;
|
|
91
|
+
token?: string;
|
|
92
|
+
outcome?: string;
|
|
93
|
+
note?: string;
|
|
94
|
+
}
|
|
95
|
+
/** Run one claim, renew or release and build the document `--json` prints. */
|
|
96
|
+
export declare function workLease(req: WorkLeaseRequest): Promise<WorkLeaseDocument>;
|
|
97
|
+
/** The version of the `work history` output this chant writes: read contract 1. */
|
|
98
|
+
export declare const WORK_HISTORY_CONTRACT_VERSION = 1;
|
|
99
|
+
/** `$id` of the JSON Schema for `work history --json`, shipped beside this file. */
|
|
100
|
+
export declare const WORK_HISTORY_OUTPUT_SCHEMA_ID = "https://intentius.io/chant/schemas/workspace/work-history/v1/work-history.schema.json";
|
|
101
|
+
/** Why `work history` read nothing. Closed. */
|
|
102
|
+
export declare const WORK_HISTORY_ERROR_CODES: readonly ["kind-unreadable", "work-kind-missing", "work-kind-ambiguous", "work-item-unknown", "not-a-git-repository"];
|
|
103
|
+
export type WorkHistoryErrorCode = (typeof WORK_HISTORY_ERROR_CODES)[number];
|
|
104
|
+
/**
|
|
105
|
+
* How a claim ended. `released`: its holder, or someone closing out an
|
|
106
|
+
* expired lease, gave it back, with an outcome when one was given. `held`: it
|
|
107
|
+
* is the live lease now. `expired`: it ran out and nobody released it or
|
|
108
|
+
* claimed the item since. `lost`: it ran out unreleased and another claim
|
|
109
|
+
* took the item.
|
|
110
|
+
*/
|
|
111
|
+
export type ClaimEnd = "released" | "held" | "expired" | "lost";
|
|
112
|
+
/** One claim of a work item: one fencing token, from its claim to how it ended. */
|
|
113
|
+
export interface LeaseClaim {
|
|
114
|
+
token: string;
|
|
115
|
+
holder: string;
|
|
116
|
+
acquiredAt: string;
|
|
117
|
+
/** The expiry its last claim or renew set. */
|
|
118
|
+
expiresAt: string;
|
|
119
|
+
renewals: number;
|
|
120
|
+
ended: ClaimEnd;
|
|
121
|
+
/** The release, when it was released. */
|
|
122
|
+
release: {
|
|
123
|
+
by: string;
|
|
124
|
+
at: string;
|
|
125
|
+
outcome: string | null;
|
|
126
|
+
note: string | null;
|
|
127
|
+
} | null;
|
|
128
|
+
}
|
|
129
|
+
/** What `work history --json` prints. */
|
|
130
|
+
export type WorkHistoryDocument = {
|
|
131
|
+
$schema: string;
|
|
132
|
+
contract: number;
|
|
133
|
+
chant: string;
|
|
134
|
+
item: string;
|
|
135
|
+
/** The work kind file, from the repository root. */
|
|
136
|
+
kind: string;
|
|
137
|
+
/** The lease ref. */
|
|
138
|
+
ref: string;
|
|
139
|
+
/** The history file on the branch, under the member's prefix when the kind's member has one. */
|
|
140
|
+
ledger: {
|
|
141
|
+
branch: string;
|
|
142
|
+
path: string;
|
|
143
|
+
};
|
|
144
|
+
/** The lease ref's record now, live or expired, or null when there is none. Read from local refs, without fetching. */
|
|
145
|
+
lease: (Omit<WorkLease, "item"> & {
|
|
146
|
+
state: "active" | "expired";
|
|
147
|
+
}) | null;
|
|
148
|
+
/** Each claim, oldest first. */
|
|
149
|
+
claims: LeaseClaim[];
|
|
150
|
+
/** Every line of the history, oldest first. */
|
|
151
|
+
events: LeaseHistoryRecord[];
|
|
152
|
+
/** Lines of the history that are not lease events, left out. */
|
|
153
|
+
malformed: number;
|
|
154
|
+
summary: {
|
|
155
|
+
claims: number;
|
|
156
|
+
released: number;
|
|
157
|
+
held: number;
|
|
158
|
+
expired: number;
|
|
159
|
+
lost: number;
|
|
160
|
+
outcomes: Record<string, number>;
|
|
161
|
+
};
|
|
162
|
+
} | {
|
|
163
|
+
$schema: string;
|
|
164
|
+
contract: number;
|
|
165
|
+
chant: string;
|
|
166
|
+
error: {
|
|
167
|
+
code: WorkHistoryErrorCode;
|
|
168
|
+
message: string;
|
|
169
|
+
};
|
|
170
|
+
};
|
|
171
|
+
/** Fold a history into its claims: one per token, in the order they were first seen. */
|
|
172
|
+
export declare function claimsOf(events: LeaseHistoryRecord[], live: Pick<WorkLeaseState, "token" | "state"> | null): LeaseClaim[];
|
|
173
|
+
/**
|
|
174
|
+
* Read work item `id`'s lease history (#2785): every claim, renew and release
|
|
175
|
+
* on `_leases/<id>.jsonl` in the ledger of the member owning the work kind,
|
|
176
|
+
* folded into claims. Read from the local `chant/lifecycle` branch and lease
|
|
177
|
+
* refs; it never fetches, like the other read-contract reads.
|
|
178
|
+
*/
|
|
179
|
+
export declare function workHistory(req: {
|
|
180
|
+
id: string;
|
|
181
|
+
cwd: string;
|
|
182
|
+
kind?: string;
|
|
183
|
+
}): Promise<WorkHistoryDocument>;
|
|
184
|
+
/** The history as lines for a person. */
|
|
185
|
+
export declare function formatWorkHistory(doc: Extract<WorkHistoryDocument, {
|
|
186
|
+
claims: unknown;
|
|
187
|
+
}>): string;
|
|
188
|
+
export declare function runWorkspaceWork(ctx: CommandContext): Promise<number>;
|
|
189
|
+
//# sourceMappingURL=work-cli.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"work-cli.d.ts","sourceRoot":"","sources":["../../src/workspace/work-cli.ts"],"names":[],"mappings":"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BD,wBAAsB,gBAAgB,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CA6C3E"}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Evidence attached to a work item's acceptance criterion by the run that
|
|
3
|
+
* holds its lease (#2772).
|
|
4
|
+
*
|
|
5
|
+
* A work kind with acceptance criteria (`work.acceptance` in the kind, read in
|
|
6
|
+
* `./work.ts`) lists what done means on the record: each criterion has an id,
|
|
7
|
+
* its text and the verification it expects. Evidence in the kind's pins field
|
|
8
|
+
* meets a criterion when it names it, carries `result: pass` and has the
|
|
9
|
+
* criterion's verification. {@link attachWorkEvidence} appends one such entry
|
|
10
|
+
* for a run under the item's work lease (an Op with `workLease`, #2748, such
|
|
11
|
+
* as a steward's), through `records amend`, so the record is written the way
|
|
12
|
+
* a person's amendment writes it.
|
|
13
|
+
*
|
|
14
|
+
* It writes only for the lease's holder, under the token the run was given:
|
|
15
|
+
* a run whose lease expired or went to someone else is refused, as a renewal
|
|
16
|
+
* would be. It refuses a criterion the record doesn't list, and a `manual`
|
|
17
|
+
* one: the run holding the lease is the item's implementer, and a manual
|
|
18
|
+
* verdict comes from someone else. A person records that verdict with
|
|
19
|
+
* `records amend`, naming themselves in `by`.
|
|
20
|
+
*/
|
|
21
|
+
import { type EvidenceResult, type WorkAcceptance } from "./work.js";
|
|
22
|
+
/** Why evidence was not attached. Closed. Nothing is written with any of them. */
|
|
23
|
+
export declare const WORK_EVIDENCE_ERROR_CODES: readonly ["kind-unreadable", "kind-invalid", "schema-unreadable", "schema-id-mismatch", "schema-invalid", "location-missing", "write-usage-invalid", "write-input-invalid", "record-not-found", "amend-id-immutable", "record-closed", "amend-supersede-instead", "record-sign-failed", "record-unparseable", "record-schema-invalid", "record-id-duplicate", "record-supersedes-unknown", "record-supersedes-conflict", "record-remediates-unknown", "record-remediates-not-closed", "session-seal-mismatch", "session-verdict-unknown-record", "work-kind-missing", "work-kind-ambiguous", "work-item-unknown", "work-item-closed", "work-criterion-unknown", "work-acceptance-self-verified", "lease-held", "lease-not-held", "lease-token-mismatch", "not-a-git-repository"];
|
|
24
|
+
export type WorkEvidenceErrorCode = (typeof WORK_EVIDENCE_ERROR_CODES)[number];
|
|
25
|
+
export interface AttachWorkEvidenceRequest {
|
|
26
|
+
/** Where the workspace is found, and what `path` and `kind` resolve against. */
|
|
27
|
+
cwd: string;
|
|
28
|
+
/** The work item. */
|
|
29
|
+
item: string;
|
|
30
|
+
/** The work kind file, when the declaration names more than one with the item. */
|
|
31
|
+
kind?: string;
|
|
32
|
+
/** The lease the run holds: its holder and fencing token. */
|
|
33
|
+
holder: string;
|
|
34
|
+
token: string;
|
|
35
|
+
/** The criterion the evidence is for, by id. */
|
|
36
|
+
criterion: string;
|
|
37
|
+
result: EvidenceResult;
|
|
38
|
+
title: string;
|
|
39
|
+
/** A public link, or */
|
|
40
|
+
url?: string;
|
|
41
|
+
/** a workspace file, pinned by the hash of its bytes now. */
|
|
42
|
+
path?: string;
|
|
43
|
+
/** When the evidence was taken, as an ISO 8601 timestamp. Now by default. */
|
|
44
|
+
asOf?: string;
|
|
45
|
+
}
|
|
46
|
+
/** The version of the attach document this chant writes. */
|
|
47
|
+
export declare const WORK_EVIDENCE_CONTRACT_VERSION = 1;
|
|
48
|
+
/** `$id` of the JSON Schema for the attach document, shipped beside this file. */
|
|
49
|
+
export declare const WORK_EVIDENCE_OUTPUT_SCHEMA_ID = "https://intentius.io/chant/schemas/workspace/work-evidence/v1/work-evidence.schema.json";
|
|
50
|
+
interface DocHead {
|
|
51
|
+
$schema: string;
|
|
52
|
+
contract: number;
|
|
53
|
+
}
|
|
54
|
+
/** What {@link attachWorkEvidence} returns: the entry written, or why nothing was. */
|
|
55
|
+
export type WorkEvidenceDocument = DocHead & ({
|
|
56
|
+
item: string;
|
|
57
|
+
/** The work kind file, from the repository root. */
|
|
58
|
+
kind: string;
|
|
59
|
+
/** The record, from the repository root. */
|
|
60
|
+
path: string;
|
|
61
|
+
/** The entry appended to the kind's pins field. */
|
|
62
|
+
evidence: Record<string, unknown>;
|
|
63
|
+
/** The record's criteria with the new entry counted. */
|
|
64
|
+
acceptance: WorkAcceptance;
|
|
65
|
+
} | {
|
|
66
|
+
error: {
|
|
67
|
+
code: WorkEvidenceErrorCode;
|
|
68
|
+
message: string;
|
|
69
|
+
};
|
|
70
|
+
});
|
|
71
|
+
/** Append one piece of evidence for a criterion to a leased work item. Never throws for a refusal. */
|
|
72
|
+
export declare function attachWorkEvidence(req: AttachWorkEvidenceRequest): Promise<WorkEvidenceDocument>;
|
|
73
|
+
export {};
|
|
74
|
+
//# sourceMappingURL=work-evidence.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"work-evidence.d.ts","sourceRoot":"","sources":["../../src/workspace/work-evidence.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAOH,OAAO,EAAwD,KAAK,cAAc,EAAyB,KAAK,cAAc,EAAE,MAAM,QAAQ,CAAC;AAG/I,kFAAkF;AAClF,eAAO,MAAM,yBAAyB,kvBAYI,CAAC;AAC3C,MAAM,MAAM,qBAAqB,GAAG,CAAC,OAAO,yBAAyB,CAAC,CAAC,MAAM,CAAC,CAAC;AAE/E,MAAM,WAAW,yBAAyB;IACxC,gFAAgF;IAChF,GAAG,EAAE,MAAM,CAAC;IACZ,qBAAqB;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,kFAAkF;IAClF,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,6DAA6D;IAC7D,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,gDAAgD;IAChD,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,cAAc,CAAC;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,wBAAwB;IACxB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,6DAA6D;IAC7D,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,6EAA6E;IAC7E,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,4DAA4D;AAC5D,eAAO,MAAM,8BAA8B,IAAI,CAAC;AAEhD,kFAAkF;AAClF,eAAO,MAAM,8BAA8B,4FAA4F,CAAC;AAExI,UAAU,OAAO;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,sFAAsF;AACtF,MAAM,MAAM,oBAAoB,GAAG,OAAO,GACxC,CACI;IACE,IAAI,EAAE,MAAM,CAAC;IACb,oDAAoD;IACpD,IAAI,EAAE,MAAM,CAAC;IACb,4CAA4C;IAC5C,IAAI,EAAE,MAAM,CAAC;IACb,mDAAmD;IACnD,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAClC,wDAAwD;IACxD,UAAU,EAAE,cAAc,CAAC;CAC5B,GACD;IAAE,KAAK,EAAE;QAAE,IAAI,EAAE,qBAAqB,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAAA;CAAE,CAC9D,CAAC;AAWJ,sGAAsG;AACtG,wBAAsB,kBAAkB,CAAC,GAAG,EAAE,yBAAyB,GAAG,OAAO,CAAC,oBAAoB,CAAC,CA+DtG"}
|
package/dist/workspace/work.d.ts
CHANGED
|
@@ -15,6 +15,8 @@
|
|
|
15
15
|
* record is valid and not superseded;
|
|
16
16
|
* - `blockedBy`: each need that is not done, with its state;
|
|
17
17
|
* - `implements`: each decision it names, with that decision's state;
|
|
18
|
+
* - `acceptance`, for a kind with acceptance criteria (#2772): how many of the
|
|
19
|
+
* record's criteria passing evidence of the expected verification meets;
|
|
18
20
|
*
|
|
19
21
|
* and each decision `implementedBy`, the work records naming it. The
|
|
20
22
|
* warnings are closed codes. `work-done-gap-open` is not raised here: it
|
|
@@ -23,7 +25,7 @@
|
|
|
23
25
|
*/
|
|
24
26
|
import { type LoadedRecordKind, type ReadRecordsOptions, type RecordEntry } from "./records.js";
|
|
25
27
|
/** Why a work record carries a warning. Closed, like the record warning codes. */
|
|
26
|
-
export declare const WORK_WARNING_CODES: readonly ["work-needs-unknown", "work-implements-unknown", "work-needs-cycle", "work-implements-undecided", "work-done-unpinned", "work-closed-without-date", "work-done-gap-open"];
|
|
28
|
+
export declare const WORK_WARNING_CODES: readonly ["work-needs-unknown", "work-implements-unknown", "work-needs-cycle", "work-implements-undecided", "work-done-unpinned", "work-closed-without-date", "work-done-gap-open", "work-acceptance-unmet", "work-acceptance-self-verified"];
|
|
27
29
|
export type WorkWarningCode = (typeof WORK_WARNING_CODES)[number];
|
|
28
30
|
/** A link from a work record to another record, with that record's state now. */
|
|
29
31
|
export interface WorkLink {
|
|
@@ -39,6 +41,46 @@ export interface DecisionWork {
|
|
|
39
41
|
supersededBy: string | null;
|
|
40
42
|
implementedBy: WorkLink[];
|
|
41
43
|
}
|
|
44
|
+
/** How a criterion is to be verified (#2772): by a unit, integration or end-to-end test, by the running system, or by a person. */
|
|
45
|
+
export declare const VERIFICATION_TYPES: readonly ["unit", "integration", "e2e", "runtime", "manual"];
|
|
46
|
+
export type VerificationType = (typeof VERIFICATION_TYPES)[number];
|
|
47
|
+
/** The results a piece of evidence for a criterion can carry. */
|
|
48
|
+
export declare const EVIDENCE_RESULTS: readonly ["pass", "fail"];
|
|
49
|
+
export type EvidenceResult = (typeof EVIDENCE_RESULTS)[number];
|
|
50
|
+
/** One acceptance criterion as a work record states it. */
|
|
51
|
+
export interface Criterion {
|
|
52
|
+
id: string;
|
|
53
|
+
text: string;
|
|
54
|
+
verification: VerificationType;
|
|
55
|
+
}
|
|
56
|
+
/** One criterion on read: whether passing evidence of its verification meets it. */
|
|
57
|
+
export interface CriterionState {
|
|
58
|
+
id: string;
|
|
59
|
+
verification: VerificationType;
|
|
60
|
+
met: boolean;
|
|
61
|
+
}
|
|
62
|
+
/** A work record's acceptance criteria on read (#2772): how many are met, of how many. */
|
|
63
|
+
export interface WorkAcceptance {
|
|
64
|
+
met: number;
|
|
65
|
+
total: number;
|
|
66
|
+
criteria: CriterionState[];
|
|
67
|
+
}
|
|
68
|
+
/** The acceptance criteria a record lists in `field`, leaving out entries without a string id and a known verification (the schema reports those). */
|
|
69
|
+
export declare function acceptanceCriteria(data: Record<string, unknown> | null, field: string): Criterion[];
|
|
70
|
+
/**
|
|
71
|
+
* Which of a record's criteria its evidence meets. Evidence meets a criterion
|
|
72
|
+
* when it names the criterion, its result is `pass` and its verification is
|
|
73
|
+
* the criterion's. A `manual` verdict also names who gave it in `by`, and
|
|
74
|
+
* counts only when that is not the record's implementer; one that is lands in
|
|
75
|
+
* `selfVerified`. `acceptance` is null when the record lists no criteria.
|
|
76
|
+
*/
|
|
77
|
+
export declare function workAcceptance(data: Record<string, unknown> | null, spec: {
|
|
78
|
+
field: string;
|
|
79
|
+
implementer: string;
|
|
80
|
+
}, pinsField: string): {
|
|
81
|
+
acceptance: WorkAcceptance | null;
|
|
82
|
+
selfVerified: string[];
|
|
83
|
+
};
|
|
42
84
|
/** The strings of a front-matter list, or none. */
|
|
43
85
|
export declare function idList(data: Record<string, unknown> | null, field: string): string[];
|
|
44
86
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"work.d.ts","sourceRoot":"","sources":["../../src/workspace/work.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"work.d.ts","sourceRoot":"","sources":["../../src/workspace/work.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAIH,OAAO,EAAmD,KAAK,gBAAgB,EAAE,KAAK,kBAAkB,EAAE,KAAK,WAAW,EAAE,MAAM,WAAW,CAAC;AAE9I,kFAAkF;AAClF,eAAO,MAAM,kBAAkB,+OAmBW,CAAC;AAC3C,MAAM,MAAM,eAAe,GAAG,CAAC,OAAO,kBAAkB,CAAC,CAAC,MAAM,CAAC,CAAC;AAElE,iFAAiF;AACjF,MAAM,WAAW,QAAQ;IACvB,EAAE,EAAE,MAAM,CAAC;IACX,oEAA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pC,IAAI,EAAE;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,WAAW,EAAE,MAAM,CAAA;CAAE,EAC5C,SAAS,EAAE,MAAM,GAChB;IAAE,UAAU,EAAE,cAAc,GAAG,IAAI,CAAC;IAAC,YAAY,EAAE,MAAM,EAAE,CAAA;CAAE,CAwB/D;AAED,mDAAmD;AACnD,wBAAgB,MAAM,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,CAGpF;AAED;;;GAGG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,gBAAgB,CAAC,MAAM,CAAC,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,OAAO,CAGvF;AAED;;;GAGG;AACH,wBAAsB,SAAS,CAAC,MAAM,EAAE,gBAAgB,EAAE,OAAO,EAAE,WAAW,EAAE,EAAE,OAAO,EAAE,kBAAkB,GAAG,OAAO,CAAC;IAAE,SAAS,EAAE,YAAY,EAAE,CAAA;CAAE,CAAC,CAiGrJ"}
|
package/package.json
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { describe, test, expect } from "vitest";
|
|
1
|
+
import { beforeAll, describe, test, expect } from "vitest";
|
|
2
2
|
import { fileURLToPath } from "url";
|
|
3
3
|
import Ajv from "ajv";
|
|
4
4
|
import { auditCommand, tokenForHost, coverageNotes, installLine, NO_LEXICONS_EXIT_CODE } from "./audit";
|
|
@@ -22,6 +22,14 @@ function loadSarifSchema(): unknown {
|
|
|
22
22
|
return JSON.parse(readFileSync(path, "utf-8"));
|
|
23
23
|
}
|
|
24
24
|
|
|
25
|
+
// The first loadAuditPlugins() imports every installed lexicon's plugin, the
|
|
26
|
+
// 15MB azure and 11MB aws generated barrels among them: 13s to 15s cold, which
|
|
27
|
+
// whichever test ran first paid, over the unit shards' per-test budget (#2817).
|
|
28
|
+
// Paid once here, the tests below time the audit, not the imports.
|
|
29
|
+
beforeAll(async () => {
|
|
30
|
+
await loadAuditPlugins();
|
|
31
|
+
}, 120_000);
|
|
32
|
+
|
|
25
33
|
describe("auditCommand", () => {
|
|
26
34
|
test("selects a host-specific token (no cross-host leakage)", () => {
|
|
27
35
|
const env = { GITHUB_TOKEN: "gh", GITLAB_TOKEN: "gl", CODEBERG_TOKEN: "cb" } as unknown as NodeJS.ProcessEnv;
|
|
@@ -506,12 +506,13 @@ export async function buildCommand(options: BuildOptions): Promise<BuildResult>
|
|
|
506
506
|
|
|
507
507
|
// Core-owned post-synth checks over the Op model (#2122, epic #2114
|
|
508
508
|
// sub-issue 6) — OPS012/OPS013/OPS014, ported from a hosting lexicon's
|
|
509
|
-
// own TMP012/TMP013/TMP014
|
|
509
|
+
// own TMP012/TMP013/TMP014, and SYS010 over the decide steps and the
|
|
510
|
+
// backends in `decide.backends` (#2828). An Op is recognized by entity type
|
|
510
511
|
// (`OpResource`), not by which lexicon declared it, so this runs over the
|
|
511
512
|
// FULL build result regardless of which plugins loaded — same as the
|
|
512
513
|
// receipt/output/knowledge checks above.
|
|
513
514
|
if (result.errors.length === 0) {
|
|
514
|
-
const opDiags = runPostSynthChecks(coreOpChecks(), result, env, { activityContracts });
|
|
515
|
+
const opDiags = runPostSynthChecks(coreOpChecks({ decideBackends: config.decide?.backends }), result, env, { activityContracts });
|
|
515
516
|
const { diagnostics: activeDiags, suppressed } = applyConfiguredSeverity(opDiags, config.lint?.rules);
|
|
516
517
|
suppressedPostSynthCount += suppressed.length;
|
|
517
518
|
for (const diag of activeDiags) {
|
package/src/cli/commands/lint.ts
CHANGED
|
@@ -546,8 +546,14 @@ async function runOpCheckDiagnostics(
|
|
|
546
546
|
? await loadActivityContracts(plugins)
|
|
547
547
|
: await loadActivityContracts(await resolveProjectLexicons(infraPath).catch(() => [] as string[]));
|
|
548
548
|
|
|
549
|
+
// SYS010 (#2828) also reads `decide.backends` from the project's config.
|
|
550
|
+
// A directory whose config does not load simply has none to check.
|
|
551
|
+
const decideBackends = await loadChantConfig(findProjectRoot(infraPath))
|
|
552
|
+
.then((loaded) => loaded.config.decide?.backends)
|
|
553
|
+
.catch(() => undefined);
|
|
554
|
+
|
|
549
555
|
const raw = runPostSynthChecks(
|
|
550
|
-
coreOpChecks(),
|
|
556
|
+
coreOpChecks({ decideBackends }),
|
|
551
557
|
{
|
|
552
558
|
outputs: new Map(),
|
|
553
559
|
entities: entities as Map<string, never>,
|