@intentius/chant 0.102.0 → 0.104.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/audit/core.d.ts +2 -0
- package/dist/audit/core.d.ts.map +1 -1
- package/dist/audit/discover.d.ts.map +1 -1
- package/dist/change-set.d.ts +232 -0
- package/dist/change-set.d.ts.map +1 -0
- package/dist/cli/commands/audit.d.ts +7 -0
- package/dist/cli/commands/audit.d.ts.map +1 -1
- package/dist/cli/commands/build.d.ts.map +1 -1
- package/dist/cli/handlers/build.d.ts.map +1 -1
- package/dist/cli/handlers/change-set.d.ts +11 -0
- package/dist/cli/handlers/change-set.d.ts.map +1 -0
- package/dist/cli/handlers/fan-out.d.ts +33 -0
- package/dist/cli/handlers/fan-out.d.ts.map +1 -1
- package/dist/cli/handlers/operator.d.ts +7 -0
- package/dist/cli/handlers/operator.d.ts.map +1 -1
- package/dist/cli/handlers/pr.d.ts +31 -0
- package/dist/cli/handlers/pr.d.ts.map +1 -0
- package/dist/cli/handlers/run.d.ts.map +1 -1
- package/dist/cli/main.d.ts.map +1 -1
- package/dist/cli/mcp/op-tools.d.ts.map +1 -1
- package/dist/cli/mcp/workspace-tools.d.ts +3 -2
- package/dist/cli/mcp/workspace-tools.d.ts.map +1 -1
- package/dist/cli/registry.d.ts +63 -1
- package/dist/cli/registry.d.ts.map +1 -1
- package/dist/components/auto-release.d.ts +16 -0
- package/dist/components/auto-release.d.ts.map +1 -1
- package/dist/components/capability.d.ts +53 -0
- package/dist/components/capability.d.ts.map +1 -1
- package/dist/components/changed-files.d.ts +31 -0
- package/dist/components/changed-files.d.ts.map +1 -0
- package/dist/components/cli-support.d.ts +9 -1
- package/dist/components/cli-support.d.ts.map +1 -1
- package/dist/components/component.d.ts +24 -0
- package/dist/components/component.d.ts.map +1 -1
- package/dist/components/deploy-units.d.ts.map +1 -1
- package/dist/components/driver.d.ts +13 -0
- package/dist/components/driver.d.ts.map +1 -1
- package/dist/components/fan-out-output.d.ts +6 -0
- package/dist/components/fan-out-output.d.ts.map +1 -1
- package/dist/components/fan-out-record.d.ts +41 -0
- package/dist/components/fan-out-record.d.ts.map +1 -0
- package/dist/components/fan-out-run.d.ts +65 -0
- package/dist/components/fan-out-run.d.ts.map +1 -1
- package/dist/components/fan-out-support.d.ts +2 -0
- package/dist/components/fan-out-support.d.ts.map +1 -1
- package/dist/components/fan-out.d.ts +6 -0
- package/dist/components/fan-out.d.ts.map +1 -1
- package/dist/components/gated-wave-pipeline.d.ts +50 -0
- package/dist/components/gated-wave-pipeline.d.ts.map +1 -0
- package/dist/components/index.d.ts +1 -1
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/layers.d.ts +25 -0
- package/dist/components/layers.d.ts.map +1 -0
- package/dist/components/pr-pipeline.d.ts +61 -0
- package/dist/components/pr-pipeline.d.ts.map +1 -0
- package/dist/components/pr-run.d.ts +119 -0
- package/dist/components/pr-run.d.ts.map +1 -0
- package/dist/components/promote.d.ts.map +1 -1
- package/dist/components/verbs/shell.d.ts.map +1 -1
- package/dist/components/wave-plan.d.ts +49 -0
- package/dist/components/wave-plan.d.ts.map +1 -0
- package/dist/gated-waves.d.ts +147 -0
- package/dist/gated-waves.d.ts.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/lexicon.d.ts +48 -0
- package/dist/lexicon.d.ts.map +1 -1
- package/dist/lifecycle/gate-ledger.d.ts +7 -0
- package/dist/lifecycle/gate-ledger.d.ts.map +1 -1
- package/dist/lifecycle/git.d.ts +46 -1
- package/dist/lifecycle/git.d.ts.map +1 -1
- package/dist/lint/post-synth.d.ts +18 -0
- package/dist/lint/post-synth.d.ts.map +1 -1
- package/dist/op/activities/activity-contracts.d.ts +126 -0
- package/dist/op/activities/activity-contracts.d.ts.map +1 -1
- package/dist/op/activities/change-set.d.ts +62 -0
- package/dist/op/activities/change-set.d.ts.map +1 -0
- package/dist/op/activities/decide.d.ts +2 -0
- package/dist/op/activities/decide.d.ts.map +1 -1
- package/dist/op/activities/factory.d.ts +137 -0
- package/dist/op/activities/factory.d.ts.map +1 -0
- package/dist/op/activities/index.d.ts +4 -0
- package/dist/op/activities/index.d.ts.map +1 -1
- package/dist/op/activity-contract.d.ts.map +1 -1
- package/dist/op/builders.d.ts +11 -0
- package/dist/op/builders.d.ts.map +1 -1
- package/dist/op/decide-backend.d.ts +5 -1
- package/dist/op/decide-backend.d.ts.map +1 -1
- package/dist/op/decide-read-inputs.d.ts +4 -2
- package/dist/op/decide-read-inputs.d.ts.map +1 -1
- package/dist/op/factory.d.ts +83 -0
- package/dist/op/factory.d.ts.map +1 -0
- package/dist/op/index.d.ts +4 -1
- package/dist/op/index.d.ts.map +1 -1
- package/dist/op/op-ir.d.ts +2 -0
- package/dist/op/op-ir.d.ts.map +1 -1
- package/dist/op/op-verb-class.d.ts.map +1 -1
- package/dist/op/types.d.ts +8 -0
- package/dist/op/types.d.ts.map +1 -1
- package/dist/op/work-lease-run.d.ts.map +1 -1
- package/dist/plan-summary.d.ts +207 -0
- package/dist/plan-summary.d.ts.map +1 -0
- package/dist/pr-forge.d.ts +105 -0
- package/dist/pr-forge.d.ts.map +1 -0
- package/dist/pr-loop.d.ts +178 -0
- package/dist/pr-loop.d.ts.map +1 -0
- package/dist/telemetry-attribution.d.ts +31 -0
- package/dist/telemetry-attribution.d.ts.map +1 -1
- package/dist/terraform/hcl2json.d.ts +45 -0
- package/dist/terraform/hcl2json.d.ts.map +1 -0
- package/dist/terraform/parse.d.ts +4 -40
- package/dist/terraform/parse.d.ts.map +1 -1
- package/dist/workspace/box-cli.d.ts +12 -0
- package/dist/workspace/box-cli.d.ts.map +1 -0
- package/dist/workspace/box-factory.d.ts +27 -3
- package/dist/workspace/box-factory.d.ts.map +1 -1
- package/dist/workspace/box-listing.d.ts +85 -0
- package/dist/workspace/box-listing.d.ts.map +1 -0
- package/dist/workspace/box-publish.d.ts +147 -0
- package/dist/workspace/box-publish.d.ts.map +1 -0
- package/dist/workspace/broker-protocol.d.ts +190 -0
- package/dist/workspace/broker-protocol.d.ts.map +1 -0
- package/dist/workspace/checks.d.ts.map +1 -1
- package/dist/workspace/composites.d.ts +2 -2
- package/dist/workspace/composites.d.ts.map +1 -1
- package/dist/workspace/conformance/__fixtures__/reference-broker.d.ts +17 -0
- package/dist/workspace/conformance/__fixtures__/reference-broker.d.ts.map +1 -0
- package/dist/workspace/conformance/broker.d.ts +202 -0
- package/dist/workspace/conformance/broker.d.ts.map +1 -0
- package/dist/workspace/conformance/index.d.ts +2 -1
- package/dist/workspace/conformance/index.d.ts.map +1 -1
- package/dist/workspace/conformance/vitest.d.ts +9 -2
- package/dist/workspace/conformance/vitest.d.ts.map +1 -1
- package/dist/workspace/conformance/writer.d.ts +108 -14
- package/dist/workspace/conformance/writer.d.ts.map +1 -1
- package/dist/workspace/decide.d.ts +126 -12
- package/dist/workspace/decide.d.ts.map +1 -1
- package/dist/workspace/decision-points.schema.json +11 -4
- package/dist/workspace/declaration.d.ts +65 -0
- package/dist/workspace/declaration.d.ts.map +1 -1
- package/dist/workspace/declaration.schema.json +153 -4
- package/dist/workspace/environments.d.ts +36 -10
- package/dist/workspace/environments.d.ts.map +1 -1
- package/dist/workspace/factory-rules.d.ts +180 -0
- package/dist/workspace/factory-rules.d.ts.map +1 -0
- package/dist/workspace/init.d.ts +21 -0
- package/dist/workspace/init.d.ts.map +1 -1
- package/dist/workspace/intent-cli.d.ts +1 -1
- package/dist/workspace/intent-cli.d.ts.map +1 -1
- package/dist/workspace/intent-record.d.ts +28 -1
- package/dist/workspace/intent-record.d.ts.map +1 -1
- package/dist/workspace/intent.d.ts +102 -5
- package/dist/workspace/intent.d.ts.map +1 -1
- package/dist/workspace/json-edit.d.ts +24 -0
- package/dist/workspace/json-edit.d.ts.map +1 -0
- package/dist/workspace/jsonc.d.ts +11 -0
- package/dist/workspace/jsonc.d.ts.map +1 -1
- package/dist/workspace/kinds.d.ts +48 -0
- package/dist/workspace/kinds.d.ts.map +1 -1
- package/dist/workspace/lexicon-symbols.d.ts +29 -0
- package/dist/workspace/lexicon-symbols.d.ts.map +1 -0
- package/dist/workspace/lineage-upgrade.d.ts +31 -2
- package/dist/workspace/lineage-upgrade.d.ts.map +1 -1
- package/dist/workspace/point-answer.schema.json +42 -2
- package/dist/workspace/points-cli.d.ts +10 -3
- package/dist/workspace/points-cli.d.ts.map +1 -1
- package/dist/workspace/points.d.ts +66 -5
- package/dist/workspace/points.d.ts.map +1 -1
- package/dist/workspace/reason-codes.d.ts +33 -4
- package/dist/workspace/reason-codes.d.ts.map +1 -1
- package/dist/workspace/record-sessions.d.ts +5 -7
- package/dist/workspace/record-sessions.d.ts.map +1 -1
- package/dist/workspace/records-cli.d.ts +7 -0
- package/dist/workspace/records-cli.d.ts.map +1 -1
- package/dist/workspace/records-close.d.ts +7 -3
- package/dist/workspace/records-close.d.ts.map +1 -1
- package/dist/workspace/records-write.d.ts +66 -6
- package/dist/workspace/records-write.d.ts.map +1 -1
- package/dist/workspace/records.d.ts +28 -9
- package/dist/workspace/records.d.ts.map +1 -1
- package/dist/workspace/runs-cli.d.ts +138 -6
- package/dist/workspace/runs-cli.d.ts.map +1 -1
- package/dist/workspace/runs.d.ts +132 -11
- package/dist/workspace/runs.d.ts.map +1 -1
- package/dist/workspace/session-kinds.d.ts +1 -1
- package/dist/workspace/session-kinds.d.ts.map +1 -1
- package/dist/workspace/squash.d.ts +80 -0
- package/dist/workspace/squash.d.ts.map +1 -0
- package/dist/workspace/status-gates.d.ts +2 -0
- package/dist/workspace/status-gates.d.ts.map +1 -1
- package/dist/workspace/status.d.ts +54 -0
- package/dist/workspace/status.d.ts.map +1 -1
- package/dist/workspace/symbols.d.ts +16 -5
- package/dist/workspace/symbols.d.ts.map +1 -1
- package/dist/workspace/trust/run-commits.d.ts +46 -0
- package/dist/workspace/trust/run-commits.d.ts.map +1 -0
- package/dist/workspace/trust/run-statement.d.ts +128 -0
- package/dist/workspace/trust/run-statement.d.ts.map +1 -0
- package/dist/workspace/trust/seal.d.ts +6 -1
- package/dist/workspace/trust/seal.d.ts.map +1 -1
- package/dist/workspace/trust/verify-cli.d.ts +1 -1
- package/dist/workspace/trust/verify.d.ts +16 -2
- package/dist/workspace/trust/verify.d.ts.map +1 -1
- package/dist/workspace/wip-cli.d.ts +21 -0
- package/dist/workspace/wip-cli.d.ts.map +1 -0
- package/dist/workspace/wip.d.ts +268 -0
- package/dist/workspace/wip.d.ts.map +1 -0
- package/dist/workspace/work-cli.d.ts.map +1 -1
- package/dist/workspace/work-evidence.d.ts +1 -1
- package/dist/workspace/work-evidence.d.ts.map +1 -1
- package/dist/workspace/work-size.d.ts +55 -0
- package/dist/workspace/work-size.d.ts.map +1 -0
- package/dist/workspace/workspace-kinds.schema.json +122 -0
- package/dist/workspace/write-lock-cli.d.ts +60 -0
- package/dist/workspace/write-lock-cli.d.ts.map +1 -0
- package/dist/workspace/write-lock.d.ts +152 -0
- package/dist/workspace/write-lock.d.ts.map +1 -0
- package/dist/workspace/write-scope.d.ts +6 -2
- package/dist/workspace/write-scope.d.ts.map +1 -1
- package/package.json +6 -1
- package/src/__fixtures__/change-set/lifecycle-plan.floci.json +59 -0
- package/src/__fixtures__/change-set/lifecycle-v1.ts.txt +4 -0
- package/src/__fixtures__/change-set/lifecycle-v2.ts.txt +4 -0
- package/src/__fixtures__/change-set/lifecycle.change-set.golden.json +95 -0
- package/src/__fixtures__/change-set/warden.change-set.golden.json +106 -0
- package/src/__fixtures__/change-set/warden.plan.json +44 -0
- package/src/__fixtures__/plan-summary/normalization-vectors.json +1593 -0
- package/src/__fixtures__/pr-loop/pr-apply-applied.note.golden.md +31 -0
- package/src/__fixtures__/pr-loop/pr-apply-refused.note.golden.md +31 -0
- package/src/__fixtures__/pr-loop/pr-plan.golden.json +127 -0
- package/src/__fixtures__/pr-loop/pr-plan.note.golden.md +37 -0
- package/src/audit/core.test.ts +15 -0
- package/src/audit/core.ts +8 -2
- package/src/audit/discover.test.ts +11 -0
- package/src/audit/discover.ts +7 -2
- package/src/change-set-bundle.test.ts +57 -0
- package/src/change-set.test.ts +215 -0
- package/src/change-set.ts +445 -0
- package/src/cli/commands/audit-opt-in.test.ts +54 -0
- package/src/cli/commands/audit.ts +29 -2
- package/src/cli/commands/build.test.ts +19 -0
- package/src/cli/commands/build.ts +3 -2
- package/src/cli/handlers/build.ts +13 -1
- package/src/cli/handlers/change-set.test.ts +56 -0
- package/src/cli/handlers/change-set.ts +44 -0
- package/src/cli/handlers/fan-out.test.ts +221 -2
- package/src/cli/handlers/fan-out.ts +165 -75
- package/src/cli/handlers/graph.ts +3 -0
- package/src/cli/handlers/operator.test.ts +21 -0
- package/src/cli/handlers/operator.ts +34 -3
- package/src/cli/handlers/pr.ts +373 -0
- package/src/cli/handlers/run.ts +1 -0
- package/src/cli/main.test.ts +20 -0
- package/src/cli/main.ts +185 -23
- package/src/cli/mcp/never-over-mcp.test.ts +101 -0
- package/src/cli/mcp/op-tools.ts +24 -2
- package/src/cli/mcp/workspace-tools.test.ts +1 -1
- package/src/cli/mcp/workspace-tools.ts +34 -6
- package/src/cli/registry.ts +63 -1
- package/src/components/auto-release.ts +1 -1
- package/src/components/capability.ts +55 -0
- package/src/components/changed-files.ts +66 -0
- package/src/components/cli-support.ts +28 -5
- package/src/components/component.schema.json +17 -0
- package/src/components/component.ts +25 -0
- package/src/components/deploy-units.ts +3 -0
- package/src/components/driver.test.ts +52 -0
- package/src/components/driver.ts +31 -13
- package/src/components/fan-out-output.ts +42 -1
- package/src/components/fan-out-record.ts +69 -0
- package/src/components/fan-out-run.test.ts +17 -0
- package/src/components/fan-out-run.ts +304 -1
- package/src/components/fan-out-support.ts +3 -0
- package/src/components/fan-out-waves.test.ts +375 -0
- package/src/components/fan-out.ts +18 -17
- package/src/components/gated-wave-pipeline.ts +82 -0
- package/src/components/index.ts +1 -0
- package/src/components/layers.ts +30 -0
- package/src/components/pr-pipeline.ts +91 -0
- package/src/components/pr-run.test.ts +205 -0
- package/src/components/pr-run.ts +280 -0
- package/src/components/promote.ts +5 -0
- package/src/components/verbs/shell.test.ts +11 -0
- package/src/components/verbs/shell.ts +7 -3
- package/src/components/wave-plan.ts +124 -0
- package/src/discovery/sandbox/bundle.ts +1 -1
- package/src/gated-waves-bundle.test.ts +62 -0
- package/src/gated-waves.test.ts +118 -0
- package/src/gated-waves.ts +240 -0
- package/src/index.ts +1 -0
- package/src/lexicon.ts +51 -0
- package/src/lifecycle/gate-ledger.ts +7 -0
- package/src/lifecycle/git.ts +102 -16
- package/src/lint/post-synth.test.ts +19 -0
- package/src/lint/post-synth.ts +19 -1
- package/src/meta/declared-imports.test.ts +1 -1
- package/src/op/activities/activity-contracts.ts +84 -0
- package/src/op/activities/change-set.ts +114 -0
- package/src/op/activities/decide.ts +3 -0
- package/src/op/activities/factory.ts +675 -0
- package/src/op/activities/index.ts +6 -0
- package/src/op/activity-contract.test.ts +21 -1
- package/src/op/activity-contract.ts +19 -9
- package/src/op/builders.ts +23 -0
- package/src/op/decide-backend.ts +5 -1
- package/src/op/decide-read-inputs.ts +33 -5
- package/src/op/factory.e2e.test.ts +232 -0
- package/src/op/factory.ts +118 -0
- package/src/op/index.ts +9 -1
- package/src/op/op-ir.test.ts +9 -0
- package/src/op/op-ir.ts +4 -0
- package/src/op/op-verb-class.ts +3 -0
- package/src/op/types.ts +8 -0
- package/src/op/work-lease-run.ts +3 -0
- package/src/plan-summary.test.ts +263 -0
- package/src/plan-summary.ts +845 -0
- package/src/pr-forge.test.ts +237 -0
- package/src/pr-forge.ts +332 -0
- package/src/pr-loop-bundle.test.ts +46 -0
- package/src/pr-loop.test.ts +171 -0
- package/src/pr-loop.ts +324 -0
- package/src/telemetry-attribution.test.ts +23 -1
- package/src/telemetry-attribution.ts +51 -0
- package/src/terraform/hcl2json.test.ts +21 -0
- package/src/terraform/hcl2json.ts +81 -0
- package/src/terraform/parse.ts +11 -74
- package/src/workspace/__fixtures__/studio-template-84c8b21.json +1 -1
- package/src/workspace/app-kind.test.ts +196 -0
- package/src/workspace/box-cli.ts +113 -0
- package/src/workspace/box-factory.test.ts +4 -1
- package/src/workspace/box-factory.ts +37 -4
- package/src/workspace/box-listing-write.schema.json +204 -0
- package/src/workspace/box-listing.test.ts +234 -0
- package/src/workspace/box-listing.ts +324 -0
- package/src/workspace/box-publish.schema.json +498 -0
- package/src/workspace/box-publish.test.ts +204 -0
- package/src/workspace/box-publish.ts +420 -0
- package/src/workspace/box-ship.test.ts +96 -0
- package/src/workspace/broker-protocol.schema.json +186 -0
- package/src/workspace/broker-protocol.test.ts +122 -0
- package/src/workspace/broker-protocol.ts +317 -0
- package/src/workspace/builder-tiers.test.ts +146 -0
- package/src/workspace/change-set.schema.json +460 -0
- package/src/workspace/chant-migrations.e2e.test.ts +17 -5
- package/src/workspace/checks/boxes.test.ts +3 -0
- package/src/workspace/checks.ts +10 -3
- package/src/workspace/component-environments.test.ts +105 -0
- package/src/workspace/composites.schema.json +23 -4
- package/src/workspace/composites.test.ts +8 -8
- package/src/workspace/composites.ts +13 -2
- package/src/workspace/conformance/__fixture__/decisions/decision.schema.json +2 -2
- package/src/workspace/conformance/__fixtures__/reference-broker.ts +207 -0
- package/src/workspace/conformance/__writer_fixture__/answers/answer.kind.mjs +7 -2
- package/src/workspace/conformance/__writer_fixture__/answers/answer.schema.json +42 -2
- package/src/workspace/conformance/__writer_fixture__/contracts/contract.kind.mjs +37 -0
- package/src/workspace/conformance/__writer_fixture__/contracts/contract.schema.json +213 -0
- package/src/workspace/conformance/__writer_fixture__/decisions/points.json +96 -0
- package/src/workspace/conformance/__writer_fixture__/drivers/driver.kind.mjs +15 -0
- package/src/workspace/conformance/__writer_fixture__/drivers/driver.schema.json +38 -0
- package/src/workspace/conformance/__writer_fixture__/sessions/session.kind.mjs +14 -8
- package/src/workspace/conformance/__writer_fixture__/sessions/session.schema.json +187 -6
- package/src/workspace/conformance/__writer_fixture__/work/work.schema.json +25 -0
- package/src/workspace/conformance/broker.test.ts +122 -0
- package/src/workspace/conformance/broker.ts +792 -0
- package/src/workspace/conformance/conformance.e2e.test.ts +2 -1
- package/src/workspace/conformance/index.mjs +22 -1
- package/src/workspace/conformance/index.ts +5 -1
- package/src/workspace/conformance/vitest.ts +33 -1
- package/src/workspace/conformance/writer-conformance.e2e.test.ts +49 -3
- package/src/workspace/conformance/writer.test.ts +32 -2
- package/src/workspace/conformance/writer.ts +339 -28
- package/src/workspace/decide.test.ts +208 -4
- package/src/workspace/decide.ts +427 -73
- package/src/workspace/decision-points.schema.json +11 -4
- package/src/workspace/declaration.schema.json +153 -4
- package/src/workspace/declaration.ts +141 -0
- package/src/workspace/environments.ts +66 -14
- package/src/workspace/factory-rules.test.ts +62 -0
- package/src/workspace/factory-rules.ts +218 -0
- package/src/workspace/graph-cli.ts +2 -2
- package/src/workspace/graph.schema.json +67 -0
- package/src/workspace/identity.test.ts +23 -0
- package/src/workspace/init.ts +82 -2
- package/src/workspace/intent-cli.ts +26 -9
- package/src/workspace/intent-patch-id.test.ts +162 -0
- package/src/workspace/intent-record.schema.json +130 -3
- package/src/workspace/intent-record.ts +74 -28
- package/src/workspace/intent-reviews.test.ts +76 -0
- package/src/workspace/intent-squash.test.ts +213 -0
- package/src/workspace/intent-why.test.ts +5 -5
- package/src/workspace/intent.schema.json +234 -4
- package/src/workspace/intent.ts +260 -66
- package/src/workspace/json-edit.test.ts +121 -0
- package/src/workspace/json-edit.ts +142 -0
- package/src/workspace/jsonc.ts +20 -0
- package/src/workspace/kinds.ts +157 -2
- package/src/workspace/lexicon-symbols.test.ts +148 -0
- package/src/workspace/lexicon-symbols.ts +125 -0
- package/src/workspace/lineage-upgrade.test.ts +63 -0
- package/src/workspace/lineage-upgrade.ts +146 -5
- package/src/workspace/plan-summary.schema.json +155 -0
- package/src/workspace/point-answer.schema.json +42 -2
- package/src/workspace/points-cli.ts +42 -16
- package/src/workspace/points-write.schema.json +162 -4
- package/src/workspace/points.schema.json +157 -2
- package/src/workspace/points.test.ts +13 -1
- package/src/workspace/points.ts +118 -12
- package/src/workspace/pr-report.schema.json +95 -0
- package/src/workspace/profiles.test.ts +159 -0
- package/src/workspace/read-contract.test.ts +2 -2
- package/src/workspace/reason-codes.test.ts +13 -1
- package/src/workspace/reason-codes.ts +38 -4
- package/src/workspace/record-sessions.ts +9 -8
- package/src/workspace/records-amend.schema.json +78 -0
- package/src/workspace/records-cli.ts +20 -6
- package/src/workspace/records-close.schema.json +78 -0
- package/src/workspace/records-close.ts +31 -7
- package/src/workspace/records-concurrent.e2e.test.ts +135 -0
- package/src/workspace/records-concurrent.test.ts +145 -0
- package/src/workspace/records-formats.test.ts +46 -10
- package/src/workspace/records-new.schema.json +7 -0
- package/src/workspace/records-review.schema.json +78 -0
- package/src/workspace/records-sessions-write.test.ts +69 -0
- package/src/workspace/records-sessions.test.ts +22 -0
- package/src/workspace/records-write.ts +192 -25
- package/src/workspace/records.schema.json +16 -0
- package/src/workspace/records.ts +50 -9
- package/src/workspace/reference-kinds/app/package.json +10 -0
- package/src/workspace/reference-kinds/app/workspace-kinds.json +45 -0
- package/src/workspace/run-statement.schema.json +622 -0
- package/src/workspace/runs-cli.ts +343 -14
- package/src/workspace/runs-statement.test.ts +239 -0
- package/src/workspace/runs-write.schema.json +416 -5
- package/src/workspace/runs.schema.json +451 -4
- package/src/workspace/runs.test.ts +39 -0
- package/src/workspace/runs.ts +296 -35
- package/src/workspace/session-kinds.ts +3 -3
- package/src/workspace/squash.ts +198 -0
- package/src/workspace/status-contract.test.ts +5 -2
- package/src/workspace/status-gates.ts +3 -1
- package/src/workspace/status.schema.json +126 -3
- package/src/workspace/status.ts +90 -1
- package/src/workspace/symbols.ts +20 -9
- package/src/workspace/trust/run-commits.ts +115 -0
- package/src/workspace/trust/run-statement.ts +226 -0
- package/src/workspace/trust/seal.ts +8 -2
- package/src/workspace/trust/verify-cli.ts +6 -5
- package/src/workspace/trust/verify.ts +39 -6
- package/src/workspace/wip-cli.ts +97 -0
- package/src/workspace/wip-write.schema.json +504 -0
- package/src/workspace/wip.schema.json +334 -0
- package/src/workspace/wip.test.ts +294 -0
- package/src/workspace/wip.ts +753 -0
- package/src/workspace/work-cli.ts +3 -0
- package/src/workspace/work-evidence.schema.json +3 -0
- package/src/workspace/work-size.test.ts +77 -0
- package/src/workspace/work-size.ts +93 -0
- package/src/workspace/workspace-kinds.schema.json +122 -0
- package/src/workspace/write-lock-cli.ts +131 -0
- package/src/workspace/write-lock.schema.json +172 -0
- package/src/workspace/write-lock.test.ts +189 -0
- package/src/workspace/write-lock.ts +474 -0
- package/src/workspace/write-scope.test.ts +16 -1
- package/src/workspace/write-scope.ts +33 -11
|
@@ -0,0 +1,239 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* #3192: the agent-run statement. A run's record, signed in a DSSE envelope
|
|
3
|
+
* by a runner or steward key `.chant/trust.json` lists at base, stored as a
|
|
4
|
+
* `statement` line in the run's ledger file, reported by `runs --json` and
|
|
5
|
+
* `runs verify`, and counted by `workspace verify`.
|
|
6
|
+
*
|
|
7
|
+
* - main holds the declaration and a trust policy listing `lobby` (service).
|
|
8
|
+
* - Run A works on W-1 for alice and makes c1 with its Chant-Run trailer;
|
|
9
|
+
* the lobby's key signs it here with `runs sign --key`.
|
|
10
|
+
* - Run B is signed elsewhere: `runs statement` gives the payload, the
|
|
11
|
+
* signer signs it, and `runs sign --envelope` checks and stores it.
|
|
12
|
+
* - Run C ends unsigned and makes c3; run D never ends.
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
import { generateKeyPairSync } from "node:crypto";
|
|
16
|
+
import { afterAll, beforeAll, describe, expect, test } from "vitest";
|
|
17
|
+
import { cleanScratch, contract, git, repo, writeFiles } from "./__fixtures__/contract-repo";
|
|
18
|
+
import { runsSign, runStatement, runsVerify, runsWrite, workspaceRuns, type RunsWriteDocument } from "./runs-cli";
|
|
19
|
+
import runsSchema from "./runs.schema.json";
|
|
20
|
+
import runsWriteSchema from "./runs-write.schema.json";
|
|
21
|
+
import runStatementSchema from "./run-statement.schema.json";
|
|
22
|
+
import { IN_TOTO_PAYLOAD_TYPE, loadRunnerKey, signEnvelope } from "./trust/dsse";
|
|
23
|
+
import { buildRunStatement, signRunStatement, verifyRunStatement } from "./trust/run-statement";
|
|
24
|
+
import { verifyChange } from "./trust/verify";
|
|
25
|
+
|
|
26
|
+
const writeContract = contract(runsWriteSchema);
|
|
27
|
+
const readContract = contract(runsSchema);
|
|
28
|
+
const statementContract = contract(runStatementSchema);
|
|
29
|
+
|
|
30
|
+
function runnerKey(): { pem: string; pub: string } {
|
|
31
|
+
const { privateKey } = generateKeyPairSync("ed25519");
|
|
32
|
+
const pem = privateKey.export({ format: "pem", type: "pkcs8" }).toString();
|
|
33
|
+
return { pem, pub: loadRunnerKey(pem).publicKey };
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
let root: string;
|
|
37
|
+
const lobby = runnerKey();
|
|
38
|
+
const stranger = runnerKey();
|
|
39
|
+
const sha: Record<string, string> = {};
|
|
40
|
+
const run: Record<string, string> = {};
|
|
41
|
+
|
|
42
|
+
const trust = (runners: { principal: string; class: string; key: string }[]) => JSON.stringify({ schema: 1, runners });
|
|
43
|
+
|
|
44
|
+
function commit(message: string[]): string {
|
|
45
|
+
git(root, "add", "-A");
|
|
46
|
+
git(root, "commit", "-q", ...message.flatMap((m) => ["-m", m]));
|
|
47
|
+
return git(root, "rev-parse", "HEAD");
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
async function write(verb: "start" | "end" | "record", fields: object, id?: string): Promise<Exclude<RunsWriteDocument, { error: unknown }>> {
|
|
51
|
+
const doc = await runsWrite({ verb, id, fields: JSON.stringify(fields), cwd: root });
|
|
52
|
+
writeContract.expectValid(doc);
|
|
53
|
+
if ("error" in doc) throw new Error(`${doc.error.code}: ${doc.error.message}`);
|
|
54
|
+
return doc;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
async function sign(id: string, opts: { keyPem?: string; envelope?: string }): Promise<RunsWriteDocument> {
|
|
58
|
+
const doc = await runsSign({ id, cwd: root, ...opts });
|
|
59
|
+
writeContract.expectValid(doc);
|
|
60
|
+
return doc;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
beforeAll(async () => {
|
|
64
|
+
root = repo({
|
|
65
|
+
"chant.workspace.json": JSON.stringify({ name: "statements", schema: 1, members: [{ name: "app", dir: "app", kind: "other", because: "the app" }] }),
|
|
66
|
+
".chant/trust.json": trust([{ principal: "lobby", class: "service", key: lobby.pub }]),
|
|
67
|
+
"app/main.js": "export const n = 0;\n",
|
|
68
|
+
});
|
|
69
|
+
sha.c0 = commit(["the workspace"]);
|
|
70
|
+
git(root, "branch", "-M", "main");
|
|
71
|
+
|
|
72
|
+
const a = await write("start", { harness: { name: "claude-code", version: "2.1.0" }, model: "claude-opus-5-5", provider: "anthropic", by: "alice", unit: "W-1", startedAt: "2026-10-01T10:00:00Z" });
|
|
73
|
+
run.a = a.run.id;
|
|
74
|
+
writeFiles(root, { "app/main.js": "export const n = 1;\n" });
|
|
75
|
+
sha.c1 = commit(["one", a.trailer]);
|
|
76
|
+
await write("end", { endedAt: "2026-10-01T10:05:00Z", outcome: "done", cost: { amount: 0.5, currency: "USD", source: "lobby:list-2026-09" } }, run.a);
|
|
77
|
+
|
|
78
|
+
writeFiles(root, { "app/main.js": "export const n = 2;\n" });
|
|
79
|
+
sha.c2 = commit(["two, by a person"]);
|
|
80
|
+
run.b = (await write("record", { id: "chat-0001", harness: "hud-chat", model: "claude-sonnet", by: "bob", startedAt: "2026-10-01T11:00:00Z", endedAt: "2026-10-01T11:00:30Z", commits: [sha.c2] })).run.id;
|
|
81
|
+
|
|
82
|
+
run.c = (await write("start", { id: "build-c", harness: "claude-code", model: "claude-opus-5-5", by: "carol", unit: "W-2", startedAt: "2026-10-01T12:00:00Z" })).run.id;
|
|
83
|
+
writeFiles(root, { "app/main.js": "export const n = 3;\n" });
|
|
84
|
+
sha.c3 = commit(["three", "Chant-Run: build-c"]);
|
|
85
|
+
await write("end", { endedAt: "2026-10-01T12:05:00Z", outcome: "done" }, run.c);
|
|
86
|
+
run.d = (await write("start", { id: "build-d", harness: "claude-code", by: "alice", startedAt: "2026-10-01T13:00:00Z" })).run.id;
|
|
87
|
+
}, 60_000);
|
|
88
|
+
afterAll(cleanScratch);
|
|
89
|
+
|
|
90
|
+
describe("signing a run", () => {
|
|
91
|
+
test("runs sign --key stores a statement over the record, its unit, harness, model and commits", async () => {
|
|
92
|
+
const doc = await sign(run.a, { keyPem: lobby.pem });
|
|
93
|
+
if ("error" in doc) throw new Error(`${doc.error.code}: ${doc.error.message}`);
|
|
94
|
+
expect(doc.verb).toBe("sign");
|
|
95
|
+
expect(doc.statement).toMatchObject({ signer: "lobby", class: "service" });
|
|
96
|
+
expect(doc.run.statements).toHaveLength(1);
|
|
97
|
+
expect(doc.run.attestation).toMatchObject({ status: "signed", signer: "lobby", commits: [sha.c1] });
|
|
98
|
+
const statement = JSON.parse(Buffer.from(doc.statement!.envelope.payload, "base64").toString("utf8"));
|
|
99
|
+
expect(statement.predicateType).toBe("https://intentius.io/chant/agent-run/v1");
|
|
100
|
+
expect(statement.subject).toEqual([{ name: sha.c1, digest: { gitCommit: sha.c1 }, annotations: { patchId: expect.stringMatching(/^[0-9a-f]{40}$/) } }]);
|
|
101
|
+
expect(statement.predicate).toEqual({
|
|
102
|
+
signer: "lobby",
|
|
103
|
+
run: { id: run.a, record: { sha256: doc.run.record!.sha256 } },
|
|
104
|
+
unit: { id: "W-1", kind: null },
|
|
105
|
+
harness: { name: "claude-code", version: "2.1.0" },
|
|
106
|
+
model: "claude-opus-5-5",
|
|
107
|
+
provider: "anthropic",
|
|
108
|
+
by: "alice",
|
|
109
|
+
});
|
|
110
|
+
});
|
|
111
|
+
|
|
112
|
+
test("a statement signed elsewhere is printed with runs statement, then checked and stored with runs sign --envelope", async () => {
|
|
113
|
+
const s = await runStatement(run.b, "lobby", root);
|
|
114
|
+
statementContract.expectValid(s);
|
|
115
|
+
if ("error" in s) throw new Error(s.error.message);
|
|
116
|
+
if (s.verb !== "statement") throw new Error("not a statement document");
|
|
117
|
+
// The signer signs the payload as given, with any DSSE library.
|
|
118
|
+
const { key } = loadRunnerKey(lobby.pem);
|
|
119
|
+
const envelope = signEnvelope(s.payloadType, Buffer.from(s.payload, "base64"), key, lobby.pub);
|
|
120
|
+
expect(s.payloadType).toBe(IN_TOTO_PAYLOAD_TYPE);
|
|
121
|
+
const doc = await sign(run.b, { envelope: JSON.stringify(envelope) });
|
|
122
|
+
if ("error" in doc) throw new Error(`${doc.error.code}: ${doc.error.message}`);
|
|
123
|
+
expect(doc.run.attestation).toMatchObject({ status: "signed", signer: "lobby", commits: [sha.c2] });
|
|
124
|
+
});
|
|
125
|
+
|
|
126
|
+
test("refuses a key the policy at base does not list, a run that has not ended, and an envelope that is not the run's", async () => {
|
|
127
|
+
const refused = async (id: string, opts: { keyPem?: string; envelope?: string }) => {
|
|
128
|
+
const doc = await sign(id, opts);
|
|
129
|
+
return "error" in doc ? doc.error.code : "written";
|
|
130
|
+
};
|
|
131
|
+
expect(await refused(run.c, { keyPem: stranger.pem })).toBe("runner-key-unlisted");
|
|
132
|
+
expect(await refused(run.c, { keyPem: "not a key" })).toBe("runner-key-invalid");
|
|
133
|
+
expect(await refused(run.d, { keyPem: lobby.pem })).toBe("run-not-ended");
|
|
134
|
+
expect(await refused("nope", { keyPem: lobby.pem })).toBe("run-unknown");
|
|
135
|
+
expect(await refused(run.c, { envelope: "{" })).toBe("envelope-unreadable");
|
|
136
|
+
|
|
137
|
+
const runs = await workspaceRuns({ cwd: root });
|
|
138
|
+
if ("error" in runs) throw new Error(runs.error.message);
|
|
139
|
+
const c = runs.runs.find((r) => r.id === run.c)!;
|
|
140
|
+
const { key } = loadRunnerKey(lobby.pem);
|
|
141
|
+
const strangerKey = loadRunnerKey(stranger.pem);
|
|
142
|
+
// Signed by a key nobody listed.
|
|
143
|
+
expect(await refused(run.c, { envelope: JSON.stringify(signRunStatement(buildRunStatement(c, "lobby"), strangerKey.key, stranger.pub)) })).toBe("envelope-untrusted");
|
|
144
|
+
// The lobby's key, speaking for another signer.
|
|
145
|
+
expect(await refused(run.c, { envelope: JSON.stringify(signRunStatement(buildRunStatement(c, "ci"), key, lobby.pub)) })).toBe("run-statement-signer-mismatch");
|
|
146
|
+
// The lobby's key, saying the run used another model than its record does.
|
|
147
|
+
expect(await refused(run.c, { envelope: JSON.stringify(signRunStatement(buildRunStatement({ ...c, model: "claude-haiku" }, "lobby"), key, lobby.pub)) })).toBe("run-statement-mismatch");
|
|
148
|
+
// Run A's statement, offered for run C.
|
|
149
|
+
const a = runs.runs.find((r) => r.id === run.a)!;
|
|
150
|
+
expect(await refused(run.c, { envelope: JSON.stringify(a.statements[0].envelope) })).toBe("run-statement-mismatch");
|
|
151
|
+
// A DSSE envelope over something other than an agent-run statement.
|
|
152
|
+
expect(await refused(run.c, { envelope: JSON.stringify(signEnvelope(IN_TOTO_PAYLOAD_TYPE, Buffer.from("{}"), key, lobby.pub)) })).toBe("run-statement-invalid");
|
|
153
|
+
|
|
154
|
+
const after = await workspaceRuns({ cwd: root });
|
|
155
|
+
if ("error" in after) throw new Error(after.error.message);
|
|
156
|
+
expect(after.runs.find((r) => r.id === run.c)!.statements).toEqual([]);
|
|
157
|
+
});
|
|
158
|
+
|
|
159
|
+
test("a record that changed after signing no longer matches its statement", () => {
|
|
160
|
+
return workspaceRuns({ cwd: root }).then((doc) => {
|
|
161
|
+
if ("error" in doc) throw new Error(doc.error.message);
|
|
162
|
+
const a = doc.runs.find((r) => r.id === run.a)!;
|
|
163
|
+
const policyRunners = [{ principal: "lobby", class: "service" as const, key: lobby.pub }];
|
|
164
|
+
expect(verifyRunStatement(a.statements[0].envelope, policyRunners, a).status).toBe("verified");
|
|
165
|
+
const v = verifyRunStatement(a.statements[0].envelope, policyRunners, { ...a, record: { sha256: "0".repeat(64) } });
|
|
166
|
+
expect(v).toMatchObject({ status: "mismatch", code: "run-statement-mismatch", signer: "lobby" });
|
|
167
|
+
});
|
|
168
|
+
});
|
|
169
|
+
});
|
|
170
|
+
|
|
171
|
+
describe("reading statements", () => {
|
|
172
|
+
test("runs --json carries each run's record hash, its statements and their verdict against the keys at base", async () => {
|
|
173
|
+
const doc = await workspaceRuns({ cwd: root });
|
|
174
|
+
readContract.expectValid(doc);
|
|
175
|
+
if ("error" in doc) throw new Error(doc.error.message);
|
|
176
|
+
expect(doc.trust).toMatchObject({ baseFrom: "main", runners: [{ principal: "lobby", class: "service" }], problems: [] });
|
|
177
|
+
const by = Object.fromEntries(doc.runs.map((r) => [r.id, r]));
|
|
178
|
+
expect(by[run.a].attestation).toMatchObject({ status: "signed", signer: "lobby", class: "service", code: null });
|
|
179
|
+
expect(by[run.b].attestation?.status).toBe("signed");
|
|
180
|
+
expect(by[run.c].attestation).toMatchObject({ status: "unsigned", code: null });
|
|
181
|
+
expect(by[run.d].record).toBeNull();
|
|
182
|
+
expect(by[run.d].attestation?.reason).toMatch(/has not ended/);
|
|
183
|
+
});
|
|
184
|
+
|
|
185
|
+
test("runs verify reports and never fails on its own; --require signed fails on an ended run that is not signed", async () => {
|
|
186
|
+
const report = await runsVerify({ cwd: root });
|
|
187
|
+
statementContract.expectValid(report);
|
|
188
|
+
if ("error" in report || report.verb !== "verify") throw new Error("not a verify document");
|
|
189
|
+
expect(report.ok).toBe(true);
|
|
190
|
+
expect(report.summary).toEqual({ runs: 4, signed: 2, unsigned: 2, failed: 0, running: 1 });
|
|
191
|
+
|
|
192
|
+
const required = await runsVerify({ cwd: root, require: "signed" });
|
|
193
|
+
statementContract.expectValid(required);
|
|
194
|
+
if ("error" in required || required.verb !== "verify") throw new Error("not a verify document");
|
|
195
|
+
expect(required.ok).toBe(false);
|
|
196
|
+
expect(required.failures).toHaveLength(1);
|
|
197
|
+
expect(required.failures[0]).toMatch(/^build-c is unsigned/);
|
|
198
|
+
|
|
199
|
+
const one = await runsVerify({ cwd: root, id: run.a, require: "signed" });
|
|
200
|
+
if ("error" in one || one.verb !== "verify") throw new Error("not a verify document");
|
|
201
|
+
expect(one.ok).toBe(true);
|
|
202
|
+
const unknown = await runsVerify({ cwd: root, id: "nope" });
|
|
203
|
+
statementContract.expectValid(unknown);
|
|
204
|
+
expect("error" in unknown && unknown.error.code).toBe("run-unknown");
|
|
205
|
+
});
|
|
206
|
+
});
|
|
207
|
+
|
|
208
|
+
describe("workspace verify counts a commit a signed run made", () => {
|
|
209
|
+
test("--require attested-runs needs a statement for each commit a run made, and nothing of a person's", () => {
|
|
210
|
+
const report = verifyChange({ repo: root, base: sha.c0, head: "HEAD", require: "attested-runs", attestors: [] });
|
|
211
|
+
expect(report.runs.runners).toEqual(["lobby"]);
|
|
212
|
+
expect(report.runs.commits.map((c) => [c.commit, c.runs, c.attested])).toEqual([
|
|
213
|
+
[sha.c1, [run.a], true],
|
|
214
|
+
[sha.c2, [run.b], true],
|
|
215
|
+
[sha.c3, [run.c], false],
|
|
216
|
+
]);
|
|
217
|
+
expect(report.ok).toBe(false);
|
|
218
|
+
expect(report.failures).toEqual([expect.stringMatching(new RegExp(`^${sha.c3.slice(0, 8)} was made by agent run build-c`))]);
|
|
219
|
+
|
|
220
|
+
const upToC2 = verifyChange({ repo: root, base: sha.c0, head: sha.c2, require: "attested-runs", attestors: [] });
|
|
221
|
+
expect(upToC2.ok).toBe(true);
|
|
222
|
+
// Without --require the same report fails nothing (studio-035 d).
|
|
223
|
+
expect(verifyChange({ repo: root, base: sha.c0, head: "HEAD", attestors: [] }).ok).toBe(true);
|
|
224
|
+
});
|
|
225
|
+
|
|
226
|
+
test("a runner key removed at base no longer vouches for what it signed", async () => {
|
|
227
|
+
writeFiles(root, { ".chant/trust.json": trust([]) });
|
|
228
|
+
const revoked = commit(["remove the lobby's key"]);
|
|
229
|
+
const doc = await workspaceRuns({ cwd: root });
|
|
230
|
+
if ("error" in doc) throw new Error(doc.error.message);
|
|
231
|
+
expect(doc.runs.find((r) => r.id === run.a)!.attestation).toMatchObject({ status: "untrusted", code: "envelope-untrusted" });
|
|
232
|
+
const report = verifyChange({ repo: root, base: revoked, head: "HEAD", require: "attested-runs", attestors: [] });
|
|
233
|
+
expect(report.runs.runners).toEqual([]);
|
|
234
|
+
// Judged by the policy at the older base, the statement still verifies.
|
|
235
|
+
const older = await workspaceRuns({ cwd: root, base: sha.c0 });
|
|
236
|
+
if ("error" in older) throw new Error(older.error.message);
|
|
237
|
+
expect(older.runs.find((r) => r.id === run.a)!.attestation?.status).toBe("signed");
|
|
238
|
+
});
|
|
239
|
+
});
|