@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
|
@@ -19,16 +19,31 @@
|
|
|
19
19
|
* as well, after checking both files, so the two lists never differ.
|
|
20
20
|
* `records close` is in `records-close.ts`.
|
|
21
21
|
*
|
|
22
|
+
* Each write holds the working tree's write lock (`write-lock.ts`, #3173,
|
|
23
|
+
* ws-089) from its first read to its last write, so writes to one working
|
|
24
|
+
* tree never interleave. `amend`, `review` and `close` take `--expect
|
|
25
|
+
* <digest>`: the record's digest the caller last read. When the record has
|
|
26
|
+
* moved on since, the write is refused with record-conflict, naming the
|
|
27
|
+
* digest it has now and the last chant write of it, and the caller re-reads
|
|
28
|
+
* and tries again.
|
|
29
|
+
*
|
|
22
30
|
* `new --sign` and `amend --sign` seal the record's author (#2688), and
|
|
23
31
|
* `review --sign` seals a verdict (#2687): see `trust/seal.ts`. A record of
|
|
24
32
|
* a kind that declares `seal` gets its whole-file seal when `new` or `amend`
|
|
25
33
|
* writes it into a closed state (#2546, ws-063).
|
|
34
|
+
*
|
|
35
|
+
* `new` also writes a record of a content-addressed JSON kind (`format:
|
|
36
|
+
* "json"`, `idFrom: "sha256"`, ws-053), such as the reference workspace's
|
|
37
|
+
* evidence (ws-082): the fields as JSON, in a file named for the SHA-256 of
|
|
38
|
+
* its bytes. Such a record never changes, so amend, review and close refuse
|
|
39
|
+
* the kind.
|
|
26
40
|
*/
|
|
27
41
|
import type { CommandContext } from "../cli/registry.js";
|
|
28
42
|
import { type RecordSource } from "./record-source.js";
|
|
29
43
|
import { type LoadedRecordKind, type RecordEntry, type RecordWarning } from "./records.js";
|
|
30
44
|
import { type ScopeSource } from "./write-scope.js";
|
|
31
45
|
import type { WriteVerb } from "./declaration.js";
|
|
46
|
+
import { type LastWrite, type WriteLockWho } from "./write-lock.js";
|
|
32
47
|
/** The version of the write documents this chant prints. */
|
|
33
48
|
export declare const RECORDS_WRITE_CONTRACT_VERSION = 1;
|
|
34
49
|
export declare const RECORDS_NEW_SCHEMA_ID = "https://intentius.io/chant/schemas/workspace/records-new/v1/records-new.schema.json";
|
|
@@ -37,11 +52,11 @@ export declare const RECORDS_REVIEW_SCHEMA_ID = "https://intentius.io/chant/sche
|
|
|
37
52
|
/** Loading the kind and reading its records, as `records` reads them. */
|
|
38
53
|
export declare const LOAD_ERROR_CODES: readonly ["kind-unreadable", "kind-invalid", "schema-unreadable", "schema-id-mismatch", "schema-invalid", "location-missing"];
|
|
39
54
|
/** Why `records new` wrote nothing. Closed: a reader may switch on it. */
|
|
40
|
-
export declare const NEW_ERROR_CODES: readonly ["kind-unreadable", "kind-invalid", "schema-unreadable", "schema-id-mismatch", "schema-invalid", "location-missing", "write-usage-invalid", "write-input-invalid", "record-id-taken", "record-id-unallocatable", "record-path-unmatched", "record-sign-failed", "source-harvest-not-proposed", "record-state-not-initial", "ratify-quorum-not-met", "write-scope-member", "write-scope-kind", "write-scope-class-unknown", "agent-unknown", "principal-unidentified", "record-unparseable", "record-schema-invalid", "record-id-duplicate", "record-supersedes-unknown", "record-supersedes-conflict", "record-remediates-unknown", "record-remediates-not-closed", "record-seal-mismatch", "session-seal-mismatch", "session-verdict-unknown-record"];
|
|
55
|
+
export declare const NEW_ERROR_CODES: readonly ["kind-unreadable", "kind-invalid", "schema-unreadable", "schema-id-mismatch", "schema-invalid", "location-missing", "write-usage-invalid", "write-input-invalid", "record-id-taken", "record-id-unallocatable", "record-path-unmatched", "record-sign-failed", "source-harvest-not-proposed", "record-state-not-initial", "ratify-quorum-not-met", "write-lock-timeout", "write-lock-not-held", "write-scope-member", "write-scope-kind", "write-scope-class-unknown", "agent-unknown", "principal-unidentified", "record-unparseable", "record-schema-invalid", "record-id-duplicate", "record-supersedes-unknown", "record-supersedes-conflict", "record-remediates-unknown", "record-remediates-not-closed", "record-seal-mismatch", "session-seal-mismatch", "session-verdict-unknown-record"];
|
|
41
56
|
/** Why `records amend` wrote nothing. */
|
|
42
|
-
export declare const AMEND_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", "ratify-quorum-not-met", "write-scope-member", "write-scope-kind", "write-scope-class-unknown", "agent-unknown", "principal-unidentified", "record-unparseable", "record-schema-invalid", "record-id-duplicate", "record-supersedes-unknown", "record-supersedes-conflict", "record-remediates-unknown", "record-remediates-not-closed", "record-seal-mismatch", "session-seal-mismatch", "session-verdict-unknown-record"];
|
|
57
|
+
export declare const AMEND_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", "ratify-quorum-not-met", "record-conflict", "write-lock-timeout", "write-lock-not-held", "write-scope-member", "write-scope-kind", "write-scope-class-unknown", "agent-unknown", "principal-unidentified", "record-unparseable", "record-schema-invalid", "record-id-duplicate", "record-supersedes-unknown", "record-supersedes-conflict", "record-remediates-unknown", "record-remediates-not-closed", "record-seal-mismatch", "session-seal-mismatch", "session-verdict-unknown-record"];
|
|
43
58
|
/** Why `records review` wrote nothing. */
|
|
44
|
-
export declare const REVIEW_ERROR_CODES: readonly ["kind-unreadable", "kind-invalid", "schema-unreadable", "schema-id-mismatch", "schema-invalid", "location-missing", "write-usage-invalid", "record-not-found", "review-unsupported", "record-closed", "review-note-required", "review-sign-failed", "session-unknown", "session-not-open", "write-scope-member", "write-scope-kind", "write-scope-class-unknown", "agent-unknown", "principal-unidentified", "record-unparseable", "record-schema-invalid", "record-id-duplicate", "record-supersedes-unknown", "record-supersedes-conflict", "record-remediates-unknown", "record-remediates-not-closed", "record-seal-mismatch", "session-seal-mismatch", "session-verdict-unknown-record"];
|
|
59
|
+
export declare const REVIEW_ERROR_CODES: readonly ["kind-unreadable", "kind-invalid", "schema-unreadable", "schema-id-mismatch", "schema-invalid", "location-missing", "write-usage-invalid", "record-not-found", "review-unsupported", "record-closed", "review-note-required", "review-sign-failed", "session-unknown", "session-not-open", "record-conflict", "write-lock-timeout", "write-lock-not-held", "write-scope-member", "write-scope-kind", "write-scope-class-unknown", "agent-unknown", "principal-unidentified", "record-unparseable", "record-schema-invalid", "record-id-duplicate", "record-supersedes-unknown", "record-supersedes-conflict", "record-remediates-unknown", "record-remediates-not-closed", "record-seal-mismatch", "session-seal-mismatch", "session-verdict-unknown-record"];
|
|
45
60
|
export type NewErrorCode = (typeof NEW_ERROR_CODES)[number];
|
|
46
61
|
export type AmendErrorCode = (typeof AMEND_ERROR_CODES)[number];
|
|
47
62
|
export type ReviewErrorCode = (typeof REVIEW_ERROR_CODES)[number];
|
|
@@ -50,7 +65,24 @@ export declare const VERDICTS: readonly ["agree", "dissent", "abstain"];
|
|
|
50
65
|
export type Verdict = (typeof VERDICTS)[number];
|
|
51
66
|
export declare class RecordWriteError extends Error {
|
|
52
67
|
readonly code: WriteErrorCode;
|
|
53
|
-
|
|
68
|
+
/** With record-conflict: the record as it is now. */
|
|
69
|
+
readonly conflict?: RecordConflict | undefined;
|
|
70
|
+
constructor(code: WriteErrorCode, message: string,
|
|
71
|
+
/** With record-conflict: the record as it is now. */
|
|
72
|
+
conflict?: RecordConflict | undefined);
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* What a record-conflict refusal says about the record (#3173): the digest
|
|
76
|
+
* the caller expected, the one it has now, and the last chant write of it
|
|
77
|
+
* when the journal knows it. The caller re-reads the record and writes again
|
|
78
|
+
* with `--expect` set to `digest`.
|
|
79
|
+
*/
|
|
80
|
+
export interface RecordConflict {
|
|
81
|
+
id: string;
|
|
82
|
+
path: string;
|
|
83
|
+
expected: string;
|
|
84
|
+
digest: string;
|
|
85
|
+
lastWrite: LastWrite | null;
|
|
54
86
|
}
|
|
55
87
|
export interface KindView {
|
|
56
88
|
name: string;
|
|
@@ -69,6 +101,12 @@ export interface WriteResult {
|
|
|
69
101
|
dryRun: boolean;
|
|
70
102
|
/** The written record's warnings, as `records` would report them. */
|
|
71
103
|
warnings: RecordWarning[];
|
|
104
|
+
/**
|
|
105
|
+
* The record's digest after the write, as `records --json` reports it
|
|
106
|
+
* (#3173): what the caller passes as `--expect` to its next write of the
|
|
107
|
+
* record.
|
|
108
|
+
*/
|
|
109
|
+
digest: string;
|
|
72
110
|
/** With --dry-run, the whole text the command would write. */
|
|
73
111
|
text?: string;
|
|
74
112
|
}
|
|
@@ -79,6 +117,8 @@ export interface WriteFailure<C> {
|
|
|
79
117
|
code: C;
|
|
80
118
|
message: string;
|
|
81
119
|
};
|
|
120
|
+
/** With record-conflict (#3173): the record as it is now. */
|
|
121
|
+
conflict?: RecordConflict;
|
|
82
122
|
}
|
|
83
123
|
/** A record's author seal as `new` and `amend` write it with `--sign` (#2688). */
|
|
84
124
|
export interface AuthorSeal {
|
|
@@ -148,7 +188,11 @@ export interface Opened {
|
|
|
148
188
|
/** The records directory, from `root`. */
|
|
149
189
|
dirRel: string;
|
|
150
190
|
}
|
|
151
|
-
|
|
191
|
+
/** A kind `records new` writes as one JSON file named for the SHA-256 of its bytes (ws-053, ws-082). */
|
|
192
|
+
export declare function isContentAddressed(kind: LoadedRecordKind["kind"]): boolean;
|
|
193
|
+
export declare function open(kind: string, cwd: string, opts?: {
|
|
194
|
+
contentAddressed?: boolean;
|
|
195
|
+
}): Promise<Opened>;
|
|
152
196
|
/**
|
|
153
197
|
* Refuse a write outside the writer's scope (#2548): the kind `o` opened,
|
|
154
198
|
* written with `verb`, by the session `agent` names (`CHANT_AGENT`) or the
|
|
@@ -175,6 +219,18 @@ export declare function overlay(base: RecordSource, path: string, text: string):
|
|
|
175
219
|
export declare function validateWrite(o: Opened, before: RecordEntry[], path: string, text: string, base?: RecordSource): Promise<RecordWarning[]>;
|
|
176
220
|
/** {@link validateWrite}, returning the written record as the read found it. */
|
|
177
221
|
export declare function validatedEntry(o: Opened, before: RecordEntry[], path: string, text: string, base?: RecordSource): Promise<RecordEntry>;
|
|
222
|
+
/**
|
|
223
|
+
* Refuse a write to `target` when the caller expected another digest
|
|
224
|
+
* (#3173): someone wrote the record since the caller read it. Called holding
|
|
225
|
+
* the write lock, after the records are read, so the digest compared is the
|
|
226
|
+
* one the write would build on.
|
|
227
|
+
*/
|
|
228
|
+
export declare function refuseStale(o: Opened, target: RecordEntry, id: string, expect: string | undefined): void;
|
|
229
|
+
/** Who a write names, for the lock's owner file and the journal. */
|
|
230
|
+
export declare function writeWho(verb: string, opts: {
|
|
231
|
+
by?: string;
|
|
232
|
+
agent?: string;
|
|
233
|
+
}): WriteLockWho;
|
|
178
234
|
export declare function findRecord(entries: RecordEntry[], id: string, kind: string): RecordEntry & {
|
|
179
235
|
data: Record<string, unknown>;
|
|
180
236
|
};
|
|
@@ -244,7 +300,7 @@ export interface ChannelOptions {
|
|
|
244
300
|
by?: string;
|
|
245
301
|
through?: WriteChannel;
|
|
246
302
|
}
|
|
247
|
-
/** `records new`: write one new record from validated fields, sealed by its author with `sign`. */
|
|
303
|
+
/** `records new`: write one new record from validated fields, sealed by its author with `sign`. Holds the write lock (#3173). */
|
|
248
304
|
export declare function newRecord(opts: NewRecordOptions & ChannelOptions): Promise<NewDocument>;
|
|
249
305
|
export interface AmendRecordOptions {
|
|
250
306
|
kind: string;
|
|
@@ -257,6 +313,8 @@ export interface AmendRecordOptions {
|
|
|
257
313
|
sign?: string | true;
|
|
258
314
|
/** The agent session the write is made in (#2548). */
|
|
259
315
|
agent?: string;
|
|
316
|
+
/** The record's digest the caller last read (#3173): the write is refused with record-conflict when the record has another. */
|
|
317
|
+
expect?: string;
|
|
260
318
|
}
|
|
261
319
|
/**
|
|
262
320
|
* `records amend`: set top-level fields of one record. A record in a closed
|
|
@@ -293,6 +351,8 @@ export interface ReviewRecordOptions {
|
|
|
293
351
|
sign?: string | true;
|
|
294
352
|
/** The agent session the write is made in (#2548). */
|
|
295
353
|
agent?: string;
|
|
354
|
+
/** The record's digest the reviewer judged (#3173): the verdict is refused with record-conflict when the record has moved on. */
|
|
355
|
+
expect?: string;
|
|
296
356
|
}
|
|
297
357
|
/**
|
|
298
358
|
* `records review`: append one verdict to a record's reviews, with the date
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"records-write.d.ts","sourceRoot":"","sources":["../../src/workspace/records-write.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"records-write.d.ts","sourceRoot":"","sources":["../../src/workspace/records-write.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AAKH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAEtD,OAAO,EAA8B,KAAK,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAChF,OAAO,EAYL,KAAK,gBAAgB,EACrB,KAAK,WAAW,EAChB,KAAK,aAAa,EACnB,MAAM,WAAW,CAAC;AAMnB,OAAO,EAAoE,KAAK,WAAW,EAAE,MAAM,eAAe,CAAC;AAEnH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,EAAiG,KAAK,SAAS,EAAE,KAAK,YAAY,EAAE,MAAM,cAAc,CAAC;AAIhK,4DAA4D;AAC5D,eAAO,MAAM,8BAA8B,IAAI,CAAC;AAEhD,eAAO,MAAM,qBAAqB,wFAAwF,CAAC;AAC3H,eAAO,MAAM,uBAAuB,4FAA4F,CAAC;AACjI,eAA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C,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,CAcjE;AAgBD;;;GAGG;AACH,wBAAsB,mBAAmB,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,YAAY,CAAC,qBAAqB,CAAC,CAAC,CAK5H;AAED,uIAAuI;AACvI,wBAAsB,eAAe,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CA4C1E"}
|
|
@@ -159,9 +159,11 @@ export declare const recordKindSchema: z.ZodObject<{
|
|
|
159
159
|
session: z.ZodOptional<z.ZodObject<{
|
|
160
160
|
verdicts: z.ZodString;
|
|
161
161
|
seal: z.ZodString;
|
|
162
|
-
subjects: z.ZodObject<{
|
|
162
|
+
subjects: z.ZodUnion<readonly [z.ZodObject<{
|
|
163
163
|
kind: z.ZodString;
|
|
164
|
-
}, z.core.$strict
|
|
164
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
165
|
+
kinds: z.ZodArray<z.ZodString>;
|
|
166
|
+
}, z.core.$strict>]>;
|
|
165
167
|
openedRev: z.ZodOptional<z.ZodString>;
|
|
166
168
|
closedRev: z.ZodOptional<z.ZodString>;
|
|
167
169
|
closedOn: z.ZodOptional<z.ZodString>;
|
|
@@ -184,6 +186,11 @@ export declare const recordKindSchema: z.ZodObject<{
|
|
|
184
186
|
tier: z.ZodOptional<z.ZodObject<{
|
|
185
187
|
field: z.ZodString;
|
|
186
188
|
tiers: z.ZodArray<z.ZodString>;
|
|
189
|
+
limits: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
190
|
+
criteria: z.ZodOptional<z.ZodNumber>;
|
|
191
|
+
files: z.ZodOptional<z.ZodNumber>;
|
|
192
|
+
words: z.ZodOptional<z.ZodNumber>;
|
|
193
|
+
}, z.core.$strict>>>;
|
|
187
194
|
}, z.core.$strict>>;
|
|
188
195
|
attempts: z.ZodOptional<z.ZodObject<{
|
|
189
196
|
field: z.ZodString;
|
|
@@ -202,6 +209,21 @@ export declare const recordKindSchema: z.ZodObject<{
|
|
|
202
209
|
/** The states of an answer kind's records (ws-058): open for people, proposed by a model, answered by a table, people, or a confirmed proposal. */
|
|
203
210
|
export declare const ANSWER_STATES: readonly ["escalated", "proposed", "answered"];
|
|
204
211
|
export type RecordKind = z.infer<typeof recordKindSchema>;
|
|
212
|
+
/** The kind files a session kind's verdicts name records of, relative to the session kind file: `subjects.kind`, or each of `subjects.kinds` (ws-082). */
|
|
213
|
+
export declare function sessionSubjectKinds(session: NonNullable<RecordKind["session"]>): string[];
|
|
214
|
+
/** The records of one of a session kind's subject kinds, and the name of their reviews list. */
|
|
215
|
+
export interface SessionSubjects {
|
|
216
|
+
/** The subject kind file, as the session kind names it. */
|
|
217
|
+
kind: string;
|
|
218
|
+
records: RecordEntry[];
|
|
219
|
+
reviews: string;
|
|
220
|
+
}
|
|
221
|
+
/**
|
|
222
|
+
* A session kind's subject records, each subject kind read from `source`
|
|
223
|
+
* (#2673, ws-082), for {@link readRecords}' `subjects`. Undefined for a kind
|
|
224
|
+
* that is not a session kind.
|
|
225
|
+
*/
|
|
226
|
+
export declare function readSessionSubjects(loaded: LoadedRecordKind, root: string, source: RecordSource): Promise<SessionSubjects[] | undefined>;
|
|
205
227
|
/** A kind as loaded: its data, where it came from, and its schema. */
|
|
206
228
|
export interface LoadedRecordKind {
|
|
207
229
|
kind: RecordKind;
|
|
@@ -470,14 +492,11 @@ export interface ReadRecordsOptions {
|
|
|
470
492
|
*/
|
|
471
493
|
history?: RecordHistory;
|
|
472
494
|
/**
|
|
473
|
-
* For a session kind: the records its
|
|
474
|
-
* from the same tree (#2673). Without them no verdict is checked
|
|
475
|
-
* session is cited.
|
|
495
|
+
* For a session kind: the records each of its subject kinds locates, read
|
|
496
|
+
* from the same tree (#2673, ws-082). Without them no verdict is checked
|
|
497
|
+
* and no session is cited.
|
|
476
498
|
*/
|
|
477
|
-
subjects?:
|
|
478
|
-
records: RecordEntry[];
|
|
479
|
-
reviews: string;
|
|
480
|
-
};
|
|
499
|
+
subjects?: SessionSubjects[];
|
|
481
500
|
/**
|
|
482
501
|
* The workspace root, from `root` with / separators ("." for `root`
|
|
483
502
|
* itself): where a content-addressed record's own path is reported from
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"records.d.ts","sourceRoot":"","sources":["../../src/workspace/records.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAQH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,OAAO,EAAyB,KAAK,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AACvE,OAAO,EAAgB,KAAK,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACvE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAEpD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAC;AAC5C,OAAO,KAAK,EAAE,YAAY,EAAE,cAAc,EAAE,QAAQ,EAAE,eAAe,EAAE,MAAM,QAAQ,CAAC;AACtF,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAIlD;;;GAGG;AACH,eAAO,MAAM,mBAAmB,4RAqBU,CAAC;AAC3C,MAAM,MAAM,gBAAgB,GAAG,CAAC,OAAO,mBAAmB,CAAC,CAAC,MAAM,CAAC,CAAC;AAEpE;;;GAGG;AACH,eAAO,MAAM,oBAAoB,6JA8BS,CAAC;AAC3C,MAAM,MAAM,iBAAiB,GAAG,CAAC,OAAO,oBAAoB,CAAC,CAAC,MAAM,CAAC,CAAC;AAEtE;;;GAGG;AACH,eAAO,MAAM,mBAAmB,6GAeU,CAAC;AAC3C,MAAM,MAAM,gBAAgB,GAAG,CAAC,OAAO,mBAAmB,CAAC,CAAC,MAAM,CAAC,CAAC;AAEpE;;;;;GAKG;AACH,eAAO,MAAM,iBAAiB,kGASY,CAAC;AAC3C,MAAM,MAAM,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U,EAAE,MAAM,CAAA;KAAE,CAAC;IAC/E,8GAA8G;IAC9G,SAAS,CAAC,EAAE,YAAY,EAAE,CAAC;CAC5B;AA0DD;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,IAAI,CAAC,UAAU,EAAE,YAAY,CAAC,EAAE,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,GAAG,MAAM,EAAE,CAQtH;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,IAAI,CAAC,UAAU,EAAE,YAAY,CAAC,EAAE,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,GAAG,MAAM,EAAE,CAQtH;AAWD,oEAAoE;AACpE,wBAAsB,WAAW,CAAC,MAAM,EAAE,gBAAgB,EAAE,OAAO,EAAE,kBAAkB,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAwNnH"}
|
|
@@ -10,27 +10,43 @@
|
|
|
10
10
|
* - `runs start --from <file|->`, `runs end <id> --from <file|->` and `runs
|
|
11
11
|
* record --from <file|->` append a run's start, its end, or both, to
|
|
12
12
|
* `_agent-runs/<id>.jsonl` on `chant/lifecycle` (`runs-write.schema.json`).
|
|
13
|
+
* - `runs sign <id> --key <runner key.pem> | --envelope <file|->` appends a
|
|
14
|
+
* statement over an ended run, signed by a runner or steward key the trust
|
|
15
|
+
* policy at base lists, or signed elsewhere and checked here (#3192).
|
|
16
|
+
* `runs statement <id> --signer <principal>` prints the statement for a
|
|
17
|
+
* signer that holds its key elsewhere, and `runs verify [<id>] [--require
|
|
18
|
+
* signed]` judges every stored statement (`run-statement.schema.json`).
|
|
13
19
|
*
|
|
14
20
|
* chant records runs and never starts one: whatever ran the agent writes the
|
|
15
|
-
* record. Reads never fetch
|
|
21
|
+
* record. Reads never fetch, except a pull request ref `--follow-squash`
|
|
22
|
+
* needs (#3035).
|
|
16
23
|
*/
|
|
17
24
|
import type { CommandContext } from "../cli/registry.js";
|
|
18
25
|
import { type RunLedgerWrite, type RunView } from "./runs.js";
|
|
26
|
+
import { type DsseEnvelope } from "./trust/dsse.js";
|
|
27
|
+
import { type BaseSource } from "./trust/provenance.js";
|
|
28
|
+
import type { TrustPolicy } from "./trust/policy.js";
|
|
29
|
+
import { type RunAttestation, type RunStatement } from "./trust/run-statement.js";
|
|
19
30
|
/** The version of the `runs` documents this chant writes: read contract 1. */
|
|
20
31
|
export declare const RUNS_CONTRACT_VERSION = 1;
|
|
21
32
|
/** `$id` of the JSON Schema for `runs --json`, shipped beside this file. */
|
|
22
33
|
export declare const RUNS_OUTPUT_SCHEMA_ID = "https://intentius.io/chant/schemas/workspace/runs/v1/runs.schema.json";
|
|
23
|
-
/** `$id` of the JSON Schema for what `runs start|end|record` print. */
|
|
34
|
+
/** `$id` of the JSON Schema for what `runs start|end|record|sign` print. */
|
|
24
35
|
export declare const RUNS_WRITE_SCHEMA_ID = "https://intentius.io/chant/schemas/workspace/runs-write/v1/runs-write.schema.json";
|
|
36
|
+
/** `$id` of the JSON Schema for what `runs statement` and `runs verify` print (#3192). */
|
|
37
|
+
export declare const RUN_STATEMENT_SCHEMA_ID = "https://intentius.io/chant/schemas/workspace/run-statement/v1/run-statement.schema.json";
|
|
25
38
|
/** Why `runs` read nothing. Closed. */
|
|
26
39
|
export declare const RUNS_ERROR_CODES: readonly ["declaration-missing", "declaration-ambiguous", "declaration-unparseable", "declaration-invalid", "placement-invalid", "reader-too-old", "root-chant-required", "not-a-git-repository", "revision-unknown"];
|
|
27
40
|
export type RunsErrorCode = (typeof RUNS_ERROR_CODES)[number];
|
|
28
41
|
/** Why part of the read is missing. The read still succeeds. Closed. */
|
|
29
|
-
export declare const RUNS_REASON_CODES: readonly ["runs-no-ledger", "runs-ledger-malformed", "kind-unreadable"];
|
|
42
|
+
export declare const RUNS_REASON_CODES: readonly ["runs-no-ledger", "runs-ledger-malformed", "kind-unreadable", "squash-unfollowed"];
|
|
30
43
|
export type RunsReasonCode = (typeof RUNS_REASON_CODES)[number];
|
|
31
44
|
/** Why a run write was refused or could not run. Closed. */
|
|
32
|
-
export declare const RUNS_WRITE_ERROR_CODES: readonly ["declaration-missing", "declaration-ambiguous", "declaration-unparseable", "declaration-invalid", "placement-invalid", "reader-too-old", "root-chant-required", "not-a-git-repository", "revision-unknown", "write-usage-invalid", "write-input-invalid", "run-exists", "run-unknown", "run-ended"];
|
|
45
|
+
export declare const RUNS_WRITE_ERROR_CODES: readonly ["declaration-missing", "declaration-ambiguous", "declaration-unparseable", "declaration-invalid", "placement-invalid", "reader-too-old", "root-chant-required", "not-a-git-repository", "revision-unknown", "write-usage-invalid", "write-input-invalid", "run-exists", "run-unknown", "run-ended", "run-not-ended", "trust-policy-unreadable", "runner-key-invalid", "runner-key-is-signer", "runner-key-unlisted", "envelope-unreadable", "envelope-invalid", "envelope-untrusted", "run-statement-invalid", "run-statement-signer-mismatch", "run-statement-mismatch"];
|
|
33
46
|
export type RunsWriteErrorCode = (typeof RUNS_WRITE_ERROR_CODES)[number];
|
|
47
|
+
/** Why `runs statement` or `runs verify` printed nothing to judge. Closed. */
|
|
48
|
+
export declare const RUN_STATEMENT_ERROR_CODES: readonly ["declaration-missing", "declaration-ambiguous", "declaration-unparseable", "declaration-invalid", "placement-invalid", "reader-too-old", "root-chant-required", "not-a-git-repository", "revision-unknown", "write-usage-invalid", "run-unknown", "run-not-ended"];
|
|
49
|
+
export type RunStatementErrorCode = (typeof RUN_STATEMENT_ERROR_CODES)[number];
|
|
34
50
|
/** Tokens and cost summed over some runs. */
|
|
35
51
|
export interface RunTotals {
|
|
36
52
|
runs: number;
|
|
@@ -64,11 +80,34 @@ export interface RunsQuery {
|
|
|
64
80
|
by?: string;
|
|
65
81
|
/** Only the runs that made a commit after `since` on HEAD, or started after its commit date. */
|
|
66
82
|
since?: string;
|
|
83
|
+
/** The revision whose trust policy judges the run statements (#3192). Default: origin/HEAD, then main, then master. */
|
|
84
|
+
base?: string;
|
|
85
|
+
/** Follow squash merges on HEAD to their pull requests' original commits, fetching missing pull request refs (#3035). */
|
|
86
|
+
followSquash?: boolean;
|
|
67
87
|
}
|
|
68
88
|
export interface RunsReason {
|
|
69
89
|
code: RunsReasonCode;
|
|
70
90
|
message: string;
|
|
71
91
|
}
|
|
92
|
+
/** The trust policy at base, as far as run statements need it (#3192). */
|
|
93
|
+
export interface RunsTrust {
|
|
94
|
+
base: string | null;
|
|
95
|
+
baseFrom: BaseSource | null;
|
|
96
|
+
/** The runner and steward keys at base, by principal and class. */
|
|
97
|
+
runners: {
|
|
98
|
+
principal: string;
|
|
99
|
+
class: "runner" | "service";
|
|
100
|
+
}[];
|
|
101
|
+
/** Why the policy at base can't be read. Nothing verifies then. */
|
|
102
|
+
problems: string[];
|
|
103
|
+
}
|
|
104
|
+
/** The policy at base for run statements, and its summary. */
|
|
105
|
+
export declare function runsTrust(top: string, base?: string): {
|
|
106
|
+
policy: TrustPolicy;
|
|
107
|
+
trust: RunsTrust;
|
|
108
|
+
};
|
|
109
|
+
/** Judge each run's statements in place against the runners at base. */
|
|
110
|
+
export declare function attestRuns(runs: Iterable<RunView>, policy: TrustPolicy): void;
|
|
72
111
|
/** What `runs --json` prints. */
|
|
73
112
|
export type RunsDocument = {
|
|
74
113
|
$schema: string;
|
|
@@ -83,13 +122,17 @@ export type RunsDocument = {
|
|
|
83
122
|
dir: string;
|
|
84
123
|
commit: string | null;
|
|
85
124
|
};
|
|
125
|
+
/** The options given. `followSquash` was added within contract 1 (#3035). */
|
|
86
126
|
filter: {
|
|
87
127
|
unit: string | null;
|
|
88
128
|
decision: string | null;
|
|
89
129
|
by: string | null;
|
|
90
130
|
since: string | null;
|
|
131
|
+
followSquash?: boolean;
|
|
91
132
|
};
|
|
92
|
-
/**
|
|
133
|
+
/** The trust policy the run statements are judged by (#3192). */
|
|
134
|
+
trust: RunsTrust;
|
|
135
|
+
/** Newest first, by when each started. Each carries its `attestation`. */
|
|
93
136
|
runs: RunView[];
|
|
94
137
|
totals: {
|
|
95
138
|
all: RunTotals;
|
|
@@ -123,7 +166,7 @@ export type RunsDocument = {
|
|
|
123
166
|
export declare function resolveRunDecisions(runs: RunView[], rootOnDisk: string, declared: string[], reasons: RunsReason[]): Promise<void>;
|
|
124
167
|
/** Read the run ledger and build the document. Never throws a {@link WorkspaceReadError}. */
|
|
125
168
|
export declare function workspaceRuns(query: RunsQuery): Promise<RunsDocument>;
|
|
126
|
-
export type RunsVerb = "start" | "end" | "record";
|
|
169
|
+
export type RunsVerb = "start" | "end" | "record" | "sign";
|
|
127
170
|
/** What `runs start|end|record` print. */
|
|
128
171
|
export type RunsWriteDocument = {
|
|
129
172
|
$schema: string;
|
|
@@ -134,6 +177,13 @@ export type RunsWriteDocument = {
|
|
|
134
177
|
/** The line a commit the run makes carries, `Chant-Run: <id>` (#3149). */
|
|
135
178
|
trailer: string;
|
|
136
179
|
ledger: RunLedgerWrite;
|
|
180
|
+
/** For `sign`: who signed the statement it stored, and the envelope (#3192). */
|
|
181
|
+
statement?: {
|
|
182
|
+
signer: string;
|
|
183
|
+
class: "runner" | "service";
|
|
184
|
+
keyid: string;
|
|
185
|
+
envelope: DsseEnvelope;
|
|
186
|
+
};
|
|
137
187
|
} | {
|
|
138
188
|
$schema: string;
|
|
139
189
|
contract: number;
|
|
@@ -156,9 +206,91 @@ export interface RunsWriteRequest {
|
|
|
156
206
|
}
|
|
157
207
|
/** Run one write and build the document it prints. */
|
|
158
208
|
export declare function runsWrite(req: RunsWriteRequest): Promise<RunsWriteDocument>;
|
|
209
|
+
export interface RunsSignRequest {
|
|
210
|
+
id: string;
|
|
211
|
+
cwd: string;
|
|
212
|
+
/** A runner key in PEM: chant builds the statement and signs it. */
|
|
213
|
+
keyPem?: string;
|
|
214
|
+
/** An envelope signed elsewhere, as text: chant checks it and stores it. */
|
|
215
|
+
envelope?: string;
|
|
216
|
+
base?: string;
|
|
217
|
+
now?: () => Date;
|
|
218
|
+
}
|
|
219
|
+
/**
|
|
220
|
+
* `runs sign <id>`: store a statement over an ended run, signed here with
|
|
221
|
+
* `keyPem` or signed elsewhere and given as `envelope`. Either way it must
|
|
222
|
+
* verify against a runner key at base and agree with the run's record before
|
|
223
|
+
* anything is written.
|
|
224
|
+
*/
|
|
225
|
+
export declare function runsSign(req: RunsSignRequest): Promise<RunsWriteDocument>;
|
|
226
|
+
/** What `runs statement` and `runs verify` print. */
|
|
227
|
+
export type RunStatementDocument = {
|
|
228
|
+
$schema: string;
|
|
229
|
+
contract: number;
|
|
230
|
+
chant: string;
|
|
231
|
+
verb: "statement";
|
|
232
|
+
run: string;
|
|
233
|
+
/** The DSSE payload type to sign under. */
|
|
234
|
+
payloadType: string;
|
|
235
|
+
/** Base64 of the payload bytes to sign: the statement's canonical JSON. */
|
|
236
|
+
payload: string;
|
|
237
|
+
statement: RunStatement;
|
|
238
|
+
} | {
|
|
239
|
+
$schema: string;
|
|
240
|
+
contract: number;
|
|
241
|
+
chant: string;
|
|
242
|
+
verb: "verify";
|
|
243
|
+
trust: RunsTrust;
|
|
244
|
+
require: "signed" | null;
|
|
245
|
+
runs: {
|
|
246
|
+
id: string;
|
|
247
|
+
state: "running" | "ended";
|
|
248
|
+
record: {
|
|
249
|
+
sha256: string;
|
|
250
|
+
} | null;
|
|
251
|
+
attestation: RunAttestation;
|
|
252
|
+
}[];
|
|
253
|
+
summary: {
|
|
254
|
+
runs: number;
|
|
255
|
+
signed: number;
|
|
256
|
+
unsigned: number;
|
|
257
|
+
failed: number;
|
|
258
|
+
running: number;
|
|
259
|
+
};
|
|
260
|
+
/** Why `--require signed` fails. Empty without it: the report alone never fails (studio-035 d). */
|
|
261
|
+
failures: string[];
|
|
262
|
+
ok: boolean;
|
|
263
|
+
} | {
|
|
264
|
+
$schema: string;
|
|
265
|
+
contract: number;
|
|
266
|
+
chant: string;
|
|
267
|
+
verb: "statement" | "verify" | null;
|
|
268
|
+
error: {
|
|
269
|
+
code: RunStatementErrorCode;
|
|
270
|
+
message: string;
|
|
271
|
+
};
|
|
272
|
+
};
|
|
273
|
+
/** `runs statement <id> --signer <principal>`: the statement a signer holding its key elsewhere signs. */
|
|
274
|
+
export declare function runStatement(id: string, signer: string, cwd: string): Promise<RunStatementDocument>;
|
|
275
|
+
/**
|
|
276
|
+
* `runs verify [<id>] [--require signed]`: judge each run's statements
|
|
277
|
+
* against the runner keys at base. Report only unless `--require signed`
|
|
278
|
+
* asks every ended run, or the one named, to be signed.
|
|
279
|
+
*/
|
|
280
|
+
export declare function runsVerify(query: {
|
|
281
|
+
cwd: string;
|
|
282
|
+
id?: string;
|
|
283
|
+
require?: "signed";
|
|
284
|
+
base?: string;
|
|
285
|
+
}): Promise<RunStatementDocument>;
|
|
159
286
|
/** The read as lines for a person. */
|
|
160
287
|
export declare function formatRuns(doc: Extract<RunsDocument, {
|
|
161
288
|
runs: unknown;
|
|
162
289
|
}>): string;
|
|
163
290
|
export declare function runWorkspaceRuns(ctx: CommandContext): Promise<number>;
|
|
291
|
+
/** `runs verify` as lines for a person. */
|
|
292
|
+
export declare function formatRunsVerify(doc: Extract<RunStatementDocument, {
|
|
293
|
+
verb: "verify";
|
|
294
|
+
runs: unknown;
|
|
295
|
+
}>): string;
|
|
164
296
|
//# sourceMappingURL=runs-cli.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runs-cli.d.ts","sourceRoot":"","sources":["../../src/workspace/runs-cli.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"runs-cli.d.ts","sourceRoot":"","sources":["../../src/workspace/runs-cli.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAKH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAMtD,OAAO,EAaL,KAAK,cAAc,EACnB,KAAK,OAAO,EAEb,MAAM,QAAQ,CAAC;AAMhB,OAAO,EAAuC,KAAK,YAAY,EAAE,MAAM,cAAc,CAAC;AACtF,OAAO,EAA6B,KAAK,UAAU,EAA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