@kontourai/flow-agents 3.12.1 → 4.0.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/.github/workflows/ci.yml +76 -0
- package/CHANGELOG.md +41 -0
- package/build/generated/capability-declarations.json +177 -0
- package/build/src/builder-flow-runtime.d.ts +37 -0
- package/build/src/builder-flow-runtime.js +71 -1
- package/build/src/builder-gate-action-envelope.d.ts +58 -7
- package/build/src/builder-gate-action-envelope.js +160 -28
- package/build/src/builder-lifecycle-authority.d.ts +26 -0
- package/build/src/builder-lifecycle-authority.js +38 -0
- package/build/src/cli/builder-run.js +71 -2
- package/build/src/cli/narrative-render.d.ts +95 -0
- package/build/src/cli/narrative-render.js +466 -0
- package/build/src/cli/narrative-sources.d.ts +2 -0
- package/build/src/cli/narrative-sources.js +282 -0
- package/build/src/cli/public-contracts.d.ts +257 -0
- package/build/src/cli/public-contracts.js +87 -0
- package/build/src/cli/workflow-sidecar.d.ts +28 -12
- package/build/src/cli/workflow-sidecar.js +599 -180
- package/build/src/cli/workflow.js +11 -1
- package/build/src/cli.js +8 -0
- package/build/src/continuation-driver.d.ts +12 -0
- package/build/src/continuation-driver.js +16 -2
- package/build/src/continuation-validation.js +324 -8
- package/build/src/flow-kit/action-metadata.js +21 -1
- package/build/src/index.d.ts +33 -2
- package/build/src/index.js +24 -0
- package/build/src/lib/capability-declarations.d.ts +83 -0
- package/build/src/lib/capability-declarations.js +209 -0
- package/build/src/narrative/envelope.d.ts +111 -0
- package/build/src/narrative/envelope.js +590 -0
- package/build/src/narrative/eval-result.d.ts +60 -0
- package/build/src/narrative/eval-result.js +158 -0
- package/build/src/narrative/grounding-validator.d.ts +104 -0
- package/build/src/narrative/grounding-validator.js +472 -0
- package/build/src/narrative/integrity.d.ts +17 -0
- package/build/src/narrative/integrity.js +39 -0
- package/build/src/narrative/intent-economics.d.ts +42 -0
- package/build/src/narrative/intent-economics.js +82 -0
- package/build/src/narrative/intent.d.ts +94 -0
- package/build/src/narrative/intent.js +132 -0
- package/build/src/narrative/policy-filter.d.ts +15 -0
- package/build/src/narrative/policy-filter.js +58 -0
- package/build/src/narrative/projection.d.ts +58 -0
- package/build/src/narrative/projection.js +502 -0
- package/build/src/narrative/readers.d.ts +84 -0
- package/build/src/narrative/readers.js +406 -0
- package/build/src/narrative/render.d.ts +3 -0
- package/build/src/narrative/render.js +83 -0
- package/build/src/narrative/resolver.d.ts +52 -0
- package/build/src/narrative/resolver.js +190 -0
- package/build/src/narrative/snapshot.d.ts +90 -0
- package/build/src/narrative/snapshot.js +325 -0
- package/build/src/narrative/source-ids.d.ts +121 -0
- package/build/src/narrative/source-ids.js +201 -0
- package/build/src/narrative/statements.d.ts +84 -0
- package/build/src/narrative/statements.js +347 -0
- package/build/src/narrative/turn-spine.d.ts +19 -0
- package/build/src/narrative/turn-spine.js +73 -0
- package/build/src/tools/build-universal-bundles.js +8 -0
- package/build/src/tools/generate-capability-matrix.d.ts +7 -0
- package/build/src/tools/generate-capability-matrix.js +207 -0
- package/build/src/tools/validate-source-tree.js +5 -1
- package/context/scripts/hooks/stop-goal-fit.js +182 -9
- package/context/scripts/hooks/workflow-steering.js +160 -19
- package/context/scripts/telemetry/lib/session.sh +3 -0
- package/context/scripts/telemetry/lib/transport.sh +12 -3
- package/context/scripts/telemetry/telemetry.sh +480 -59
- package/dist/base/build/generated/capability-declarations.json +177 -0
- package/dist/base/build/package.json +1 -1
- package/dist/base/build/src/builder-flow-runtime.d.ts +37 -0
- package/dist/base/build/src/builder-flow-runtime.js +71 -1
- package/dist/base/build/src/builder-gate-action-envelope.d.ts +58 -7
- package/dist/base/build/src/builder-gate-action-envelope.js +160 -28
- package/dist/base/build/src/builder-lifecycle-authority.d.ts +26 -0
- package/dist/base/build/src/builder-lifecycle-authority.js +38 -0
- package/dist/base/build/src/cli/builder-run.js +71 -2
- package/dist/base/build/src/cli/narrative-render.d.ts +95 -0
- package/dist/base/build/src/cli/narrative-render.js +466 -0
- package/dist/base/build/src/cli/narrative-sources.d.ts +2 -0
- package/dist/base/build/src/cli/narrative-sources.js +282 -0
- package/dist/base/build/src/cli/public-contracts.d.ts +257 -0
- package/dist/base/build/src/cli/public-contracts.js +87 -0
- package/dist/base/build/src/cli/workflow-sidecar.d.ts +28 -12
- package/dist/base/build/src/cli/workflow-sidecar.js +599 -180
- package/dist/base/build/src/cli/workflow.js +11 -1
- package/dist/base/build/src/cli.js +8 -0
- package/dist/base/build/src/continuation-driver.d.ts +12 -0
- package/dist/base/build/src/continuation-driver.js +16 -2
- package/dist/base/build/src/continuation-validation.js +324 -8
- package/dist/base/build/src/flow-kit/action-metadata.js +21 -1
- package/dist/base/build/src/index.d.ts +33 -2
- package/dist/base/build/src/index.js +24 -0
- package/dist/base/build/src/lib/capability-declarations.d.ts +83 -0
- package/dist/base/build/src/lib/capability-declarations.js +209 -0
- package/dist/base/build/src/narrative/envelope.d.ts +111 -0
- package/dist/base/build/src/narrative/envelope.js +590 -0
- package/dist/base/build/src/narrative/eval-result.d.ts +60 -0
- package/dist/base/build/src/narrative/eval-result.js +158 -0
- package/dist/base/build/src/narrative/grounding-validator.d.ts +104 -0
- package/dist/base/build/src/narrative/grounding-validator.js +472 -0
- package/dist/base/build/src/narrative/integrity.d.ts +17 -0
- package/dist/base/build/src/narrative/integrity.js +39 -0
- package/dist/base/build/src/narrative/intent-economics.d.ts +42 -0
- package/dist/base/build/src/narrative/intent-economics.js +82 -0
- package/dist/base/build/src/narrative/intent.d.ts +94 -0
- package/dist/base/build/src/narrative/intent.js +132 -0
- package/dist/base/build/src/narrative/policy-filter.d.ts +15 -0
- package/dist/base/build/src/narrative/policy-filter.js +58 -0
- package/dist/base/build/src/narrative/projection.d.ts +58 -0
- package/dist/base/build/src/narrative/projection.js +502 -0
- package/dist/base/build/src/narrative/readers.d.ts +84 -0
- package/dist/base/build/src/narrative/readers.js +406 -0
- package/dist/base/build/src/narrative/render.d.ts +3 -0
- package/dist/base/build/src/narrative/render.js +83 -0
- package/dist/base/build/src/narrative/resolver.d.ts +52 -0
- package/dist/base/build/src/narrative/resolver.js +190 -0
- package/dist/base/build/src/narrative/snapshot.d.ts +90 -0
- package/dist/base/build/src/narrative/snapshot.js +325 -0
- package/dist/base/build/src/narrative/source-ids.d.ts +121 -0
- package/dist/base/build/src/narrative/source-ids.js +201 -0
- package/dist/base/build/src/narrative/statements.d.ts +84 -0
- package/dist/base/build/src/narrative/statements.js +347 -0
- package/dist/base/build/src/narrative/turn-spine.d.ts +19 -0
- package/dist/base/build/src/narrative/turn-spine.js +73 -0
- package/dist/base/build/src/tools/build-universal-bundles.js +8 -0
- package/dist/base/build/src/tools/generate-capability-matrix.d.ts +7 -0
- package/dist/base/build/src/tools/generate-capability-matrix.js +207 -0
- package/dist/base/build/src/tools/validate-source-tree.js +5 -1
- package/dist/base/context/scripts/hooks/stop-goal-fit.js +182 -9
- package/dist/base/context/scripts/hooks/workflow-steering.js +160 -19
- package/dist/base/context/scripts/telemetry/lib/session.sh +3 -0
- package/dist/base/context/scripts/telemetry/lib/transport.sh +12 -3
- package/dist/base/context/scripts/telemetry/telemetry.sh +480 -59
- package/dist/base/docs/context-map.md +4 -0
- package/dist/base/docs/decisions/index.md +1 -0
- package/dist/base/docs/decisions/writer-observed-execution.md +51 -0
- package/dist/base/docs/fixture-ownership.md +5 -1
- package/dist/base/docs/migrations.md +19 -4
- package/dist/base/docs/public-workflow-cli.md +9 -0
- package/dist/base/docs/spec/builder-flow-runtime.md +49 -8
- package/dist/base/docs/spec/runtime-hook-surface.md +29 -1
- package/dist/base/docs/specs/economics-record-contract.md +1 -1
- package/dist/base/docs/specs/harness-capability-matrix.md +63 -21
- package/dist/base/docs/workflow-usage-guide.md +4 -1
- package/dist/base/evals/ci/run-baseline.sh +38 -0
- package/dist/base/evals/fixtures/narrative-evals/README.md +62 -0
- package/dist/base/evals/fixtures/narrative-evals/corpus.json +129 -0
- package/dist/base/evals/fixtures/narrative-evals/scorer.mjs +522 -0
- package/dist/base/evals/fixtures/narrative-grounding-validator/corpus.json +20 -0
- package/dist/base/evals/fixtures/narrative-grounding-validator/prompt-injection-adversarial.txt +1 -0
- package/dist/base/evals/fixtures/narrative-grounding-validator/prompt-injection-control.txt +1 -0
- package/dist/base/evals/fixtures/narrative-grounding-validator/scorer.mjs +201 -0
- package/dist/base/evals/fixtures/narrative-prose-renderer/corpus.json +15 -0
- package/dist/base/evals/fixtures/narrative-prose-renderer/scorer.mjs +201 -0
- package/dist/base/evals/fixtures/narrative-sources/expected-capture-completeness.json +13 -0
- package/dist/base/evals/fixtures/narrative-sources/flow/runs/run-fixture/report.json +1 -0
- package/dist/base/evals/fixtures/narrative-sources/flow/runs/run-fixture/state.json +1 -0
- package/dist/base/evals/fixtures/narrative-sources/flow/runs/run-runtime/state.json +1 -0
- package/dist/base/evals/fixtures/narrative-sources/repo/created.txt +1 -0
- package/dist/base/evals/fixtures/narrative-sources/repo/fixture.txt +1 -0
- package/dist/base/evals/fixtures/narrative-sources/session/agents/agent-fixture/events.jsonl +2 -0
- package/dist/base/evals/fixtures/narrative-sources/session/agents/nested-worker/events.jsonl +1 -0
- package/dist/base/evals/fixtures/narrative-sources/session/trust.bundle +1 -0
- package/dist/base/evals/fixtures/narrative-sources/telemetry/full.jsonl +3 -0
- package/dist/base/evals/fixtures/narrative-sources/telemetry/runtime.jsonl +4 -0
- package/dist/base/evals/fixtures/narrative-sources/transcripts/session.txt +1 -0
- package/dist/base/evals/integration/test_capability_declarations.sh +183 -0
- package/dist/base/evals/integration/test_economics_record.sh +42 -0
- package/dist/base/evals/integration/test_fixture_retirement_audit.sh +2 -2
- package/dist/base/evals/integration/test_gate_review_inquiry_records.sh +42 -35
- package/dist/base/evals/integration/test_goal_fit_hook.sh +13 -5
- package/dist/base/evals/integration/test_goal_fit_narrative_exclusion.sh +68 -0
- package/dist/base/evals/integration/test_narrative_evals.sh +174 -0
- package/dist/base/evals/integration/test_narrative_grounded_envelope.sh +280 -0
- package/dist/base/evals/integration/test_narrative_grounding_validator.sh +166 -0
- package/dist/base/evals/integration/test_narrative_intent_annotation.sh +205 -0
- package/dist/base/evals/integration/test_narrative_prose_renderer.sh +239 -0
- package/dist/base/evals/integration/test_narrative_redaction_failclosed.sh +120 -0
- package/dist/base/evals/integration/test_narrative_runtime_projection.sh +146 -0
- package/dist/base/evals/integration/test_narrative_source_contract.sh +228 -0
- package/dist/base/evals/integration/test_narrative_trust_isolation.sh +408 -0
- package/dist/base/evals/integration/test_plain_stop_messaging.sh +91 -0
- package/dist/base/evals/integration/test_session_resume_roundtrip.sh +228 -0
- package/dist/base/evals/integration/test_telemetry_action_class.sh +265 -0
- package/dist/base/evals/integration/test_telemetry_delegation.sh +291 -0
- package/dist/base/evals/integration/test_telemetry_sanitize_usage.sh +155 -0
- package/dist/base/evals/integration/test_telemetry_task_slug.sh +158 -0
- package/dist/base/evals/integration/test_telemetry_tool_outcome.sh +279 -0
- package/dist/base/evals/integration/test_workflow_sidecar_writer.sh +111 -2
- package/dist/base/evals/run.sh +12 -0
- package/dist/base/evals/static/test_library_exports.sh +5 -0
- package/dist/base/install.sh +1 -1
- package/dist/base/schemas/grounded-execution-narrative.schema.json +292 -0
- package/dist/base/schemas/narrative-eval-result.schema.json +205 -0
- package/dist/base/schemas/narrative-runtime-projection.schema.json +134 -0
- package/dist/base/schemas/narrative-source-manifest.schema.json +294 -0
- package/dist/base/scripts/check-hachure-boundary.mjs +81 -0
- package/dist/base/scripts/hooks/stop-goal-fit.js +182 -9
- package/dist/base/scripts/hooks/workflow-steering.js +160 -19
- package/dist/base/scripts/telemetry/economics-record.schema.json +1 -1
- package/dist/base/scripts/telemetry/economics-record.sh +47 -3
- package/dist/base/scripts/telemetry/lib/session.sh +3 -0
- package/dist/base/scripts/telemetry/lib/transport.sh +12 -3
- package/dist/base/scripts/telemetry/telemetry.sh +480 -59
- package/dist/claude-code/build/generated/capability-declarations.json +177 -0
- package/dist/claude-code/build/package.json +1 -1
- package/dist/claude-code/build/src/builder-flow-runtime.d.ts +37 -0
- package/dist/claude-code/build/src/builder-flow-runtime.js +71 -1
- package/dist/claude-code/build/src/builder-gate-action-envelope.d.ts +58 -7
- package/dist/claude-code/build/src/builder-gate-action-envelope.js +160 -28
- package/dist/claude-code/build/src/builder-lifecycle-authority.d.ts +26 -0
- package/dist/claude-code/build/src/builder-lifecycle-authority.js +38 -0
- package/dist/claude-code/build/src/cli/builder-run.js +71 -2
- package/dist/claude-code/build/src/cli/narrative-render.d.ts +95 -0
- package/dist/claude-code/build/src/cli/narrative-render.js +466 -0
- package/dist/claude-code/build/src/cli/narrative-sources.d.ts +2 -0
- package/dist/claude-code/build/src/cli/narrative-sources.js +282 -0
- package/dist/claude-code/build/src/cli/public-contracts.d.ts +257 -0
- package/dist/claude-code/build/src/cli/public-contracts.js +87 -0
- package/dist/claude-code/build/src/cli/workflow-sidecar.d.ts +28 -12
- package/dist/claude-code/build/src/cli/workflow-sidecar.js +599 -180
- package/dist/claude-code/build/src/cli/workflow.js +11 -1
- package/dist/claude-code/build/src/cli.js +8 -0
- package/dist/claude-code/build/src/continuation-driver.d.ts +12 -0
- package/dist/claude-code/build/src/continuation-driver.js +16 -2
- package/dist/claude-code/build/src/continuation-validation.js +324 -8
- package/dist/claude-code/build/src/flow-kit/action-metadata.js +21 -1
- package/dist/claude-code/build/src/index.d.ts +33 -2
- package/dist/claude-code/build/src/index.js +24 -0
- package/dist/claude-code/build/src/lib/capability-declarations.d.ts +83 -0
- package/dist/claude-code/build/src/lib/capability-declarations.js +209 -0
- package/dist/claude-code/build/src/narrative/envelope.d.ts +111 -0
- package/dist/claude-code/build/src/narrative/envelope.js +590 -0
- package/dist/claude-code/build/src/narrative/eval-result.d.ts +60 -0
- package/dist/claude-code/build/src/narrative/eval-result.js +158 -0
- package/dist/claude-code/build/src/narrative/grounding-validator.d.ts +104 -0
- package/dist/claude-code/build/src/narrative/grounding-validator.js +472 -0
- package/dist/claude-code/build/src/narrative/integrity.d.ts +17 -0
- package/dist/claude-code/build/src/narrative/integrity.js +39 -0
- package/dist/claude-code/build/src/narrative/intent-economics.d.ts +42 -0
- package/dist/claude-code/build/src/narrative/intent-economics.js +82 -0
- package/dist/claude-code/build/src/narrative/intent.d.ts +94 -0
- package/dist/claude-code/build/src/narrative/intent.js +132 -0
- package/dist/claude-code/build/src/narrative/policy-filter.d.ts +15 -0
- package/dist/claude-code/build/src/narrative/policy-filter.js +58 -0
- package/dist/claude-code/build/src/narrative/projection.d.ts +58 -0
- package/dist/claude-code/build/src/narrative/projection.js +502 -0
- package/dist/claude-code/build/src/narrative/readers.d.ts +84 -0
- package/dist/claude-code/build/src/narrative/readers.js +406 -0
- package/dist/claude-code/build/src/narrative/render.d.ts +3 -0
- package/dist/claude-code/build/src/narrative/render.js +83 -0
- package/dist/claude-code/build/src/narrative/resolver.d.ts +52 -0
- package/dist/claude-code/build/src/narrative/resolver.js +190 -0
- package/dist/claude-code/build/src/narrative/snapshot.d.ts +90 -0
- package/dist/claude-code/build/src/narrative/snapshot.js +325 -0
- package/dist/claude-code/build/src/narrative/source-ids.d.ts +121 -0
- package/dist/claude-code/build/src/narrative/source-ids.js +201 -0
- package/dist/claude-code/build/src/narrative/statements.d.ts +84 -0
- package/dist/claude-code/build/src/narrative/statements.js +347 -0
- package/dist/claude-code/build/src/narrative/turn-spine.d.ts +19 -0
- package/dist/claude-code/build/src/narrative/turn-spine.js +73 -0
- package/dist/claude-code/build/src/tools/build-universal-bundles.js +8 -0
- package/dist/claude-code/build/src/tools/generate-capability-matrix.d.ts +7 -0
- package/dist/claude-code/build/src/tools/generate-capability-matrix.js +207 -0
- package/dist/claude-code/build/src/tools/validate-source-tree.js +5 -1
- package/dist/claude-code/context/scripts/hooks/stop-goal-fit.js +182 -9
- package/dist/claude-code/context/scripts/hooks/workflow-steering.js +160 -19
- package/dist/claude-code/context/scripts/telemetry/lib/session.sh +3 -0
- package/dist/claude-code/context/scripts/telemetry/lib/transport.sh +12 -3
- package/dist/claude-code/context/scripts/telemetry/telemetry.sh +480 -59
- package/dist/claude-code/docs/context-map.md +4 -0
- package/dist/claude-code/docs/decisions/index.md +1 -0
- package/dist/claude-code/docs/decisions/writer-observed-execution.md +51 -0
- package/dist/claude-code/docs/fixture-ownership.md +5 -1
- package/dist/claude-code/docs/migrations.md +19 -4
- package/dist/claude-code/docs/public-workflow-cli.md +9 -0
- package/dist/claude-code/docs/spec/builder-flow-runtime.md +49 -8
- package/dist/claude-code/docs/spec/runtime-hook-surface.md +29 -1
- package/dist/claude-code/docs/specs/economics-record-contract.md +1 -1
- package/dist/claude-code/docs/specs/harness-capability-matrix.md +63 -21
- package/dist/claude-code/docs/workflow-usage-guide.md +4 -1
- package/dist/claude-code/evals/ci/run-baseline.sh +38 -0
- package/dist/claude-code/evals/fixtures/narrative-evals/README.md +62 -0
- package/dist/claude-code/evals/fixtures/narrative-evals/corpus.json +129 -0
- package/dist/claude-code/evals/fixtures/narrative-evals/scorer.mjs +522 -0
- package/dist/claude-code/evals/fixtures/narrative-grounding-validator/corpus.json +20 -0
- package/dist/claude-code/evals/fixtures/narrative-grounding-validator/prompt-injection-adversarial.txt +1 -0
- package/dist/claude-code/evals/fixtures/narrative-grounding-validator/prompt-injection-control.txt +1 -0
- package/dist/claude-code/evals/fixtures/narrative-grounding-validator/scorer.mjs +201 -0
- package/dist/claude-code/evals/fixtures/narrative-prose-renderer/corpus.json +15 -0
- package/dist/claude-code/evals/fixtures/narrative-prose-renderer/scorer.mjs +201 -0
- package/dist/claude-code/evals/fixtures/narrative-sources/expected-capture-completeness.json +13 -0
- package/dist/claude-code/evals/fixtures/narrative-sources/flow/runs/run-fixture/report.json +1 -0
- package/dist/claude-code/evals/fixtures/narrative-sources/flow/runs/run-fixture/state.json +1 -0
- package/dist/claude-code/evals/fixtures/narrative-sources/flow/runs/run-runtime/state.json +1 -0
- package/dist/claude-code/evals/fixtures/narrative-sources/repo/created.txt +1 -0
- package/dist/claude-code/evals/fixtures/narrative-sources/repo/fixture.txt +1 -0
- package/dist/claude-code/evals/fixtures/narrative-sources/session/agents/agent-fixture/events.jsonl +2 -0
- package/dist/claude-code/evals/fixtures/narrative-sources/session/agents/nested-worker/events.jsonl +1 -0
- package/dist/claude-code/evals/fixtures/narrative-sources/session/trust.bundle +1 -0
- package/dist/claude-code/evals/fixtures/narrative-sources/telemetry/full.jsonl +3 -0
- package/dist/claude-code/evals/fixtures/narrative-sources/telemetry/runtime.jsonl +4 -0
- package/dist/claude-code/evals/fixtures/narrative-sources/transcripts/session.txt +1 -0
- package/dist/claude-code/evals/integration/test_capability_declarations.sh +183 -0
- package/dist/claude-code/evals/integration/test_economics_record.sh +42 -0
- package/dist/claude-code/evals/integration/test_fixture_retirement_audit.sh +2 -2
- package/dist/claude-code/evals/integration/test_gate_review_inquiry_records.sh +42 -35
- package/dist/claude-code/evals/integration/test_goal_fit_hook.sh +13 -5
- package/dist/claude-code/evals/integration/test_goal_fit_narrative_exclusion.sh +68 -0
- package/dist/claude-code/evals/integration/test_narrative_evals.sh +174 -0
- package/dist/claude-code/evals/integration/test_narrative_grounded_envelope.sh +280 -0
- package/dist/claude-code/evals/integration/test_narrative_grounding_validator.sh +166 -0
- package/dist/claude-code/evals/integration/test_narrative_intent_annotation.sh +205 -0
- package/dist/claude-code/evals/integration/test_narrative_prose_renderer.sh +239 -0
- package/dist/claude-code/evals/integration/test_narrative_redaction_failclosed.sh +120 -0
- package/dist/claude-code/evals/integration/test_narrative_runtime_projection.sh +146 -0
- package/dist/claude-code/evals/integration/test_narrative_source_contract.sh +228 -0
- package/dist/claude-code/evals/integration/test_narrative_trust_isolation.sh +408 -0
- package/dist/claude-code/evals/integration/test_plain_stop_messaging.sh +91 -0
- package/dist/claude-code/evals/integration/test_session_resume_roundtrip.sh +228 -0
- package/dist/claude-code/evals/integration/test_telemetry_action_class.sh +265 -0
- package/dist/claude-code/evals/integration/test_telemetry_delegation.sh +291 -0
- package/dist/claude-code/evals/integration/test_telemetry_sanitize_usage.sh +155 -0
- package/dist/claude-code/evals/integration/test_telemetry_task_slug.sh +158 -0
- package/dist/claude-code/evals/integration/test_telemetry_tool_outcome.sh +279 -0
- package/dist/claude-code/evals/integration/test_workflow_sidecar_writer.sh +111 -2
- package/dist/claude-code/evals/run.sh +12 -0
- package/dist/claude-code/evals/static/test_library_exports.sh +5 -0
- package/dist/claude-code/install.sh +1 -1
- package/dist/claude-code/schemas/grounded-execution-narrative.schema.json +292 -0
- package/dist/claude-code/schemas/narrative-eval-result.schema.json +205 -0
- package/dist/claude-code/schemas/narrative-runtime-projection.schema.json +134 -0
- package/dist/claude-code/schemas/narrative-source-manifest.schema.json +294 -0
- package/dist/claude-code/scripts/check-hachure-boundary.mjs +81 -0
- package/dist/claude-code/scripts/hooks/stop-goal-fit.js +182 -9
- package/dist/claude-code/scripts/hooks/workflow-steering.js +160 -19
- package/dist/claude-code/scripts/telemetry/economics-record.schema.json +1 -1
- package/dist/claude-code/scripts/telemetry/economics-record.sh +47 -3
- package/dist/claude-code/scripts/telemetry/lib/session.sh +3 -0
- package/dist/claude-code/scripts/telemetry/lib/transport.sh +12 -3
- package/dist/claude-code/scripts/telemetry/telemetry.sh +480 -59
- package/dist/codex/build/generated/capability-declarations.json +177 -0
- package/dist/codex/build/package.json +1 -1
- package/dist/codex/build/src/builder-flow-runtime.d.ts +37 -0
- package/dist/codex/build/src/builder-flow-runtime.js +71 -1
- package/dist/codex/build/src/builder-gate-action-envelope.d.ts +58 -7
- package/dist/codex/build/src/builder-gate-action-envelope.js +160 -28
- package/dist/codex/build/src/builder-lifecycle-authority.d.ts +26 -0
- package/dist/codex/build/src/builder-lifecycle-authority.js +38 -0
- package/dist/codex/build/src/cli/builder-run.js +71 -2
- package/dist/codex/build/src/cli/narrative-render.d.ts +95 -0
- package/dist/codex/build/src/cli/narrative-render.js +466 -0
- package/dist/codex/build/src/cli/narrative-sources.d.ts +2 -0
- package/dist/codex/build/src/cli/narrative-sources.js +282 -0
- package/dist/codex/build/src/cli/public-contracts.d.ts +257 -0
- package/dist/codex/build/src/cli/public-contracts.js +87 -0
- package/dist/codex/build/src/cli/workflow-sidecar.d.ts +28 -12
- package/dist/codex/build/src/cli/workflow-sidecar.js +599 -180
- package/dist/codex/build/src/cli/workflow.js +11 -1
- package/dist/codex/build/src/cli.js +8 -0
- package/dist/codex/build/src/continuation-driver.d.ts +12 -0
- package/dist/codex/build/src/continuation-driver.js +16 -2
- package/dist/codex/build/src/continuation-validation.js +324 -8
- package/dist/codex/build/src/flow-kit/action-metadata.js +21 -1
- package/dist/codex/build/src/index.d.ts +33 -2
- package/dist/codex/build/src/index.js +24 -0
- package/dist/codex/build/src/lib/capability-declarations.d.ts +83 -0
- package/dist/codex/build/src/lib/capability-declarations.js +209 -0
- package/dist/codex/build/src/narrative/envelope.d.ts +111 -0
- package/dist/codex/build/src/narrative/envelope.js +590 -0
- package/dist/codex/build/src/narrative/eval-result.d.ts +60 -0
- package/dist/codex/build/src/narrative/eval-result.js +158 -0
- package/dist/codex/build/src/narrative/grounding-validator.d.ts +104 -0
- package/dist/codex/build/src/narrative/grounding-validator.js +472 -0
- package/dist/codex/build/src/narrative/integrity.d.ts +17 -0
- package/dist/codex/build/src/narrative/integrity.js +39 -0
- package/dist/codex/build/src/narrative/intent-economics.d.ts +42 -0
- package/dist/codex/build/src/narrative/intent-economics.js +82 -0
- package/dist/codex/build/src/narrative/intent.d.ts +94 -0
- package/dist/codex/build/src/narrative/intent.js +132 -0
- package/dist/codex/build/src/narrative/policy-filter.d.ts +15 -0
- package/dist/codex/build/src/narrative/policy-filter.js +58 -0
- package/dist/codex/build/src/narrative/projection.d.ts +58 -0
- package/dist/codex/build/src/narrative/projection.js +502 -0
- package/dist/codex/build/src/narrative/readers.d.ts +84 -0
- package/dist/codex/build/src/narrative/readers.js +406 -0
- package/dist/codex/build/src/narrative/render.d.ts +3 -0
- package/dist/codex/build/src/narrative/render.js +83 -0
- package/dist/codex/build/src/narrative/resolver.d.ts +52 -0
- package/dist/codex/build/src/narrative/resolver.js +190 -0
- package/dist/codex/build/src/narrative/snapshot.d.ts +90 -0
- package/dist/codex/build/src/narrative/snapshot.js +325 -0
- package/dist/codex/build/src/narrative/source-ids.d.ts +121 -0
- package/dist/codex/build/src/narrative/source-ids.js +201 -0
- package/dist/codex/build/src/narrative/statements.d.ts +84 -0
- package/dist/codex/build/src/narrative/statements.js +347 -0
- package/dist/codex/build/src/narrative/turn-spine.d.ts +19 -0
- package/dist/codex/build/src/narrative/turn-spine.js +73 -0
- package/dist/codex/build/src/tools/build-universal-bundles.js +8 -0
- package/dist/codex/build/src/tools/generate-capability-matrix.d.ts +7 -0
- package/dist/codex/build/src/tools/generate-capability-matrix.js +207 -0
- package/dist/codex/build/src/tools/validate-source-tree.js +5 -1
- package/dist/codex/context/scripts/hooks/stop-goal-fit.js +182 -9
- package/dist/codex/context/scripts/hooks/workflow-steering.js +160 -19
- package/dist/codex/context/scripts/telemetry/lib/session.sh +3 -0
- package/dist/codex/context/scripts/telemetry/lib/transport.sh +12 -3
- package/dist/codex/context/scripts/telemetry/telemetry.sh +480 -59
- package/dist/codex/docs/context-map.md +4 -0
- package/dist/codex/docs/decisions/index.md +1 -0
- package/dist/codex/docs/decisions/writer-observed-execution.md +51 -0
- package/dist/codex/docs/fixture-ownership.md +5 -1
- package/dist/codex/docs/migrations.md +19 -4
- package/dist/codex/docs/public-workflow-cli.md +9 -0
- package/dist/codex/docs/spec/builder-flow-runtime.md +49 -8
- package/dist/codex/docs/spec/runtime-hook-surface.md +29 -1
- package/dist/codex/docs/specs/economics-record-contract.md +1 -1
- package/dist/codex/docs/specs/harness-capability-matrix.md +63 -21
- package/dist/codex/docs/workflow-usage-guide.md +4 -1
- package/dist/codex/evals/ci/run-baseline.sh +38 -0
- package/dist/codex/evals/fixtures/narrative-evals/README.md +62 -0
- package/dist/codex/evals/fixtures/narrative-evals/corpus.json +129 -0
- package/dist/codex/evals/fixtures/narrative-evals/scorer.mjs +522 -0
- package/dist/codex/evals/fixtures/narrative-grounding-validator/corpus.json +20 -0
- package/dist/codex/evals/fixtures/narrative-grounding-validator/prompt-injection-adversarial.txt +1 -0
- package/dist/codex/evals/fixtures/narrative-grounding-validator/prompt-injection-control.txt +1 -0
- package/dist/codex/evals/fixtures/narrative-grounding-validator/scorer.mjs +201 -0
- package/dist/codex/evals/fixtures/narrative-prose-renderer/corpus.json +15 -0
- package/dist/codex/evals/fixtures/narrative-prose-renderer/scorer.mjs +201 -0
- package/dist/codex/evals/fixtures/narrative-sources/expected-capture-completeness.json +13 -0
- package/dist/codex/evals/fixtures/narrative-sources/flow/runs/run-fixture/report.json +1 -0
- package/dist/codex/evals/fixtures/narrative-sources/flow/runs/run-fixture/state.json +1 -0
- package/dist/codex/evals/fixtures/narrative-sources/flow/runs/run-runtime/state.json +1 -0
- package/dist/codex/evals/fixtures/narrative-sources/repo/created.txt +1 -0
- package/dist/codex/evals/fixtures/narrative-sources/repo/fixture.txt +1 -0
- package/dist/codex/evals/fixtures/narrative-sources/session/agents/agent-fixture/events.jsonl +2 -0
- package/dist/codex/evals/fixtures/narrative-sources/session/agents/nested-worker/events.jsonl +1 -0
- package/dist/codex/evals/fixtures/narrative-sources/session/trust.bundle +1 -0
- package/dist/codex/evals/fixtures/narrative-sources/telemetry/full.jsonl +3 -0
- package/dist/codex/evals/fixtures/narrative-sources/telemetry/runtime.jsonl +4 -0
- package/dist/codex/evals/fixtures/narrative-sources/transcripts/session.txt +1 -0
- package/dist/codex/evals/integration/test_capability_declarations.sh +183 -0
- package/dist/codex/evals/integration/test_economics_record.sh +42 -0
- package/dist/codex/evals/integration/test_fixture_retirement_audit.sh +2 -2
- package/dist/codex/evals/integration/test_gate_review_inquiry_records.sh +42 -35
- package/dist/codex/evals/integration/test_goal_fit_hook.sh +13 -5
- package/dist/codex/evals/integration/test_goal_fit_narrative_exclusion.sh +68 -0
- package/dist/codex/evals/integration/test_narrative_evals.sh +174 -0
- package/dist/codex/evals/integration/test_narrative_grounded_envelope.sh +280 -0
- package/dist/codex/evals/integration/test_narrative_grounding_validator.sh +166 -0
- package/dist/codex/evals/integration/test_narrative_intent_annotation.sh +205 -0
- package/dist/codex/evals/integration/test_narrative_prose_renderer.sh +239 -0
- package/dist/codex/evals/integration/test_narrative_redaction_failclosed.sh +120 -0
- package/dist/codex/evals/integration/test_narrative_runtime_projection.sh +146 -0
- package/dist/codex/evals/integration/test_narrative_source_contract.sh +228 -0
- package/dist/codex/evals/integration/test_narrative_trust_isolation.sh +408 -0
- package/dist/codex/evals/integration/test_plain_stop_messaging.sh +91 -0
- package/dist/codex/evals/integration/test_session_resume_roundtrip.sh +228 -0
- package/dist/codex/evals/integration/test_telemetry_action_class.sh +265 -0
- package/dist/codex/evals/integration/test_telemetry_delegation.sh +291 -0
- package/dist/codex/evals/integration/test_telemetry_sanitize_usage.sh +155 -0
- package/dist/codex/evals/integration/test_telemetry_task_slug.sh +158 -0
- package/dist/codex/evals/integration/test_telemetry_tool_outcome.sh +279 -0
- package/dist/codex/evals/integration/test_workflow_sidecar_writer.sh +111 -2
- package/dist/codex/evals/run.sh +12 -0
- package/dist/codex/evals/static/test_library_exports.sh +5 -0
- package/dist/codex/install.sh +1 -1
- package/dist/codex/schemas/grounded-execution-narrative.schema.json +292 -0
- package/dist/codex/schemas/narrative-eval-result.schema.json +205 -0
- package/dist/codex/schemas/narrative-runtime-projection.schema.json +134 -0
- package/dist/codex/schemas/narrative-source-manifest.schema.json +294 -0
- package/dist/codex/scripts/check-hachure-boundary.mjs +81 -0
- package/dist/codex/scripts/hooks/stop-goal-fit.js +182 -9
- package/dist/codex/scripts/hooks/workflow-steering.js +160 -19
- package/dist/codex/scripts/telemetry/economics-record.schema.json +1 -1
- package/dist/codex/scripts/telemetry/economics-record.sh +47 -3
- package/dist/codex/scripts/telemetry/lib/session.sh +3 -0
- package/dist/codex/scripts/telemetry/lib/transport.sh +12 -3
- package/dist/codex/scripts/telemetry/telemetry.sh +480 -59
- package/dist/kiro/build/generated/capability-declarations.json +177 -0
- package/dist/kiro/build/package.json +1 -1
- package/dist/kiro/build/src/builder-flow-runtime.d.ts +37 -0
- package/dist/kiro/build/src/builder-flow-runtime.js +71 -1
- package/dist/kiro/build/src/builder-gate-action-envelope.d.ts +58 -7
- package/dist/kiro/build/src/builder-gate-action-envelope.js +160 -28
- package/dist/kiro/build/src/builder-lifecycle-authority.d.ts +26 -0
- package/dist/kiro/build/src/builder-lifecycle-authority.js +38 -0
- package/dist/kiro/build/src/cli/builder-run.js +71 -2
- package/dist/kiro/build/src/cli/narrative-render.d.ts +95 -0
- package/dist/kiro/build/src/cli/narrative-render.js +466 -0
- package/dist/kiro/build/src/cli/narrative-sources.d.ts +2 -0
- package/dist/kiro/build/src/cli/narrative-sources.js +282 -0
- package/dist/kiro/build/src/cli/public-contracts.d.ts +257 -0
- package/dist/kiro/build/src/cli/public-contracts.js +87 -0
- package/dist/kiro/build/src/cli/workflow-sidecar.d.ts +28 -12
- package/dist/kiro/build/src/cli/workflow-sidecar.js +599 -180
- package/dist/kiro/build/src/cli/workflow.js +11 -1
- package/dist/kiro/build/src/cli.js +8 -0
- package/dist/kiro/build/src/continuation-driver.d.ts +12 -0
- package/dist/kiro/build/src/continuation-driver.js +16 -2
- package/dist/kiro/build/src/continuation-validation.js +324 -8
- package/dist/kiro/build/src/flow-kit/action-metadata.js +21 -1
- package/dist/kiro/build/src/index.d.ts +33 -2
- package/dist/kiro/build/src/index.js +24 -0
- package/dist/kiro/build/src/lib/capability-declarations.d.ts +83 -0
- package/dist/kiro/build/src/lib/capability-declarations.js +209 -0
- package/dist/kiro/build/src/narrative/envelope.d.ts +111 -0
- package/dist/kiro/build/src/narrative/envelope.js +590 -0
- package/dist/kiro/build/src/narrative/eval-result.d.ts +60 -0
- package/dist/kiro/build/src/narrative/eval-result.js +158 -0
- package/dist/kiro/build/src/narrative/grounding-validator.d.ts +104 -0
- package/dist/kiro/build/src/narrative/grounding-validator.js +472 -0
- package/dist/kiro/build/src/narrative/integrity.d.ts +17 -0
- package/dist/kiro/build/src/narrative/integrity.js +39 -0
- package/dist/kiro/build/src/narrative/intent-economics.d.ts +42 -0
- package/dist/kiro/build/src/narrative/intent-economics.js +82 -0
- package/dist/kiro/build/src/narrative/intent.d.ts +94 -0
- package/dist/kiro/build/src/narrative/intent.js +132 -0
- package/dist/kiro/build/src/narrative/policy-filter.d.ts +15 -0
- package/dist/kiro/build/src/narrative/policy-filter.js +58 -0
- package/dist/kiro/build/src/narrative/projection.d.ts +58 -0
- package/dist/kiro/build/src/narrative/projection.js +502 -0
- package/dist/kiro/build/src/narrative/readers.d.ts +84 -0
- package/dist/kiro/build/src/narrative/readers.js +406 -0
- package/dist/kiro/build/src/narrative/render.d.ts +3 -0
- package/dist/kiro/build/src/narrative/render.js +83 -0
- package/dist/kiro/build/src/narrative/resolver.d.ts +52 -0
- package/dist/kiro/build/src/narrative/resolver.js +190 -0
- package/dist/kiro/build/src/narrative/snapshot.d.ts +90 -0
- package/dist/kiro/build/src/narrative/snapshot.js +325 -0
- package/dist/kiro/build/src/narrative/source-ids.d.ts +121 -0
- package/dist/kiro/build/src/narrative/source-ids.js +201 -0
- package/dist/kiro/build/src/narrative/statements.d.ts +84 -0
- package/dist/kiro/build/src/narrative/statements.js +347 -0
- package/dist/kiro/build/src/narrative/turn-spine.d.ts +19 -0
- package/dist/kiro/build/src/narrative/turn-spine.js +73 -0
- package/dist/kiro/build/src/tools/build-universal-bundles.js +8 -0
- package/dist/kiro/build/src/tools/generate-capability-matrix.d.ts +7 -0
- package/dist/kiro/build/src/tools/generate-capability-matrix.js +207 -0
- package/dist/kiro/build/src/tools/validate-source-tree.js +5 -1
- package/dist/kiro/context/scripts/hooks/stop-goal-fit.js +182 -9
- package/dist/kiro/context/scripts/hooks/workflow-steering.js +160 -19
- package/dist/kiro/context/scripts/telemetry/lib/session.sh +3 -0
- package/dist/kiro/context/scripts/telemetry/lib/transport.sh +12 -3
- package/dist/kiro/context/scripts/telemetry/telemetry.sh +480 -59
- package/dist/kiro/docs/context-map.md +4 -0
- package/dist/kiro/docs/decisions/index.md +1 -0
- package/dist/kiro/docs/decisions/writer-observed-execution.md +51 -0
- package/dist/kiro/docs/fixture-ownership.md +5 -1
- package/dist/kiro/docs/migrations.md +19 -4
- package/dist/kiro/docs/public-workflow-cli.md +9 -0
- package/dist/kiro/docs/spec/builder-flow-runtime.md +49 -8
- package/dist/kiro/docs/spec/runtime-hook-surface.md +29 -1
- package/dist/kiro/docs/specs/economics-record-contract.md +1 -1
- package/dist/kiro/docs/specs/harness-capability-matrix.md +63 -21
- package/dist/kiro/docs/workflow-usage-guide.md +4 -1
- package/dist/kiro/evals/ci/run-baseline.sh +38 -0
- package/dist/kiro/evals/fixtures/narrative-evals/README.md +62 -0
- package/dist/kiro/evals/fixtures/narrative-evals/corpus.json +129 -0
- package/dist/kiro/evals/fixtures/narrative-evals/scorer.mjs +522 -0
- package/dist/kiro/evals/fixtures/narrative-grounding-validator/corpus.json +20 -0
- package/dist/kiro/evals/fixtures/narrative-grounding-validator/prompt-injection-adversarial.txt +1 -0
- package/dist/kiro/evals/fixtures/narrative-grounding-validator/prompt-injection-control.txt +1 -0
- package/dist/kiro/evals/fixtures/narrative-grounding-validator/scorer.mjs +201 -0
- package/dist/kiro/evals/fixtures/narrative-prose-renderer/corpus.json +15 -0
- package/dist/kiro/evals/fixtures/narrative-prose-renderer/scorer.mjs +201 -0
- package/dist/kiro/evals/fixtures/narrative-sources/expected-capture-completeness.json +13 -0
- package/dist/kiro/evals/fixtures/narrative-sources/flow/runs/run-fixture/report.json +1 -0
- package/dist/kiro/evals/fixtures/narrative-sources/flow/runs/run-fixture/state.json +1 -0
- package/dist/kiro/evals/fixtures/narrative-sources/flow/runs/run-runtime/state.json +1 -0
- package/dist/kiro/evals/fixtures/narrative-sources/repo/created.txt +1 -0
- package/dist/kiro/evals/fixtures/narrative-sources/repo/fixture.txt +1 -0
- package/dist/kiro/evals/fixtures/narrative-sources/session/agents/agent-fixture/events.jsonl +2 -0
- package/dist/kiro/evals/fixtures/narrative-sources/session/agents/nested-worker/events.jsonl +1 -0
- package/dist/kiro/evals/fixtures/narrative-sources/session/trust.bundle +1 -0
- package/dist/kiro/evals/fixtures/narrative-sources/telemetry/full.jsonl +3 -0
- package/dist/kiro/evals/fixtures/narrative-sources/telemetry/runtime.jsonl +4 -0
- package/dist/kiro/evals/fixtures/narrative-sources/transcripts/session.txt +1 -0
- package/dist/kiro/evals/integration/test_capability_declarations.sh +183 -0
- package/dist/kiro/evals/integration/test_economics_record.sh +42 -0
- package/dist/kiro/evals/integration/test_fixture_retirement_audit.sh +2 -2
- package/dist/kiro/evals/integration/test_gate_review_inquiry_records.sh +42 -35
- package/dist/kiro/evals/integration/test_goal_fit_hook.sh +13 -5
- package/dist/kiro/evals/integration/test_goal_fit_narrative_exclusion.sh +68 -0
- package/dist/kiro/evals/integration/test_narrative_evals.sh +174 -0
- package/dist/kiro/evals/integration/test_narrative_grounded_envelope.sh +280 -0
- package/dist/kiro/evals/integration/test_narrative_grounding_validator.sh +166 -0
- package/dist/kiro/evals/integration/test_narrative_intent_annotation.sh +205 -0
- package/dist/kiro/evals/integration/test_narrative_prose_renderer.sh +239 -0
- package/dist/kiro/evals/integration/test_narrative_redaction_failclosed.sh +120 -0
- package/dist/kiro/evals/integration/test_narrative_runtime_projection.sh +146 -0
- package/dist/kiro/evals/integration/test_narrative_source_contract.sh +228 -0
- package/dist/kiro/evals/integration/test_narrative_trust_isolation.sh +408 -0
- package/dist/kiro/evals/integration/test_plain_stop_messaging.sh +91 -0
- package/dist/kiro/evals/integration/test_session_resume_roundtrip.sh +228 -0
- package/dist/kiro/evals/integration/test_telemetry_action_class.sh +265 -0
- package/dist/kiro/evals/integration/test_telemetry_delegation.sh +291 -0
- package/dist/kiro/evals/integration/test_telemetry_sanitize_usage.sh +155 -0
- package/dist/kiro/evals/integration/test_telemetry_task_slug.sh +158 -0
- package/dist/kiro/evals/integration/test_telemetry_tool_outcome.sh +279 -0
- package/dist/kiro/evals/integration/test_workflow_sidecar_writer.sh +111 -2
- package/dist/kiro/evals/run.sh +12 -0
- package/dist/kiro/evals/static/test_library_exports.sh +5 -0
- package/dist/kiro/install.sh +1 -1
- package/dist/kiro/schemas/grounded-execution-narrative.schema.json +292 -0
- package/dist/kiro/schemas/narrative-eval-result.schema.json +205 -0
- package/dist/kiro/schemas/narrative-runtime-projection.schema.json +134 -0
- package/dist/kiro/schemas/narrative-source-manifest.schema.json +294 -0
- package/dist/kiro/scripts/check-hachure-boundary.mjs +81 -0
- package/dist/kiro/scripts/hooks/stop-goal-fit.js +182 -9
- package/dist/kiro/scripts/hooks/workflow-steering.js +160 -19
- package/dist/kiro/scripts/telemetry/economics-record.schema.json +1 -1
- package/dist/kiro/scripts/telemetry/economics-record.sh +47 -3
- package/dist/kiro/scripts/telemetry/lib/session.sh +3 -0
- package/dist/kiro/scripts/telemetry/lib/transport.sh +12 -3
- package/dist/kiro/scripts/telemetry/telemetry.sh +480 -59
- package/dist/opencode/build/generated/capability-declarations.json +177 -0
- package/dist/opencode/build/package.json +1 -1
- package/dist/opencode/build/src/builder-flow-runtime.d.ts +37 -0
- package/dist/opencode/build/src/builder-flow-runtime.js +71 -1
- package/dist/opencode/build/src/builder-gate-action-envelope.d.ts +58 -7
- package/dist/opencode/build/src/builder-gate-action-envelope.js +160 -28
- package/dist/opencode/build/src/builder-lifecycle-authority.d.ts +26 -0
- package/dist/opencode/build/src/builder-lifecycle-authority.js +38 -0
- package/dist/opencode/build/src/cli/builder-run.js +71 -2
- package/dist/opencode/build/src/cli/narrative-render.d.ts +95 -0
- package/dist/opencode/build/src/cli/narrative-render.js +466 -0
- package/dist/opencode/build/src/cli/narrative-sources.d.ts +2 -0
- package/dist/opencode/build/src/cli/narrative-sources.js +282 -0
- package/dist/opencode/build/src/cli/public-contracts.d.ts +257 -0
- package/dist/opencode/build/src/cli/public-contracts.js +87 -0
- package/dist/opencode/build/src/cli/workflow-sidecar.d.ts +28 -12
- package/dist/opencode/build/src/cli/workflow-sidecar.js +599 -180
- package/dist/opencode/build/src/cli/workflow.js +11 -1
- package/dist/opencode/build/src/cli.js +8 -0
- package/dist/opencode/build/src/continuation-driver.d.ts +12 -0
- package/dist/opencode/build/src/continuation-driver.js +16 -2
- package/dist/opencode/build/src/continuation-validation.js +324 -8
- package/dist/opencode/build/src/flow-kit/action-metadata.js +21 -1
- package/dist/opencode/build/src/index.d.ts +33 -2
- package/dist/opencode/build/src/index.js +24 -0
- package/dist/opencode/build/src/lib/capability-declarations.d.ts +83 -0
- package/dist/opencode/build/src/lib/capability-declarations.js +209 -0
- package/dist/opencode/build/src/narrative/envelope.d.ts +111 -0
- package/dist/opencode/build/src/narrative/envelope.js +590 -0
- package/dist/opencode/build/src/narrative/eval-result.d.ts +60 -0
- package/dist/opencode/build/src/narrative/eval-result.js +158 -0
- package/dist/opencode/build/src/narrative/grounding-validator.d.ts +104 -0
- package/dist/opencode/build/src/narrative/grounding-validator.js +472 -0
- package/dist/opencode/build/src/narrative/integrity.d.ts +17 -0
- package/dist/opencode/build/src/narrative/integrity.js +39 -0
- package/dist/opencode/build/src/narrative/intent-economics.d.ts +42 -0
- package/dist/opencode/build/src/narrative/intent-economics.js +82 -0
- package/dist/opencode/build/src/narrative/intent.d.ts +94 -0
- package/dist/opencode/build/src/narrative/intent.js +132 -0
- package/dist/opencode/build/src/narrative/policy-filter.d.ts +15 -0
- package/dist/opencode/build/src/narrative/policy-filter.js +58 -0
- package/dist/opencode/build/src/narrative/projection.d.ts +58 -0
- package/dist/opencode/build/src/narrative/projection.js +502 -0
- package/dist/opencode/build/src/narrative/readers.d.ts +84 -0
- package/dist/opencode/build/src/narrative/readers.js +406 -0
- package/dist/opencode/build/src/narrative/render.d.ts +3 -0
- package/dist/opencode/build/src/narrative/render.js +83 -0
- package/dist/opencode/build/src/narrative/resolver.d.ts +52 -0
- package/dist/opencode/build/src/narrative/resolver.js +190 -0
- package/dist/opencode/build/src/narrative/snapshot.d.ts +90 -0
- package/dist/opencode/build/src/narrative/snapshot.js +325 -0
- package/dist/opencode/build/src/narrative/source-ids.d.ts +121 -0
- package/dist/opencode/build/src/narrative/source-ids.js +201 -0
- package/dist/opencode/build/src/narrative/statements.d.ts +84 -0
- package/dist/opencode/build/src/narrative/statements.js +347 -0
- package/dist/opencode/build/src/narrative/turn-spine.d.ts +19 -0
- package/dist/opencode/build/src/narrative/turn-spine.js +73 -0
- package/dist/opencode/build/src/tools/build-universal-bundles.js +8 -0
- package/dist/opencode/build/src/tools/generate-capability-matrix.d.ts +7 -0
- package/dist/opencode/build/src/tools/generate-capability-matrix.js +207 -0
- package/dist/opencode/build/src/tools/validate-source-tree.js +5 -1
- package/dist/opencode/context/scripts/hooks/stop-goal-fit.js +182 -9
- package/dist/opencode/context/scripts/hooks/workflow-steering.js +160 -19
- package/dist/opencode/context/scripts/telemetry/lib/session.sh +3 -0
- package/dist/opencode/context/scripts/telemetry/lib/transport.sh +12 -3
- package/dist/opencode/context/scripts/telemetry/telemetry.sh +480 -59
- package/dist/opencode/docs/context-map.md +4 -0
- package/dist/opencode/docs/decisions/index.md +1 -0
- package/dist/opencode/docs/decisions/writer-observed-execution.md +51 -0
- package/dist/opencode/docs/fixture-ownership.md +5 -1
- package/dist/opencode/docs/migrations.md +19 -4
- package/dist/opencode/docs/public-workflow-cli.md +9 -0
- package/dist/opencode/docs/spec/builder-flow-runtime.md +49 -8
- package/dist/opencode/docs/spec/runtime-hook-surface.md +29 -1
- package/dist/opencode/docs/specs/economics-record-contract.md +1 -1
- package/dist/opencode/docs/specs/harness-capability-matrix.md +63 -21
- package/dist/opencode/docs/workflow-usage-guide.md +4 -1
- package/dist/opencode/evals/ci/run-baseline.sh +38 -0
- package/dist/opencode/evals/fixtures/narrative-evals/README.md +62 -0
- package/dist/opencode/evals/fixtures/narrative-evals/corpus.json +129 -0
- package/dist/opencode/evals/fixtures/narrative-evals/scorer.mjs +522 -0
- package/dist/opencode/evals/fixtures/narrative-grounding-validator/corpus.json +20 -0
- package/dist/opencode/evals/fixtures/narrative-grounding-validator/prompt-injection-adversarial.txt +1 -0
- package/dist/opencode/evals/fixtures/narrative-grounding-validator/prompt-injection-control.txt +1 -0
- package/dist/opencode/evals/fixtures/narrative-grounding-validator/scorer.mjs +201 -0
- package/dist/opencode/evals/fixtures/narrative-prose-renderer/corpus.json +15 -0
- package/dist/opencode/evals/fixtures/narrative-prose-renderer/scorer.mjs +201 -0
- package/dist/opencode/evals/fixtures/narrative-sources/expected-capture-completeness.json +13 -0
- package/dist/opencode/evals/fixtures/narrative-sources/flow/runs/run-fixture/report.json +1 -0
- package/dist/opencode/evals/fixtures/narrative-sources/flow/runs/run-fixture/state.json +1 -0
- package/dist/opencode/evals/fixtures/narrative-sources/flow/runs/run-runtime/state.json +1 -0
- package/dist/opencode/evals/fixtures/narrative-sources/repo/created.txt +1 -0
- package/dist/opencode/evals/fixtures/narrative-sources/repo/fixture.txt +1 -0
- package/dist/opencode/evals/fixtures/narrative-sources/session/agents/agent-fixture/events.jsonl +2 -0
- package/dist/opencode/evals/fixtures/narrative-sources/session/agents/nested-worker/events.jsonl +1 -0
- package/dist/opencode/evals/fixtures/narrative-sources/session/trust.bundle +1 -0
- package/dist/opencode/evals/fixtures/narrative-sources/telemetry/full.jsonl +3 -0
- package/dist/opencode/evals/fixtures/narrative-sources/telemetry/runtime.jsonl +4 -0
- package/dist/opencode/evals/fixtures/narrative-sources/transcripts/session.txt +1 -0
- package/dist/opencode/evals/integration/test_capability_declarations.sh +183 -0
- package/dist/opencode/evals/integration/test_economics_record.sh +42 -0
- package/dist/opencode/evals/integration/test_fixture_retirement_audit.sh +2 -2
- package/dist/opencode/evals/integration/test_gate_review_inquiry_records.sh +42 -35
- package/dist/opencode/evals/integration/test_goal_fit_hook.sh +13 -5
- package/dist/opencode/evals/integration/test_goal_fit_narrative_exclusion.sh +68 -0
- package/dist/opencode/evals/integration/test_narrative_evals.sh +174 -0
- package/dist/opencode/evals/integration/test_narrative_grounded_envelope.sh +280 -0
- package/dist/opencode/evals/integration/test_narrative_grounding_validator.sh +166 -0
- package/dist/opencode/evals/integration/test_narrative_intent_annotation.sh +205 -0
- package/dist/opencode/evals/integration/test_narrative_prose_renderer.sh +239 -0
- package/dist/opencode/evals/integration/test_narrative_redaction_failclosed.sh +120 -0
- package/dist/opencode/evals/integration/test_narrative_runtime_projection.sh +146 -0
- package/dist/opencode/evals/integration/test_narrative_source_contract.sh +228 -0
- package/dist/opencode/evals/integration/test_narrative_trust_isolation.sh +408 -0
- package/dist/opencode/evals/integration/test_plain_stop_messaging.sh +91 -0
- package/dist/opencode/evals/integration/test_session_resume_roundtrip.sh +228 -0
- package/dist/opencode/evals/integration/test_telemetry_action_class.sh +265 -0
- package/dist/opencode/evals/integration/test_telemetry_delegation.sh +291 -0
- package/dist/opencode/evals/integration/test_telemetry_sanitize_usage.sh +155 -0
- package/dist/opencode/evals/integration/test_telemetry_task_slug.sh +158 -0
- package/dist/opencode/evals/integration/test_telemetry_tool_outcome.sh +279 -0
- package/dist/opencode/evals/integration/test_workflow_sidecar_writer.sh +111 -2
- package/dist/opencode/evals/run.sh +12 -0
- package/dist/opencode/evals/static/test_library_exports.sh +5 -0
- package/dist/opencode/install.sh +1 -1
- package/dist/opencode/schemas/grounded-execution-narrative.schema.json +292 -0
- package/dist/opencode/schemas/narrative-eval-result.schema.json +205 -0
- package/dist/opencode/schemas/narrative-runtime-projection.schema.json +134 -0
- package/dist/opencode/schemas/narrative-source-manifest.schema.json +294 -0
- package/dist/opencode/scripts/check-hachure-boundary.mjs +81 -0
- package/dist/opencode/scripts/hooks/stop-goal-fit.js +182 -9
- package/dist/opencode/scripts/hooks/workflow-steering.js +160 -19
- package/dist/opencode/scripts/telemetry/economics-record.schema.json +1 -1
- package/dist/opencode/scripts/telemetry/economics-record.sh +47 -3
- package/dist/opencode/scripts/telemetry/lib/session.sh +3 -0
- package/dist/opencode/scripts/telemetry/lib/transport.sh +12 -3
- package/dist/opencode/scripts/telemetry/telemetry.sh +480 -59
- package/dist/pi/build/generated/capability-declarations.json +177 -0
- package/dist/pi/build/package.json +1 -1
- package/dist/pi/build/src/builder-flow-runtime.d.ts +37 -0
- package/dist/pi/build/src/builder-flow-runtime.js +71 -1
- package/dist/pi/build/src/builder-gate-action-envelope.d.ts +58 -7
- package/dist/pi/build/src/builder-gate-action-envelope.js +160 -28
- package/dist/pi/build/src/builder-lifecycle-authority.d.ts +26 -0
- package/dist/pi/build/src/builder-lifecycle-authority.js +38 -0
- package/dist/pi/build/src/cli/builder-run.js +71 -2
- package/dist/pi/build/src/cli/narrative-render.d.ts +95 -0
- package/dist/pi/build/src/cli/narrative-render.js +466 -0
- package/dist/pi/build/src/cli/narrative-sources.d.ts +2 -0
- package/dist/pi/build/src/cli/narrative-sources.js +282 -0
- package/dist/pi/build/src/cli/public-contracts.d.ts +257 -0
- package/dist/pi/build/src/cli/public-contracts.js +87 -0
- package/dist/pi/build/src/cli/workflow-sidecar.d.ts +28 -12
- package/dist/pi/build/src/cli/workflow-sidecar.js +599 -180
- package/dist/pi/build/src/cli/workflow.js +11 -1
- package/dist/pi/build/src/cli.js +8 -0
- package/dist/pi/build/src/continuation-driver.d.ts +12 -0
- package/dist/pi/build/src/continuation-driver.js +16 -2
- package/dist/pi/build/src/continuation-validation.js +324 -8
- package/dist/pi/build/src/flow-kit/action-metadata.js +21 -1
- package/dist/pi/build/src/index.d.ts +33 -2
- package/dist/pi/build/src/index.js +24 -0
- package/dist/pi/build/src/lib/capability-declarations.d.ts +83 -0
- package/dist/pi/build/src/lib/capability-declarations.js +209 -0
- package/dist/pi/build/src/narrative/envelope.d.ts +111 -0
- package/dist/pi/build/src/narrative/envelope.js +590 -0
- package/dist/pi/build/src/narrative/eval-result.d.ts +60 -0
- package/dist/pi/build/src/narrative/eval-result.js +158 -0
- package/dist/pi/build/src/narrative/grounding-validator.d.ts +104 -0
- package/dist/pi/build/src/narrative/grounding-validator.js +472 -0
- package/dist/pi/build/src/narrative/integrity.d.ts +17 -0
- package/dist/pi/build/src/narrative/integrity.js +39 -0
- package/dist/pi/build/src/narrative/intent-economics.d.ts +42 -0
- package/dist/pi/build/src/narrative/intent-economics.js +82 -0
- package/dist/pi/build/src/narrative/intent.d.ts +94 -0
- package/dist/pi/build/src/narrative/intent.js +132 -0
- package/dist/pi/build/src/narrative/policy-filter.d.ts +15 -0
- package/dist/pi/build/src/narrative/policy-filter.js +58 -0
- package/dist/pi/build/src/narrative/projection.d.ts +58 -0
- package/dist/pi/build/src/narrative/projection.js +502 -0
- package/dist/pi/build/src/narrative/readers.d.ts +84 -0
- package/dist/pi/build/src/narrative/readers.js +406 -0
- package/dist/pi/build/src/narrative/render.d.ts +3 -0
- package/dist/pi/build/src/narrative/render.js +83 -0
- package/dist/pi/build/src/narrative/resolver.d.ts +52 -0
- package/dist/pi/build/src/narrative/resolver.js +190 -0
- package/dist/pi/build/src/narrative/snapshot.d.ts +90 -0
- package/dist/pi/build/src/narrative/snapshot.js +325 -0
- package/dist/pi/build/src/narrative/source-ids.d.ts +121 -0
- package/dist/pi/build/src/narrative/source-ids.js +201 -0
- package/dist/pi/build/src/narrative/statements.d.ts +84 -0
- package/dist/pi/build/src/narrative/statements.js +347 -0
- package/dist/pi/build/src/narrative/turn-spine.d.ts +19 -0
- package/dist/pi/build/src/narrative/turn-spine.js +73 -0
- package/dist/pi/build/src/tools/build-universal-bundles.js +8 -0
- package/dist/pi/build/src/tools/generate-capability-matrix.d.ts +7 -0
- package/dist/pi/build/src/tools/generate-capability-matrix.js +207 -0
- package/dist/pi/build/src/tools/validate-source-tree.js +5 -1
- package/dist/pi/context/scripts/hooks/stop-goal-fit.js +182 -9
- package/dist/pi/context/scripts/hooks/workflow-steering.js +160 -19
- package/dist/pi/context/scripts/telemetry/lib/session.sh +3 -0
- package/dist/pi/context/scripts/telemetry/lib/transport.sh +12 -3
- package/dist/pi/context/scripts/telemetry/telemetry.sh +480 -59
- package/dist/pi/docs/context-map.md +4 -0
- package/dist/pi/docs/decisions/index.md +1 -0
- package/dist/pi/docs/decisions/writer-observed-execution.md +51 -0
- package/dist/pi/docs/fixture-ownership.md +5 -1
- package/dist/pi/docs/migrations.md +19 -4
- package/dist/pi/docs/public-workflow-cli.md +9 -0
- package/dist/pi/docs/spec/builder-flow-runtime.md +49 -8
- package/dist/pi/docs/spec/runtime-hook-surface.md +29 -1
- package/dist/pi/docs/specs/economics-record-contract.md +1 -1
- package/dist/pi/docs/specs/harness-capability-matrix.md +63 -21
- package/dist/pi/docs/workflow-usage-guide.md +4 -1
- package/dist/pi/evals/ci/run-baseline.sh +38 -0
- package/dist/pi/evals/fixtures/narrative-evals/README.md +62 -0
- package/dist/pi/evals/fixtures/narrative-evals/corpus.json +129 -0
- package/dist/pi/evals/fixtures/narrative-evals/scorer.mjs +522 -0
- package/dist/pi/evals/fixtures/narrative-grounding-validator/corpus.json +20 -0
- package/dist/pi/evals/fixtures/narrative-grounding-validator/prompt-injection-adversarial.txt +1 -0
- package/dist/pi/evals/fixtures/narrative-grounding-validator/prompt-injection-control.txt +1 -0
- package/dist/pi/evals/fixtures/narrative-grounding-validator/scorer.mjs +201 -0
- package/dist/pi/evals/fixtures/narrative-prose-renderer/corpus.json +15 -0
- package/dist/pi/evals/fixtures/narrative-prose-renderer/scorer.mjs +201 -0
- package/dist/pi/evals/fixtures/narrative-sources/expected-capture-completeness.json +13 -0
- package/dist/pi/evals/fixtures/narrative-sources/flow/runs/run-fixture/report.json +1 -0
- package/dist/pi/evals/fixtures/narrative-sources/flow/runs/run-fixture/state.json +1 -0
- package/dist/pi/evals/fixtures/narrative-sources/flow/runs/run-runtime/state.json +1 -0
- package/dist/pi/evals/fixtures/narrative-sources/repo/created.txt +1 -0
- package/dist/pi/evals/fixtures/narrative-sources/repo/fixture.txt +1 -0
- package/dist/pi/evals/fixtures/narrative-sources/session/agents/agent-fixture/events.jsonl +2 -0
- package/dist/pi/evals/fixtures/narrative-sources/session/agents/nested-worker/events.jsonl +1 -0
- package/dist/pi/evals/fixtures/narrative-sources/session/trust.bundle +1 -0
- package/dist/pi/evals/fixtures/narrative-sources/telemetry/full.jsonl +3 -0
- package/dist/pi/evals/fixtures/narrative-sources/telemetry/runtime.jsonl +4 -0
- package/dist/pi/evals/fixtures/narrative-sources/transcripts/session.txt +1 -0
- package/dist/pi/evals/integration/test_capability_declarations.sh +183 -0
- package/dist/pi/evals/integration/test_economics_record.sh +42 -0
- package/dist/pi/evals/integration/test_fixture_retirement_audit.sh +2 -2
- package/dist/pi/evals/integration/test_gate_review_inquiry_records.sh +42 -35
- package/dist/pi/evals/integration/test_goal_fit_hook.sh +13 -5
- package/dist/pi/evals/integration/test_goal_fit_narrative_exclusion.sh +68 -0
- package/dist/pi/evals/integration/test_narrative_evals.sh +174 -0
- package/dist/pi/evals/integration/test_narrative_grounded_envelope.sh +280 -0
- package/dist/pi/evals/integration/test_narrative_grounding_validator.sh +166 -0
- package/dist/pi/evals/integration/test_narrative_intent_annotation.sh +205 -0
- package/dist/pi/evals/integration/test_narrative_prose_renderer.sh +239 -0
- package/dist/pi/evals/integration/test_narrative_redaction_failclosed.sh +120 -0
- package/dist/pi/evals/integration/test_narrative_runtime_projection.sh +146 -0
- package/dist/pi/evals/integration/test_narrative_source_contract.sh +228 -0
- package/dist/pi/evals/integration/test_narrative_trust_isolation.sh +408 -0
- package/dist/pi/evals/integration/test_plain_stop_messaging.sh +91 -0
- package/dist/pi/evals/integration/test_session_resume_roundtrip.sh +228 -0
- package/dist/pi/evals/integration/test_telemetry_action_class.sh +265 -0
- package/dist/pi/evals/integration/test_telemetry_delegation.sh +291 -0
- package/dist/pi/evals/integration/test_telemetry_sanitize_usage.sh +155 -0
- package/dist/pi/evals/integration/test_telemetry_task_slug.sh +158 -0
- package/dist/pi/evals/integration/test_telemetry_tool_outcome.sh +279 -0
- package/dist/pi/evals/integration/test_workflow_sidecar_writer.sh +111 -2
- package/dist/pi/evals/run.sh +12 -0
- package/dist/pi/evals/static/test_library_exports.sh +5 -0
- package/dist/pi/install.sh +1 -1
- package/dist/pi/schemas/grounded-execution-narrative.schema.json +292 -0
- package/dist/pi/schemas/narrative-eval-result.schema.json +205 -0
- package/dist/pi/schemas/narrative-runtime-projection.schema.json +134 -0
- package/dist/pi/schemas/narrative-source-manifest.schema.json +294 -0
- package/dist/pi/scripts/check-hachure-boundary.mjs +81 -0
- package/dist/pi/scripts/hooks/stop-goal-fit.js +182 -9
- package/dist/pi/scripts/hooks/workflow-steering.js +160 -19
- package/dist/pi/scripts/telemetry/economics-record.schema.json +1 -1
- package/dist/pi/scripts/telemetry/economics-record.sh +47 -3
- package/dist/pi/scripts/telemetry/lib/session.sh +3 -0
- package/dist/pi/scripts/telemetry/lib/transport.sh +12 -3
- package/dist/pi/scripts/telemetry/telemetry.sh +480 -59
- package/docs/context-map.md +4 -0
- package/docs/decisions/index.md +1 -0
- package/docs/decisions/writer-observed-execution.md +51 -0
- package/docs/fixture-ownership.md +5 -1
- package/docs/migrations.md +19 -4
- package/docs/public-workflow-cli.md +9 -0
- package/docs/spec/builder-flow-runtime.md +49 -8
- package/docs/spec/runtime-hook-surface.md +29 -1
- package/docs/specs/economics-record-contract.md +1 -1
- package/docs/specs/harness-capability-matrix.md +63 -21
- package/docs/workflow-usage-guide.md +4 -1
- package/evals/ci/run-baseline.sh +38 -0
- package/evals/fixtures/narrative-evals/README.md +62 -0
- package/evals/fixtures/narrative-evals/corpus.json +129 -0
- package/evals/fixtures/narrative-evals/scorer.mjs +522 -0
- package/evals/fixtures/narrative-grounding-validator/corpus.json +20 -0
- package/evals/fixtures/narrative-grounding-validator/prompt-injection-adversarial.txt +1 -0
- package/evals/fixtures/narrative-grounding-validator/prompt-injection-control.txt +1 -0
- package/evals/fixtures/narrative-grounding-validator/scorer.mjs +201 -0
- package/evals/fixtures/narrative-prose-renderer/corpus.json +15 -0
- package/evals/fixtures/narrative-prose-renderer/scorer.mjs +201 -0
- package/evals/fixtures/narrative-sources/expected-capture-completeness.json +13 -0
- package/evals/fixtures/narrative-sources/flow/runs/run-fixture/report.json +1 -0
- package/evals/fixtures/narrative-sources/flow/runs/run-fixture/state.json +1 -0
- package/evals/fixtures/narrative-sources/flow/runs/run-runtime/state.json +1 -0
- package/evals/fixtures/narrative-sources/repo/created.txt +1 -0
- package/evals/fixtures/narrative-sources/repo/fixture.txt +1 -0
- package/evals/fixtures/narrative-sources/session/agents/agent-fixture/events.jsonl +2 -0
- package/evals/fixtures/narrative-sources/session/agents/nested-worker/events.jsonl +1 -0
- package/evals/fixtures/narrative-sources/session/trust.bundle +1 -0
- package/evals/fixtures/narrative-sources/telemetry/full.jsonl +3 -0
- package/evals/fixtures/narrative-sources/telemetry/runtime.jsonl +4 -0
- package/evals/fixtures/narrative-sources/transcripts/session.txt +1 -0
- package/evals/integration/test_capability_declarations.sh +183 -0
- package/evals/integration/test_economics_record.sh +42 -0
- package/evals/integration/test_fixture_retirement_audit.sh +2 -2
- package/evals/integration/test_gate_review_inquiry_records.sh +42 -35
- package/evals/integration/test_goal_fit_hook.sh +13 -5
- package/evals/integration/test_goal_fit_narrative_exclusion.sh +68 -0
- package/evals/integration/test_narrative_evals.sh +174 -0
- package/evals/integration/test_narrative_grounded_envelope.sh +280 -0
- package/evals/integration/test_narrative_grounding_validator.sh +166 -0
- package/evals/integration/test_narrative_intent_annotation.sh +205 -0
- package/evals/integration/test_narrative_prose_renderer.sh +239 -0
- package/evals/integration/test_narrative_redaction_failclosed.sh +120 -0
- package/evals/integration/test_narrative_runtime_projection.sh +146 -0
- package/evals/integration/test_narrative_source_contract.sh +228 -0
- package/evals/integration/test_narrative_trust_isolation.sh +408 -0
- package/evals/integration/test_plain_stop_messaging.sh +91 -0
- package/evals/integration/test_session_resume_roundtrip.sh +228 -0
- package/evals/integration/test_telemetry_action_class.sh +265 -0
- package/evals/integration/test_telemetry_delegation.sh +291 -0
- package/evals/integration/test_telemetry_sanitize_usage.sh +155 -0
- package/evals/integration/test_telemetry_task_slug.sh +158 -0
- package/evals/integration/test_telemetry_tool_outcome.sh +279 -0
- package/evals/integration/test_workflow_sidecar_writer.sh +111 -2
- package/evals/run.sh +12 -0
- package/evals/static/test_library_exports.sh +5 -0
- package/package.json +9 -5
- package/schemas/grounded-execution-narrative.schema.json +292 -0
- package/schemas/narrative-eval-result.schema.json +205 -0
- package/schemas/narrative-runtime-projection.schema.json +134 -0
- package/schemas/narrative-source-manifest.schema.json +294 -0
- package/scripts/check-hachure-boundary.mjs +81 -0
- package/scripts/hooks/stop-goal-fit.js +182 -9
- package/scripts/hooks/workflow-steering.js +160 -19
- package/scripts/telemetry/economics-record.schema.json +1 -1
- package/scripts/telemetry/economics-record.sh +47 -3
- package/scripts/telemetry/lib/session.sh +3 -0
- package/scripts/telemetry/lib/transport.sh +12 -3
- package/scripts/telemetry/telemetry.sh +480 -59
- package/src/builder-flow-runtime.ts +102 -1
- package/src/builder-gate-action-envelope.ts +212 -35
- package/src/builder-lifecycle-authority.ts +48 -0
- package/src/cli/builder-flow-runtime.test.mjs +218 -7
- package/src/cli/builder-run.ts +71 -1
- package/src/cli/capability-declarations.test.mjs +117 -0
- package/src/cli/continuation-driver.test.mjs +327 -20
- package/src/cli/kit-metadata-security.test.mjs +90 -2
- package/src/cli/narrative-arch-isolation.test.mjs +198 -0
- package/src/cli/narrative-envelope.test.mjs +367 -0
- package/src/cli/narrative-grounding-validator.test.mjs +322 -0
- package/src/cli/narrative-intent.test.mjs +177 -0
- package/src/cli/narrative-policy-filter.test.mjs +66 -0
- package/src/cli/narrative-projection.test.mjs +236 -0
- package/src/cli/narrative-readers.test.mjs +196 -0
- package/src/cli/narrative-render.test.mjs +221 -0
- package/src/cli/narrative-render.ts +589 -0
- package/src/cli/narrative-resolver.test.mjs +114 -0
- package/src/cli/narrative-snapshot.test.mjs +149 -0
- package/src/cli/narrative-source-ids.test.mjs +84 -0
- package/src/cli/narrative-sources.ts +276 -0
- package/src/cli/narrative-statements.test.mjs +369 -0
- package/src/cli/narrative-turn-spine.test.mjs +74 -0
- package/src/cli/public-api.test.mjs +17 -0
- package/src/cli/public-contracts.ts +95 -0
- package/src/cli/sidecar-pure-helpers.test.mjs +216 -24
- package/src/cli/trust-bundle-policy-order.test.mjs +134 -1
- package/src/cli/workflow-sidecar.ts +563 -167
- package/src/cli/workflow.ts +15 -1
- package/src/cli/writer-observed-execution.test.mjs +102 -0
- package/src/cli.ts +8 -0
- package/src/continuation-driver.ts +32 -3
- package/src/continuation-validation.ts +336 -8
- package/src/flow-kit/action-metadata.ts +20 -1
- package/src/index.ts +241 -0
- package/src/lib/capability-declarations.ts +261 -0
- package/src/narrative/envelope.ts +624 -0
- package/src/narrative/eval-result.ts +175 -0
- package/src/narrative/grounding-validator.ts +610 -0
- package/src/narrative/integrity.ts +53 -0
- package/src/narrative/intent-economics.ts +119 -0
- package/src/narrative/intent.ts +216 -0
- package/src/narrative/policy-filter.ts +66 -0
- package/src/narrative/projection.ts +530 -0
- package/src/narrative/readers.ts +427 -0
- package/src/narrative/render.ts +82 -0
- package/src/narrative/resolver.ts +195 -0
- package/src/narrative/snapshot.ts +365 -0
- package/src/narrative/source-ids.ts +294 -0
- package/src/narrative/statements.ts +423 -0
- package/src/narrative/turn-spine.ts +99 -0
- package/src/tools/build-universal-bundles.ts +8 -0
- package/src/tools/generate-capability-matrix.ts +215 -0
- package/src/tools/validate-source-tree.ts +5 -1
- package/build/src/cli/sidecar-claim-explain.d.ts +0 -45
- package/build/src/cli/sidecar-claim-explain.js +0 -87
- package/dist/base/build/src/cli/sidecar-claim-explain.d.ts +0 -45
- package/dist/base/build/src/cli/sidecar-claim-explain.js +0 -87
- package/dist/claude-code/build/src/cli/sidecar-claim-explain.d.ts +0 -45
- package/dist/claude-code/build/src/cli/sidecar-claim-explain.js +0 -87
- package/dist/codex/build/src/cli/sidecar-claim-explain.d.ts +0 -45
- package/dist/codex/build/src/cli/sidecar-claim-explain.js +0 -87
- package/dist/kiro/build/src/cli/sidecar-claim-explain.d.ts +0 -45
- package/dist/kiro/build/src/cli/sidecar-claim-explain.js +0 -87
- package/dist/opencode/build/src/cli/sidecar-claim-explain.d.ts +0 -45
- package/dist/opencode/build/src/cli/sidecar-claim-explain.js +0 -87
- package/dist/pi/build/src/cli/sidecar-claim-explain.d.ts +0 -45
- package/dist/pi/build/src/cli/sidecar-claim-explain.js +0 -87
- package/src/cli/sidecar-claim-explain.ts +0 -130
package/build/src/index.d.ts
CHANGED
|
@@ -1,13 +1,44 @@
|
|
|
1
|
+
export { NARRATIVE_SOURCE_ID_VERSION, SourceIdParseError, compareSourceIds, formatSourceId, parseSourceId, } from "./narrative/source-ids.js";
|
|
2
|
+
export type { AgentEventSourceId, ChainedCommandLogSourceId, CommandLogSourceId, FileSourceId, FlowReportSourceId, FlowStateSourceId, FlowTransitionSourceId, LegacyCommandLogSourceId, NarrativeSourceId, NarrativeSourceStream, SourceIdErrorCode, SurfaceExplanationSourceId, TelemetrySourceId, TranscriptSourceId, TrustSourceId, } from "./narrative/source-ids.js";
|
|
3
|
+
export { DEFAULT_INTEGRITY_CLASS, KNOWN_CAPTURE_GAPS, buildCaptureCompleteness, integrityClassForSource, } from "./narrative/integrity.js";
|
|
4
|
+
export type { CaptureChannelStatus, CaptureCompleteness, IntegrityClass, KnownGapClass, UnavailableReason, } from "./narrative/integrity.js";
|
|
5
|
+
export { TELEMETRY_CHANNEL_ANALYTICS_REDACT_DEFAULT, TELEMETRY_CHANNEL_FULL_REDACT_DEFAULT, effectiveNarrativeRedactionFields, filterNarrativeRecord, } from "./narrative/policy-filter.js";
|
|
6
|
+
export type { NarrativePolicyFilterResult } from "./narrative/policy-filter.js";
|
|
7
|
+
export { snapshotNarrative, validateNarrativeSourceManifest } from "./narrative/snapshot.js";
|
|
8
|
+
export type { NarrativeLineageEvent, NarrativeSourceManifest, NarrativeSourceManifestEntry, NarrativeSourceOrigin, NarrativeSourceRequest, NarrativeSourceRoots, SnapshotNarrativeDependencies, SnapshotNarrativeInput, } from "./narrative/snapshot.js";
|
|
9
|
+
export { resolveManifestEntry, resolveSource, verifyManifest } from "./narrative/resolver.js";
|
|
10
|
+
export type { FrozenManifestEntry, ResolveSourceOptions, ResolveSourceResult, VerifyManifestReport } from "./narrative/resolver.js";
|
|
11
|
+
export { NARRATIVE_RUNTIME_PROJECTION_SCHEMA_VERSION, NARRATIVE_RUNTIME_PROJECTOR, NarrativeProjectionError, projectRuntimeNarrative, stableStringify, validateNarrativeRuntimeProjection, } from "./narrative/projection.js";
|
|
12
|
+
export { GROUNDED_EXECUTION_NARRATIVE_COMPILER_NAME, GROUNDED_EXECUTION_NARRATIVE_SCHEMA_VERSION, GroundedNarrativeError, composeGroundedNarrative, validateGroundedNarrative, writeEnvelope, } from "./narrative/envelope.js";
|
|
13
|
+
export { renderGroundedNarrative } from "./narrative/render.js";
|
|
14
|
+
export type { GroundedExecutionNarrative, GroundedNarrativeConclusion, GroundedNarrativeConfig, GroundedNarrativeCorrelation, GroundedNarrativeErrorCode, GroundedNarrativeFlowTransition, GroundedNarrativeForeignSection, GroundedNarrativeRule, GroundedNarrativeRuntimeSection, GroundedNarrativeSection, SchemaIssue as GroundedNarrativeSchemaIssue, WriteEnvelopeOptions, WrittenGroundedNarrative, } from "./narrative/envelope.js";
|
|
15
|
+
export type { NarrativeRuntimeProjection, NarrativeProjectionErrorCode, ProjectRuntimeNarrativeOptions, RuntimePurpose, RuntimeProjectionTurn, } from "./narrative/projection.js";
|
|
16
|
+
export { QUARANTINE_SESSION_ID, TURN_SPINE_RULE_ID, buildTurnSpine } from "./narrative/turn-spine.js";
|
|
17
|
+
export type { ResolvedTelemetryRecord, Turn, TurnBoundary } from "./narrative/turn-spine.js";
|
|
18
|
+
export { AGENT_STATED_ACTOR_MAX_LENGTH, AGENT_STATED_PURPOSE_MAX_LENGTH, NarrativeStatementError, agentStatedIntent, derivedNoOpTurn, derivedRetry, derivedTimeout, derivedUnavailableSource, observedCommand, observedDelegation, observedFileCreation, observedToolAction, summarizerInferredConnective, workflowDerivedPurpose, } from "./narrative/statements.js";
|
|
19
|
+
export type { NarrativeStatementErrorCode, ObservedResult, Statement, StatementClass, StatementRule, } from "./narrative/statements.js";
|
|
20
|
+
export { INTENT_ANNOTATION_FILE, INTENT_ANNOTATION_SCHEMA_VERSION, bindIntentAnnotation, captureIntent, } from "./narrative/intent.js";
|
|
21
|
+
export type { CaptureIntentDependencies, CaptureIntentInput, CapturedIntent, IntentAnnotation, IntentCapabilityStatus, IntentCaptureMode, } from "./narrative/intent.js";
|
|
22
|
+
export { INTENT_ECONOMICS_FILE, appendIntentEconomics, readIntentEconomics, reduceIntentEconomics, } from "./narrative/intent-economics.js";
|
|
23
|
+
export type { IntentAnnotationMode, IntentEconomicsDelta, IntentEconomicsRecord, IntentEconomicsSummary, } from "./narrative/intent-economics.js";
|
|
24
|
+
export { entailmentIndependenceHolds, isAssertionProhibited, materialEventCoverage, NarrativeGroundingError, validateNarrativeGrounding, } from "./narrative/grounding-validator.js";
|
|
25
|
+
export type { AssertionKind, EntailmentIdentity, EntailmentProvenance, EntailmentVerdict, GroundingKnownGap, GroundingViolation, GroundingViolationCode, GroundingVerdict, MaterialEventClassCoverage, MaterialEventCoverage, MaterialEventKind, ValidateNarrativeGroundingOptions, } from "./narrative/grounding-validator.js";
|
|
26
|
+
export { NARRATIVE_EVAL_RESULT_SCHEMA_VERSION, validateNarrativeEvalResult, } from "./narrative/eval-result.js";
|
|
27
|
+
export type { NarrativeEvalCapabilityParity, NarrativeEvalFixtureResult, NarrativeEvalKnownGap, NarrativeEvalMetricUncertainty, NarrativeEvalMetrics, NarrativeEvalRawSourceLink, NarrativeEvalResult, NarrativeEvalVerdict, SchemaIssue as NarrativeEvalResultSchemaIssue, } from "./narrative/eval-result.js";
|
|
28
|
+
export { GeneratorTimeoutError, PROSE_ECONOMICS_FILE, PROSE_PROMPT_VERSION, ProviderNotAllowedError, hostedModelGenerator, localModelGenerator, providerAllowed, renderProse, stubGenerator, } from "./cli/narrative-render.js";
|
|
29
|
+
export type { GeneratedProse, ModelGeneratorConfig, ProseEconomicsRecord, ProseGenerator, ProseGeneratorInput, ProseGeneratorSentence, ProseGeneratorUsage, ProseRenderOutcome, ProseSourceView, ProviderConfig, ProviderOptIn, RenderProseOptions, RenderProseResult, } from "./cli/narrative-render.js";
|
|
1
30
|
export { BUILDER_BUILD_FLOW_ID, BUILDER_BUILD_FLOW_RELATIVE_PATH, BuilderBuildRunInputError, BuilderBuildRunIdentityError, evaluateBuilderBuildRun, loadBuilderBuildRun, resolveBuilderBuildFlowDefinitionPath, startBuilderBuildRun, } from "./builder-flow-run-adapter.js";
|
|
2
31
|
export type { BuilderBuildRunResult, BuilderBuildRunIdentityMismatch, BuilderBuildTrustBundleEvidenceInput, EvaluateBuilderBuildRunInput, LoadBuilderBuildRunInput, StartBuilderBuildRunInput, } from "./builder-flow-run-adapter.js";
|
|
3
32
|
export { archiveBuilderFlowSession, cancelBuilderFlowSession, pauseBuilderFlowSession, recoverBuilderFlowSession, releaseBuilderFlowAssignment, resumeBuilderFlowSession, startBuilderFlowSession, syncBuilderFlowSession, } from "./builder-flow-runtime.js";
|
|
4
33
|
export type { BuilderFlowAgentLifecycleInput, BuilderFlowAuthorizedLifecycleInput, BuilderFlowSessionInput, BuilderFlowSessionResult } from "./builder-flow-runtime.js";
|
|
5
34
|
export { deriveBuilderGateActionEnvelope, gateActionProgressSnapshot, withGateActionPriorProgress, } from "./builder-gate-action-envelope.js";
|
|
6
|
-
export type { BuilderGateActionEnvelopeInput, GateActionEnvelope, GateActionInterfaceParameter, GateActionPriorProgress, GateActionProgressSnapshot, GateActionPublicMutation, } from "./builder-gate-action-envelope.js";
|
|
35
|
+
export type { BuilderGateActionEnvelopeInput, GateActionArtifactBinding, GateActionArtifactTarget, GateActionEnvelope, GateActionInterfaceParameter, GateActionPriorProgress, GateActionProgressSnapshot, GateActionPublicMutation, } from "./builder-gate-action-envelope.js";
|
|
7
36
|
export { ContinuationAdapterTimeoutError, MAX_CONTINUATION_ADAPTER_EVIDENCE_BYTES, MAX_CONTINUATION_TURN_RESULT_BYTES, createFileContinuationStore, driveBuilderFlowSession, runContinuationDriver, withContinuationDriverLock, } from "./continuation-driver.js";
|
|
8
|
-
export type { ContinuationBarrier, ContinuationAcceptedTurn, ContinuationDriverEvent, ContinuationDriverLockLease, ContinuationDriverOutcome, ContinuationDriverState, ContinuationRuntimePort, ContinuationSnapshot, ContinuationStateStore, ContinuationTurnAuthority, ContinuationTurnContext, ContinuationTurnRequest, ContinuationTurnResult, DriveBuilderFlowSessionInput, RunContinuationDriverInput, } from "./continuation-driver.js";
|
|
37
|
+
export type { ContinuationBarrier, ContinuationContextPolicy, ContinuationContextStrategy, ContinuationAcceptedTurn, ContinuationDriverEvent, ContinuationDriverLockLease, ContinuationDriverOutcome, ContinuationDriverState, ContinuationRuntimePort, ContinuationSnapshot, ContinuationStateStore, ContinuationTurnAuthority, ContinuationTurnContext, ContinuationTurnRequest, ContinuationTurnResult, DriveBuilderFlowSessionInput, RunContinuationDriverInput, } from "./continuation-driver.js";
|
|
9
38
|
export { builderLifecycleAuthorizationPayload, loadBuilderLifecycleAuthorization } from "./builder-lifecycle-authority.js";
|
|
10
39
|
export type { BuilderLifecycleAuthorization } from "./builder-lifecycle-authority.js";
|
|
40
|
+
export { CAPABILITIES, RUNTIME_ADAPTER_IDS, RUNTIME_CAPABILITY_DECLARATIONS, RUNTIME_ID_ALIASES, getDeclaration, normalizeRuntimeId, queryCapability, } from "./lib/capability-declarations.js";
|
|
41
|
+
export type { Capability, CapabilityStatus, RuntimeAdapterId, RuntimeCapabilityDeclaration, } from "./lib/capability-declarations.js";
|
|
11
42
|
export { defaultArtifactRootForRead, defaultCodexHome, defaultTelemetryDirForRead, defaultTelemetryDirsForRead, durableFlowAgentsRoot, durableInstallRecordPath, DURABLE_FLOW_AGENTS_DIR, FLOW_AGENTS_RUNTIME_DIR, FLOW_AGENTS_RUNTIME_SUBDIR, firstExistingPath, flowAgentsArtifactRoot, KONTOURAI_DIR, legacyTelemetryDataDir, LEGACY_TELEMETRY_DIR, telemetryDataDir, } from "./lib/local-artifact-root.js";
|
|
12
43
|
export { validateTrustBundle, normalizeCheck, normalizeFinding, normalizeLearning, normalizeEvidenceRefs, validateEvidenceRef, validateLearningCorrection, loadJson, writeJson, appendJsonl, sidecarBase, writeState, statuses, phases, checkKinds, checkStatuses, verdicts, } from "./cli/workflow-sidecar.js";
|
|
13
44
|
/** Read a sidecar JSON file from a workflow artifact directory; returns `{}` if absent. */
|
package/build/src/index.js
CHANGED
|
@@ -13,6 +13,29 @@
|
|
|
13
13
|
*/
|
|
14
14
|
import * as path from "node:path";
|
|
15
15
|
import { loadJson as _loadJson, writeJson as _writeJson } from "./cli/workflow-sidecar.js";
|
|
16
|
+
export { NARRATIVE_SOURCE_ID_VERSION, SourceIdParseError, compareSourceIds, formatSourceId, parseSourceId, } from "./narrative/source-ids.js";
|
|
17
|
+
export { DEFAULT_INTEGRITY_CLASS, KNOWN_CAPTURE_GAPS, buildCaptureCompleteness, integrityClassForSource, } from "./narrative/integrity.js";
|
|
18
|
+
export { TELEMETRY_CHANNEL_ANALYTICS_REDACT_DEFAULT, TELEMETRY_CHANNEL_FULL_REDACT_DEFAULT, effectiveNarrativeRedactionFields, filterNarrativeRecord, } from "./narrative/policy-filter.js";
|
|
19
|
+
export { snapshotNarrative, validateNarrativeSourceManifest } from "./narrative/snapshot.js";
|
|
20
|
+
export { resolveManifestEntry, resolveSource, verifyManifest } from "./narrative/resolver.js";
|
|
21
|
+
export { NARRATIVE_RUNTIME_PROJECTION_SCHEMA_VERSION, NARRATIVE_RUNTIME_PROJECTOR, NarrativeProjectionError, projectRuntimeNarrative, stableStringify, validateNarrativeRuntimeProjection, } from "./narrative/projection.js";
|
|
22
|
+
export { GROUNDED_EXECUTION_NARRATIVE_COMPILER_NAME, GROUNDED_EXECUTION_NARRATIVE_SCHEMA_VERSION, GroundedNarrativeError, composeGroundedNarrative, validateGroundedNarrative, writeEnvelope, } from "./narrative/envelope.js";
|
|
23
|
+
export { renderGroundedNarrative } from "./narrative/render.js";
|
|
24
|
+
export { QUARANTINE_SESSION_ID, TURN_SPINE_RULE_ID, buildTurnSpine } from "./narrative/turn-spine.js";
|
|
25
|
+
export { AGENT_STATED_ACTOR_MAX_LENGTH, AGENT_STATED_PURPOSE_MAX_LENGTH, NarrativeStatementError, agentStatedIntent, derivedNoOpTurn, derivedRetry, derivedTimeout, derivedUnavailableSource, observedCommand, observedDelegation, observedFileCreation, observedToolAction, summarizerInferredConnective, workflowDerivedPurpose, } from "./narrative/statements.js";
|
|
26
|
+
// #622: bounded, capability-declared at-action stated-intent capture + the
|
|
27
|
+
// annotation-on/off A/B measurement with uncertainty.
|
|
28
|
+
export { INTENT_ANNOTATION_FILE, INTENT_ANNOTATION_SCHEMA_VERSION, bindIntentAnnotation, captureIntent, } from "./narrative/intent.js";
|
|
29
|
+
export { INTENT_ECONOMICS_FILE, appendIntentEconomics, readIntentEconomics, reduceIntentEconomics, } from "./narrative/intent-economics.js";
|
|
30
|
+
export { entailmentIndependenceHolds, isAssertionProhibited, materialEventCoverage, NarrativeGroundingError, validateNarrativeGrounding, } from "./narrative/grounding-validator.js";
|
|
31
|
+
// #612: consolidated grounded-narrative eval-result schema + ajv-free validator.
|
|
32
|
+
// The shared, versioned package (corpus.json + this result schema) consumed by
|
|
33
|
+
// kontourai/evals#95 unmodified (R6/AC6).
|
|
34
|
+
export { NARRATIVE_EVAL_RESULT_SCHEMA_VERSION, validateNarrativeEvalResult, } from "./narrative/eval-result.js";
|
|
35
|
+
// #614: model-assisted prose renderer (display-only, fail-closed). Lives outside
|
|
36
|
+
// src/narrative/ (I/O, provider gating, timeout orchestration; see narrative-render.ts's
|
|
37
|
+
// header comment) but is exported here alongside the pure narrative primitives it composes.
|
|
38
|
+
export { GeneratorTimeoutError, PROSE_ECONOMICS_FILE, PROSE_PROMPT_VERSION, ProviderNotAllowedError, hostedModelGenerator, localModelGenerator, providerAllowed, renderProse, stubGenerator, } from "./cli/narrative-render.js";
|
|
16
39
|
export { BUILDER_BUILD_FLOW_ID, BUILDER_BUILD_FLOW_RELATIVE_PATH, BuilderBuildRunInputError, BuilderBuildRunIdentityError, evaluateBuilderBuildRun, loadBuilderBuildRun, resolveBuilderBuildFlowDefinitionPath, startBuilderBuildRun, } from "./builder-flow-run-adapter.js";
|
|
17
40
|
export { archiveBuilderFlowSession, cancelBuilderFlowSession, pauseBuilderFlowSession, recoverBuilderFlowSession, releaseBuilderFlowAssignment, resumeBuilderFlowSession, startBuilderFlowSession, syncBuilderFlowSession, } from "./builder-flow-runtime.js";
|
|
18
41
|
export { deriveBuilderGateActionEnvelope, gateActionProgressSnapshot, withGateActionPriorProgress, } from "./builder-gate-action-envelope.js";
|
|
@@ -20,6 +43,7 @@ export { ContinuationAdapterTimeoutError, MAX_CONTINUATION_ADAPTER_EVIDENCE_BYTE
|
|
|
20
43
|
// Pure serialization contract used by external lifecycle authorities when
|
|
21
44
|
// signing requests. This does not load, create, or mutate a Flow run.
|
|
22
45
|
export { builderLifecycleAuthorizationPayload, loadBuilderLifecycleAuthorization } from "./builder-lifecycle-authority.js";
|
|
46
|
+
export { CAPABILITIES, RUNTIME_ADAPTER_IDS, RUNTIME_CAPABILITY_DECLARATIONS, RUNTIME_ID_ALIASES, getDeclaration, normalizeRuntimeId, queryCapability, } from "./lib/capability-declarations.js";
|
|
23
47
|
export { defaultArtifactRootForRead, defaultCodexHome, defaultTelemetryDirForRead, defaultTelemetryDirsForRead, durableFlowAgentsRoot, durableInstallRecordPath, DURABLE_FLOW_AGENTS_DIR, FLOW_AGENTS_RUNTIME_DIR, FLOW_AGENTS_RUNTIME_SUBDIR, firstExistingPath, flowAgentsArtifactRoot, KONTOURAI_DIR, legacyTelemetryDataDir, LEGACY_TELEMETRY_DIR, telemetryDataDir, } from "./lib/local-artifact-root.js";
|
|
24
48
|
export {
|
|
25
49
|
// Trust-bundle (Hachure) validation — the same validator the writer uses.
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Programmatic runtime capability declarations (#620).
|
|
3
|
+
*
|
|
4
|
+
* The single source of truth for "which agent-runtime telemetry capability does
|
|
5
|
+
* each shipped adapter expose". This replaces the hand-maintained coverage table
|
|
6
|
+
* in docs/specs/harness-capability-matrix.md and the hardcoded emitter `signals`
|
|
7
|
+
* literals: the matrix doc is GENERATED from this module (src/tools/
|
|
8
|
+
* generate-capability-matrix.ts) and the economics-record emitter derives its
|
|
9
|
+
* per_delegation_tokens signal from a build-only JSON projection of it.
|
|
10
|
+
*
|
|
11
|
+
* This module is the declaration/query MECHANISM only (issue #620). It does NOT
|
|
12
|
+
* measure declaration-vs-runtime reality (a NON-GOAL), and it does NOT implement
|
|
13
|
+
* the capabilities themselves (intent capture #622, trace propagation #425) — it
|
|
14
|
+
* declares whether each runtime exposes them so consumers can distinguish a real
|
|
15
|
+
* zero from a harness-blind gap, and returns a TYPED `unsupported` for an
|
|
16
|
+
* undeclared runtime or capability rather than a fabricated default.
|
|
17
|
+
*
|
|
18
|
+
* PURE: no fs / net / process imports. Safe to import from hooks, compilers,
|
|
19
|
+
* evals, and generators alike.
|
|
20
|
+
*
|
|
21
|
+
* @module
|
|
22
|
+
*/
|
|
23
|
+
/** The six declared per-runtime capabilities (R1/#620). */
|
|
24
|
+
export declare const CAPABILITIES: readonly ["turn_id", "transcript_path", "intent_annotation", "per_delegation_trace_context", "per_delegation_tokens", "terminal_verdict"];
|
|
25
|
+
export type Capability = (typeof CAPABILITIES)[number];
|
|
26
|
+
/**
|
|
27
|
+
* The seven shipped adapters (R1). The first five are agent runtimes; the last
|
|
28
|
+
* two (codex-local, strands-local) are kit-ACTIVATION adapters on a different
|
|
29
|
+
* axis from agent-runtime telemetry — they declare their agent-runtime telemetry
|
|
30
|
+
* capabilities honestly (mostly `unsupported`), satisfying R1 literally without
|
|
31
|
+
* fabricating support they do not have.
|
|
32
|
+
*/
|
|
33
|
+
export declare const RUNTIME_ADAPTER_IDS: readonly ["claude-code", "codex", "kiro", "opencode", "pi", "codex-local", "strands-local"];
|
|
34
|
+
export type RuntimeAdapterId = (typeof RUNTIME_ADAPTER_IDS)[number];
|
|
35
|
+
/**
|
|
36
|
+
* Per-capability status as a discriminated union (D3). Richer than a bare
|
|
37
|
+
* boolean: `partial` carries a `note`, `unsupported` carries a `reason`, so R4's
|
|
38
|
+
* explicit `unsupported` sentinel always travels with a justification and a
|
|
39
|
+
* consumer never has to invent one.
|
|
40
|
+
*/
|
|
41
|
+
export type CapabilityStatus = {
|
|
42
|
+
readonly status: "supported";
|
|
43
|
+
} | {
|
|
44
|
+
readonly status: "partial";
|
|
45
|
+
readonly note: string;
|
|
46
|
+
} | {
|
|
47
|
+
readonly status: "unsupported";
|
|
48
|
+
readonly reason: string;
|
|
49
|
+
};
|
|
50
|
+
/** A runtime's full declaration: the canonical id + all six capability statuses. */
|
|
51
|
+
export interface RuntimeCapabilityDeclaration {
|
|
52
|
+
readonly runtime: RuntimeAdapterId;
|
|
53
|
+
readonly capabilities: Readonly<Record<Capability, CapabilityStatus>>;
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* The canonical declaration data — the single source of truth. Every adapter
|
|
57
|
+
* declares ALL six capabilities explicitly (conformance-enforced; no defaulting).
|
|
58
|
+
*/
|
|
59
|
+
export declare const RUNTIME_CAPABILITY_DECLARATIONS: Readonly<Record<RuntimeAdapterId, RuntimeCapabilityDeclaration>>;
|
|
60
|
+
/**
|
|
61
|
+
* Alias → canonical-runtime-id map (D1). The load-bearing entry is
|
|
62
|
+
* `kiro-cli → kiro`: the value `.agent.runtime` carries for Kiro is `kiro-cli`,
|
|
63
|
+
* but declarations are keyed on the canonical `kiro`. Keys are the already
|
|
64
|
+
* lowercased + whitespace-collapsed form.
|
|
65
|
+
*/
|
|
66
|
+
export declare const RUNTIME_ID_ALIASES: Readonly<Record<string, string>>;
|
|
67
|
+
/**
|
|
68
|
+
* Normalize any raw runtime spelling to its canonical key (D1). Total + pure:
|
|
69
|
+
* trims, lowercases, collapses internal whitespace to hyphens, then folds known
|
|
70
|
+
* aliases (notably `kiro-cli → kiro`). Returns `""` for a null/blank input.
|
|
71
|
+
* The canonical id may still be undeclared (e.g. `base`) — that is intentional
|
|
72
|
+
* and resolves to a typed `unsupported` at query time, never a fabricated value.
|
|
73
|
+
*/
|
|
74
|
+
export declare function normalizeRuntimeId(raw: string | null | undefined): string;
|
|
75
|
+
/** Return the full declaration for a runtime (after alias normalization), or `undefined`. */
|
|
76
|
+
export declare function getDeclaration(runtimeId: string | null | undefined): RuntimeCapabilityDeclaration | undefined;
|
|
77
|
+
/**
|
|
78
|
+
* Query a single capability for a runtime (D5). ALWAYS returns a typed
|
|
79
|
+
* `CapabilityStatus` — never `undefined`/`false`. An undeclared runtime OR an
|
|
80
|
+
* undeclared capability returns `{status:"unsupported", reason}` (R4): the
|
|
81
|
+
* JS-natural undefined/false fallback is exactly the fabrication R4 forbids.
|
|
82
|
+
*/
|
|
83
|
+
export declare function queryCapability(runtimeId: string | null | undefined, capability: string): CapabilityStatus;
|
|
@@ -0,0 +1,209 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Programmatic runtime capability declarations (#620).
|
|
3
|
+
*
|
|
4
|
+
* The single source of truth for "which agent-runtime telemetry capability does
|
|
5
|
+
* each shipped adapter expose". This replaces the hand-maintained coverage table
|
|
6
|
+
* in docs/specs/harness-capability-matrix.md and the hardcoded emitter `signals`
|
|
7
|
+
* literals: the matrix doc is GENERATED from this module (src/tools/
|
|
8
|
+
* generate-capability-matrix.ts) and the economics-record emitter derives its
|
|
9
|
+
* per_delegation_tokens signal from a build-only JSON projection of it.
|
|
10
|
+
*
|
|
11
|
+
* This module is the declaration/query MECHANISM only (issue #620). It does NOT
|
|
12
|
+
* measure declaration-vs-runtime reality (a NON-GOAL), and it does NOT implement
|
|
13
|
+
* the capabilities themselves (intent capture #622, trace propagation #425) — it
|
|
14
|
+
* declares whether each runtime exposes them so consumers can distinguish a real
|
|
15
|
+
* zero from a harness-blind gap, and returns a TYPED `unsupported` for an
|
|
16
|
+
* undeclared runtime or capability rather than a fabricated default.
|
|
17
|
+
*
|
|
18
|
+
* PURE: no fs / net / process imports. Safe to import from hooks, compilers,
|
|
19
|
+
* evals, and generators alike.
|
|
20
|
+
*
|
|
21
|
+
* @module
|
|
22
|
+
*/
|
|
23
|
+
/** The six declared per-runtime capabilities (R1/#620). */
|
|
24
|
+
export const CAPABILITIES = [
|
|
25
|
+
"turn_id",
|
|
26
|
+
"transcript_path",
|
|
27
|
+
"intent_annotation",
|
|
28
|
+
"per_delegation_trace_context",
|
|
29
|
+
"per_delegation_tokens",
|
|
30
|
+
"terminal_verdict",
|
|
31
|
+
];
|
|
32
|
+
/**
|
|
33
|
+
* The seven shipped adapters (R1). The first five are agent runtimes; the last
|
|
34
|
+
* two (codex-local, strands-local) are kit-ACTIVATION adapters on a different
|
|
35
|
+
* axis from agent-runtime telemetry — they declare their agent-runtime telemetry
|
|
36
|
+
* capabilities honestly (mostly `unsupported`), satisfying R1 literally without
|
|
37
|
+
* fabricating support they do not have.
|
|
38
|
+
*/
|
|
39
|
+
export const RUNTIME_ADAPTER_IDS = [
|
|
40
|
+
"claude-code",
|
|
41
|
+
"codex",
|
|
42
|
+
"kiro",
|
|
43
|
+
"opencode",
|
|
44
|
+
"pi",
|
|
45
|
+
"codex-local",
|
|
46
|
+
"strands-local",
|
|
47
|
+
];
|
|
48
|
+
// --- status constructors (local, keep the declaration table terse + honest) ---
|
|
49
|
+
const supported = () => ({ status: "supported" });
|
|
50
|
+
const partial = (note) => ({ status: "partial", note });
|
|
51
|
+
const unsupported = (reason) => ({ status: "unsupported", reason });
|
|
52
|
+
// Reasons shared across every adapter for the three capabilities that no runtime
|
|
53
|
+
// exposes today (kept single-sourced so the declarations stay consistent).
|
|
54
|
+
const NOT_IMPLEMENTED_INTENT = unsupported("Intent-annotation capture is not implemented on any runtime yet (#622).");
|
|
55
|
+
const NOT_IMPLEMENTED_TRACE = unsupported("Per-delegation trace-context propagation is not implemented on any runtime yet (#425).");
|
|
56
|
+
const NO_PER_DELEGATION_TOKENS = unsupported("No runtime isolates per-sub-agent token usage; per-delegation cost is attributed at (role, model) granularity instead.");
|
|
57
|
+
const VERDICT_WORKFLOW_PARTIAL = partial("Captured only when the workflow records an evidence/verdict event for the sub-agent — not guaranteed every run.");
|
|
58
|
+
const KIT_ADAPTER_TURN = (adapter) => unsupported(`${adapter} is a kit-activation adapter, not an agent-runtime telemetry source; it emits no per-turn agent-runtime telemetry.`);
|
|
59
|
+
const KIT_ADAPTER_TRANSCRIPT = (adapter) => unsupported(`${adapter} is a kit-activation adapter and does not expose a per-session transcript path.`);
|
|
60
|
+
const KIT_ADAPTER_VERDICT = (adapter) => unsupported(`${adapter} is a kit-activation adapter and does not surface per-sub-agent terminal verdicts.`);
|
|
61
|
+
/**
|
|
62
|
+
* The canonical declaration data — the single source of truth. Every adapter
|
|
63
|
+
* declares ALL six capabilities explicitly (conformance-enforced; no defaulting).
|
|
64
|
+
*/
|
|
65
|
+
export const RUNTIME_CAPABILITY_DECLARATIONS = {
|
|
66
|
+
"claude-code": {
|
|
67
|
+
runtime: "claude-code",
|
|
68
|
+
capabilities: {
|
|
69
|
+
turn_id: supported(),
|
|
70
|
+
transcript_path: supported(),
|
|
71
|
+
intent_annotation: NOT_IMPLEMENTED_INTENT,
|
|
72
|
+
per_delegation_trace_context: NOT_IMPLEMENTED_TRACE,
|
|
73
|
+
per_delegation_tokens: NO_PER_DELEGATION_TOKENS,
|
|
74
|
+
terminal_verdict: VERDICT_WORKFLOW_PARTIAL,
|
|
75
|
+
},
|
|
76
|
+
},
|
|
77
|
+
codex: {
|
|
78
|
+
runtime: "codex",
|
|
79
|
+
capabilities: {
|
|
80
|
+
turn_id: supported(),
|
|
81
|
+
transcript_path: supported(),
|
|
82
|
+
intent_annotation: NOT_IMPLEMENTED_INTENT,
|
|
83
|
+
per_delegation_trace_context: NOT_IMPLEMENTED_TRACE,
|
|
84
|
+
per_delegation_tokens: NO_PER_DELEGATION_TOKENS,
|
|
85
|
+
terminal_verdict: unsupported("Codex does not surface a per-sub-agent terminal verdict to the orchestrator."),
|
|
86
|
+
},
|
|
87
|
+
},
|
|
88
|
+
kiro: {
|
|
89
|
+
runtime: "kiro",
|
|
90
|
+
capabilities: {
|
|
91
|
+
turn_id: supported(),
|
|
92
|
+
transcript_path: supported(),
|
|
93
|
+
intent_annotation: NOT_IMPLEMENTED_INTENT,
|
|
94
|
+
per_delegation_trace_context: NOT_IMPLEMENTED_TRACE,
|
|
95
|
+
per_delegation_tokens: NO_PER_DELEGATION_TOKENS,
|
|
96
|
+
terminal_verdict: VERDICT_WORKFLOW_PARTIAL,
|
|
97
|
+
},
|
|
98
|
+
},
|
|
99
|
+
opencode: {
|
|
100
|
+
runtime: "opencode",
|
|
101
|
+
capabilities: {
|
|
102
|
+
turn_id: partial("session.start telemetry is unavailable in opencode run (non-interactive) mode; tool events still carry a turn context."),
|
|
103
|
+
transcript_path: unsupported("opencode does not expose a per-session transcript path to hooks."),
|
|
104
|
+
intent_annotation: NOT_IMPLEMENTED_INTENT,
|
|
105
|
+
per_delegation_trace_context: NOT_IMPLEMENTED_TRACE,
|
|
106
|
+
per_delegation_tokens: NO_PER_DELEGATION_TOKENS,
|
|
107
|
+
terminal_verdict: unsupported("opencode does not surface per-sub-agent terminal verdicts."),
|
|
108
|
+
},
|
|
109
|
+
},
|
|
110
|
+
pi: {
|
|
111
|
+
runtime: "pi",
|
|
112
|
+
capabilities: {
|
|
113
|
+
turn_id: supported(),
|
|
114
|
+
transcript_path: unsupported("pi does not expose a per-session transcript path to hooks."),
|
|
115
|
+
intent_annotation: NOT_IMPLEMENTED_INTENT,
|
|
116
|
+
per_delegation_trace_context: NOT_IMPLEMENTED_TRACE,
|
|
117
|
+
per_delegation_tokens: NO_PER_DELEGATION_TOKENS,
|
|
118
|
+
terminal_verdict: unsupported("pi has no named-subagent registry, so per-sub-agent verdicts are not observable."),
|
|
119
|
+
},
|
|
120
|
+
},
|
|
121
|
+
"codex-local": {
|
|
122
|
+
runtime: "codex-local",
|
|
123
|
+
capabilities: {
|
|
124
|
+
turn_id: KIT_ADAPTER_TURN("codex-local"),
|
|
125
|
+
transcript_path: KIT_ADAPTER_TRANSCRIPT("codex-local"),
|
|
126
|
+
intent_annotation: NOT_IMPLEMENTED_INTENT,
|
|
127
|
+
per_delegation_trace_context: NOT_IMPLEMENTED_TRACE,
|
|
128
|
+
per_delegation_tokens: NO_PER_DELEGATION_TOKENS,
|
|
129
|
+
terminal_verdict: KIT_ADAPTER_VERDICT("codex-local"),
|
|
130
|
+
},
|
|
131
|
+
},
|
|
132
|
+
"strands-local": {
|
|
133
|
+
runtime: "strands-local",
|
|
134
|
+
capabilities: {
|
|
135
|
+
turn_id: KIT_ADAPTER_TURN("strands-local"),
|
|
136
|
+
transcript_path: KIT_ADAPTER_TRANSCRIPT("strands-local"),
|
|
137
|
+
intent_annotation: NOT_IMPLEMENTED_INTENT,
|
|
138
|
+
per_delegation_trace_context: NOT_IMPLEMENTED_TRACE,
|
|
139
|
+
per_delegation_tokens: NO_PER_DELEGATION_TOKENS,
|
|
140
|
+
terminal_verdict: KIT_ADAPTER_VERDICT("strands-local"),
|
|
141
|
+
},
|
|
142
|
+
},
|
|
143
|
+
};
|
|
144
|
+
/**
|
|
145
|
+
* Alias → canonical-runtime-id map (D1). The load-bearing entry is
|
|
146
|
+
* `kiro-cli → kiro`: the value `.agent.runtime` carries for Kiro is `kiro-cli`,
|
|
147
|
+
* but declarations are keyed on the canonical `kiro`. Keys are the already
|
|
148
|
+
* lowercased + whitespace-collapsed form.
|
|
149
|
+
*/
|
|
150
|
+
export const RUNTIME_ID_ALIASES = {
|
|
151
|
+
"kiro-cli": "kiro",
|
|
152
|
+
"raw-model": "base",
|
|
153
|
+
"raw-model-runner": "base",
|
|
154
|
+
};
|
|
155
|
+
/**
|
|
156
|
+
* Normalize any raw runtime spelling to its canonical key (D1). Total + pure:
|
|
157
|
+
* trims, lowercases, collapses internal whitespace to hyphens, then folds known
|
|
158
|
+
* aliases (notably `kiro-cli → kiro`). Returns `""` for a null/blank input.
|
|
159
|
+
* The canonical id may still be undeclared (e.g. `base`) — that is intentional
|
|
160
|
+
* and resolves to a typed `unsupported` at query time, never a fabricated value.
|
|
161
|
+
*/
|
|
162
|
+
export function normalizeRuntimeId(raw) {
|
|
163
|
+
const lowered = String(raw ?? "").trim().toLowerCase();
|
|
164
|
+
if (!lowered)
|
|
165
|
+
return "";
|
|
166
|
+
const collapsed = lowered.replace(/\s+/g, "-");
|
|
167
|
+
// Object.hasOwn guards against prototype-member keys (`__proto__`,
|
|
168
|
+
// `constructor`, `toString`, …): a bare bracket lookup would resolve those to
|
|
169
|
+
// inherited Object.prototype members instead of `undefined`, breaking the
|
|
170
|
+
// total-string contract. Own-property only; unknown keys fall through.
|
|
171
|
+
return Object.hasOwn(RUNTIME_ID_ALIASES, collapsed) ? RUNTIME_ID_ALIASES[collapsed] : collapsed;
|
|
172
|
+
}
|
|
173
|
+
/** Return the full declaration for a runtime (after alias normalization), or `undefined`. */
|
|
174
|
+
export function getDeclaration(runtimeId) {
|
|
175
|
+
const canonical = normalizeRuntimeId(runtimeId);
|
|
176
|
+
return Object.hasOwn(RUNTIME_CAPABILITY_DECLARATIONS, canonical)
|
|
177
|
+
? RUNTIME_CAPABILITY_DECLARATIONS[canonical]
|
|
178
|
+
: undefined;
|
|
179
|
+
}
|
|
180
|
+
/**
|
|
181
|
+
* Query a single capability for a runtime (D5). ALWAYS returns a typed
|
|
182
|
+
* `CapabilityStatus` — never `undefined`/`false`. An undeclared runtime OR an
|
|
183
|
+
* undeclared capability returns `{status:"unsupported", reason}` (R4): the
|
|
184
|
+
* JS-natural undefined/false fallback is exactly the fabrication R4 forbids.
|
|
185
|
+
*/
|
|
186
|
+
export function queryCapability(runtimeId, capability) {
|
|
187
|
+
const canonical = normalizeRuntimeId(runtimeId);
|
|
188
|
+
const declaration = getDeclaration(canonical);
|
|
189
|
+
if (!declaration) {
|
|
190
|
+
return {
|
|
191
|
+
status: "unsupported",
|
|
192
|
+
reason: `No capability declaration for runtime '${canonical || String(runtimeId ?? "")}'.`,
|
|
193
|
+
};
|
|
194
|
+
}
|
|
195
|
+
// Own-property guard: a prototype-member capability name (`constructor`,
|
|
196
|
+
// `__proto__`, …) must resolve to a typed `unsupported`, not an inherited
|
|
197
|
+
// Object.prototype value (a function / the prototype object) that is not a
|
|
198
|
+
// CapabilityStatus at all.
|
|
199
|
+
const status = Object.hasOwn(declaration.capabilities, capability)
|
|
200
|
+
? declaration.capabilities[capability]
|
|
201
|
+
: undefined;
|
|
202
|
+
if (!status) {
|
|
203
|
+
return {
|
|
204
|
+
status: "unsupported",
|
|
205
|
+
reason: `Capability '${capability}' is not declared for runtime '${canonical}'.`,
|
|
206
|
+
};
|
|
207
|
+
}
|
|
208
|
+
return status;
|
|
209
|
+
}
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import type { CaptureCompleteness, UnavailableReason } from "./integrity.js";
|
|
2
|
+
import { type NarrativeRuntimeProjection } from "./projection.js";
|
|
3
|
+
export declare const GROUNDED_EXECUTION_NARRATIVE_SCHEMA_VERSION: "grounded-execution-narrative/v1";
|
|
4
|
+
export declare const GROUNDED_EXECUTION_NARRATIVE_COMPILER_NAME: "flow-agents-narrative-composer";
|
|
5
|
+
export type GroundedNarrativeErrorCode = "manifest_invalid" | "source_integrity_failed" | "malformed_embedded_json" | "embedded_integrity_failed" | "schema_unavailable" | "compiler_unavailable";
|
|
6
|
+
export declare class GroundedNarrativeError extends Error {
|
|
7
|
+
readonly code: GroundedNarrativeErrorCode;
|
|
8
|
+
readonly sourceId?: string | undefined;
|
|
9
|
+
readonly name = "GroundedNarrativeError";
|
|
10
|
+
constructor(code: GroundedNarrativeErrorCode, message: string, sourceId?: string | undefined);
|
|
11
|
+
}
|
|
12
|
+
export interface GroundedNarrativeConfig {
|
|
13
|
+
compiledAt: string;
|
|
14
|
+
renderTitle?: string;
|
|
15
|
+
}
|
|
16
|
+
export interface GroundedNarrativeRule {
|
|
17
|
+
id: "flow-turn-correlation/v1";
|
|
18
|
+
version: "v1";
|
|
19
|
+
inputs: string[];
|
|
20
|
+
}
|
|
21
|
+
export interface GroundedNarrativeFlowTransition {
|
|
22
|
+
kind: "flow-transition";
|
|
23
|
+
from: string;
|
|
24
|
+
to: string;
|
|
25
|
+
at?: string;
|
|
26
|
+
source_refs: [string];
|
|
27
|
+
rule: GroundedNarrativeRule;
|
|
28
|
+
}
|
|
29
|
+
export interface GroundedNarrativeCorrelation {
|
|
30
|
+
turns: Array<{
|
|
31
|
+
turn_ordinal: number;
|
|
32
|
+
placed: GroundedNarrativeFlowTransition[];
|
|
33
|
+
}>;
|
|
34
|
+
unplaced: Array<GroundedNarrativeFlowTransition & {
|
|
35
|
+
reason: "ambiguous_window" | "no_timestamp" | "no_timezone" | "no_turns";
|
|
36
|
+
}>;
|
|
37
|
+
}
|
|
38
|
+
export type GroundedNarrativeConclusion = {
|
|
39
|
+
proposition: string;
|
|
40
|
+
grounding: {
|
|
41
|
+
kind: "flow_gate_derivation";
|
|
42
|
+
source_ref: string;
|
|
43
|
+
pointer: string;
|
|
44
|
+
};
|
|
45
|
+
} | {
|
|
46
|
+
proposition: string;
|
|
47
|
+
grounding: {
|
|
48
|
+
kind: "surface_explanation";
|
|
49
|
+
source_ref: string;
|
|
50
|
+
};
|
|
51
|
+
};
|
|
52
|
+
export interface GroundedNarrativeForeignSection {
|
|
53
|
+
authority: "flow" | "surface";
|
|
54
|
+
kind: "flow-process-projection" | "claim-explanation";
|
|
55
|
+
source_refs: [string];
|
|
56
|
+
sha256: string;
|
|
57
|
+
embedded_bytes: string;
|
|
58
|
+
}
|
|
59
|
+
export interface GroundedNarrativeRuntimeSection {
|
|
60
|
+
authority: "flow-agents";
|
|
61
|
+
kind: "runtime-projection";
|
|
62
|
+
sha256: string;
|
|
63
|
+
embedded: NarrativeRuntimeProjection;
|
|
64
|
+
}
|
|
65
|
+
export type GroundedNarrativeSection = GroundedNarrativeForeignSection | GroundedNarrativeRuntimeSection;
|
|
66
|
+
export interface GroundedExecutionNarrative {
|
|
67
|
+
schema_version: typeof GROUNDED_EXECUTION_NARRATIVE_SCHEMA_VERSION;
|
|
68
|
+
narrative_id: string;
|
|
69
|
+
provenance: {
|
|
70
|
+
compiler: {
|
|
71
|
+
name: typeof GROUNDED_EXECUTION_NARRATIVE_COMPILER_NAME;
|
|
72
|
+
version: string;
|
|
73
|
+
};
|
|
74
|
+
compiled_at: string;
|
|
75
|
+
manifest_sha256: string;
|
|
76
|
+
schema_sha256: string;
|
|
77
|
+
config_sha256: string;
|
|
78
|
+
compiler_sha256: string;
|
|
79
|
+
};
|
|
80
|
+
capture_completeness: CaptureCompleteness;
|
|
81
|
+
sections: GroundedNarrativeSection[];
|
|
82
|
+
correlation: GroundedNarrativeCorrelation;
|
|
83
|
+
conclusions: GroundedNarrativeConclusion[];
|
|
84
|
+
coverage: {
|
|
85
|
+
sources: number;
|
|
86
|
+
embedded: number;
|
|
87
|
+
unavailable: number;
|
|
88
|
+
};
|
|
89
|
+
unavailable_sources: Array<{
|
|
90
|
+
source_ref: string;
|
|
91
|
+
reason: UnavailableReason;
|
|
92
|
+
}>;
|
|
93
|
+
}
|
|
94
|
+
export interface WrittenGroundedNarrative {
|
|
95
|
+
envelopePath: string;
|
|
96
|
+
lineagePath: string;
|
|
97
|
+
envelopeSha256: string;
|
|
98
|
+
renderPath?: string;
|
|
99
|
+
}
|
|
100
|
+
export interface WriteEnvelopeOptions {
|
|
101
|
+
render?: boolean;
|
|
102
|
+
outDir?: string;
|
|
103
|
+
}
|
|
104
|
+
export type SchemaIssue = {
|
|
105
|
+
path: string;
|
|
106
|
+
message: string;
|
|
107
|
+
};
|
|
108
|
+
export declare function validateGroundedNarrative(value: unknown): SchemaIssue[];
|
|
109
|
+
/** Compile exclusively from the frozen manifest and its content-addressed blobs. */
|
|
110
|
+
export declare function composeGroundedNarrative(narrativeDir: string, config: GroundedNarrativeConfig): GroundedExecutionNarrative;
|
|
111
|
+
export declare function writeEnvelope(narrativeDir: string, envelope: GroundedExecutionNarrative, options?: WriteEnvelopeOptions): WrittenGroundedNarrative;
|