@intentius/chant 0.100.0 → 0.102.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/agents/checks.d.ts.map +1 -1
- package/dist/attrref.d.ts.map +1 -1
- package/dist/audit/discover.d.ts.map +1 -1
- package/dist/audit/nginx.d.ts.map +1 -1
- package/dist/audit/prior-art.d.ts +48 -0
- package/dist/audit/prior-art.d.ts.map +1 -1
- package/dist/behaviour-kinds.d.ts.map +1 -1
- package/dist/build.d.ts +6 -0
- package/dist/build.d.ts.map +1 -1
- package/dist/builder.d.ts.map +1 -1
- package/dist/cli/build-options.d.ts +2 -0
- package/dist/cli/build-options.d.ts.map +1 -1
- package/dist/cli/commands/build.d.ts.map +1 -1
- package/dist/cli/commands/carve-emit.d.ts.map +1 -1
- package/dist/cli/commands/check-lexicon.d.ts +16 -0
- package/dist/cli/commands/check-lexicon.d.ts.map +1 -1
- package/dist/cli/commands/import.d.ts +8 -0
- package/dist/cli/commands/import.d.ts.map +1 -1
- package/dist/cli/commands/init-lexicon.d.ts.map +1 -1
- package/dist/cli/commands/init.d.ts +19 -0
- package/dist/cli/commands/init.d.ts.map +1 -1
- package/dist/cli/commands/onboard.d.ts +9 -0
- package/dist/cli/commands/onboard.d.ts.map +1 -1
- package/dist/cli/commands/pinned-upgrade.d.ts +19 -5
- package/dist/cli/commands/pinned-upgrade.d.ts.map +1 -1
- package/dist/cli/handlers/dev.d.ts.map +1 -1
- package/dist/cli/handlers/fan-out.d.ts.map +1 -1
- package/dist/cli/handlers/lifecycle.d.ts.map +1 -1
- package/dist/cli/handlers/misc.d.ts.map +1 -1
- package/dist/cli/handlers/operator.d.ts +9 -0
- package/dist/cli/handlers/operator.d.ts.map +1 -1
- package/dist/cli/handlers/run.d.ts.map +1 -1
- package/dist/cli/lsp/server.d.ts.map +1 -1
- package/dist/cli/main.d.ts.map +1 -1
- package/dist/cli/mcp/server.d.ts.map +1 -1
- package/dist/cli/mcp/tools/build.d.ts.map +1 -1
- package/dist/cli/mcp/tools/composites.d.ts.map +1 -1
- package/dist/cli/mcp/tools/explain.d.ts.map +1 -1
- package/dist/cli/mcp/tools/import.d.ts.map +1 -1
- package/dist/cli/mcp/tools/lint.d.ts.map +1 -1
- package/dist/cli/mcp/tools/scaffold.d.ts.map +1 -1
- package/dist/cli/mcp/tools/search.d.ts.map +1 -1
- package/dist/cli/mcp/workspace-tools.d.ts +9 -1
- package/dist/cli/mcp/workspace-tools.d.ts.map +1 -1
- package/dist/cli/registry.d.ts +33 -2
- package/dist/cli/registry.d.ts.map +1 -1
- package/dist/codegen/fetch.d.ts.map +1 -1
- package/dist/codegen/naming.d.ts.map +1 -1
- package/dist/codegen/pinned-upgrade.d.ts +67 -3
- package/dist/codegen/pinned-upgrade.d.ts.map +1 -1
- package/dist/codegen/registry.d.ts.map +1 -1
- package/dist/components/capability-plugin-loader.d.ts.map +1 -1
- package/dist/components/capability.d.ts.map +1 -1
- package/dist/components/driver.d.ts.map +1 -1
- package/dist/components/fan-out.d.ts.map +1 -1
- package/dist/components/starter-plugin.d.ts.map +1 -1
- package/dist/components/verbs/process-runner.d.ts.map +1 -1
- package/dist/components/verbs/r2-sync.d.ts.map +1 -1
- package/dist/components/verbs/run-agent.d.ts.map +1 -1
- package/dist/components/verbs/sbom-generator.d.ts.map +1 -1
- package/dist/components/verbs/sign.d.ts.map +1 -1
- package/dist/components/verbs/verify.d.ts.map +1 -1
- package/dist/components/verbs/vuln-gate.d.ts.map +1 -1
- package/dist/components/verbs/vuln-scan.d.ts.map +1 -1
- package/dist/components/verbs/wrangler.d.ts.map +1 -1
- package/dist/composite.d.ts.map +1 -1
- package/dist/config.d.ts +30 -7
- package/dist/config.d.ts.map +1 -1
- package/dist/declarable.d.ts +16 -0
- package/dist/declarable.d.ts.map +1 -1
- package/dist/discovery/cache.d.ts.map +1 -1
- package/dist/discovery/fold-import.d.ts +15 -5
- package/dist/discovery/fold-import.d.ts.map +1 -1
- package/dist/discovery/param-deps.d.ts +16 -0
- package/dist/discovery/param-deps.d.ts.map +1 -1
- package/dist/discovery/sandbox/policy-wire.d.ts.map +1 -1
- package/dist/discovery/specifier-resolve.d.ts +37 -0
- package/dist/discovery/specifier-resolve.d.ts.map +1 -0
- package/dist/errors.d.ts.map +1 -1
- package/dist/fold/fold.d.ts +3 -1
- package/dist/fold/fold.d.ts.map +1 -1
- package/dist/graph-detail.d.ts.map +1 -1
- package/dist/graph-ir.d.ts.map +1 -1
- package/dist/graph-layout.d.ts.map +1 -1
- package/dist/import/base-parser.d.ts.map +1 -1
- package/dist/import/embedded.d.ts +7 -0
- package/dist/import/embedded.d.ts.map +1 -1
- package/dist/import/parser-options.d.ts +14 -0
- package/dist/import/parser-options.d.ts.map +1 -0
- package/dist/import/parser.d.ts +17 -0
- package/dist/import/parser.d.ts.map +1 -1
- package/dist/kubectl-context.d.ts.map +1 -1
- package/dist/lexicon-output.d.ts.map +1 -1
- package/dist/lexicon-schema.d.ts +3 -3
- package/dist/lexicon.d.ts +78 -3
- package/dist/lexicon.d.ts.map +1 -1
- package/dist/lifecycle/assert-live.d.ts.map +1 -1
- package/dist/lifecycle/gate-ledger.d.ts +15 -0
- package/dist/lifecycle/gate-ledger.d.ts.map +1 -1
- package/dist/lifecycle/git.d.ts.map +1 -1
- package/dist/lifecycle/member-ledger.d.ts.map +1 -1
- package/dist/lifecycle/observe.d.ts.map +1 -1
- package/dist/lifecycle/plan-digest.d.ts +26 -5
- package/dist/lifecycle/plan-digest.d.ts.map +1 -1
- package/dist/lifecycle/plan-ledger.d.ts.map +1 -1
- package/dist/lifecycle/release-ledger.d.ts.map +1 -1
- package/dist/lifecycle/scenario.d.ts.map +1 -1
- package/dist/lifecycle/status.d.ts.map +1 -1
- package/dist/lifecycle/work-lease.d.ts +61 -2
- package/dist/lifecycle/work-lease.d.ts.map +1 -1
- package/dist/lint/config.d.ts +4 -4
- package/dist/lint/engine.d.ts +6 -0
- package/dist/lint/engine.d.ts.map +1 -1
- package/dist/lsp/lexicon-providers.d.ts.map +1 -1
- package/dist/op/activities/activity-contracts.d.ts +12 -11
- package/dist/op/activities/activity-contracts.d.ts.map +1 -1
- package/dist/op/activities/apply.d.ts +79 -9
- package/dist/op/activities/apply.d.ts.map +1 -1
- package/dist/op/activities/decide.d.ts.map +1 -1
- package/dist/op/activities/index.d.ts +1 -1
- package/dist/op/activities/index.d.ts.map +1 -1
- package/dist/op/activities/lexicon-upgrade.d.ts +44 -12
- package/dist/op/activities/lexicon-upgrade.d.ts.map +1 -1
- package/dist/op/activities/propose-upgrade.d.ts +2 -0
- package/dist/op/activities/propose-upgrade.d.ts.map +1 -1
- package/dist/op/activity-contract.d.ts +1 -1
- package/dist/op/activity-failure.d.ts.map +1 -1
- package/dist/op/activity-profiles.d.ts.map +1 -1
- package/dist/op/builders.d.ts.map +1 -1
- package/dist/op/composites/apply-op.d.ts +12 -5
- package/dist/op/composites/apply-op.d.ts.map +1 -1
- package/dist/op/composites/lexicon-upgrade-op.d.ts +22 -6
- package/dist/op/composites/lexicon-upgrade-op.d.ts.map +1 -1
- package/dist/op/decide-backend.d.ts.map +1 -1
- package/dist/op/decide-read-inputs.d.ts.map +1 -1
- package/dist/op/emulator-lifecycle.d.ts +21 -2
- package/dist/op/emulator-lifecycle.d.ts.map +1 -1
- package/dist/op/gate-approval.d.ts +5 -1
- package/dist/op/gate-approval.d.ts.map +1 -1
- package/dist/op/gate-wait.d.ts.map +1 -1
- package/dist/op/gate.d.ts +19 -3
- package/dist/op/gate.d.ts.map +1 -1
- package/dist/op/index.d.ts +3 -1
- package/dist/op/index.d.ts.map +1 -1
- package/dist/op/local-executor.d.ts +6 -0
- package/dist/op/local-executor.d.ts.map +1 -1
- package/dist/op/operator.d.ts.map +1 -1
- package/dist/op/run-context.d.ts +39 -0
- package/dist/op/run-context.d.ts.map +1 -0
- package/dist/op/run-live.d.ts.map +1 -1
- package/dist/op/runtimes/local.d.ts.map +1 -1
- package/dist/op/source-archive.d.ts.map +1 -1
- package/dist/op/steward-beside.d.ts.map +1 -1
- package/dist/op/steward-points.d.ts.map +1 -1
- package/dist/op/steward.d.ts.map +1 -1
- package/dist/op/types.d.ts +8 -3
- package/dist/op/types.d.ts.map +1 -1
- package/dist/op/work-lease-run.d.ts +24 -4
- package/dist/op/work-lease-run.d.ts.map +1 -1
- package/dist/project-root.d.ts.map +1 -1
- package/dist/provenance.d.ts +21 -0
- package/dist/provenance.d.ts.map +1 -1
- package/dist/pseudo-parameter.d.ts.map +1 -1
- package/dist/reconcile.d.ts.map +1 -1
- package/dist/secret-materialization.d.ts.map +1 -1
- package/dist/serializer.d.ts +8 -0
- package/dist/serializer.d.ts.map +1 -1
- package/dist/telemetry-attribution.d.ts +77 -0
- package/dist/telemetry-attribution.d.ts.map +1 -0
- package/dist/terraform/emit-source.d.ts.map +1 -1
- package/dist/terraform/parse.d.ts.map +1 -1
- package/dist/testing.d.ts.map +1 -1
- package/dist/workspace/__fixtures__/contract-repo.d.ts.map +1 -1
- package/dist/workspace/__fixtures__/decide-workspace.d.ts +1 -1
- package/dist/workspace/__fixtures__/decide-workspace.d.ts.map +1 -1
- package/dist/workspace/agent-cli.d.ts +88 -0
- package/dist/workspace/agent-cli.d.ts.map +1 -0
- package/dist/workspace/box-factory.d.ts +73 -0
- package/dist/workspace/box-factory.d.ts.map +1 -0
- package/dist/workspace/changes-cli.d.ts.map +1 -1
- package/dist/workspace/changes.d.ts +8 -1
- package/dist/workspace/changes.d.ts.map +1 -1
- package/dist/workspace/chant-migrations/chud-lexicon-exit.d.ts.map +1 -1
- package/dist/workspace/checks/boxes.d.ts.map +1 -1
- package/dist/workspace/checks/links.d.ts +1 -0
- package/dist/workspace/checks/links.d.ts.map +1 -1
- package/dist/workspace/checks/live.d.ts +40 -0
- package/dist/workspace/checks/live.d.ts.map +1 -0
- package/dist/workspace/checks.d.ts +26 -2
- package/dist/workspace/checks.d.ts.map +1 -1
- package/dist/workspace/compose-graph.d.ts +73 -0
- package/dist/workspace/compose-graph.d.ts.map +1 -1
- package/dist/workspace/conformance/index.d.ts +67 -6
- package/dist/workspace/conformance/index.d.ts.map +1 -1
- package/dist/workspace/conformance/vitest.d.ts +12 -3
- package/dist/workspace/conformance/vitest.d.ts.map +1 -1
- package/dist/workspace/conformance/writer.d.ts +368 -0
- package/dist/workspace/conformance/writer.d.ts.map +1 -0
- package/dist/workspace/decide.d.ts +1 -1
- package/dist/workspace/decide.d.ts.map +1 -1
- package/dist/workspace/declaration.d.ts +119 -0
- package/dist/workspace/declaration.d.ts.map +1 -1
- package/dist/workspace/declaration.schema.json +368 -4
- package/dist/workspace/export-cli.d.ts +12 -0
- package/dist/workspace/export-cli.d.ts.map +1 -0
- package/dist/workspace/export.d.ts +145 -0
- package/dist/workspace/export.d.ts.map +1 -0
- package/dist/workspace/generated-files.d.ts.map +1 -1
- package/dist/workspace/graph-cache.d.ts.map +1 -1
- package/dist/workspace/graph-cli.d.ts +2 -0
- package/dist/workspace/graph-cli.d.ts.map +1 -1
- package/dist/workspace/identity.d.ts +111 -0
- package/dist/workspace/identity.d.ts.map +1 -0
- package/dist/workspace/import.d.ts +73 -0
- package/dist/workspace/import.d.ts.map +1 -0
- package/dist/workspace/intent-cli.d.ts +7 -4
- package/dist/workspace/intent-cli.d.ts.map +1 -1
- package/dist/workspace/intent-record.d.ts +8 -1
- package/dist/workspace/intent-record.d.ts.map +1 -1
- package/dist/workspace/intent.d.ts +149 -5
- package/dist/workspace/intent.d.ts.map +1 -1
- package/dist/workspace/kinds.d.ts +24 -6
- package/dist/workspace/kinds.d.ts.map +1 -1
- package/dist/workspace/lineage-adopt-cli.d.ts +15 -0
- package/dist/workspace/lineage-adopt-cli.d.ts.map +1 -0
- package/dist/workspace/lineage-adopt.d.ts +106 -0
- package/dist/workspace/lineage-adopt.d.ts.map +1 -0
- package/dist/workspace/lineage-check.d.ts +9 -2
- package/dist/workspace/lineage-check.d.ts.map +1 -1
- package/dist/workspace/lineage-cli.d.ts +6 -1
- package/dist/workspace/lineage-cli.d.ts.map +1 -1
- package/dist/workspace/lineage-hash-index.d.ts +110 -0
- package/dist/workspace/lineage-hash-index.d.ts.map +1 -0
- package/dist/workspace/lineage-init.d.ts +10 -0
- package/dist/workspace/lineage-init.d.ts.map +1 -1
- package/dist/workspace/lineage-lock.d.ts +149 -2
- package/dist/workspace/lineage-lock.d.ts.map +1 -1
- package/dist/workspace/lineage-migrations.d.ts +15 -3
- package/dist/workspace/lineage-migrations.d.ts.map +1 -1
- package/dist/workspace/lineage-provenance.d.ts +18 -0
- package/dist/workspace/lineage-provenance.d.ts.map +1 -0
- package/dist/workspace/lineage-upgrade-cli.d.ts +2 -0
- package/dist/workspace/lineage-upgrade-cli.d.ts.map +1 -1
- package/dist/workspace/lineage-upgrade.d.ts +30 -1
- package/dist/workspace/lineage-upgrade.d.ts.map +1 -1
- package/dist/workspace/lineage-versions.d.ts +116 -0
- package/dist/workspace/lineage-versions.d.ts.map +1 -0
- package/dist/workspace/links.d.ts +31 -5
- package/dist/workspace/links.d.ts.map +1 -1
- package/dist/workspace/ls-generated.d.ts +37 -0
- package/dist/workspace/ls-generated.d.ts.map +1 -0
- package/dist/workspace/ls.d.ts +4 -0
- package/dist/workspace/ls.d.ts.map +1 -1
- package/dist/workspace/member-commands.d.ts.map +1 -1
- package/dist/workspace/nested-graph.d.ts +56 -0
- package/dist/workspace/nested-graph.d.ts.map +1 -0
- package/dist/workspace/nesting.d.ts +21 -0
- package/dist/workspace/nesting.d.ts.map +1 -0
- package/dist/workspace/pin-cli.d.ts +10 -0
- package/dist/workspace/pin-cli.d.ts.map +1 -0
- package/dist/workspace/pin-integrity.d.ts +51 -0
- package/dist/workspace/pin-integrity.d.ts.map +1 -0
- package/dist/workspace/points.d.ts.map +1 -1
- package/dist/workspace/principal-classes.d.ts +114 -0
- package/dist/workspace/principal-classes.d.ts.map +1 -0
- package/dist/workspace/reason-codes.d.ts +47 -3
- package/dist/workspace/reason-codes.d.ts.map +1 -1
- package/dist/workspace/record-assets.d.ts.map +1 -1
- package/dist/workspace/record-sessions.d.ts +7 -11
- package/dist/workspace/record-sessions.d.ts.map +1 -1
- package/dist/workspace/records-checkout.d.ts +54 -0
- package/dist/workspace/records-checkout.d.ts.map +1 -0
- package/dist/workspace/records-cli.d.ts +57 -2
- package/dist/workspace/records-cli.d.ts.map +1 -1
- package/dist/workspace/records-close.d.ts +5 -2
- package/dist/workspace/records-close.d.ts.map +1 -1
- package/dist/workspace/records-since.d.ts.map +1 -1
- package/dist/workspace/records-write.d.ts +23 -4
- package/dist/workspace/records-write.d.ts.map +1 -1
- package/dist/workspace/records.d.ts +58 -5
- package/dist/workspace/records.d.ts.map +1 -1
- package/dist/workspace/returns.d.ts +129 -0
- package/dist/workspace/returns.d.ts.map +1 -0
- package/dist/workspace/runs-cli.d.ts +164 -0
- package/dist/workspace/runs-cli.d.ts.map +1 -0
- package/dist/workspace/runs.d.ts +423 -0
- package/dist/workspace/runs.d.ts.map +1 -0
- package/dist/workspace/source-block.d.ts +1 -1
- package/dist/workspace/source-block.d.ts.map +1 -1
- package/dist/workspace/status-gates.d.ts +15 -3
- package/dist/workspace/status-gates.d.ts.map +1 -1
- package/dist/workspace/status.d.ts +10 -0
- package/dist/workspace/status.d.ts.map +1 -1
- package/dist/workspace/symbols.d.ts +52 -0
- package/dist/workspace/symbols.d.ts.map +1 -0
- package/dist/workspace/template-manifest.d.ts +11 -3
- package/dist/workspace/template-manifest.d.ts.map +1 -1
- package/dist/workspace/trailer-joins.d.ts +46 -0
- package/dist/workspace/trailer-joins.d.ts.map +1 -0
- package/dist/workspace/trailers.d.ts +89 -0
- package/dist/workspace/trailers.d.ts.map +1 -0
- package/dist/workspace/trust/attestor.d.ts +8 -0
- package/dist/workspace/trust/attestor.d.ts.map +1 -1
- package/dist/workspace/trust/dsse.d.ts +58 -0
- package/dist/workspace/trust/dsse.d.ts.map +1 -0
- package/dist/workspace/trust/evidence-cli.d.ts +66 -0
- package/dist/workspace/trust/evidence-cli.d.ts.map +1 -0
- package/dist/workspace/trust/evidence.d.ts +93 -0
- package/dist/workspace/trust/evidence.d.ts.map +1 -0
- package/dist/workspace/trust/policy.d.ts +54 -1
- package/dist/workspace/trust/policy.d.ts.map +1 -1
- package/dist/workspace/trust/provenance.d.ts +21 -1
- package/dist/workspace/trust/provenance.d.ts.map +1 -1
- package/dist/workspace/trust/rotation.d.ts +132 -0
- package/dist/workspace/trust/rotation.d.ts.map +1 -0
- package/dist/workspace/trust/seal.d.ts +33 -0
- package/dist/workspace/trust/seal.d.ts.map +1 -1
- package/dist/workspace/trust/signers-cli.d.ts +49 -0
- package/dist/workspace/trust/signers-cli.d.ts.map +1 -0
- package/dist/workspace/trust/ssh-commit.d.ts +12 -0
- package/dist/workspace/trust/ssh-commit.d.ts.map +1 -1
- package/dist/workspace/trust/test-repo.d.ts +13 -0
- package/dist/workspace/trust/test-repo.d.ts.map +1 -1
- package/dist/workspace/trust/verify.d.ts +15 -0
- package/dist/workspace/trust/verify.d.ts.map +1 -1
- package/dist/workspace/work-cli.d.ts +39 -3
- 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.d.ts +26 -1
- package/dist/workspace/work.d.ts.map +1 -1
- package/dist/workspace/workspace-principals.schema.json +60 -0
- package/dist/workspace/write-scope.d.ts +259 -0
- package/dist/workspace/write-scope.d.ts.map +1 -0
- package/dist/yaml.d.ts +21 -39
- package/dist/yaml.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/audit/prior-art.ts +15 -0
- package/src/build.ts +8 -0
- package/src/cli/build-options.ts +4 -1
- package/src/cli/commands/__fixtures__/init-lexicon-output/package.json +1 -1
- package/src/cli/commands/build.ts +2 -0
- package/src/cli/commands/carve-emit-state.test.ts +4 -0
- package/src/cli/commands/carve-emit.ts +5 -19
- package/src/cli/commands/check-lexicon.test.ts +62 -1
- package/src/cli/commands/check-lexicon.ts +36 -6
- package/src/cli/commands/import-live.test.ts +87 -1
- package/src/cli/commands/import-parser-options.test.ts +133 -0
- package/src/cli/commands/import.ts +69 -25
- package/src/cli/commands/init-lexicon/templates/project.ts +1 -1
- package/src/cli/commands/init.test.ts +8 -1
- package/src/cli/commands/init.ts +23 -8
- package/src/cli/commands/lint.test.ts +37 -0
- package/src/cli/commands/onboard.test.ts +53 -3
- package/src/cli/commands/onboard.ts +52 -4
- package/src/cli/commands/pinned-upgrade.ts +73 -33
- package/src/cli/handlers/__snapshots__/build-member.test.ts.snap +2 -2
- package/src/cli/handlers/components.ts +2 -2
- package/src/cli/handlers/dev.ts +8 -6
- package/src/cli/handlers/fan-out.test.ts +6 -6
- package/src/cli/handlers/fan-out.ts +2 -1
- package/src/cli/handlers/graph.test.ts +42 -0
- package/src/cli/handlers/graph.ts +22 -0
- package/src/cli/handlers/lifecycle.test.ts +67 -0
- package/src/cli/handlers/lifecycle.ts +6 -5
- package/src/cli/handlers/misc.ts +2 -0
- package/src/cli/handlers/operator.ts +88 -4
- package/src/cli/handlers/run.test.ts +111 -0
- package/src/cli/handlers/run.ts +85 -24
- package/src/cli/handlers/scenario.ts +2 -2
- package/src/cli/main.test.ts +33 -0
- package/src/cli/main.ts +168 -17
- package/src/cli/mcp/workspace-tools.test.ts +5 -2
- package/src/cli/mcp/workspace-tools.ts +62 -4
- package/src/cli/registry.ts +33 -2
- package/src/cli/serve-mcp-workspace.test.ts +1 -1
- package/src/codegen/pinned-upgrade-multi.test.ts +157 -0
- package/src/codegen/pinned-upgrade-tags.test.ts +112 -0
- package/src/codegen/pinned-upgrade.test.ts +104 -0
- package/src/codegen/pinned-upgrade.ts +250 -56
- package/src/codegen/release-wiring.test.ts +5 -1
- package/src/codegen/testdata/postgres-tags.json +242 -0
- package/src/components/fan-out-output.test.ts +1 -1
- package/src/components/fan-out.test.ts +1 -1
- package/src/components/promote.test.ts +1 -1
- package/src/config.test.ts +21 -0
- package/src/config.ts +27 -0
- package/src/content-digest.test.ts +2 -2
- package/src/declarable.test.ts +21 -0
- package/src/declarable.ts +19 -0
- package/src/discovery/fold-composite.test.ts +41 -5
- package/src/discovery/fold-import.test.ts +129 -0
- package/src/discovery/fold-import.ts +643 -131
- package/src/discovery/fold-package-composite.test.ts +264 -0
- package/src/discovery/fold-specifiers.test.ts +191 -0
- package/src/discovery/param-deps.test.ts +66 -1
- package/src/discovery/param-deps.ts +45 -0
- package/src/discovery/specifier-resolve.ts +344 -0
- package/src/fold/fold.test.ts +39 -1
- package/src/fold/fold.ts +83 -9
- package/src/fold-provenance.test.ts +140 -0
- package/src/graph-ir.test.ts +83 -0
- package/src/graph-ir.ts +29 -0
- package/src/import/embedded.test.ts +20 -0
- package/src/import/embedded.ts +13 -0
- package/src/import/parser-options.ts +46 -0
- package/src/import/parser.ts +20 -0
- package/src/lexicon.ts +79 -3
- package/src/lifecycle/gate-ledger.test.ts +14 -0
- package/src/lifecycle/gate-ledger.ts +18 -1
- package/src/lifecycle/observe.test.ts +18 -0
- package/src/lifecycle/observe.ts +6 -4
- package/src/lifecycle/plan-digest.test.ts +54 -3
- package/src/lifecycle/plan-digest.ts +38 -8
- package/src/lifecycle/snapshot.ts +2 -2
- package/src/lifecycle/work-lease.test.ts +1 -1
- package/src/lifecycle/work-lease.ts +93 -2
- package/src/lint/engine.test.ts +55 -0
- package/src/lint/engine.ts +30 -4
- package/src/lint/output-docs.test.ts +59 -56
- package/src/op/activities/activity-contracts.ts +1 -0
- package/src/op/activities/apply.test.ts +189 -5
- package/src/op/activities/apply.ts +230 -8
- package/src/op/activities/index.ts +3 -0
- package/src/op/activities/lexicon-upgrade.test.ts +160 -6
- package/src/op/activities/lexicon-upgrade.ts +154 -51
- package/src/op/activities/propose-upgrade.ts +8 -5
- package/src/op/composites/apply-op.ts +12 -5
- package/src/op/composites/composites.test.ts +30 -3
- package/src/op/composites/lexicon-upgrade-op.test.ts +7 -2
- package/src/op/composites/lexicon-upgrade-op.ts +29 -8
- package/src/op/emulator-lifecycle.test.ts +23 -0
- package/src/op/emulator-lifecycle.ts +52 -14
- package/src/op/gate-approval.test.ts +91 -0
- package/src/op/gate-approval.ts +5 -1
- package/src/op/gate.ts +34 -8
- package/src/op/index.ts +3 -1
- package/src/op/local-executor.test.ts +15 -0
- package/src/op/local-executor.ts +40 -12
- package/src/op/local-output.ts +1 -1
- package/src/op/operator.ts +4 -0
- package/src/op/run-context.test.ts +141 -0
- package/src/op/run-context.ts +51 -0
- package/src/op/runtimes/local.test.ts +14 -0
- package/src/op/runtimes/local.ts +2 -0
- package/src/op/steward-beside.ts +2 -0
- package/src/op/types.ts +8 -3
- package/src/op/work-lease-run.test.ts +47 -0
- package/src/op/work-lease-run.ts +73 -11
- package/src/provenance.ts +35 -0
- package/src/serializer.ts +9 -0
- package/src/telemetry-attribution.test.ts +91 -0
- package/src/telemetry-attribution.ts +145 -0
- package/src/workspace/__fixtures__/studio-template-84c8b21.json +1 -1
- package/src/workspace/agent-cli.ts +138 -0
- package/src/workspace/agent.schema.json +378 -0
- package/src/workspace/behold-kinds.test.ts +1 -1
- package/src/workspace/box-factory.test.ts +320 -0
- package/src/workspace/box-factory.ts +103 -0
- package/src/workspace/changes-cli.ts +5 -0
- package/src/workspace/changes.schema.json +171 -1
- package/src/workspace/changes.ts +61 -4
- package/src/workspace/check-live.test.ts +192 -0
- package/src/workspace/check.schema.json +64 -0
- package/src/workspace/checks/boxes.test.ts +2 -0
- package/src/workspace/checks/links.ts +23 -2
- package/src/workspace/checks/live.ts +113 -0
- package/src/workspace/checks.test.ts +2 -2
- package/src/workspace/checks.ts +49 -8
- package/src/workspace/compose-graph.test.ts +47 -0
- package/src/workspace/compose-graph.ts +127 -3
- package/src/workspace/conformance/__fixture__/decisions/decision.kind.mjs +7 -1
- package/src/workspace/conformance/__fixture__/decisions/decision.schema.json +5 -0
- package/src/workspace/conformance/__writer_fixture__/answers/answer.kind.mjs +27 -0
- package/src/workspace/conformance/__writer_fixture__/answers/answer.schema.json +95 -0
- package/src/workspace/conformance/__writer_fixture__/decisions/points.json +132 -0
- package/src/workspace/conformance/__writer_fixture__/sessions/session.kind.mjs +48 -0
- package/src/workspace/conformance/__writer_fixture__/sessions/session.schema.json +108 -0
- package/src/workspace/conformance/__writer_fixture__/work/W-001-the-writer-suite-works-this-item.md +25 -0
- package/src/workspace/conformance/__writer_fixture__/work/work.kind.mjs +60 -0
- package/src/workspace/conformance/__writer_fixture__/work/work.schema.json +578 -0
- package/src/workspace/conformance/conformance.e2e.test.ts +35 -3
- package/src/workspace/conformance/index.mjs +30 -3
- package/src/workspace/conformance/index.ts +103 -15
- package/src/workspace/conformance/vitest.ts +44 -2
- package/src/workspace/conformance/writer-conformance.e2e.test.ts +131 -0
- package/src/workspace/conformance/writer.test.ts +156 -0
- package/src/workspace/conformance/writer.ts +880 -0
- package/src/workspace/decide.ts +7 -1
- package/src/workspace/declaration.schema.json +368 -4
- package/src/workspace/declaration.ts +270 -1
- package/src/workspace/declared-kinds.test.ts +33 -0
- package/src/workspace/evidence.schema.json +279 -0
- package/src/workspace/export-cli.ts +180 -0
- package/src/workspace/export-import.test.ts +282 -0
- package/src/workspace/export.ts +486 -0
- package/src/workspace/graph-cli.ts +51 -2
- package/src/workspace/graph-contract.test.ts +89 -4
- package/src/workspace/graph.schema.json +453 -1
- package/src/workspace/identity.test.ts +196 -0
- package/src/workspace/identity.ts +186 -0
- package/src/workspace/import.ts +325 -0
- package/src/workspace/intent-cli.ts +64 -10
- package/src/workspace/intent-record.schema.json +208 -0
- package/src/workspace/intent-record.ts +35 -1
- package/src/workspace/intent-why.test.ts +274 -0
- package/src/workspace/intent.schema.json +718 -7
- package/src/workspace/intent.test.ts +11 -2
- package/src/workspace/intent.ts +495 -32
- package/src/workspace/kinds.test.ts +5 -5
- package/src/workspace/kinds.ts +62 -33
- package/src/workspace/lineage-adopt-cli.ts +103 -0
- package/src/workspace/lineage-adopt.test.ts +552 -0
- package/src/workspace/lineage-adopt.ts +452 -0
- package/src/workspace/lineage-check.ts +26 -5
- package/src/workspace/lineage-cli.ts +12 -2
- package/src/workspace/lineage-hash-index.ts +305 -0
- package/src/workspace/lineage-init.test.ts +9 -0
- package/src/workspace/lineage-init.ts +29 -9
- package/src/workspace/lineage-lock.ts +54 -0
- package/src/workspace/lineage-migrations.test.ts +27 -0
- package/src/workspace/lineage-migrations.ts +44 -14
- package/src/workspace/lineage-provenance.ts +40 -0
- package/src/workspace/lineage-upgrade-cli.ts +9 -5
- package/src/workspace/lineage-upgrade.test.ts +92 -1
- package/src/workspace/lineage-upgrade.ts +111 -16
- package/src/workspace/lineage-versions.ts +348 -0
- package/src/workspace/links.test.ts +121 -2
- package/src/workspace/links.ts +97 -6
- package/src/workspace/ls-contract.test.ts +84 -1
- package/src/workspace/ls-generated.ts +111 -0
- package/src/workspace/ls.schema.json +19 -0
- package/src/workspace/ls.ts +8 -1
- package/src/workspace/member-commands.ts +3 -1
- package/src/workspace/nested-graph.test.ts +176 -0
- package/src/workspace/nested-graph.ts +169 -0
- package/src/workspace/nesting.ts +37 -0
- package/src/workspace/pin-cli.test.ts +71 -0
- package/src/workspace/pin-cli.ts +57 -0
- package/src/workspace/pin-integrity.test.ts +121 -0
- package/src/workspace/pin-integrity.ts +104 -0
- package/src/workspace/points-write.schema.json +2 -0
- package/src/workspace/principal-classes.test.ts +175 -0
- package/src/workspace/principal-classes.ts +307 -0
- package/src/workspace/read-contract.test.ts +24 -0
- package/src/workspace/reason-codes.test.ts +20 -2
- package/src/workspace/reason-codes.ts +53 -3
- package/src/workspace/record-sessions.ts +12 -14
- package/src/workspace/records-amend.schema.json +6 -0
- package/src/workspace/records-checkout.ts +106 -0
- package/src/workspace/records-cli.ts +195 -22
- package/src/workspace/records-close.schema.json +7 -2
- package/src/workspace/records-close.ts +10 -2
- package/src/workspace/records-formats.test.ts +13 -5
- package/src/workspace/records-new.schema.json +6 -0
- package/src/workspace/records-review.schema.json +6 -0
- package/src/workspace/records-sessions.test.ts +23 -6
- package/src/workspace/records-uncommitted.test.ts +171 -0
- package/src/workspace/records-write.test.ts +65 -8
- package/src/workspace/records-write.ts +92 -6
- package/src/workspace/records.schema.json +127 -4
- package/src/workspace/records.ts +123 -5
- package/src/workspace/returns.ts +328 -0
- package/src/workspace/runs-cli.ts +381 -0
- package/src/workspace/runs-write.schema.json +583 -0
- package/src/workspace/runs.schema.json +810 -0
- package/src/workspace/runs.test.ts +242 -0
- package/src/workspace/runs.ts +709 -0
- package/src/workspace/signers.schema.json +206 -0
- package/src/workspace/status-contract.test.ts +5 -0
- package/src/workspace/status-gates.ts +24 -9
- package/src/workspace/status.schema.json +127 -2
- package/src/workspace/status.ts +21 -1
- package/src/workspace/symbols.ts +180 -0
- package/src/workspace/template-manifest.ts +22 -4
- package/src/workspace/trailer-joins.test.ts +171 -0
- package/src/workspace/trailer-joins.ts +82 -0
- package/src/workspace/trailers.ts +148 -0
- package/src/workspace/trust/attestor.ts +15 -0
- package/src/workspace/trust/dsse.ts +134 -0
- package/src/workspace/trust/evidence-cli.ts +195 -0
- package/src/workspace/trust/evidence.test.ts +241 -0
- package/src/workspace/trust/evidence.ts +207 -0
- package/src/workspace/trust/policy.ts +110 -3
- package/src/workspace/trust/provenance.ts +41 -4
- package/src/workspace/trust/record-seal.test.ts +1 -1
- package/src/workspace/trust/rotation.test.ts +258 -0
- package/src/workspace/trust/rotation.ts +336 -0
- package/src/workspace/trust/seal.ts +63 -1
- package/src/workspace/trust/signers-cli.ts +178 -0
- package/src/workspace/trust/ssh-commit.ts +53 -4
- package/src/workspace/trust/test-repo.ts +18 -0
- package/src/workspace/trust/trust.test.ts +8 -2
- package/src/workspace/trust/verify-cli.ts +1 -0
- package/src/workspace/trust/verify.ts +22 -0
- package/src/workspace/work-cli.e2e.test.ts +28 -1
- package/src/workspace/work-cli.ts +133 -8
- package/src/workspace/work-evidence.schema.json +6 -0
- package/src/workspace/work-history.schema.json +73 -1
- package/src/workspace/work-history.test.ts +48 -5
- package/src/workspace/work-kind-fields.test.ts +154 -0
- package/src/workspace/work-lease.schema.json +14 -1
- package/src/workspace/work.ts +82 -0
- package/src/workspace/workspace-principals.schema.json +60 -0
- package/src/workspace/write-scope.test.ts +466 -0
- package/src/workspace/write-scope.ts +573 -0
- package/src/yaml.test.ts +111 -1
- package/src/yaml.ts +141 -549
|
@@ -3,7 +3,8 @@
|
|
|
3
3
|
* session in one write. It sets the session's state to its kind's closed
|
|
4
4
|
* state, the time it closed and the commit it closed at (the fields the
|
|
5
5
|
* kind's `session` block names in `closedOn` and `closedRev`), and then the
|
|
6
|
-
* seal by chant's rule ({@link sessionSeal}), so a UI never
|
|
6
|
+
* seal by chant's whole-file rule ({@link sessionSeal}, #2546), so a UI never
|
|
7
|
+
* computes a seal.
|
|
7
8
|
*
|
|
8
9
|
* Like `new`, `amend` and `review`, it reads the records again with the file
|
|
9
10
|
* in place and writes only when the session comes back valid: a verdict
|
|
@@ -14,7 +15,7 @@
|
|
|
14
15
|
import { type WriteFailure, type WriteResult } from "./records-write.js";
|
|
15
16
|
export declare const RECORDS_CLOSE_SCHEMA_ID = "https://intentius.io/chant/schemas/workspace/records-close/v1/records-close.schema.json";
|
|
16
17
|
/** Why `records close` wrote nothing. Closed. */
|
|
17
|
-
export declare const CLOSE_ERROR_CODES: readonly ["kind-unreadable", "kind-invalid", "schema-unreadable", "schema-id-mismatch", "schema-invalid", "location-missing", "write-usage-invalid", "record-not-found", "record-closed", "record-unparseable", "record-schema-invalid", "record-id-duplicate", "record-supersedes-unknown", "record-supersedes-conflict", "record-remediates-unknown", "record-remediates-not-closed", "session-seal-mismatch", "session-verdict-unknown-record"];
|
|
18
|
+
export declare const CLOSE_ERROR_CODES: readonly ["kind-unreadable", "kind-invalid", "schema-unreadable", "schema-id-mismatch", "schema-invalid", "location-missing", "write-usage-invalid", "record-not-found", "record-closed", "write-scope-member", "write-scope-kind", "write-scope-class-unknown", "agent-unknown", "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"];
|
|
18
19
|
export type CloseErrorCode = (typeof CLOSE_ERROR_CODES)[number];
|
|
19
20
|
export type CloseDocument = (WriteResult & {
|
|
20
21
|
/** The top-level fields the close set, in the order written. */
|
|
@@ -35,6 +36,8 @@ export interface CloseRecordOptions {
|
|
|
35
36
|
cwd: string;
|
|
36
37
|
/** The close time. Defaults to now. */
|
|
37
38
|
now?: Date;
|
|
39
|
+
/** The agent session the write is made in (#2548). */
|
|
40
|
+
agent?: string;
|
|
38
41
|
}
|
|
39
42
|
/** `records close`: close one open session and seal it. */
|
|
40
43
|
export declare function closeRecord(opts: CloseRecordOptions): Promise<CloseDocument>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"records-close.d.ts","sourceRoot":"","sources":["../../src/workspace/records-close.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"records-close.d.ts","sourceRoot":"","sources":["../../src/workspace/records-close.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAMH,OAAO,EAcL,KAAK,YAAY,EACjB,KAAK,WAAW,EACjB,MAAM,iBAAiB,CAAC;AAIzB,eAAO,MAAM,uBAAuB,4FAA4F,CAAC;AAEjI,iDAAiD;AACjD,eAAO,MAAM,iBAAiB,oiBAOY,CAAC;AAC3C,MAAM,MAAM,cAAc,GAAG,CAAC,OAAO,iBAAiB,CAAC,CAAC,MAAM,CAAC,CAAC;AAEhE,MAAM,MAAM,aAAa,GACrB,CAAC,WAAW,GAAG;IACb,gEAAgE;IAChE,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,mDAAmD;IACnD,IAAI,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC;IACxC,0FAA0F;IAC1F,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;CAC1B,CAAC,GACF,YAAY,CAAC,cAAc,CAAC,CAAC;AAEjC,MAAM,WAA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CAAC;IAClB,wCAAwC;IACxC,OAAO,CAAC,EAAE,YAAY,CAAC;IACvB,OAAO,EAAE,WAAW,EAAE,CAAC;IACvB,OAAO,EAAE,MAAM,CAAC,eAAe,EAAE,MAAM,CAAC,CAAC;CAC1C,GACD;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE;QAAE,IAAI,EAAE,qBAAqB,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAAA;CAAE,CAAC;AAEnG,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;CACb;AAWD,4FAA4F;AAC5F,wBAAsB,iBAAiB,CAAC,KAAK,EAAE,iBAAiB,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAoC/F;AAwID,wGAAwG;AACxG,wBAAgB,cAAc,CAAC,IAAI,EAAE,UAAU,EAAE,MAAM,EAAE,WAAW,EAAE,EAAE,KAAK,EAAE,WAAW,EAAE,GAAG,WAAW,EAAE,CAkD3G;AAED,wDAAwD;AACxD,wBAAgB,WAAW,CAAC,GAAG,EAAE,OAAO,CAAC,oBAAoB,EAAE;IAAE,OAAO,EAAE,WAAW,EAAE,CAAA;CAAE,CAAC,GAAG,MAAM,CA0BlG"}
|
|
@@ -20,11 +20,15 @@
|
|
|
20
20
|
* `records close` is in `records-close.ts`.
|
|
21
21
|
*
|
|
22
22
|
* `new --sign` and `amend --sign` seal the record's author (#2688), and
|
|
23
|
-
* `review --sign` seals a verdict (#2687): see `trust/seal.ts`.
|
|
23
|
+
* `review --sign` seals a verdict (#2687): see `trust/seal.ts`. A record of
|
|
24
|
+
* a kind that declares `seal` gets its whole-file seal when `new` or `amend`
|
|
25
|
+
* writes it into a closed state (#2546, ws-063).
|
|
24
26
|
*/
|
|
25
27
|
import type { CommandContext } from "../cli/registry.js";
|
|
26
28
|
import { type RecordSource } from "./record-source.js";
|
|
27
29
|
import { type LoadedRecordKind, type RecordEntry, type RecordWarning } from "./records.js";
|
|
30
|
+
import { type ScopeSource } from "./write-scope.js";
|
|
31
|
+
import type { WriteVerb } from "./declaration.js";
|
|
28
32
|
/** The version of the write documents this chant prints. */
|
|
29
33
|
export declare const RECORDS_WRITE_CONTRACT_VERSION = 1;
|
|
30
34
|
export declare const RECORDS_NEW_SCHEMA_ID = "https://intentius.io/chant/schemas/workspace/records-new/v1/records-new.schema.json";
|
|
@@ -33,11 +37,11 @@ export declare const RECORDS_REVIEW_SCHEMA_ID = "https://intentius.io/chant/sche
|
|
|
33
37
|
/** Loading the kind and reading its records, as `records` reads them. */
|
|
34
38
|
export declare const LOAD_ERROR_CODES: readonly ["kind-unreadable", "kind-invalid", "schema-unreadable", "schema-id-mismatch", "schema-invalid", "location-missing"];
|
|
35
39
|
/** Why `records new` wrote nothing. Closed: a reader may switch on it. */
|
|
36
|
-
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", "record-unparseable", "record-schema-invalid", "record-id-duplicate", "record-supersedes-unknown", "record-supersedes-conflict", "record-remediates-unknown", "record-remediates-not-closed", "session-seal-mismatch", "session-verdict-unknown-record"];
|
|
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"];
|
|
37
41
|
/** Why `records amend` wrote nothing. */
|
|
38
|
-
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-unparseable", "record-schema-invalid", "record-id-duplicate", "record-supersedes-unknown", "record-supersedes-conflict", "record-remediates-unknown", "record-remediates-not-closed", "session-seal-mismatch", "session-verdict-unknown-record"];
|
|
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"];
|
|
39
43
|
/** Why `records review` wrote nothing. */
|
|
40
|
-
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-unparseable", "record-schema-invalid", "record-id-duplicate", "record-supersedes-unknown", "record-supersedes-conflict", "record-remediates-unknown", "record-remediates-not-closed", "session-seal-mismatch", "session-verdict-unknown-record"];
|
|
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"];
|
|
41
45
|
export type NewErrorCode = (typeof NEW_ERROR_CODES)[number];
|
|
42
46
|
export type AmendErrorCode = (typeof AMEND_ERROR_CODES)[number];
|
|
43
47
|
export type ReviewErrorCode = (typeof REVIEW_ERROR_CODES)[number];
|
|
@@ -145,6 +149,15 @@ export interface Opened {
|
|
|
145
149
|
dirRel: string;
|
|
146
150
|
}
|
|
147
151
|
export declare function open(kind: string, cwd: string): Promise<Opened>;
|
|
152
|
+
/**
|
|
153
|
+
* Refuse a write outside the writer's scope (#2548): the kind `o` opened,
|
|
154
|
+
* written with `verb`, by the session `agent` names (`CHANT_AGENT`) or the
|
|
155
|
+
* principal `by` names. Throws a {@link WriteScopeError}.
|
|
156
|
+
*/
|
|
157
|
+
export declare function refuseOutOfScope(o: Opened, verb: WriteVerb, cwd: string, writer: {
|
|
158
|
+
agent?: string;
|
|
159
|
+
by?: string;
|
|
160
|
+
}): ScopeSource;
|
|
148
161
|
/**
|
|
149
162
|
* The kind's records as `records` reads them from `source`. A session kind's
|
|
150
163
|
* subject records are read from the same source (#2693), so a write is
|
|
@@ -202,6 +215,8 @@ export interface NewRecordOptions {
|
|
|
202
215
|
* `reviews.decider` field, which the fields must set.
|
|
203
216
|
*/
|
|
204
217
|
sign?: string | true;
|
|
218
|
+
/** The agent session the write is made in (`CHANT_AGENT`, #2548), which its write scope binds. */
|
|
219
|
+
agent?: string;
|
|
205
220
|
}
|
|
206
221
|
/**
|
|
207
222
|
* A write made through a channel other than the command line (#2707), such
|
|
@@ -240,6 +255,8 @@ export interface AmendRecordOptions {
|
|
|
240
255
|
cwd: string;
|
|
241
256
|
/** Seal the amended record's author, as `records new` does (#2688). */
|
|
242
257
|
sign?: string | true;
|
|
258
|
+
/** The agent session the write is made in (#2548). */
|
|
259
|
+
agent?: string;
|
|
243
260
|
}
|
|
244
261
|
/**
|
|
245
262
|
* `records amend`: set top-level fields of one record. A record in a closed
|
|
@@ -274,6 +291,8 @@ export interface ReviewRecordOptions {
|
|
|
274
291
|
* git's `user.signingkey`. Without it the verdict is written unsealed.
|
|
275
292
|
*/
|
|
276
293
|
sign?: string | true;
|
|
294
|
+
/** The agent session the write is made in (#2548). */
|
|
295
|
+
agent?: string;
|
|
277
296
|
}
|
|
278
297
|
/**
|
|
279
298
|
* `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;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAIH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAEtD,OAAO,EAA8B,KAAK,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAChF,OAAO,EAWL,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;AAI/C,4DAA4D;AAC5D,eAAO,MAAM,8BAA8B,IAAI,CAAC;AAEhD,eAAO,MAAM,qBAAqB,wFAAwF,CAAC;AAC3H,eAAO,MAAM,uBAAuB,4FAA4F,CAAC;AACjI,eAAO,MAAM,wBAAwB,8FAA8F,CAAC;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;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,GAAG,YAAY,CAAC,qBAAqB,CAAC,CAa5H;AAED;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,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,CA2C1E"}
|
|
@@ -13,8 +13,10 @@
|
|
|
13
13
|
*
|
|
14
14
|
* A record that fails any of that is still returned, with reason codes, and the
|
|
15
15
|
* read succeeds. Only a failure to read the kind, its schema or the revision is
|
|
16
|
-
* an error.
|
|
17
|
-
* #
|
|
16
|
+
* an error. A closed record of a kind that declares `seal` is checked against
|
|
17
|
+
* its whole-file seal ({@link recordSeal}, #2546); author and verdict seals
|
|
18
|
+
* are checked by `records-cli.ts` against the policy at base. Nothing here
|
|
19
|
+
* needs a `chant.workspace.json`.
|
|
18
20
|
*
|
|
19
21
|
* Everything under `workspace/` loads only when a `chant workspace` command
|
|
20
22
|
* runs. The level-0 goldens (#2526) fail if a level-0 command loads it.
|
|
@@ -30,7 +32,7 @@ import type { AnswerWarningCode } from "./points.js";
|
|
|
30
32
|
* Why one record is not valid. The list is closed: a reader may switch on it,
|
|
31
33
|
* and a new code is a contract change (#2536).
|
|
32
34
|
*/
|
|
33
|
-
export declare const RECORD_REASON_CODES: readonly ["record-unparseable", "record-schema-invalid", "record-id-duplicate", "record-supersedes-unknown", "record-supersedes-conflict", "record-remediates-unknown", "record-remediates-not-closed", "session-seal-mismatch", "session-verdict-unknown-record"];
|
|
35
|
+
export declare const RECORD_REASON_CODES: readonly ["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"];
|
|
34
36
|
export type RecordReasonCode = (typeof RECORD_REASON_CODES)[number];
|
|
35
37
|
/**
|
|
36
38
|
* Why a record carries a warning. Closed, like the reason codes. A warning
|
|
@@ -72,7 +74,9 @@ export declare const RECORD_SEAL_FIELD = "seal";
|
|
|
72
74
|
* moving a record to that state keeps the verdicts that ratified it
|
|
73
75
|
* counting.
|
|
74
76
|
*/
|
|
75
|
-
export declare function digestFields(kind: Pick<RecordKind, "reviews" | "stateField">): string[] | null;
|
|
77
|
+
export declare function digestFields(kind: Pick<RecordKind, "reviews" | "stateField" | "seal">): string[] | null;
|
|
78
|
+
/** The field holding a closed record's whole-file seal: the kind's `seal.field`, or a session kind's `session.seal` (#2546, #2673). */
|
|
79
|
+
export declare function sealFieldOf(kind: Pick<RecordKind, "seal" | "session">): string | undefined;
|
|
76
80
|
/** What a verdict's seal establishes (#2687). See `trust/seal.ts`. */
|
|
77
81
|
export interface VerdictAttestation {
|
|
78
82
|
/** Why the verdict is not attested. Absent when its seal verified. */
|
|
@@ -173,10 +177,27 @@ export declare const recordKindSchema: z.ZodObject<{
|
|
|
173
177
|
field: z.ZodString;
|
|
174
178
|
implementer: z.ZodString;
|
|
175
179
|
}, z.core.$strict>>;
|
|
180
|
+
contract: z.ZodOptional<z.ZodObject<{
|
|
181
|
+
field: z.ZodString;
|
|
182
|
+
kind: z.ZodString;
|
|
183
|
+
}, z.core.$strict>>;
|
|
184
|
+
tier: z.ZodOptional<z.ZodObject<{
|
|
185
|
+
field: z.ZodString;
|
|
186
|
+
tiers: z.ZodArray<z.ZodString>;
|
|
187
|
+
}, z.core.$strict>>;
|
|
188
|
+
attempts: z.ZodOptional<z.ZodObject<{
|
|
189
|
+
field: z.ZodString;
|
|
190
|
+
max: z.ZodNumber;
|
|
191
|
+
}, z.core.$strict>>;
|
|
192
|
+
answers: z.ZodOptional<z.ZodString>;
|
|
176
193
|
}, z.core.$strict>>;
|
|
177
194
|
answers: z.ZodOptional<z.ZodObject<{
|
|
178
195
|
points: z.ZodString;
|
|
179
196
|
}, z.core.$strict>>;
|
|
197
|
+
seal: z.ZodOptional<z.ZodObject<{
|
|
198
|
+
field: z.ZodString;
|
|
199
|
+
}, z.core.$strict>>;
|
|
200
|
+
spec: z.ZodOptional<z.ZodBoolean>;
|
|
180
201
|
}, z.core.$strict>;
|
|
181
202
|
/** 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. */
|
|
182
203
|
export declare const ANSWER_STATES: readonly ["escalated", "proposed", "answered"];
|
|
@@ -238,7 +259,9 @@ export declare function parseRecord(format: RecordFormat, text: string): FrontMa
|
|
|
238
259
|
* record's author seal (#2688; {@link digestFields}), so sealing a record
|
|
239
260
|
* leaves its digest where it was too. A record with no `seal` hashes exactly
|
|
240
261
|
* as it did before author seals existed. A kind with `reviews.ratified` adds
|
|
241
|
-
* its state field (#2873)
|
|
262
|
+
* its state field (#2873), and a kind with `seal` its seal field (#2546), so
|
|
263
|
+
* the whole-file seal written at the close moves no digest. The digest is not
|
|
264
|
+
* that seal: {@link recordSeal} covers the whole record.
|
|
242
265
|
*
|
|
243
266
|
* The rule, which a hand-editor can follow with a text editor and
|
|
244
267
|
* `sha256sum`:
|
|
@@ -260,6 +283,34 @@ export declare function parseRecord(format: RecordFormat, text: string): FrontMa
|
|
|
260
283
|
* counting.
|
|
261
284
|
*/
|
|
262
285
|
export declare function recordTextDigest(text: string, field?: string | readonly string[] | null, format?: RecordFormat): string;
|
|
286
|
+
/**
|
|
287
|
+
* The seal of a closed record (#2546, ws-003, ws-063): `sha256:` and the
|
|
288
|
+
* lowercase hex SHA-256 of the RFC 8785 (JCS) form of the whole record, with
|
|
289
|
+
* only the field that holds the seal left out. It is a separate hash from
|
|
290
|
+
* {@link recordTextDigest}, which a review verdict names: the digest leaves
|
|
291
|
+
* out the reviews, the author seal and the state so verdicts keep counting,
|
|
292
|
+
* and the seal covers all of them.
|
|
293
|
+
*
|
|
294
|
+
* 1. Line endings become LF (CRLF and a lone CR each become one LF).
|
|
295
|
+
* 2. The structured core is parsed as the kind's format says: the front
|
|
296
|
+
* matter, as the JSON subset of YAML, or the whole JSON object. The
|
|
297
|
+
* top-level member `field` is removed from it.
|
|
298
|
+
* 3. For a Markdown record the value hashed is the object
|
|
299
|
+
* `{"body": <the text after the closing --- line>, "core": <the core>}`;
|
|
300
|
+
* for a JSON record it is the core itself.
|
|
301
|
+
* 4. That value is written in JCS (keys sorted by UTF-16 code units, no
|
|
302
|
+
* whitespace, ECMAScript number and string forms) and hashed as UTF-8.
|
|
303
|
+
*
|
|
304
|
+
* So every value in the record and every byte of its body is sealed, the
|
|
305
|
+
* reviews, the author seal and the state included, while the key order,
|
|
306
|
+
* quoting and indentation of the front matter are not: the same record
|
|
307
|
+
* written another way has the same seal. A YAML comment in the front matter
|
|
308
|
+
* is not part of the record, so it is not sealed either (#3066). Returns null when
|
|
309
|
+
* the core can't be parsed.
|
|
310
|
+
*/
|
|
311
|
+
export declare function recordSeal(text: string, field: string, format?: RecordFormat): string | null;
|
|
312
|
+
/** The text below a Markdown file's front matter, with LF line endings: everything after the closing `---` line. */
|
|
313
|
+
export declare function bodyText(text: string): string;
|
|
263
314
|
/** The quorum a workspace sets when its declaration names none: two verdicts besides the decider's (#2555). */
|
|
264
315
|
export declare const DEFAULT_QUORUM = 2;
|
|
265
316
|
/** A principal as the quorum compares it: NFKC, trimmed and lower-cased, so `alice` and `Alice ` are one reviewer (#2671). */
|
|
@@ -398,6 +449,8 @@ export interface RecordEntry {
|
|
|
398
449
|
implements?: WorkLink[];
|
|
399
450
|
/** For a work kind with acceptance criteria (#2772): how many of the record's criteria passing evidence meets, or null when it lists none. */
|
|
400
451
|
acceptance?: WorkAcceptance | null;
|
|
452
|
+
/** For a work kind with a contract link (#3147): the contract record the item builds, with its state, or null when it names none. */
|
|
453
|
+
contract?: WorkLink | null;
|
|
401
454
|
}
|
|
402
455
|
export interface ReadRecordsOptions {
|
|
403
456
|
/** Where record paths are reported from, and what `source` reads relative to. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"records.d.ts","sourceRoot":"","sources":["../../src/workspace/records.ts"],"names":[],"mappings":"AAAA
|
|
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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AAC,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"}
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Returns: the record an import writes when a copy of the workspace comes
|
|
3
|
+
* back (#2552, #2524 D10, ws-004, ws-073).
|
|
4
|
+
*
|
|
5
|
+
* `chant workspace import` writes `.chant/returns/<id>.json` at the workspace
|
|
6
|
+
* root, beside the lock. It names the export the copy started from, the
|
|
7
|
+
* copy's HEAD when the copy is a git repository of its own, and every path
|
|
8
|
+
* the import wrote or removed. For each written path whose bytes are the
|
|
9
|
+
* copy's own (no host value was switched back into it), it also carries the
|
|
10
|
+
* origin: the raw commit object that last changed the file in the copy, and
|
|
11
|
+
* the raw tree objects from that commit's root tree down to the file. Those
|
|
12
|
+
* objects hash to the ids that name them, so anyone can check offline that
|
|
13
|
+
* the commit, with its original signature, holds exactly the bytes the
|
|
14
|
+
* workspace now has. Nothing is re-signed: the signature is the one the
|
|
15
|
+
* author made where the copy lived.
|
|
16
|
+
*
|
|
17
|
+
* The commit is judged by the attestors of #2547 with the policy at base. A
|
|
18
|
+
* signer the base policy does not list makes it `attested-unverifiable-here`,
|
|
19
|
+
* not `unattested`: there is a signature, and nothing here can say whose key
|
|
20
|
+
* it is. An admin admits the signers by adding them to `.chant/trust.json`
|
|
21
|
+
* under `admitted`, naming the return (`chant workspace admit <id>`). That
|
|
22
|
+
* file is policy, read at base, and changing it is a protected write, so the
|
|
23
|
+
* admission is signed by the admin's own commit. From then on, the returned
|
|
24
|
+
* commits read as `attested`. An admitted key verifies only that return's
|
|
25
|
+
* commits and seals, never a commit made in the workspace's own repository.
|
|
26
|
+
*/
|
|
27
|
+
import { z } from "zod";
|
|
28
|
+
import type { WorkspaceTree } from "./tree.js";
|
|
29
|
+
import { type CommitAttestor } from "./trust/attestor.js";
|
|
30
|
+
import { type TrustPolicy } from "./trust/policy.js";
|
|
31
|
+
import type { RecordProvenance } from "./trust/provenance.js";
|
|
32
|
+
/** Where return records live, relative to the workspace root. */
|
|
33
|
+
export declare const RETURNS_DIR = ".chant/returns";
|
|
34
|
+
declare const OriginSchema: z.ZodObject<{
|
|
35
|
+
commit: z.ZodString;
|
|
36
|
+
raw: z.ZodString;
|
|
37
|
+
trees: z.ZodArray<z.ZodString>;
|
|
38
|
+
}, z.core.$strict>;
|
|
39
|
+
export type ReturnOrigin = z.infer<typeof OriginSchema>;
|
|
40
|
+
declare const ReturnSchema: z.ZodObject<{
|
|
41
|
+
schema: z.ZodLiteral<1>;
|
|
42
|
+
id: z.ZodString;
|
|
43
|
+
export: z.ZodObject<{
|
|
44
|
+
id: z.ZodString;
|
|
45
|
+
workspace: z.ZodString;
|
|
46
|
+
revision: z.ZodNullable<z.ZodString>;
|
|
47
|
+
}, z.core.$strict>;
|
|
48
|
+
head: z.ZodNullable<z.ZodString>;
|
|
49
|
+
paths: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
50
|
+
sha256: z.ZodString;
|
|
51
|
+
origin: z.ZodOptional<z.ZodObject<{
|
|
52
|
+
commit: z.ZodString;
|
|
53
|
+
raw: z.ZodString;
|
|
54
|
+
trees: z.ZodArray<z.ZodString>;
|
|
55
|
+
}, z.core.$strict>>;
|
|
56
|
+
}, z.core.$strict>>;
|
|
57
|
+
removed: z.ZodArray<z.ZodString>;
|
|
58
|
+
hostValues: z.ZodArray<z.ZodString>;
|
|
59
|
+
signers: z.ZodArray<z.ZodObject<{
|
|
60
|
+
key: z.ZodString;
|
|
61
|
+
fingerprint: z.ZodString;
|
|
62
|
+
principal: z.ZodString;
|
|
63
|
+
commits: z.ZodArray<z.ZodString>;
|
|
64
|
+
}, z.core.$strict>>;
|
|
65
|
+
}, z.core.$strict>;
|
|
66
|
+
export type ReturnRecord = z.infer<typeof ReturnSchema>;
|
|
67
|
+
/** The id git gives an object: the hash of `<type> <length>\0<data>`, SHA-1 or SHA-256 by the id length in use. */
|
|
68
|
+
export declare function gitObjectId(type: "blob" | "tree" | "commit", data: Buffer, algorithm: "sha1" | "sha256"): string;
|
|
69
|
+
/** The entries of a raw tree object: mode, name and id. */
|
|
70
|
+
export declare function parseTree(raw: Buffer, idBytes: number): {
|
|
71
|
+
mode: string;
|
|
72
|
+
name: string;
|
|
73
|
+
id: string;
|
|
74
|
+
}[];
|
|
75
|
+
/**
|
|
76
|
+
* The origin of `path` (relative to the copy's root) in the copy's own
|
|
77
|
+
* repository at `dir`: the last commit that changed it, and the tree objects
|
|
78
|
+
* down to it. Undefined when the file at that commit is not `content`, such
|
|
79
|
+
* as a file with uncommitted changes.
|
|
80
|
+
*/
|
|
81
|
+
export declare function buildOrigin(dir: string, path: string, content: Buffer): ReturnOrigin | undefined;
|
|
82
|
+
/** Check that `origin`'s objects hash to their ids and lead from the commit to `content` at `path`. */
|
|
83
|
+
export declare function verifyOrigin(origin: ReturnOrigin, path: string, content: Buffer): {
|
|
84
|
+
ok: true;
|
|
85
|
+
} | {
|
|
86
|
+
ok: false;
|
|
87
|
+
reason: string;
|
|
88
|
+
};
|
|
89
|
+
/** The keys that signed the origins, grouped by key, for an admin to admit. */
|
|
90
|
+
export declare function originSigners(origins: readonly ReturnOrigin[]): ReturnRecord["signers"];
|
|
91
|
+
export declare function parseReturn(text: string, label: string): ReturnRecord;
|
|
92
|
+
export declare function renderReturn(r: ReturnRecord): string;
|
|
93
|
+
export declare function writeReturn(root: string, r: ReturnRecord): string;
|
|
94
|
+
/** The return records in `tree` (the workspace root's), sorted by id. Unreadable ones are skipped and named in `problems`. */
|
|
95
|
+
export declare function readReturns(tree: WorkspaceTree): {
|
|
96
|
+
returns: ReturnRecord[];
|
|
97
|
+
problems: string[];
|
|
98
|
+
};
|
|
99
|
+
/**
|
|
100
|
+
* The provenance of a returned file: its origin commit judged by the
|
|
101
|
+
* attestors with the policy at base plus the signers admitted for the
|
|
102
|
+
* return. Undefined when the return holds no origin for the path, or the
|
|
103
|
+
* workspace's bytes are not the ones returned, so the commit that holds the
|
|
104
|
+
* file here is what counts.
|
|
105
|
+
*/
|
|
106
|
+
export declare function returnedProvenance(policy: TrustPolicy, attestors: readonly CommitAttestor[], ret: ReturnRecord, path: string, content: Buffer, host: RecordProvenance): RecordProvenance | undefined;
|
|
107
|
+
export interface AdmitResult {
|
|
108
|
+
id: string;
|
|
109
|
+
/** Repository-relative path of the trust config. */
|
|
110
|
+
path: string;
|
|
111
|
+
/** The signers added. Empty when every one was already admitted. */
|
|
112
|
+
added: {
|
|
113
|
+
principal: string;
|
|
114
|
+
key: string;
|
|
115
|
+
}[];
|
|
116
|
+
written: boolean;
|
|
117
|
+
}
|
|
118
|
+
/**
|
|
119
|
+
* Add the signers of return `ret` to the `admitted` list of
|
|
120
|
+
* `.chant/trust.json` at the repository root `repo`, keeping everything else
|
|
121
|
+
* in it. The admission counts once an admin's signed commit merges it: the
|
|
122
|
+
* file is policy, read at base, and a protected write.
|
|
123
|
+
*/
|
|
124
|
+
export declare function admitReturn(repo: string, ret: ReturnRecord, opts?: {
|
|
125
|
+
note?: string;
|
|
126
|
+
dryRun?: boolean;
|
|
127
|
+
}): AdmitResult;
|
|
128
|
+
export {};
|
|
129
|
+
//# sourceMappingURL=returns.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"returns.d.ts","sourceRoot":"","sources":["../../src/workspace/returns.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAMH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CA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|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `chant workspace runs` (#3033, ws-076): read and write the agent run
|
|
3
|
+
* record.
|
|
4
|
+
*
|
|
5
|
+
* - `runs [--unit <id>] [--decision <id>] [--by <principal>] [--since <rev>]
|
|
6
|
+
* --json` reads every run in the ledger with the commits it made, and
|
|
7
|
+
* totals tokens and cost per work item, per decision and per principal,
|
|
8
|
+
* naming the runs that report no cost instead of counting them as zero
|
|
9
|
+
* (`runs.schema.json`, a read-contract output).
|
|
10
|
+
* - `runs start --from <file|->`, `runs end <id> --from <file|->` and `runs
|
|
11
|
+
* record --from <file|->` append a run's start, its end, or both, to
|
|
12
|
+
* `_agent-runs/<id>.jsonl` on `chant/lifecycle` (`runs-write.schema.json`).
|
|
13
|
+
*
|
|
14
|
+
* chant records runs and never starts one: whatever ran the agent writes the
|
|
15
|
+
* record. Reads never fetch.
|
|
16
|
+
*/
|
|
17
|
+
import type { CommandContext } from "../cli/registry.js";
|
|
18
|
+
import { type RunLedgerWrite, type RunView } from "./runs.js";
|
|
19
|
+
/** The version of the `runs` documents this chant writes: read contract 1. */
|
|
20
|
+
export declare const RUNS_CONTRACT_VERSION = 1;
|
|
21
|
+
/** `$id` of the JSON Schema for `runs --json`, shipped beside this file. */
|
|
22
|
+
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. */
|
|
24
|
+
export declare const RUNS_WRITE_SCHEMA_ID = "https://intentius.io/chant/schemas/workspace/runs-write/v1/runs-write.schema.json";
|
|
25
|
+
/** Why `runs` read nothing. Closed. */
|
|
26
|
+
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
|
+
export type RunsErrorCode = (typeof RUNS_ERROR_CODES)[number];
|
|
28
|
+
/** 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"];
|
|
30
|
+
export type RunsReasonCode = (typeof RUNS_REASON_CODES)[number];
|
|
31
|
+
/** 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"];
|
|
33
|
+
export type RunsWriteErrorCode = (typeof RUNS_WRITE_ERROR_CODES)[number];
|
|
34
|
+
/** Tokens and cost summed over some runs. */
|
|
35
|
+
export interface RunTotals {
|
|
36
|
+
runs: number;
|
|
37
|
+
/** Runs with no end recorded yet. */
|
|
38
|
+
running: number;
|
|
39
|
+
/** Summed over the runs that report usage; a count a run leaves out adds nothing. */
|
|
40
|
+
tokens: {
|
|
41
|
+
input: number;
|
|
42
|
+
output: number;
|
|
43
|
+
cacheRead: number;
|
|
44
|
+
cacheWrite: number;
|
|
45
|
+
};
|
|
46
|
+
/** One sum per currency, since amounts in two currencies don't add. */
|
|
47
|
+
cost: {
|
|
48
|
+
currency: string;
|
|
49
|
+
amount: number;
|
|
50
|
+
}[];
|
|
51
|
+
/** The runs that report no cost, running ones included: left out of `cost`, never counted as zero. */
|
|
52
|
+
unpriced: string[];
|
|
53
|
+
/** The runs that report no usage: left out of `tokens`. */
|
|
54
|
+
unreported: string[];
|
|
55
|
+
}
|
|
56
|
+
export declare function totalRuns(runs: RunView[]): RunTotals;
|
|
57
|
+
export interface RunsQuery {
|
|
58
|
+
cwd: string;
|
|
59
|
+
/** Only the runs on this work item. */
|
|
60
|
+
unit?: string;
|
|
61
|
+
/** Only the runs that carried out this decision: its id, or `<kind>/<id>`. */
|
|
62
|
+
decision?: string;
|
|
63
|
+
/** Only the runs made for this principal. */
|
|
64
|
+
by?: string;
|
|
65
|
+
/** Only the runs that made a commit after `since` on HEAD, or started after its commit date. */
|
|
66
|
+
since?: string;
|
|
67
|
+
}
|
|
68
|
+
export interface RunsReason {
|
|
69
|
+
code: RunsReasonCode;
|
|
70
|
+
message: string;
|
|
71
|
+
}
|
|
72
|
+
/** What `runs --json` prints. */
|
|
73
|
+
export type RunsDocument = {
|
|
74
|
+
$schema: string;
|
|
75
|
+
contract: number;
|
|
76
|
+
chant: string;
|
|
77
|
+
workspace: {
|
|
78
|
+
name: string;
|
|
79
|
+
root: string;
|
|
80
|
+
};
|
|
81
|
+
ledger: {
|
|
82
|
+
branch: string;
|
|
83
|
+
dir: string;
|
|
84
|
+
commit: string | null;
|
|
85
|
+
};
|
|
86
|
+
filter: {
|
|
87
|
+
unit: string | null;
|
|
88
|
+
decision: string | null;
|
|
89
|
+
by: string | null;
|
|
90
|
+
since: string | null;
|
|
91
|
+
};
|
|
92
|
+
/** Newest first, by when each started. */
|
|
93
|
+
runs: RunView[];
|
|
94
|
+
totals: {
|
|
95
|
+
all: RunTotals;
|
|
96
|
+
byUnit: (RunTotals & {
|
|
97
|
+
unit: string | null;
|
|
98
|
+
})[];
|
|
99
|
+
byDecision: (RunTotals & {
|
|
100
|
+
decision: string;
|
|
101
|
+
})[];
|
|
102
|
+
byPrincipal: (RunTotals & {
|
|
103
|
+
principal: string | null;
|
|
104
|
+
})[];
|
|
105
|
+
};
|
|
106
|
+
malformed: number;
|
|
107
|
+
reasons: RunsReason[];
|
|
108
|
+
} | {
|
|
109
|
+
$schema: string;
|
|
110
|
+
contract: number;
|
|
111
|
+
chant: string;
|
|
112
|
+
error: {
|
|
113
|
+
code: RunsErrorCode;
|
|
114
|
+
message: string;
|
|
115
|
+
};
|
|
116
|
+
};
|
|
117
|
+
/**
|
|
118
|
+
* The decisions each run carried out, as `<kind>/<id>`: the ones its work
|
|
119
|
+
* item implements, read through the declared work kinds, and the records it
|
|
120
|
+
* names of a kind a work kind calls its decision kind. Fills `decisions` in
|
|
121
|
+
* place.
|
|
122
|
+
*/
|
|
123
|
+
export declare function resolveRunDecisions(runs: RunView[], rootOnDisk: string, declared: string[], reasons: RunsReason[]): Promise<void>;
|
|
124
|
+
/** Read the run ledger and build the document. Never throws a {@link WorkspaceReadError}. */
|
|
125
|
+
export declare function workspaceRuns(query: RunsQuery): Promise<RunsDocument>;
|
|
126
|
+
export type RunsVerb = "start" | "end" | "record";
|
|
127
|
+
/** What `runs start|end|record` print. */
|
|
128
|
+
export type RunsWriteDocument = {
|
|
129
|
+
$schema: string;
|
|
130
|
+
contract: number;
|
|
131
|
+
verb: RunsVerb;
|
|
132
|
+
/** The run as the ledger now holds it. */
|
|
133
|
+
run: RunView;
|
|
134
|
+
/** The line a commit the run makes carries, `Chant-Run: <id>` (#3149). */
|
|
135
|
+
trailer: string;
|
|
136
|
+
ledger: RunLedgerWrite;
|
|
137
|
+
} | {
|
|
138
|
+
$schema: string;
|
|
139
|
+
contract: number;
|
|
140
|
+
verb: RunsVerb | null;
|
|
141
|
+
error: {
|
|
142
|
+
code: RunsWriteErrorCode;
|
|
143
|
+
message: string;
|
|
144
|
+
};
|
|
145
|
+
};
|
|
146
|
+
export interface RunsWriteRequest {
|
|
147
|
+
verb: RunsVerb;
|
|
148
|
+
/** The run id, for `end`. */
|
|
149
|
+
id?: string;
|
|
150
|
+
/** The JSON fields, as text. */
|
|
151
|
+
fields: string;
|
|
152
|
+
cwd: string;
|
|
153
|
+
/** The agent session in `CHANT_AGENT`, the default for `agent`. */
|
|
154
|
+
agent?: string;
|
|
155
|
+
now?: () => Date;
|
|
156
|
+
}
|
|
157
|
+
/** Run one write and build the document it prints. */
|
|
158
|
+
export declare function runsWrite(req: RunsWriteRequest): Promise<RunsWriteDocument>;
|
|
159
|
+
/** The read as lines for a person. */
|
|
160
|
+
export declare function formatRuns(doc: Extract<RunsDocument, {
|
|
161
|
+
runs: unknown;
|
|
162
|
+
}>): string;
|
|
163
|
+
export declare function runWorkspaceRuns(ctx: CommandContext): Promise<number>;
|
|
164
|
+
//# sourceMappingURL=runs-cli.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runs-cli.d.ts","sourceRoot":"","sources":["../../src/workspace/runs-cli.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAKH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAMtD,OAAO,EAUL,KAAK,cAAc,EACnB,KAAK,OAAO,EAEb,MAAM,QAAQ,CAAC;AAOhB,8EAA8E;AAC9E,eAAO,MAAM,qBAAqB,IAAI,CAAC;AAEvC,4EAA4E;AAC5E,eAAO,MAAM,qBAAqB,0EAA0E,CAAC;AAE7G,uEAAuE;AACvE,eAAO,MAAM,oBAAoB,sFAAsF,CAAC;AASxH,uCAAuC;AACvC,eAAO,MAAM,gBAAgB,uNAAsE,CAAC;AACpG,MAAM,MAAM,aAAa,GAAG,CAAC,OAAO,gBAAgB,CAAC,CAAC,MAAM,CAAC,CAAC;AAE9D,wEAAwE;AACxE,eAAO,MAAM,iBAAiB,yEAA0G,CAAC;AACzI,MAAM,MAAM,cAAc,GAAG,CAAC,OAAO,iBAAiB,CAAC,CAAC,MAAM,CAAC,CAAC;AAEhE,4DAA4D;AAC5D,eAAO,MAAM,sBAAsB,+SAA8J,CAAC;AAClM,MAAM,MAAM,kBAAkB,GAAG,CAAC,OAAO,sBAAsB,CAAC,CAAC,MAAM,CAAC,CAAC;AAIzE,6CAA6C;AAC7C,MAAM,WAAW,SAAS;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,qCAAqC;IACrC,OAAO,EAAE,MAAM,CAAC;IAChB,qFAAqF;IACrF,MAAM,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,MAAM,CAAC;QAAC,UAAU,EAAE,MAAM,CAAA;KAAE,CAAC;IACj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