@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
package/src/workspace/checks.ts
CHANGED
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
* | WSP001 to WSP011 | the declaration and member kinds (this file) |
|
|
25
25
|
* | WSP071, WSP072 | member ledgers |
|
|
26
26
|
* | WSP081 to WSP083 | recorded pipelines |
|
|
27
|
-
* | WSP091 to
|
|
27
|
+
* | WSP091 to WSP098 | member links (#2539, #2558) |
|
|
28
28
|
* | WSP101 to WSP106 | generated files |
|
|
29
29
|
* | WSP111 to WSP114 | records read with `--kind` (#2549) |
|
|
30
30
|
* | WSP115 | the record kinds the declaration names (#2680) |
|
|
@@ -34,6 +34,7 @@
|
|
|
34
34
|
* | WSP123, WSP124 | box isolation: no shared port, state path or cookie, no literal machine path (#2727) |
|
|
35
35
|
* | WSP125 | boxes: a fountain Box declares the callback token fountain gives its sandbox (#2780) |
|
|
36
36
|
* | WSP126, WSP127 | box intent: the decision record a box names exists, and constrains a member or path of this workspace (#2850, #2857) |
|
|
37
|
+
* | WSP141, WSP142 | member links resolved against a live read, with `--live` (#2549) |
|
|
37
38
|
* | WSP131 to WSP133 | diagram artifacts: source and render exist, a recorded source hash still matches (#2764) |
|
|
38
39
|
*/
|
|
39
40
|
|
|
@@ -45,12 +46,14 @@ import { readDeclaration, resolveGroups, WorkspaceReadError, type Declaration, t
|
|
|
45
46
|
import type { ReasonCode } from "./reason-codes";
|
|
46
47
|
import { parseJsonText, pointerToken, type TextLocation } from "./jsonc";
|
|
47
48
|
import { loadKindRegistry, probeKind, resolveKind, type KindLoadProblem, type KindRegistry } from "./kinds";
|
|
49
|
+
import { coreClassRegistry, loadClassRegistry, unknownScopeClasses, type ClassRegistry } from "./principal-classes";
|
|
48
50
|
import { gitTop, workingTree, type WorkspaceTree } from "./tree";
|
|
49
51
|
import { LINK_CHECKS, linkTable } from "./checks/links";
|
|
50
|
-
import type { LinkTableRow } from "./links";
|
|
52
|
+
import type { LinkRow, LinkTableRow } from "./links";
|
|
51
53
|
import { gatherGeneratedFacts, GENERATED_CHECKS, type GeneratedFileFacts } from "./checks/generated";
|
|
52
54
|
import { gatherLedgerFacts, LEDGER_CHECKS, type MemberLedgerFacts } from "./checks/ledgers";
|
|
53
55
|
import { gatherPipelineFacts, PIPELINE_CHECKS, type MemberPipelineFacts } from "./checks/pipelines";
|
|
56
|
+
import { gatherLiveLinkFacts, LIVE_CHECKS, type LiveLinkFacts } from "./checks/live";
|
|
54
57
|
import { RECORD_CHECKS, type RecordFacts } from "./checks/records";
|
|
55
58
|
import { BOX_CHECKS } from "./checks/boxes";
|
|
56
59
|
import { DIAGRAM_CHECKS } from "./checks/diagrams";
|
|
@@ -73,6 +76,8 @@ export interface WorkspaceFacts {
|
|
|
73
76
|
records?: RecordFacts;
|
|
74
77
|
/** The record kinds the declaration names, each loaded, or only looked for under `--at` (#2680). */
|
|
75
78
|
declaredKinds?: readonly DeclaredKind[];
|
|
79
|
+
/** The declared links resolved against a live read, with `--live` (#2549). */
|
|
80
|
+
live?: LiveLinkFacts;
|
|
76
81
|
/** The decision record each box's intent names, read from the working tree (#2850). */
|
|
77
82
|
boxIntents?: readonly ResolvedBoxIntent[];
|
|
78
83
|
}
|
|
@@ -85,6 +90,10 @@ export interface WorkspaceCheckContext {
|
|
|
85
90
|
kinds: KindRegistry;
|
|
86
91
|
/** Why some pinned kinds could not be read. */
|
|
87
92
|
kindProblems: KindLoadProblem[];
|
|
93
|
+
/** The principal classes: the core four and those the pins supply (#3080). Without it, the core four. */
|
|
94
|
+
classes?: ClassRegistry;
|
|
95
|
+
/** Why some pinned principal classes could not be read (#3080). */
|
|
96
|
+
classProblems?: KindLoadProblem[];
|
|
88
97
|
/** The facts gathered before the checks ran. */
|
|
89
98
|
facts?: WorkspaceFacts;
|
|
90
99
|
}
|
|
@@ -137,6 +146,8 @@ export interface DeclarationCheckReport {
|
|
|
137
146
|
suppressed: SuppressedFinding[];
|
|
138
147
|
/** The member links, declared and inferred, as resolved in source (#2539). */
|
|
139
148
|
links: LinkTableRow[];
|
|
149
|
+
/** With `--live`, the declared links as resolved against a live read of `env` (#2549). */
|
|
150
|
+
live?: { env: string; links: LinkRow[] };
|
|
140
151
|
/** Whether an error-severity finding is active. */
|
|
141
152
|
ok: boolean;
|
|
142
153
|
}
|
|
@@ -176,23 +187,41 @@ export const WORKSPACE_CHECKS: readonly WorkspaceCheck[] = [
|
|
|
176
187
|
{
|
|
177
188
|
id: "WSP002",
|
|
178
189
|
name: "kinds-unreadable",
|
|
179
|
-
description: "Every pinned package's kinds can be read: it is installed at the pinned version,
|
|
190
|
+
description: "Every pinned package's kinds and principal classes can be read: it is installed at the pinned version, its ./workspace-kinds file is valid kind data, and its ./workspace-principals file is valid class data.",
|
|
180
191
|
severity: "error",
|
|
181
192
|
configurable: false,
|
|
182
193
|
check(ctx) {
|
|
183
|
-
|
|
194
|
+
// A pin that can't be read is a problem for both loaders; report it once.
|
|
195
|
+
const seen = new Set<string>();
|
|
196
|
+
return [...ctx.kindProblems, ...(ctx.classProblems ?? [])]
|
|
197
|
+
.filter((p) => {
|
|
198
|
+
const key = `${p.pin}\0${p.message}`;
|
|
199
|
+
if (seen.has(key)) return false;
|
|
200
|
+
seen.add(key);
|
|
201
|
+
return true;
|
|
202
|
+
})
|
|
203
|
+
.map((p) => ({ checkId: this.id, severity: this.severity, message: p.message, pointer: `/pins/${p.pin}` }));
|
|
184
204
|
},
|
|
185
205
|
},
|
|
186
206
|
{
|
|
187
207
|
id: "WSP003",
|
|
188
208
|
name: "kind-unknown",
|
|
189
|
-
description: "Every member's kind is built in or supplied by a pinned package. Unknown kinds fail closed.",
|
|
209
|
+
description: "Every member's kind is built in or supplied by a pinned package, and so is every principal class writeScope names (#3080). Unknown kinds and classes fail closed.",
|
|
190
210
|
severity: "error",
|
|
191
211
|
configurable: false,
|
|
192
212
|
check(ctx) {
|
|
193
|
-
|
|
213
|
+
const members = ctx.declaration.members
|
|
194
214
|
.filter((m) => ctx.kinds.get(m.kind) === undefined)
|
|
195
215
|
.map((m) => entryFinding(this, m, "kind", `member ${m.name} has kind ${m.kind}, which no built-in kind or pinned package supplies; known kinds: ${ctx.kinds.names().join(", ")}`));
|
|
216
|
+
const classes = ctx.classes ?? coreClassRegistry();
|
|
217
|
+
const scope = unknownScopeClasses(ctx.declaration.writeScope, classes).map((c) => ({
|
|
218
|
+
checkId: this.id,
|
|
219
|
+
severity: this.severity,
|
|
220
|
+
message: `writeScope names the principal class ${c}, which no core class or pinned package supplies, so a writer judged human is refused with write-scope-class-unknown; known classes: ${classes.names().join(", ")}`,
|
|
221
|
+
entity: c,
|
|
222
|
+
pointer: `/writeScope/${pointerToken(c)}`,
|
|
223
|
+
}));
|
|
224
|
+
return [...members, ...scope];
|
|
196
225
|
},
|
|
197
226
|
},
|
|
198
227
|
{
|
|
@@ -319,7 +348,7 @@ export const WORKSPACE_CHECKS: readonly WorkspaceCheck[] = [
|
|
|
319
348
|
...LEDGER_CHECKS,
|
|
320
349
|
// Recorded pipelines (#2542).
|
|
321
350
|
...PIPELINE_CHECKS,
|
|
322
|
-
// Member links (#2539), WSP091 to
|
|
351
|
+
// Member links (#2539, #2558), WSP091 to WSP098.
|
|
323
352
|
...LINK_CHECKS,
|
|
324
353
|
// Generated files (#2541).
|
|
325
354
|
...GENERATED_CHECKS,
|
|
@@ -329,6 +358,8 @@ export const WORKSPACE_CHECKS: readonly WorkspaceCheck[] = [
|
|
|
329
358
|
...BOX_CHECKS,
|
|
330
359
|
// Diagram artifacts (#2764).
|
|
331
360
|
...DIAGRAM_CHECKS,
|
|
361
|
+
// Links resolved against a live read, with --live (#2549), WSP141 and WSP142.
|
|
362
|
+
...LIVE_CHECKS,
|
|
332
363
|
];
|
|
333
364
|
|
|
334
365
|
const BY_ID = new Map(WORKSPACE_CHECKS.map((c) => [c.id, c]));
|
|
@@ -406,6 +437,13 @@ export interface DeclarationCheckOptions {
|
|
|
406
437
|
tree?: WorkspaceTree;
|
|
407
438
|
/** The records read with `--kind`, in the same tree (#2549). Given with or without `tree`. */
|
|
408
439
|
records?: RecordFacts;
|
|
440
|
+
/**
|
|
441
|
+
* Resolve the declared links against a live read of this environment
|
|
442
|
+
* (`--live --env`, #2549). Each `chant` member runs `chant graph --live`, so
|
|
443
|
+
* this reaches whatever those reach. Not with `tree`: a live read is of the
|
|
444
|
+
* account now. `onStderr` gets each member's stderr.
|
|
445
|
+
*/
|
|
446
|
+
live?: { env: string; onStderr?: (text: string) => void };
|
|
409
447
|
}
|
|
410
448
|
|
|
411
449
|
/**
|
|
@@ -469,6 +507,7 @@ export async function runDeclarationChecks(
|
|
|
469
507
|
return { file: display(location.file), diagnostics: [diagnostic], suppressed: [], links: [], ok: false };
|
|
470
508
|
}
|
|
471
509
|
const { registry, problems } = loadKindRegistry(declaration.pins, root);
|
|
510
|
+
const classes = loadClassRegistry(declaration.pins, root, { tree });
|
|
472
511
|
const gathered = options.gather === false || options.tree ? {} : await gatherWorkspaceFacts(root, declaration, options);
|
|
473
512
|
// The declared record kinds load from the working tree; under --at only whether each exists at the revision is checked (#2680).
|
|
474
513
|
// A declared work kind's acceptance criteria are counted in the working tree too (#2772).
|
|
@@ -480,8 +519,9 @@ export async function runDeclarationChecks(
|
|
|
480
519
|
...(options.records ? { records: options.records } : {}),
|
|
481
520
|
...(declaredKinds ? { declaredKinds } : {}),
|
|
482
521
|
...(boxIntents ? { boxIntents } : {}),
|
|
522
|
+
...(options.live && !options.tree ? { live: await gatherLiveLinkFacts(root, declaration, registry, options.live.env, options.live.onStderr) } : {}),
|
|
483
523
|
};
|
|
484
|
-
const ctx: WorkspaceCheckContext = { declaration, tree, groups, kinds: registry, kindProblems: problems, facts };
|
|
524
|
+
const ctx: WorkspaceCheckContext = { declaration, tree, groups, kinds: registry, kindProblems: problems, classes: classes.registry, classProblems: classes.problems, facts };
|
|
485
525
|
const findings = runWorkspaceChecks(ctx);
|
|
486
526
|
const { active, suppressed } = applyCheckSettings(declaration, findings);
|
|
487
527
|
|
|
@@ -507,6 +547,7 @@ export async function runDeclarationChecks(
|
|
|
507
547
|
diagnostics,
|
|
508
548
|
suppressed: suppressed.map((s) => ({ ...toFinding(s), reason: s.reason })).sort(order),
|
|
509
549
|
links: linkTable(ctx),
|
|
550
|
+
...(facts.live ? { live: { env: facts.live.env, links: facts.live.rows } } : {}),
|
|
510
551
|
ok: !diagnostics.some((d) => d.severity === "error"),
|
|
511
552
|
};
|
|
512
553
|
}
|
|
@@ -146,3 +146,50 @@ describe("the links section (#2539)", () => {
|
|
|
146
146
|
]);
|
|
147
147
|
});
|
|
148
148
|
});
|
|
149
|
+
|
|
150
|
+
describe("collectors (#2559)", () => {
|
|
151
|
+
const topology = {
|
|
152
|
+
pipelines: [{ id: "traces", signal: "traces", receivers: ["otlp"], processors: ["batch"], exporters: ["otlphttp/honeycomb"] }],
|
|
153
|
+
components: [
|
|
154
|
+
{ id: "otlp", kind: "receiver", type: "otlp", builtin: true, endpoints: ["0.0.0.0:4317"], protocols: ["grpc"], pipelines: ["traces"] },
|
|
155
|
+
{ id: "otlphttp/honeycomb", kind: "exporter", type: "otlphttp", builtin: true, endpoints: ["https://api.honeycomb.io"], protocols: ["http/protobuf"], pipelines: ["traces"] },
|
|
156
|
+
],
|
|
157
|
+
exporters: [{ id: "otlphttp/honeycomb", type: "otlphttp", endpoints: ["https://api.honeycomb.io"], pipelines: ["traces"], signals: ["traces"] }],
|
|
158
|
+
edges: [],
|
|
159
|
+
semconv: [],
|
|
160
|
+
};
|
|
161
|
+
const withMeta = (meta: Record<string, unknown>): GraphIR => ({ ...structuredClone(db), meta });
|
|
162
|
+
|
|
163
|
+
test("lifts a member's meta.collector into a section and keeps the rest of its meta", () => {
|
|
164
|
+
const inputs = [
|
|
165
|
+
{ member: member("web", "web"), ir: structuredClone(web) },
|
|
166
|
+
{ member: member("ops", "ops"), ir: withMeta({ collector: topology, other: 1 }) },
|
|
167
|
+
];
|
|
168
|
+
const doc = composeWorkspaceGraph({ name: "acme", root: "/w" }, inputs);
|
|
169
|
+
expect(doc.collectors).toEqual([
|
|
170
|
+
{
|
|
171
|
+
member: "ops",
|
|
172
|
+
pipelines: topology.pipelines,
|
|
173
|
+
components: topology.components.map(({ builtin: _b, ...c }) => c),
|
|
174
|
+
exporters: topology.exporters,
|
|
175
|
+
},
|
|
176
|
+
]);
|
|
177
|
+
expect(doc.members.find((m) => m.name === "ops")!.meta).toEqual({ other: 1 });
|
|
178
|
+
});
|
|
179
|
+
|
|
180
|
+
test("is empty when no member reports a collector, and leaves meta alone", () => {
|
|
181
|
+
const doc = composeWorkspaceGraph({ name: "acme", root: "/w" }, [
|
|
182
|
+
{ member: member("web", "web"), ir: structuredClone(web) },
|
|
183
|
+
{ member: member("ops", "ops"), ir: withMeta({ _behaviour: { engine: "x" } }) },
|
|
184
|
+
]);
|
|
185
|
+
expect(doc.collectors).toEqual([]);
|
|
186
|
+
expect(doc.members.find((m) => m.name === "ops")!.meta).toEqual({ _behaviour: { engine: "x" } });
|
|
187
|
+
});
|
|
188
|
+
|
|
189
|
+
test("ignores a meta.collector that is not a topology", () => {
|
|
190
|
+
for (const bad of ["x", 1, null, {}, { pipelines: "no" }]) {
|
|
191
|
+
const doc = composeWorkspaceGraph({ name: "acme", root: "/w" }, [{ member: member("ops", "ops"), ir: withMeta({ collector: bad }) }]);
|
|
192
|
+
expect(doc.collectors, JSON.stringify(bad)).toEqual([]);
|
|
193
|
+
}
|
|
194
|
+
});
|
|
195
|
+
});
|
|
@@ -29,6 +29,7 @@
|
|
|
29
29
|
* `chant graph` itself is untouched: this is the only place members compose.
|
|
30
30
|
*/
|
|
31
31
|
|
|
32
|
+
import type { FactoryView, ListingView } from "./box-factory";
|
|
32
33
|
import type { Declaration } from "./declaration";
|
|
33
34
|
import type { KindRegistry } from "./kinds";
|
|
34
35
|
import { graphLinks, type LinkTableRow } from "./links";
|
|
@@ -87,12 +88,81 @@ export interface ComposedMember {
|
|
|
87
88
|
cached?: boolean;
|
|
88
89
|
/** The member's stamp (#2876): what the cache keys the read on, or null when none could be taken. */
|
|
89
90
|
stamp?: string | null;
|
|
91
|
+
/**
|
|
92
|
+
* For a member of kind `workspace` (#2551, ws-071): the nested workspace's
|
|
93
|
+
* own view, read through its own `chant workspace graph`. Its nodes are in
|
|
94
|
+
* the outer `nodes` with `outer/inner/id` ids.
|
|
95
|
+
*/
|
|
96
|
+
nested?: NestedWorkspace;
|
|
97
|
+
/**
|
|
98
|
+
* The factory and listing the member's box block declares (#3146, ws-077),
|
|
99
|
+
* read from the declaration at the revision read. Set by
|
|
100
|
+
* `chant workspace graph` on every member; null when the box declares neither.
|
|
101
|
+
*/
|
|
102
|
+
box?: { factory: FactoryView | null; listing: ListingView | null } | null;
|
|
90
103
|
/** Whole-read facts the member's IR carried (`meta`, `pipeline`), kept apart from the composed sections. */
|
|
91
104
|
meta?: Record<string, unknown>;
|
|
92
105
|
pipeline?: unknown;
|
|
93
106
|
}
|
|
94
107
|
|
|
95
|
-
|
|
108
|
+
/** A nested workspace as the outer graph shows it (#2551, ./nested-graph.ts). */
|
|
109
|
+
export interface NestedWorkspace {
|
|
110
|
+
/** The nested declaration's name. */
|
|
111
|
+
name: string;
|
|
112
|
+
/** The contract version of the document the nested read printed. */
|
|
113
|
+
contract: number;
|
|
114
|
+
/** The nested workspace's members, as its own graph lists them. */
|
|
115
|
+
members: ComposedMember[];
|
|
116
|
+
/** The nested workspace's links, with member names as the nested side writes them. */
|
|
117
|
+
links: (LinkTableRow | RecordLinkRow)[];
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
/**
|
|
121
|
+
* A collector pipeline as a member's IR reports it (#2559). Plain data, so
|
|
122
|
+
* core never imports the lexicon that computes it.
|
|
123
|
+
*/
|
|
124
|
+
export interface CollectorPipeline {
|
|
125
|
+
/** The id under `service.pipelines`, such as `traces` or `traces/backend`. */
|
|
126
|
+
id: string;
|
|
127
|
+
signal: string;
|
|
128
|
+
receivers: string[];
|
|
129
|
+
processors: string[];
|
|
130
|
+
exporters: string[];
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
/** One collector component with the addresses its config states. */
|
|
134
|
+
export interface CollectorComponent {
|
|
135
|
+
id: string;
|
|
136
|
+
kind: string;
|
|
137
|
+
type: string;
|
|
138
|
+
endpoints: string[];
|
|
139
|
+
/** The wire protocols it speaks (`grpc`, `http/protobuf`, `http/json`); empty when unknown (#2558). */
|
|
140
|
+
protocols: string[];
|
|
141
|
+
pipelines: string[];
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
/** An exporter and the signals that reach it: where a member's telemetry goes. */
|
|
145
|
+
export interface CollectorExporter {
|
|
146
|
+
id: string;
|
|
147
|
+
type: string;
|
|
148
|
+
endpoints: string[];
|
|
149
|
+
pipelines: string[];
|
|
150
|
+
signals: string[];
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
/** The topology of one member's collector config, from the lexicon that types it. */
|
|
154
|
+
export interface MemberCollector {
|
|
155
|
+
member: string;
|
|
156
|
+
pipelines: CollectorPipeline[];
|
|
157
|
+
components: CollectorComponent[];
|
|
158
|
+
exporters: CollectorExporter[];
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
/** The meta key a lexicon's `graphMeta` hook answers the collector under. */
|
|
162
|
+
export const COLLECTOR_META_KEY = "collector";
|
|
163
|
+
|
|
164
|
+
/** `nested` names the nested workspace's member a node was read through (#2551); absent for the outer workspace's own nodes. */
|
|
165
|
+
export type ComposedNode = IRNode & { member: string; nested?: string };
|
|
96
166
|
export type ComposedEdge = IREdge & { member: string };
|
|
97
167
|
|
|
98
168
|
export interface WorkspaceGraph {
|
|
@@ -110,6 +180,11 @@ export interface WorkspaceGraph {
|
|
|
110
180
|
* the records read with `--kind` (#2549). Empty when no declaration is given.
|
|
111
181
|
*/
|
|
112
182
|
links: (LinkTableRow | RecordLinkRow)[];
|
|
183
|
+
/**
|
|
184
|
+
* The collector pipelines and exporters of each member that declares a
|
|
185
|
+
* collector, in declaration order (#2559). Empty when none does.
|
|
186
|
+
*/
|
|
187
|
+
collectors: MemberCollector[];
|
|
113
188
|
/** The records read with `--kind` (#2524 D4, #2549). Empty without it. */
|
|
114
189
|
records: GraphRecord[];
|
|
115
190
|
}
|
|
@@ -163,6 +238,46 @@ export interface ComposeInput {
|
|
|
163
238
|
|
|
164
239
|
const prefix = (member: string, id: string): string => `${member}/${id}`;
|
|
165
240
|
|
|
241
|
+
const strings = (v: unknown): string[] => (Array.isArray(v) ? v.filter((x): x is string => typeof x === "string") : []);
|
|
242
|
+
const records = (v: unknown): Record<string, unknown>[] =>
|
|
243
|
+
Array.isArray(v) ? v.filter((x): x is Record<string, unknown> => typeof x === "object" && x !== null) : [];
|
|
244
|
+
|
|
245
|
+
/**
|
|
246
|
+
* A member's collector topology from its IR meta, or null when the meta holds
|
|
247
|
+
* none or something that isn't one. Read defensively: the topology comes from
|
|
248
|
+
* a lexicon the member's own toolchain loaded, which may be newer or older
|
|
249
|
+
* than this chant.
|
|
250
|
+
*/
|
|
251
|
+
function readCollector(member: string, value: unknown): MemberCollector | null {
|
|
252
|
+
if (typeof value !== "object" || value === null || !Array.isArray((value as { pipelines?: unknown }).pipelines)) return null;
|
|
253
|
+
const v = value as Record<string, unknown>;
|
|
254
|
+
return {
|
|
255
|
+
member,
|
|
256
|
+
pipelines: records(v.pipelines).map((p) => ({
|
|
257
|
+
id: String(p.id),
|
|
258
|
+
signal: String(p.signal),
|
|
259
|
+
receivers: strings(p.receivers),
|
|
260
|
+
processors: strings(p.processors),
|
|
261
|
+
exporters: strings(p.exporters),
|
|
262
|
+
})),
|
|
263
|
+
components: records(v.components).map((c) => ({
|
|
264
|
+
id: String(c.id),
|
|
265
|
+
kind: String(c.kind),
|
|
266
|
+
type: String(c.type),
|
|
267
|
+
endpoints: strings(c.endpoints),
|
|
268
|
+
protocols: strings(c.protocols),
|
|
269
|
+
pipelines: strings(c.pipelines),
|
|
270
|
+
})),
|
|
271
|
+
exporters: records(v.exporters).map((e) => ({
|
|
272
|
+
id: String(e.id),
|
|
273
|
+
type: String(e.type),
|
|
274
|
+
endpoints: strings(e.endpoints),
|
|
275
|
+
pipelines: strings(e.pipelines),
|
|
276
|
+
signals: strings(e.signals),
|
|
277
|
+
})),
|
|
278
|
+
};
|
|
279
|
+
}
|
|
280
|
+
|
|
166
281
|
function prefixRefs(value: unknown, member: string): unknown {
|
|
167
282
|
if (Array.isArray(value)) return value.map((v) => prefixRefs(v, member));
|
|
168
283
|
if (value === null || typeof value !== "object") return value;
|
|
@@ -202,6 +317,7 @@ export function composeWorkspaceGraph(
|
|
|
202
317
|
const shared: Record<"byLexicon" | "byComposite", Record<string, string[]>> = { byLexicon: {}, byComposite: {} };
|
|
203
318
|
const scoped: Record<"byStack" | "byContainer" | "byWave", Record<string, string[]>> = { byStack: {}, byContainer: {}, byWave: {} };
|
|
204
319
|
const derivedAttrs: Record<string, Set<string>> = {};
|
|
320
|
+
const collectors: MemberCollector[] = [];
|
|
205
321
|
|
|
206
322
|
for (const { member, ir } of inputs) {
|
|
207
323
|
if (!ir) continue;
|
|
@@ -225,7 +341,14 @@ export function composeWorkspaceGraph(
|
|
|
225
341
|
for (const e of ir.exports ?? []) exports.push({ ...e, ...(e.node ? { node: prefix(m, e.node) } : {}), member: m });
|
|
226
342
|
for (const i of ir.imports ?? []) imports.push({ ...i, node: prefix(m, i.node), member: m });
|
|
227
343
|
for (const [kind, attrs] of Object.entries(ir.derivedAttrs ?? {})) for (const a of attrs) (derivedAttrs[kind] ??= new Set()).add(a);
|
|
228
|
-
if (ir.meta)
|
|
344
|
+
if (ir.meta) {
|
|
345
|
+
// The collector topology has a section of its own; the rest of the meta stays on the member.
|
|
346
|
+
const { [COLLECTOR_META_KEY]: collector, ...rest } = ir.meta;
|
|
347
|
+
const read = readCollector(m, collector);
|
|
348
|
+
if (read) collectors.push(read);
|
|
349
|
+
if (!read) member.meta = ir.meta;
|
|
350
|
+
else if (Object.keys(rest).length > 0) member.meta = rest;
|
|
351
|
+
}
|
|
229
352
|
if (ir.pipeline) member.pipeline = ir.pipeline;
|
|
230
353
|
}
|
|
231
354
|
|
|
@@ -247,8 +370,9 @@ export function composeWorkspaceGraph(
|
|
|
247
370
|
exports,
|
|
248
371
|
imports,
|
|
249
372
|
links: links
|
|
250
|
-
? graphLinks(links.declaration, { composed: inputs.filter((i) => i.ir).map((i) => i.member.name), exports, imports }, links.kinds)
|
|
373
|
+
? graphLinks(links.declaration, { composed: inputs.filter((i) => i.ir).map((i) => i.member.name), collectors, exports, imports }, links.kinds)
|
|
251
374
|
: [],
|
|
375
|
+
collectors,
|
|
252
376
|
records: [],
|
|
253
377
|
};
|
|
254
378
|
if (Object.keys(derivedAttrs).length) {
|
|
@@ -14,8 +14,14 @@ export const recordKind = {
|
|
|
14
14
|
idField: "id",
|
|
15
15
|
stateField: "state",
|
|
16
16
|
states: ["proposed", "decided", "ratified", "superseded", "withdrawn"],
|
|
17
|
-
// Sealed once reached (#2555)
|
|
17
|
+
// Sealed once reached (#2555): records amend and new write the whole-file
|
|
18
|
+
// seal into closed_digest when a decision enters one, and records checks it
|
|
19
|
+
// on every read (#2546, ws-063).
|
|
18
20
|
closedStates: ["ratified", "superseded"],
|
|
21
|
+
seal: { field: "closed_digest" },
|
|
22
|
+
// The current decisions, with the files they pin, are the workspace's spec:
|
|
23
|
+
// records --current --json lists them under spec (#2524 D20, #2546).
|
|
24
|
+
spec: true,
|
|
19
25
|
supersedes: { field: "supersedes", key: "decision" },
|
|
20
26
|
// A remediates link names a closed decision this one fixes the consequence
|
|
21
27
|
// of, without replacing it: the target's state never changes (#2774).
|
|
@@ -227,6 +227,11 @@
|
|
|
227
227
|
"signature": { "description": "The armored ssh signature, as ssh-keygen -Y sign prints it.", "type": "string", "pattern": "^-----BEGIN SSH SIGNATURE-----\\n" }
|
|
228
228
|
}
|
|
229
229
|
},
|
|
230
|
+
"closed_digest": {
|
|
231
|
+
"description": "The decision's whole-file seal (#2546, ws-063): sha256: and the lowercase hex SHA-256 of the JCS form of {body, core}, where core is this front matter without closed_digest and body is the text below it, line endings LF. chant workspace records amend and new write it when the decision enters a closed state (ratified or superseded), and records reports record-seal-mismatch if the file changes afterwards. It covers the reviews, the author seal and the state, which the review digest leaves out, and the digest leaves this field out.",
|
|
232
|
+
"type": "string",
|
|
233
|
+
"pattern": "^sha256:[0-9a-f]{64}$"
|
|
234
|
+
},
|
|
230
235
|
"constrains": {
|
|
231
236
|
"description": "What this decision governs: issues (owner/repo#n), other decisions (their ids), workspace members (member:<name>) or files and directories in the workspace (path:<path>, the grammar of an evidence path, #2549). At least one entry: a decision that governs nothing is refused.",
|
|
232
237
|
"type": "array",
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
// The answers to the workspace's decision points (ws-058, #2739), data only:
|
|
2
|
+
// no imports, no code.
|
|
3
|
+
//
|
|
4
|
+
// chant workspace points --open --json
|
|
5
|
+
// chant workspace points ask slice-tier --inputs inputs.json --subject W-002
|
|
6
|
+
// chant workspace points answer <id> --answer medium --by <name>
|
|
7
|
+
//
|
|
8
|
+
// The points are declared in ../decisions/points.json: typed questions, the
|
|
9
|
+
// read-contract outputs they read, and a table, model and quorum chain. Each
|
|
10
|
+
// answer is one record here, named for the point and its inputs' hash, so the
|
|
11
|
+
// same question is answered once. A table's answer is answered, a model's is
|
|
12
|
+
// proposed until a person confirms it, and a question nobody before the
|
|
13
|
+
// quorum answered is escalated to people. answer.schema.json is a copy of the
|
|
14
|
+
// one @intentius/chant ships as workspace/point-answer.schema.json.
|
|
15
|
+
export const recordKind = {
|
|
16
|
+
name: "answer",
|
|
17
|
+
location: { dir: ".", match: "^[a-z][a-z0-9-]*-[0-9a-f]{12}\\.md$" },
|
|
18
|
+
format: "markdown-front-matter",
|
|
19
|
+
schema: { id: "urn:intentius:chant:point-answer:1", path: "answer.schema.json" },
|
|
20
|
+
idField: "id",
|
|
21
|
+
stateField: "state",
|
|
22
|
+
states: ["escalated", "proposed", "answered"],
|
|
23
|
+
closedStates: ["answered"],
|
|
24
|
+
constrains: { field: "constrains" },
|
|
25
|
+
source: { field: "source" },
|
|
26
|
+
answers: { points: "../decisions/points.json" },
|
|
27
|
+
};
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
3
|
+
"$id": "urn:intentius:chant:point-answer:1",
|
|
4
|
+
"title": "Decision point answer front matter",
|
|
5
|
+
"description": "The front matter of one answer to a decision point (ws-058, #2739), as `chant workspace points ask` and `points answer` write it into the records directory of a record kind with an `answers` block. One record per point, declaration and inputs: its id is the point's name and the first 12 hex digits of the inputs hash, so the same question is answered once. A table's answer is `answered`; a model's answer at or above its threshold is `proposed` until a person confirms it; a question no decider before the quorum answered is `escalated`, open for people. A workspace copies this file next to its answer kind, as reference-workspace/answers/ does. Values stay within what YAML and JSON share. Fields other than these must start with x-.",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"additionalProperties": false,
|
|
8
|
+
"patternProperties": { "^x-": {} },
|
|
9
|
+
"required": ["id", "title", "point", "point_version", "question_type", "candidates", "inputs", "inputs_hash", "state", "decider", "asked_on"],
|
|
10
|
+
"properties": {
|
|
11
|
+
"id": { "type": "string", "pattern": "^[a-z][a-z0-9-]*-[0-9a-f]{12}$", "description": "The point's name, a hyphen, and the first 12 hex digits of inputs_hash." },
|
|
12
|
+
"title": { "type": "string", "minLength": 1 },
|
|
13
|
+
"point": { "type": "string", "pattern": "^[a-z][a-z0-9-]*$", "description": "The point in the points file this answers." },
|
|
14
|
+
"point_version": { "$ref": "#/definitions/sha256", "description": "sha256 of the point's declaration when it was asked. Editing the question or any decider changes it." },
|
|
15
|
+
"question_type": { "enum": ["noul", "choice", "score"] },
|
|
16
|
+
"candidates": { "type": "array", "minItems": 2, "items": { "type": ["string", "boolean"] }, "description": "The answers the question allowed: true and false, a choice's options, or a score's levels." },
|
|
17
|
+
"inputs": { "type": "object", "description": "The state the deciders saw, input name to value." },
|
|
18
|
+
"inputs_hash": { "$ref": "#/definitions/sha256", "description": "sha256 of the point, its version and its inputs. The same hash is answered once." },
|
|
19
|
+
"constrains": { "type": "array", "items": { "type": "string", "minLength": 1 }, "description": "What the question is about, such as a work item's id." },
|
|
20
|
+
"state": { "enum": ["escalated", "proposed", "answered"] },
|
|
21
|
+
"answer": { "type": ["string", "boolean"] },
|
|
22
|
+
"decider": {
|
|
23
|
+
"type": "object",
|
|
24
|
+
"required": ["kind"],
|
|
25
|
+
"properties": {
|
|
26
|
+
"kind": { "enum": ["table", "model", "quorum"] },
|
|
27
|
+
"row": { "type": "integer", "minimum": 0, "description": "table: the row that matched." },
|
|
28
|
+
"backend": { "type": "string", "minLength": 1 },
|
|
29
|
+
"model": { "type": "string", "minLength": 1, "description": "model: the model id that answered, as the backend reported it." },
|
|
30
|
+
"count": { "type": "integer", "minimum": 1 },
|
|
31
|
+
"roles": { "type": "array", "items": { "type": "string" } },
|
|
32
|
+
"by": { "type": "array", "items": { "type": "string" }, "description": "quorum: who answered." }
|
|
33
|
+
},
|
|
34
|
+
"additionalProperties": false
|
|
35
|
+
},
|
|
36
|
+
"probabilities": { "$ref": "#/definitions/probabilities" },
|
|
37
|
+
"confidence": { "$ref": "#/definitions/unit" },
|
|
38
|
+
"threshold": { "$ref": "#/definitions/unit" },
|
|
39
|
+
"escalations": {
|
|
40
|
+
"type": "array",
|
|
41
|
+
"description": "The deciders asked before the one that answered, or before the quorum, and why each did not answer.",
|
|
42
|
+
"items": { "$ref": "#/definitions/escalation" }
|
|
43
|
+
},
|
|
44
|
+
"answered_by": { "type": "array", "minItems": 1, "items": { "type": "string", "minLength": 1 }, "description": "The people who answered or confirmed it." },
|
|
45
|
+
"asked_on": { "$ref": "#/definitions/date" },
|
|
46
|
+
"answered_on": { "$ref": "#/definitions/date" },
|
|
47
|
+
"source": {
|
|
48
|
+
"type": "object",
|
|
49
|
+
"description": "Where the answer came from (#2708): via, client and model, the model id that answered when a model decider did."
|
|
50
|
+
}
|
|
51
|
+
},
|
|
52
|
+
"allOf": [
|
|
53
|
+
{
|
|
54
|
+
"if": { "properties": { "state": { "const": "proposed" } }, "required": ["state"] },
|
|
55
|
+
"then": { "required": ["answer"], "properties": { "decider": { "properties": { "kind": { "const": "model" } } } } }
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
"if": { "properties": { "state": { "const": "answered" } }, "required": ["state"] },
|
|
59
|
+
"then": { "required": ["answer", "answered_on"] }
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
"if": { "properties": { "state": { "const": "escalated" } }, "required": ["state"] },
|
|
63
|
+
"then": { "not": { "required": ["answer"] }, "properties": { "decider": { "properties": { "kind": { "const": "quorum" } } } } }
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
"if": { "properties": { "decider": { "properties": { "kind": { "const": "model" } }, "required": ["kind"] } }, "required": ["decider"] },
|
|
67
|
+
"then": { "required": ["probabilities", "confidence", "threshold"], "properties": { "decider": { "required": ["backend", "model"] } } }
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
"if": { "properties": { "state": { "const": "answered" }, "decider": { "properties": { "kind": { "const": "quorum" } }, "required": ["kind"] } }, "required": ["state", "decider"] },
|
|
71
|
+
"then": { "required": ["answered_by"], "properties": { "decider": { "required": ["by"] } } }
|
|
72
|
+
}
|
|
73
|
+
],
|
|
74
|
+
"definitions": {
|
|
75
|
+
"sha256": { "type": "string", "pattern": "^[0-9a-f]{64}$" },
|
|
76
|
+
"unit": { "type": "number", "minimum": 0, "maximum": 1 },
|
|
77
|
+
"date": { "type": "string", "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}$" },
|
|
78
|
+
"probabilities": { "type": "object", "additionalProperties": { "$ref": "#/definitions/unit" } },
|
|
79
|
+
"escalation": {
|
|
80
|
+
"type": "object",
|
|
81
|
+
"required": ["kind", "reason"],
|
|
82
|
+
"properties": {
|
|
83
|
+
"kind": { "enum": ["table", "model"] },
|
|
84
|
+
"reason": { "type": "string", "minLength": 1 },
|
|
85
|
+
"backend": { "type": "string" },
|
|
86
|
+
"model": { "type": "string" },
|
|
87
|
+
"answer": { "type": ["string", "boolean", "null"] },
|
|
88
|
+
"probabilities": { "$ref": "#/definitions/probabilities" },
|
|
89
|
+
"confidence": { "$ref": "#/definitions/unit" },
|
|
90
|
+
"threshold": { "$ref": "#/definitions/unit" }
|
|
91
|
+
},
|
|
92
|
+
"additionalProperties": false
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
}
|