@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
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
---
|
|
2
|
+
status: current
|
|
3
|
+
subject: Writer-observed execution
|
|
4
|
+
decided: 2026-07-14
|
|
5
|
+
evidence:
|
|
6
|
+
- kind: issue
|
|
7
|
+
ref: "634"
|
|
8
|
+
- kind: adr
|
|
9
|
+
ref: docs/adr/0017-anti-gaming-trust-security-model.md
|
|
10
|
+
- kind: adr
|
|
11
|
+
ref: docs/adr/0020-trust-reconcile-manifest-and-claim-classification.md
|
|
12
|
+
---
|
|
13
|
+
# Writer-observed execution
|
|
14
|
+
|
|
15
|
+
**Decision.** When `record-gate-claim` executes a declared evidence command itself
|
|
16
|
+
(`runObservedCommand` — a real process it spawned, with a real exit code, output hash, and,
|
|
17
|
+
for tests, a `local-process-exit` execution proof), it appends that observation to the same
|
|
18
|
+
hash-chained `command-log.jsonl` the PostToolUse capture hook writes, under the same
|
|
19
|
+
lockfile protocol, visibly attributed via `source: "canonical-writer-execution"`. The
|
|
20
|
+
capture fold's precedence is **outcome-ranked, source-blind**: observed fail > observed
|
|
21
|
+
pass > ambiguous, with the exit code always traveling with the winning status. The
|
|
22
|
+
properties that matter follow: a writer pass can lift ambiguity but can never bury an
|
|
23
|
+
independently captured failure (fail is sticky from either source), and a writer-observed
|
|
24
|
+
failure likewise defeats any pass. Passes from the two sources rank equally — the
|
|
25
|
+
distinction between them lives in the permanent `source` attribution, not in the fold. The chain
|
|
26
|
+
fork classifier tolerates shared-parent siblings only when every sibling's source is
|
|
27
|
+
`postToolUse-capture` or `canonical-writer-execution`; any other source on a shared parent
|
|
28
|
+
remains tamper.
|
|
29
|
+
|
|
30
|
+
**Context.** ADR 0017/0020 make the independent capture log the truth source for command
|
|
31
|
+
outcomes, and #470 hardened capture to never record `pass` without positive evidence. On
|
|
32
|
+
hosts whose runtime hook payloads carry no exit code (Claude Code's PostToolUse
|
|
33
|
+
`tool_response` today), every captured entry is honestly `ambiguous` — and #634 showed the
|
|
34
|
+
consequence: `builder.verify.*` claims can never derive `verified`, while the sanctioned
|
|
35
|
+
accepted-gap waiver produces `assumed`, which no gate's `accepted_statuses` admits. The
|
|
36
|
+
verify gate was structurally unclosable on such hosts regardless of evidence quality.
|
|
37
|
+
|
|
38
|
+
**Why this preserves the anti-gaming posture.** A writer observation is not an inference or
|
|
39
|
+
a self-report of intent — it is the exit code of a process the canonical writer itself
|
|
40
|
+
spawned and waited on. It enters the record distinguishable forever (the `source` field),
|
|
41
|
+
tamper-evident (chain-hashed), serialized against the hook (shared lock), and subordinate
|
|
42
|
+
on conflict (an observed fail from either source wins). The waiver path is untouched:
|
|
43
|
+
accepted gaps remain disclosure that derives `assumed`, never gate satisfaction.
|
|
44
|
+
|
|
45
|
+
**Residual risk, accepted.** A compromised writer process could self-attest a pass the hook
|
|
46
|
+
never saw. Mitigations: the attribution is permanent and auditable; the chain makes
|
|
47
|
+
retroactive editing detectable; a hook-observed failure always prevails; and PR CI Trust
|
|
48
|
+
Reconcile re-executes manifest commands independently of any local observation. Follow-up
|
|
49
|
+
(#634 option c): when runtime harnesses surface exit codes in hook payloads, hook capture
|
|
50
|
+
naturally resumes confirming passes first-hand; writer observations then serve as
|
|
51
|
+
corroboration rather than the sole deterministic signal.
|
|
@@ -23,11 +23,15 @@ run `npm run validate:source --` and `npm run fixture:retirement-audit --`.
|
|
|
23
23
|
| `evals/fixtures/kit-conformance-levels` | K-level conformance and consumer-target derivation fixtures | `evals/integration/test_kit_conformance_levels.sh` | Keep while K-level derivation, degradation invariant, and consumer-target badge rules are tested. |
|
|
24
24
|
| `evals/fixtures/hook-influence` | hook influence behavioral cases | `evals/integration/test_hook_influence_cases.sh`, `evals/static/test_workflow_skills.sh`, `scripts/validate-hook-influence-cases.js` | Keep while hook influence cases define agent guidance behavior. |
|
|
25
25
|
| `evals/fixtures/learning-review-proposals` | learning-review kit/gate tuning proposal fixtures (#352): pattern-present (engineered cost-inflation + gate false-block-rate pattern, with sessions/ trust.bundle + gate-review.inquiries.json joins and a hand-computed expected-aggregates.json), balanced (proportional cost/findings movement -> zero proposals), under-threshold (below LR_MIN_WINDOW_SAMPLE), repeat-window (idempotency), and effect-follow-up (later-window effect-fill pass for a ratified proposal) | `evals/integration/test_learning_review_proposals.sh` | Keep while `scripts/telemetry/learning-review-proposals.sh`/`learning-review-decide.sh` (docs/specs/learning-review-proposals-contract.md) are enforced: hand-computed aggregates, evidence-cited proposals, zero-mutation, idempotency, and the ratify -> effect-fill trail. |
|
|
26
|
+
| `evals/fixtures/narrative-sources` | narrative source snapshot, offline resolution, integrity, completeness, fail-closed redaction, grounded runtime projection, grounded execution narrative, and trust-isolation fixtures (#613, #617, #618, #619) | `evals/integration/test_narrative_source_contract.sh`, `evals/integration/test_narrative_runtime_projection.sh`, `evals/integration/test_narrative_grounded_envelope.sh`, `evals/integration/test_narrative_redaction_failclosed.sh`, `evals/integration/test_narrative_trust_isolation.sh` | Keep while the narrative source manifest, content-addressed offline resolver, integrity verification, grounded runtime projection, grounded execution narrative composition, capture-completeness disclosure, lifecycle locality, fail-closed redaction, and narrative trust-isolation contracts are supported. |
|
|
27
|
+
| `evals/fixtures/narrative-grounding-validator` | narrative grounding validator adversarial fixtures (#623) | `evals/integration/test_narrative_grounding_validator.sh` | Keep while deterministic citation integrity, material-event coverage, epistemic-label integrity, and fail-closed narrative publication are enforced. |
|
|
28
|
+
| `evals/fixtures/narrative-prose-renderer` | model-assisted prose renderer adversarial fixtures (#614): provenance-subset (unsupported-summary), no-op-loop lack-of-progress wording, and prompt-injection fixtures reused from evals/fixtures/narrative-grounding-validator | `evals/integration/test_narrative_prose_renderer.sh` | Keep while the fail-closed prose renderer (D3 provenance-subset citation check, provider gating, economics-always, zero-prose-artifact-on-failure) is enforced. |
|
|
29
|
+
| `evals/fixtures/narrative-evals` | grounded narrative faithfulness eval corpus + result-schema package (#612): ten R1 case-class fixtures with frozen-manifest answer keys plus five R3 corruption fixtures whose named eval-check anchors are the scorer-teeth mutation targets | `evals/integration/test_narrative_evals.sh` | Keep while the versioned adversarial corpus, its frozen-manifest answer keys, the schema-valid narrative-eval-result output, the declared cross-runtime capability parity, and the R3 scorer-teeth mutation battery are enforced. |
|
|
26
30
|
| `evals/fixtures/pull-work-provider` | work item provider normalization fixtures | `evals/integration/test_pull_work_provider.sh` | Keep while provider normalization preserves blockers, artifact refs, board membership, and freshness metadata. |
|
|
27
31
|
| `evals/fixtures/pull-work-wip-shepherding` | WIP shepherding state fixtures | `evals/static/test_workflow_skills.sh` | Keep while pull-work documents personal versus global WIP behavior. |
|
|
28
32
|
| `evals/fixtures/reconcile-preflight` | #356 reconcile-preflight shape fixtures not already covered by trust-reconcile-exploits (un-superseded disputed critique, standalone disputed session-local claim) | `evals/integration/test_reconcile_preflight.sh` | Keep while the local `reconcile-preflight` subcommand (#356) is proven against the two shapes trust-reconcile-exploits does not already fixture (un-superseded disputed critique, standalone disputed session-local claim); the other four shapes reuse trust-reconcile-exploits/trust-reconcile-mixed-bundle directly rather than forking near-duplicates. |
|
|
29
33
|
| `evals/fixtures/surface-trust` | Surface trust evidence fixtures | `evals/integration/test_workflow_sidecar_writer.sh` | Keep while sidecar writer maps Surface trust evidence into workflow records. |
|
|
30
|
-
| `evals/fixtures/telemetry` | hermetic Stop-hook usage transcript fixture (#defect-2026-07 telemetry-usage-cost-extraction): a multi-model JSONL transcript with .message.model + .message.usage token blocks proving real token/cost/model extraction end-to-end; also reused by the #568 slice 1 per-tool-call usage-enrichment eval (test_telemetry_tool_usage.sh), which adds usage-transcript-oversized-prefix.jsonl to prove the bounded tail-read | `evals/integration/test_usage_cost.sh`, `evals/integration/test_telemetry_usage_pipeline.sh`, `evals/integration/test_telemetry_tool_usage.sh` | Keep while telemetry.sh's Stop-hook usage pipeline (usage_parse_transcript / usage_model_from_transcript_usage / usage_last_turn_usage) is proven against hermetic multi-model and oversized-prefix transcripts rather than relying on live runtime data. |
|
|
34
|
+
| `evals/fixtures/telemetry` | hermetic Stop-hook usage transcript fixture (#defect-2026-07 telemetry-usage-cost-extraction): a multi-model JSONL transcript with .message.model + .message.usage token blocks proving real token/cost/model extraction end-to-end; also reused by the #568 slice 1 per-tool-call usage-enrichment eval (test_telemetry_tool_usage.sh), which adds usage-transcript-oversized-prefix.jsonl to prove the bounded tail-read | `evals/integration/test_usage_cost.sh`, `evals/integration/test_telemetry_usage_pipeline.sh`, `evals/integration/test_telemetry_tool_usage.sh`, `evals/integration/test_telemetry_tool_outcome.sh` | Keep while telemetry.sh's Stop-hook usage pipeline (usage_parse_transcript / usage_model_from_transcript_usage / usage_last_turn_usage) is proven against hermetic multi-model and oversized-prefix transcripts rather than relying on live runtime data. |
|
|
31
35
|
| `evals/fixtures/trust-reconcile-exploits` | WS8 trust-reconcile anti-gaming exploit fixtures (frozen negative regressions); also reused by the #356 local reconcile-preflight eval (same shapes, no forked copies) | `evals/integration/test_trust_reconcile_negatives.sh`, `evals/integration/test_reconcile_preflight.sh` | Keep while trust-reconcile.js enforces the WS8 iteration-2 soundness properties (no-label test_output, unwaived-assumed, status-misassertion, waiver-on-command); each fixture is a permanent negative regression. |
|
|
32
36
|
| `evals/fixtures/trust-reconcile-mixed-bundle` | WS8 trust-reconcile mixed-evidence end-to-end proof fixture; also reused by the #356 reconcile-preflight eval as its CLEAN-BUNDLE (AC4) case | `evals/integration/test_trust_reconcile_mixed_bundle.sh`, `evals/integration/test_reconcile_preflight.sh` | Keep while the trust-reconcile manifest/classification/waiver contract (ADR 0020) is enforced; proves a mixed test_output + session-local + waived bundle passes the CI anchor. |
|
|
33
37
|
| `evals/fixtures/trust-reconcile-ws3` | WS8 AC6 backward-compat fixture: real ws3-kit-dependencies-namespacing old-style bundle | `evals/integration/test_trust_reconcile_negatives.sh` | Keep while backward compatibility with pre-classification (all-test_output) bundles is asserted; proves an old-style bundle still FAILS the same way (no silent pass). |
|
|
@@ -6,11 +6,26 @@ title: Migrations
|
|
|
6
6
|
|
|
7
7
|
## Unreleased
|
|
8
8
|
|
|
9
|
-
- Gate-action envelopes now use `schema_version: "
|
|
10
|
-
`
|
|
9
|
+
- Gate-action envelopes now use `schema_version: "3.0"`. `action.declared_artifacts`
|
|
10
|
+
and `stop_condition.required.artifact_refs` contain typed targets instead of
|
|
11
|
+
strings. A `file` target names its project-relative `path` and whether it is
|
|
12
|
+
directly writable or must be produced through a declared operation; a
|
|
13
|
+
`trust_slice` target is explicitly non-writable and names the public interface
|
|
14
|
+
that records it. `action.artifact_bindings` maps each typed target to the
|
|
15
|
+
gate expectation ids it satisfies, so consumers can derive the exact required
|
|
16
|
+
target set from unresolved required expectations without private kit metadata.
|
|
17
|
+
The bindings are product-owned gate semantics, not grader hints or
|
|
18
|
+
consumer-authored guidance. Empty expectation ownership on a file represents
|
|
19
|
+
a declared optional artifact that is never gate-required; trust slices must
|
|
20
|
+
own an expectation so their recording interface can be derived.
|
|
21
|
+
Structured evidence parameters reference the canonical
|
|
22
|
+
`public_interfaces.schemas.evidence_ref_json` JSON Schema. There is no legacy
|
|
23
|
+
envelope fallback; adapters must require version 3.0 and stop treating
|
|
24
|
+
`trust.bundle#<slice>` as a filesystem path.
|
|
25
|
+
- Gate-action envelope version 2.0 added the originating `gate_id` to each
|
|
26
|
+
`gate.requirements` entry, allowing consumers to
|
|
11
27
|
verify accepted exceptions without private Flow-definition knowledge. There
|
|
12
|
-
|
|
13
|
-
envelope must require version 2.0 and the new binding.
|
|
28
|
+
was no legacy version 1.0 fallback.
|
|
14
29
|
- Workflow runtime artifacts now live under `.kontourai/flow-agents/` instead
|
|
15
30
|
of earlier runtime roots such as `.flow-agents/` or `.agents/flow-agents/`.
|
|
16
31
|
Move any local session directories, sidecars, or `current.json` pointers you
|
|
@@ -165,12 +165,21 @@ consume another turn when `workflow drive` is invoked again:
|
|
|
165
165
|
flow_agents workflow drive \
|
|
166
166
|
--session-dir .kontourai/flow-agents/example \
|
|
167
167
|
--adapter-command-file .kontourai/flow-agents/runtime-adapter.json \
|
|
168
|
+
--context-policy fresh \
|
|
168
169
|
--max-turns 6 \
|
|
169
170
|
--turn-timeout-ms 900000 \
|
|
170
171
|
--barrier-wait-ms 300000 \
|
|
171
172
|
--json
|
|
172
173
|
```
|
|
173
174
|
|
|
175
|
+
`--context-policy warm` remains the default and requests one new adapter context for the mission,
|
|
176
|
+
then resumes it. `--context-policy fresh` requests a new context for every bounded Flow action. Both
|
|
177
|
+
policies pass the same canonical gate-action handoff and preserve the same Flow gates, evidence rules,
|
|
178
|
+
mission budget, and adapter authority. The selected policy is persisted with the mission and cannot be
|
|
179
|
+
changed on resume. Adapters must honor the request's `context_strategy.thread` value and must not infer
|
|
180
|
+
context routing from model names. This is a context-management capability, not permission to drop gates,
|
|
181
|
+
invent evidence, or replay a prior transcript into a nominally fresh context.
|
|
182
|
+
|
|
174
183
|
Driver state and its append-only event stream live under
|
|
175
184
|
`.kontourai/flow-agents/<slug>/continuation-driver/`. The mission turn count survives reinvocation;
|
|
176
185
|
subsequent invocations must use the same `--max-turns` value. The request contains the
|
|
@@ -157,7 +157,7 @@ authority for pointer navigation.
|
|
|
157
157
|
### Gate-Action Envelope
|
|
158
158
|
|
|
159
159
|
Every active Builder continuation request includes a bounded
|
|
160
|
-
`gate_action_envelope` with schema version `
|
|
160
|
+
`gate_action_envelope` with schema version `3.0`. Flow Agents derives it from
|
|
161
161
|
the persisted canonical Flow run and effective Flow Definition, then joins it
|
|
162
162
|
to the installed Builder Kit's validated `flow_step_actions` record. It is an
|
|
163
163
|
execution context, not a second gate evaluator: Flow remains the only authority
|
|
@@ -179,12 +179,30 @@ Declared operations, artifacts, and evidence expectation ids come from product
|
|
|
179
179
|
metadata. `implementation_allowed` is also product metadata; the shipped Builder
|
|
180
180
|
Kit declares it true only for `builder.build/execute`.
|
|
181
181
|
|
|
182
|
-
|
|
182
|
+
Declared artifact targets are typed. A `file` target includes its resolved
|
|
183
|
+
project-relative path under the active session, its direct-write policy, and
|
|
184
|
+
the skill or external operation that produces it. Operation result files are
|
|
185
|
+
not model-writable. A `trust_slice` target names a
|
|
186
|
+
logical `trust.bundle#<slice>` projection, sets `direct_write_allowed` to false,
|
|
187
|
+
and identifies the public evidence or critique interface that records it. A
|
|
188
|
+
trust slice is never a filename and adapters must not edit `trust.bundle`
|
|
189
|
+
directly.
|
|
190
|
+
|
|
191
|
+
The read-only status interface identifies the exact package version, binary,
|
|
192
|
+
and argv without requiring an adapter to parse a shell command. Mutation
|
|
183
193
|
interfaces are typed per expectation: `workflow.evidence`, `workflow.critique`,
|
|
184
194
|
or a named product operation such as `publish-change`. Evidence and critique
|
|
185
195
|
interfaces expose fixed argv plus typed required parameters and allowed values;
|
|
186
|
-
they do not publish shell strings with substitution placeholders.
|
|
187
|
-
|
|
196
|
+
they do not publish shell strings with substitution placeholders. Structured
|
|
197
|
+
evidence parameters reference `public_interfaces.schemas.evidence_ref_json`, a
|
|
198
|
+
bounded JSON Schema with required fields for source, command, artifact,
|
|
199
|
+
provider, and external evidence. Consumers add parameter values as distinct
|
|
200
|
+
argv entries.
|
|
201
|
+
|
|
202
|
+
Adapters that perform an allowed direct file write remain responsible for
|
|
203
|
+
opening the target without following symlinks and for confirming that the final
|
|
204
|
+
path remains inside the active session. The envelope declares authority and
|
|
205
|
+
identity; it does not make an arbitrary adapter filesystem write atomic.
|
|
188
206
|
|
|
189
207
|
`publish-change` is a provider-capability protocol, not a claim that the local
|
|
190
208
|
`flow-agents publish-change` helper opens a pull request. Its envelope binds the
|
|
@@ -204,7 +222,14 @@ checks; it is not the provider action executor.
|
|
|
204
222
|
empty lists for terminal actions. Expectation ids must exactly equal the resolved
|
|
205
223
|
Flow expectation set. Artifact bindings map each artifact to its owning
|
|
206
224
|
expectations, allowing optional artifacts to remain declared without appearing
|
|
207
|
-
under `stop_condition.required`.
|
|
225
|
+
under `stop_condition.required`. The same ownership is projected publicly as
|
|
226
|
+
typed `action.artifact_bindings`; consumers derive required targets by selecting
|
|
227
|
+
bindings that own an unresolved required expectation. These bindings are
|
|
228
|
+
product-owned gate semantics, not grader hints or consumer-authored guidance.
|
|
229
|
+
For file artifacts, an empty `expectation_ids` list keeps the artifact declared
|
|
230
|
+
and observable but never gate-required. Trust slices must own at least one
|
|
231
|
+
expectation because ownership determines their recording interface.
|
|
232
|
+
Operation bindings must resolve through the
|
|
208
233
|
canonical public operation catalog, not merely a self-declared string. Artifact
|
|
209
234
|
refs are either lexically safe session-relative paths or validated
|
|
210
235
|
`trust.bundle#<safe-id>` virtual refs; absolute paths, traversal, and arbitrary
|
|
@@ -265,11 +290,16 @@ exception applies, or every effective expectation is optional. This advances
|
|
|
265
290
|
those gates without prematurely evaluating ordinary missing-required gates, and
|
|
266
291
|
once the run advances no obsolete action skill remains required.
|
|
267
292
|
|
|
268
|
-
The envelope
|
|
293
|
+
The envelope, its prior-turn delta, and `context_strategy` are additive fields of
|
|
269
294
|
`ContinuationTurnRequest` schema `1.0`; adapters that only consume the existing
|
|
270
|
-
request fields remain compatible.
|
|
295
|
+
request fields remain compatible. `context_strategy` tells a capable adapter to
|
|
296
|
+
start a `new` context or `resume` the mission context and identifies the handoff
|
|
297
|
+
as canonical. The mission-bound policy defaults to warm continuation; selecting
|
|
298
|
+
fresh context changes only transcript routing, never the Flow contract, gate
|
|
299
|
+
requirements, or evidence authority. When `workflow drive` produces its optional
|
|
271
300
|
signed request/result attestation, the exact request object (including the
|
|
272
|
-
envelope) is included in the signed payload without
|
|
301
|
+
envelope and context strategy) is included in the signed payload without
|
|
302
|
+
transformation.
|
|
273
303
|
# Builder Lifecycle Authority
|
|
274
304
|
|
|
275
305
|
The canonical Flow run owns pause, resume, and cancellation. The current assignment actor may
|
|
@@ -295,6 +325,7 @@ Flow issue #118.
|
|
|
295
325
|
```text
|
|
296
326
|
flow-agents builder-run pause --session-dir <dir> --reason <text>
|
|
297
327
|
flow-agents builder-run resume --session-dir <dir> --reason <text>
|
|
328
|
+
flow-agents builder-run cancel-request --session-dir <dir> [--out <file>] [--reason <text>] [--actor <name>] [--expires-in-hours <n>]
|
|
298
329
|
flow-agents builder-run cancel --session-dir <dir> --authorization-file <record.json>
|
|
299
330
|
flow-agents builder-run release-assignment --session-dir <dir> --reason <text>
|
|
300
331
|
flow-agents builder-run archive --session-dir <dir> --authorization-file <record.json>
|
|
@@ -307,3 +338,13 @@ assignment while holding the same lock; a successfully consumed cancellation non
|
|
|
307
338
|
replayed. Archive accepts only completed or canceled runs, moves the session under
|
|
308
339
|
`.kontourai/flow-agents/archive/<slug>/`, and retains the canonical Flow run. None of these
|
|
309
340
|
operations deletes a branch or worktree; cleanup requires a separate provider-aware action.
|
|
341
|
+
|
|
342
|
+
`cancel-request` is a **read-only convenience** that removes the friction of hand-assembling a
|
|
343
|
+
cancellation record: it mints the *unsigned* authorization for the run (correct `run_id`,
|
|
344
|
+
`subject`, active `assignment_actor`, a fresh `nonce` and expiry) and prints the exact
|
|
345
|
+
`signing_payload` bytes to sign. It does not sign, cancel, or mutate anything — the operator signs
|
|
346
|
+
the payload with their Ed25519 lifecycle-authority key, adds the `signature` block to the emitted
|
|
347
|
+
file, and runs `cancel --authorization-file` as above. The signing payload is produced through the
|
|
348
|
+
same actor/request normalization the verifier applies, so a signature over it verifies by
|
|
349
|
+
construction. Like `cancel`, it requires an active assignment holder; an active run whose
|
|
350
|
+
assignment has already been released cannot be authorized this way without re-claiming it first.
|
|
@@ -29,13 +29,20 @@ Every Flow Agents event has a canonical name that is runtime-neutral. Adapters m
|
|
|
29
29
|
| `userPromptSubmit` | The user submits a new turn or message. Maps from `UserPromptSubmit`. | `hook_event_name` | `turn.prompt_text` (redacted by default), `cwd` |
|
|
30
30
|
| `preToolUse` | Immediately before a tool call is executed. Maps from `PreToolUse`. | `hook_event_name`, `tool_name`, `tool_input` | `tool_id`, `cwd`, `usage.model`, `usage.input_tokens`, `usage.output_tokens`, `usage.cache_creation_input_tokens`, `usage.cache_read_input_tokens`, `usage.estimated_cost_usd`, `usage.pricing_version` |
|
|
31
31
|
| `permissionRequest` | The runtime is asking for permission to run a tool or action. Maps from `PermissionRequest`. | `hook_event_name`, `tool_name` | `tool_input`, `cwd` |
|
|
32
|
-
| `postToolUse` | After a tool call completes (success or failure). Maps from `PostToolUse` and `PostToolUseFailure`. | `hook_event_name`, `tool_name`, `tool_response` | `tool_input`, `tool_output`, `error`, `cwd`, `usage.model`, `usage.input_tokens`, `usage.output_tokens`, `usage.cache_creation_input_tokens`, `usage.cache_read_input_tokens`, `usage.estimated_cost_usd`, `usage.pricing_version` |
|
|
32
|
+
| `postToolUse` | After a tool call completes (success or failure). Maps from `PostToolUse` and `PostToolUseFailure`. | `hook_event_name`, `tool_name`, `tool_response` | `tool_input`, `tool_output`, `error`, `cwd`, `tool.duration_ms`, `tool.outcome`, `tool.status`, `usage.model`, `usage.input_tokens`, `usage.output_tokens`, `usage.cache_creation_input_tokens`, `usage.cache_read_input_tokens`, `usage.estimated_cost_usd`, `usage.pricing_version` |
|
|
33
33
|
| `stop` | The agent is about to stop and return control to the user. Maps from `Stop` and `SessionEnd`. | `hook_event_name` | `stop_reason`, `cwd` |
|
|
34
34
|
| `subagentStart` | A subagent or specialist delegate is spawning. Maps from `SubagentStart` (Claude Code). | `hook_event_name` | `agent_name`, `agent_type` |
|
|
35
35
|
| `subagentStop` | A subagent or specialist delegate has stopped. Maps from `SubagentStop` (Claude Code). | `hook_event_name` | `agent_name`, `outcome` |
|
|
36
36
|
|
|
37
37
|
**`usage.*` on `preToolUse`/`postToolUse` (#568 slice 1).** These two events carry an optional `.usage` object — `model`, `input_tokens`, `output_tokens`, `cache_creation_input_tokens`, `cache_read_input_tokens`, `estimated_cost_usd`, `pricing_version` — sourced from the runtime transcript's LAST assistant turn (the turn that produced this specific tool call), joined via a bounded tail-read of `hook.transcript_path`. This is **per-turn, not a per-tool-call cost fraction**: multiple tool calls inside the same assistant turn (parallel tool_use blocks) report the *same* whole-turn usage figures — do not sum `estimated_cost_usd` across `tool.invoke`/`tool.result` rows within one turn, or cost will be double-counted; `session.usage`'s cumulative totals remain the authoritative aggregate. When the transcript join is unavailable but the runtime's `.model` hook field is present, only `usage.model` is populated and every token/cost field is explicitly `null` (never a guessed number); `.model` itself is best-effort on these two events (see §8.2), not a contractually guaranteed field. `tool.permission_request` (`permissionRequest`) is explicitly excluded from this enrichment.
|
|
38
38
|
|
|
39
|
+
**`tool.duration_ms` / `tool.outcome` / `tool.status` on `tool.result` (#580).** Every `tool.result` record (from `postToolUse`/`PostToolUse`/`PostToolUseFailure`) carries three intrinsic tool-result fields on its `.tool` object (co-located with `.tool.name`/`.tool.output`):
|
|
40
|
+
- **`duration_ms`** — non-negative wall-clock milliseconds between this tool's invoke and its result, correlated per tool call (host call id when present, else a content hash of `tool_name` + compact `tool_input`). The invoke's start time is recorded on `preToolUse` and read+unlinked on the matching result. It is **`null`** — never a fabricated `0` or a stale value — when the matching start record is absent (a result with no prior recorded invoke). Best-effort and non-blocking; a missing/corrupt start record degrades to `null`. Resolution is millisecond on hosts with a sub-second clock (`$EPOCHREALTIME`/GNU `date +%s%3N`) and second-granular on the portable fallback.
|
|
41
|
+
- **`outcome`** — the deterministic tri-state `pass` | `fail` | `ambiguous` from the canonical observation contract (§2.5), computed in-process by a jq port of `scripts/hooks/evidence-capture.js observeResult` so the Claude hot path stays hermetic (no node subprocess). A `PostToolUseFailure` event folds to `fail`. Never derived from stdout text or model narration. On the Codex runtime only — where the exit code lives in the rollout banner rather than the payload — the code is resolved via `scripts/hooks/lib/codex-exit-code.js` and fed through the same tri-state; an unreadable rollout degrades to `ambiguous`.
|
|
42
|
+
- **`status`** — the host-surfaced integer exit code when one is cleanly present (the same fields §2.5 scans), else **`null`**.
|
|
43
|
+
|
|
44
|
+
`tool.invoke` and `tool.permission_request` records carry none of these three fields (an invoke has no result yet; a permission request is not a tool result). The three fields are derived scalars only (a timestamp delta, a verdict, an integer) — no args/output/secret material — and the start record stores a bare timestamp, so the console-relay sanitize backstop is unaffected.
|
|
45
|
+
|
|
39
46
|
### Redaction Defaults
|
|
40
47
|
|
|
41
48
|
Telemetry channels redact sensitive payload fields before emission. Adapters must honor these defaults and must not log raw hook payloads without applying channel redaction.
|
|
@@ -87,6 +94,27 @@ way.
|
|
|
87
94
|
supported, it resolves from step 3 onward. Adapters MUST document which manifests they honor so the
|
|
88
95
|
attribution granularity difference is explicit, not surprising.
|
|
89
96
|
|
|
97
|
+
#### Work-item attribution (`task_slug`)
|
|
98
|
+
|
|
99
|
+
Where `context.project` groups events by *codebase*, `task_slug` groups them by the *active Builder
|
|
100
|
+
work item* — so the console can report cost and activity per unit of work (the "Cost by work-item"
|
|
101
|
+
breakdown), not just per project.
|
|
102
|
+
|
|
103
|
+
| Field | Semantics | Redacted? | Producer requirement |
|
|
104
|
+
| --- | --- | --- | --- |
|
|
105
|
+
| `task_slug` | Top-level slug of the Builder run active in `context.cwd` at emission time. | **No** (an opaque work-item slug; carries no path or content) | Adapters SHOULD stamp `task_slug` when a Builder run is active in the working dir. **Omit the field entirely when no run is active — never emit an empty string and never fabricate a slug.** |
|
|
106
|
+
|
|
107
|
+
Canonical resolution (harness adapter), first match wins, read from the *same* `current.json` the
|
|
108
|
+
economics relay reads so both surfaces attribute to one identifier:
|
|
109
|
+
|
|
110
|
+
1. `<cwd>/.kontourai/flow-agents/current.json` → `.active_slug`, else `.artifact_dir`.
|
|
111
|
+
2. `<cwd>/.flow-agents/current.json` (legacy location) → `.active_slug`, else `.artifact_dir`.
|
|
112
|
+
3. No file, or both fields empty → **no `task_slug` key on the record.**
|
|
113
|
+
|
|
114
|
+
Only the slug string is stored; no prompt, args, or file content is ever read into it. A non-Builder
|
|
115
|
+
session (no `current.json`) therefore emits records with no `task_slug`, and the console buckets
|
|
116
|
+
those under "unknown" rather than inventing an attribution.
|
|
117
|
+
|
|
90
118
|
### Exit Code Protocol (Canonical Hook Scripts)
|
|
91
119
|
|
|
92
120
|
Canonical hook scripts in `scripts/hooks/` use the following exit code contract — originally derived from Kiro conventions and shared across all harness adapters via the adapter translation layer:
|
|
@@ -156,7 +156,7 @@ from a harness-blind gap (full doctrine + per-runtime matrix in `harness-capabil
|
|
|
156
156
|
| Field | Meaning |
|
|
157
157
|
| --- | --- |
|
|
158
158
|
| `runtime` | the runtime that produced the record (`claude-code`, `kiro-cli`, …), from `session.usage .agent.runtime` |
|
|
159
|
-
| `per_delegation_tokens` | `true` iff the runtime isolates per-sub-agent tokens. `false` everywhere today → per-delegation cost unavailable |
|
|
159
|
+
| `per_delegation_tokens` | `true` iff the runtime isolates per-sub-agent tokens. **Derived (not a hardcoded literal, #620)** from the runtime's capability declaration — the emitter reads the build-only `build/generated/capability-declarations.json` (generated from `src/lib/capability-declarations.ts`), keys it on the normalized `.agent.runtime` (`kiro-cli`→`kiro`), and emits `true` iff the declared `per_delegation_tokens` status is `supported`. An unresolved runtime or a missing declaration JSON yields the explicit sentinel `false` — never a fabricated `true`. `false` everywhere today → per-delegation cost unavailable |
|
|
160
160
|
| `per_delegation_outcome` | outcome-signal coverage this run: `full`\|`partial`\|`none`\|`n/a` |
|
|
161
161
|
|
|
162
162
|
Consumers MUST read `signals` before rendering a delegation metric: if the needed signal is unavailable,
|
|
@@ -3,6 +3,10 @@
|
|
|
3
3
|
**The signals a feature can rely on depend on which runtime/harness the kit is hooked into. State the
|
|
4
4
|
coverage; never assume it, never fabricate the gap.**
|
|
5
5
|
|
|
6
|
+
> Generated by `npm run capability-matrix` from `src/lib/capability-declarations.ts` — the single
|
|
7
|
+
> source of truth. Do NOT edit this file by hand; change the declarations and regenerate. CI fails on
|
|
8
|
+
> drift (`npm run capability-matrix -- --check`).
|
|
9
|
+
|
|
6
10
|
This is a cross-cutting contract: any feature whose data comes from telemetry (economics, delegation
|
|
7
11
|
efficiency, liveness, learning) must declare which signals it needs, which *class* each falls in, and
|
|
8
12
|
how it degrades when the current runtime does not expose one. A missing signal is rendered as
|
|
@@ -35,30 +39,67 @@ exposed:
|
|
|
35
39
|
| Field | Class | Meaning |
|
|
36
40
|
| --- | --- | --- |
|
|
37
41
|
| `runtime` | — | the runtime that produced the record (`claude-code`, `kiro-cli`, `codex`, …) |
|
|
38
|
-
| `per_delegation_tokens` | sub-agent-internal | `true` iff the runtime isolates per-sub-agent token usage. **`false` on every runtime today** → per-delegation cost is unavailable; the console attributes cost at `(role, model)` granularity via `cost.by_model` instead. |
|
|
42
|
+
| `per_delegation_tokens` | sub-agent-internal | `true` iff the runtime isolates per-sub-agent token usage. **`false` on every runtime today** → per-delegation cost is unavailable; the console attributes cost at `(role, model)` granularity via `cost.by_model` instead. Derived from this matrix's `per_delegation_tokens` capability declaration, not a hardcoded literal. |
|
|
39
43
|
| `per_delegation_outcome` | orchestrator-observable | coverage of the outcome signal on this run: `full` (every delegation resolved to a real outcome), `partial` (some), `none` (delegations exist but none had a verdict/escalation/re-dispatch), `n/a` (no delegations observed). |
|
|
40
44
|
|
|
41
45
|
Consumers (console panels, `learning-review`) MUST read `signals` before rendering a metric: if the
|
|
42
46
|
signal a metric needs is unavailable, show "not measurable on this harness," not a misleading number.
|
|
43
47
|
|
|
44
|
-
## Per-runtime coverage (
|
|
45
|
-
|
|
46
|
-
`✓` exposed · `partial` best-effort/orchestrator-derived · `✗` not exposed.
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
|
52
|
-
|
|
|
53
|
-
|
|
|
54
|
-
|
|
|
55
|
-
|
|
|
56
|
-
|
|
|
57
|
-
|
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
48
|
+
## Per-runtime capability coverage (generated, honest snapshot)
|
|
49
|
+
|
|
50
|
+
`✓` exposed · `partial` best-effort/orchestrator-derived · `✗` not exposed. This table is generated
|
|
51
|
+
from `src/lib/capability-declarations.ts`; update the declarations there as runtimes add
|
|
52
|
+
instrumentation — it is the single source of truth the `signals` values are stamped from. The
|
|
53
|
+
`kiro-cli` runtime value normalizes to the canonical `kiro` column before lookup.
|
|
54
|
+
|
|
55
|
+
| Capability | `claude-code` | `codex` | `kiro` | `opencode` | `pi` | `codex-local` | `strands-local` |
|
|
56
|
+
| --- | --- | --- | --- | --- | --- | --- | --- |
|
|
57
|
+
| `turn_id` | ✓ | ✓ | ✓ | partial | ✓ | ✗ | ✗ |
|
|
58
|
+
| `transcript_path` | ✓ | ✓ | ✓ | ✗ | ✗ | ✗ | ✗ |
|
|
59
|
+
| `intent_annotation` | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ |
|
|
60
|
+
| `per_delegation_trace_context` | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ |
|
|
61
|
+
| `per_delegation_tokens` | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ |
|
|
62
|
+
| `terminal_verdict` | partial | ✗ | partial | ✗ | ✗ | ✗ | ✗ |
|
|
63
|
+
|
|
64
|
+
### Declared notes and reasons
|
|
65
|
+
|
|
66
|
+
Every `partial` / `✗` cell above, with its declared justification:
|
|
67
|
+
|
|
68
|
+
- `turn_id` · `opencode` (partial): session.start telemetry is unavailable in opencode run (non-interactive) mode; tool events still carry a turn context.
|
|
69
|
+
- `turn_id` · `codex-local` (unsupported): codex-local is a kit-activation adapter, not an agent-runtime telemetry source; it emits no per-turn agent-runtime telemetry.
|
|
70
|
+
- `turn_id` · `strands-local` (unsupported): strands-local is a kit-activation adapter, not an agent-runtime telemetry source; it emits no per-turn agent-runtime telemetry.
|
|
71
|
+
- `transcript_path` · `opencode` (unsupported): opencode does not expose a per-session transcript path to hooks.
|
|
72
|
+
- `transcript_path` · `pi` (unsupported): pi does not expose a per-session transcript path to hooks.
|
|
73
|
+
- `transcript_path` · `codex-local` (unsupported): codex-local is a kit-activation adapter and does not expose a per-session transcript path.
|
|
74
|
+
- `transcript_path` · `strands-local` (unsupported): strands-local is a kit-activation adapter and does not expose a per-session transcript path.
|
|
75
|
+
- `intent_annotation` · `claude-code` (unsupported): Intent-annotation capture is not implemented on any runtime yet (#622).
|
|
76
|
+
- `intent_annotation` · `codex` (unsupported): Intent-annotation capture is not implemented on any runtime yet (#622).
|
|
77
|
+
- `intent_annotation` · `kiro` (unsupported): Intent-annotation capture is not implemented on any runtime yet (#622).
|
|
78
|
+
- `intent_annotation` · `opencode` (unsupported): Intent-annotation capture is not implemented on any runtime yet (#622).
|
|
79
|
+
- `intent_annotation` · `pi` (unsupported): Intent-annotation capture is not implemented on any runtime yet (#622).
|
|
80
|
+
- `intent_annotation` · `codex-local` (unsupported): Intent-annotation capture is not implemented on any runtime yet (#622).
|
|
81
|
+
- `intent_annotation` · `strands-local` (unsupported): Intent-annotation capture is not implemented on any runtime yet (#622).
|
|
82
|
+
- `per_delegation_trace_context` · `claude-code` (unsupported): Per-delegation trace-context propagation is not implemented on any runtime yet (#425).
|
|
83
|
+
- `per_delegation_trace_context` · `codex` (unsupported): Per-delegation trace-context propagation is not implemented on any runtime yet (#425).
|
|
84
|
+
- `per_delegation_trace_context` · `kiro` (unsupported): Per-delegation trace-context propagation is not implemented on any runtime yet (#425).
|
|
85
|
+
- `per_delegation_trace_context` · `opencode` (unsupported): Per-delegation trace-context propagation is not implemented on any runtime yet (#425).
|
|
86
|
+
- `per_delegation_trace_context` · `pi` (unsupported): Per-delegation trace-context propagation is not implemented on any runtime yet (#425).
|
|
87
|
+
- `per_delegation_trace_context` · `codex-local` (unsupported): Per-delegation trace-context propagation is not implemented on any runtime yet (#425).
|
|
88
|
+
- `per_delegation_trace_context` · `strands-local` (unsupported): Per-delegation trace-context propagation is not implemented on any runtime yet (#425).
|
|
89
|
+
- `per_delegation_tokens` · `claude-code` (unsupported): No runtime isolates per-sub-agent token usage; per-delegation cost is attributed at (role, model) granularity instead.
|
|
90
|
+
- `per_delegation_tokens` · `codex` (unsupported): No runtime isolates per-sub-agent token usage; per-delegation cost is attributed at (role, model) granularity instead.
|
|
91
|
+
- `per_delegation_tokens` · `kiro` (unsupported): No runtime isolates per-sub-agent token usage; per-delegation cost is attributed at (role, model) granularity instead.
|
|
92
|
+
- `per_delegation_tokens` · `opencode` (unsupported): No runtime isolates per-sub-agent token usage; per-delegation cost is attributed at (role, model) granularity instead.
|
|
93
|
+
- `per_delegation_tokens` · `pi` (unsupported): No runtime isolates per-sub-agent token usage; per-delegation cost is attributed at (role, model) granularity instead.
|
|
94
|
+
- `per_delegation_tokens` · `codex-local` (unsupported): No runtime isolates per-sub-agent token usage; per-delegation cost is attributed at (role, model) granularity instead.
|
|
95
|
+
- `per_delegation_tokens` · `strands-local` (unsupported): No runtime isolates per-sub-agent token usage; per-delegation cost is attributed at (role, model) granularity instead.
|
|
96
|
+
- `terminal_verdict` · `claude-code` (partial): Captured only when the workflow records an evidence/verdict event for the sub-agent — not guaranteed every run.
|
|
97
|
+
- `terminal_verdict` · `codex` (unsupported): Codex does not surface a per-sub-agent terminal verdict to the orchestrator.
|
|
98
|
+
- `terminal_verdict` · `kiro` (partial): Captured only when the workflow records an evidence/verdict event for the sub-agent — not guaranteed every run.
|
|
99
|
+
- `terminal_verdict` · `opencode` (unsupported): opencode does not surface per-sub-agent terminal verdicts.
|
|
100
|
+
- `terminal_verdict` · `pi` (unsupported): pi has no named-subagent registry, so per-sub-agent verdicts are not observable.
|
|
101
|
+
- `terminal_verdict` · `codex-local` (unsupported): codex-local is a kit-activation adapter and does not surface per-sub-agent terminal verdicts.
|
|
102
|
+
- `terminal_verdict` · `strands-local` (unsupported): strands-local is a kit-activation adapter and does not surface per-sub-agent terminal verdicts.
|
|
62
103
|
|
|
63
104
|
## The doctrine (applies to any telemetry-dependent feature)
|
|
64
105
|
|
|
@@ -70,5 +111,6 @@ That is exactly why `outcome` degrades to `unavailable` rather than `accepted` w
|
|
|
70
111
|
is not `$0`; an outcome you cannot observe is not `accepted`.
|
|
71
112
|
4. **Fall back to the coarsest honest proxy** when the fine signal is missing (per-delegation cost →
|
|
72
113
|
`(role, model)` via `by_model`), and label the proxy as such.
|
|
73
|
-
5. **Keep
|
|
74
|
-
`
|
|
114
|
+
5. **Keep these declarations current.** When a harness starts exposing a signal, flip the declaration in
|
|
115
|
+
`src/lib/capability-declarations.ts` and regenerate — the `signals` stamp follows and the feature
|
|
116
|
+
"lights up" without a schema change.
|
|
@@ -667,7 +667,10 @@ For unattended runtime re-entry, the active assignment actor may use `workflow d
|
|
|
667
667
|
explicit runtime adapter argv file. The driver repeats the same public projection/evidence cycle,
|
|
668
668
|
persists its mission turn budget, and parks on adapter-declared PID or deadline barriers instead of
|
|
669
669
|
spending turns while external work is incomplete. Adapter completion never advances a gate by
|
|
670
|
-
self-report; only trust evidence accepted by canonical Flow can change the current step.
|
|
670
|
+
self-report; only trust evidence accepted by canonical Flow can change the current step. Use
|
|
671
|
+
`--context-policy fresh` when the selected adapter supports canonical fresh-context handoffs and
|
|
672
|
+
the runtime capability profile calls for bounded contexts. This preserves every gate while avoiding
|
|
673
|
+
prior-transcript replay between actions; `warm` remains the default. See
|
|
671
674
|
[`docs/public-workflow-cli.md`](public-workflow-cli.md#bounded-continuation-driver) for the protocol.
|
|
672
675
|
|
|
673
676
|
If the same Builder slice is interrupted, inspect its canonical status. Resume
|
|
@@ -11,9 +11,11 @@ mkdir -p "$LOG_DIR"
|
|
|
11
11
|
|
|
12
12
|
CHECKS=(
|
|
13
13
|
"Content boundary|npm run check:content-boundary --"
|
|
14
|
+
"Hachure boundary|npm run check:hachure-boundary --"
|
|
14
15
|
"Decision registry|npm run check:decisions --"
|
|
15
16
|
"Source tree validation|npm run validate:source --"
|
|
16
17
|
"Context map drift|npm run context-map -- --check"
|
|
18
|
+
"Capability matrix drift|npm run capability-matrix -- --check"
|
|
17
19
|
"Static eval suite|bash evals/run.sh static"
|
|
18
20
|
"Workflow artifact integration|bash evals/integration/test_workflow_artifacts.sh"
|
|
19
21
|
"Workflow artifact cleanup audit integration|bash evals/integration/test_workflow_artifact_cleanup_audit.sh"
|
|
@@ -22,6 +24,15 @@ CHECKS=(
|
|
|
22
24
|
"Workflow sidecar writer integration|bash evals/integration/test_workflow_sidecar_writer.sh"
|
|
23
25
|
"Sidecar field preservation integration|bash evals/integration/test_sidecar_field_preservation.sh"
|
|
24
26
|
"Record-check integration|bash evals/integration/test_record_check.sh"
|
|
27
|
+
"Narrative source contract integration|bash evals/integration/test_narrative_source_contract.sh"
|
|
28
|
+
"Narrative runtime projection integration|bash evals/integration/test_narrative_runtime_projection.sh"
|
|
29
|
+
"Narrative grounded envelope integration|bash evals/integration/test_narrative_grounded_envelope.sh"
|
|
30
|
+
"Narrative redaction fail-closed integration|bash evals/integration/test_narrative_redaction_failclosed.sh"
|
|
31
|
+
"Narrative trust isolation integration|bash evals/integration/test_narrative_trust_isolation.sh"
|
|
32
|
+
"Narrative grounding validator integration|bash evals/integration/test_narrative_grounding_validator.sh"
|
|
33
|
+
"Narrative prose renderer integration|bash evals/integration/test_narrative_prose_renderer.sh"
|
|
34
|
+
"Narrative grounded evals integration|bash evals/integration/test_narrative_evals.sh"
|
|
35
|
+
"Narrative intent annotation integration|bash evals/integration/test_narrative_intent_annotation.sh"
|
|
25
36
|
"Actor identity resolver integration|bash evals/integration/test_actor_identity.sh"
|
|
26
37
|
"CI-runtime actor identity integration|bash evals/integration/test_ci_actor_identity.sh"
|
|
27
38
|
"Assignment provider local-file integration|bash evals/integration/test_assignment_provider_local_file.sh"
|
|
@@ -35,6 +46,8 @@ CHECKS=(
|
|
|
35
46
|
"Liveness console relay integration|bash evals/integration/test_liveness_console_relay.sh"
|
|
36
47
|
"Console tenant isolation integration|bash evals/integration/test_console_tenant_isolation.sh"
|
|
37
48
|
"Goal Fit hook integration|bash evals/integration/test_goal_fit_hook.sh"
|
|
49
|
+
"Plain stop messaging integration|bash evals/integration/test_plain_stop_messaging.sh"
|
|
50
|
+
"Goal Fit narrative exclusion integration|env -u FLOW_AGENTS_GOAL_FIT_MODE bash evals/integration/test_goal_fit_narrative_exclusion.sh"
|
|
38
51
|
"Hook category behavior integration|bash evals/integration/test_hook_category_behaviors.sh"
|
|
39
52
|
"Workflow steering hook integration|bash evals/integration/test_workflow_steering_hook.sh"
|
|
40
53
|
"Hook influence contract integration|bash evals/integration/test_hook_influence_cases.sh"
|
|
@@ -61,7 +74,13 @@ CHECKS=(
|
|
|
61
74
|
"Usage and cost integration|bash evals/integration/test_usage_cost.sh"
|
|
62
75
|
"Telemetry usage pipeline integration|bash evals/integration/test_telemetry_usage_pipeline.sh"
|
|
63
76
|
"Telemetry tool usage integration|bash evals/integration/test_telemetry_tool_usage.sh"
|
|
77
|
+
"Telemetry tool outcome integration|bash evals/integration/test_telemetry_tool_outcome.sh"
|
|
78
|
+
"Telemetry delegation integration|bash evals/integration/test_telemetry_delegation.sh"
|
|
79
|
+
"Telemetry action-class integration|bash evals/integration/test_telemetry_action_class.sh"
|
|
80
|
+
"Telemetry sanitize usage integration|bash evals/integration/test_telemetry_sanitize_usage.sh"
|
|
81
|
+
"Telemetry task slug integration|bash evals/integration/test_telemetry_task_slug.sh"
|
|
64
82
|
"Economics record integration|bash evals/integration/test_economics_record.sh"
|
|
83
|
+
"Capability declarations integration|bash evals/integration/test_capability_declarations.sh"
|
|
65
84
|
"Learning review proposals integration|bash evals/integration/test_learning_review_proposals.sh"
|
|
66
85
|
"Utterance check integration|bash evals/integration/test_utterance_check.sh"
|
|
67
86
|
"Pull work provider integration|bash evals/integration/test_pull_work_provider.sh"
|
|
@@ -100,9 +119,11 @@ CHECKS=(
|
|
|
100
119
|
|
|
101
120
|
LANE_SOURCE_AND_STATIC=(
|
|
102
121
|
"Content boundary"
|
|
122
|
+
"Hachure boundary"
|
|
103
123
|
"Decision registry"
|
|
104
124
|
"Source tree validation"
|
|
105
125
|
"Context map drift"
|
|
126
|
+
"Capability matrix drift"
|
|
106
127
|
"Static eval suite"
|
|
107
128
|
)
|
|
108
129
|
|
|
@@ -110,6 +131,15 @@ LANE_WORKFLOW_CONTRACTS=(
|
|
|
110
131
|
"Workflow artifact integration"
|
|
111
132
|
"Workflow artifact cleanup audit integration"
|
|
112
133
|
"Fixture retirement audit integration"
|
|
134
|
+
"Narrative source contract integration"
|
|
135
|
+
"Narrative runtime projection integration"
|
|
136
|
+
"Narrative grounded envelope integration"
|
|
137
|
+
"Narrative redaction fail-closed integration"
|
|
138
|
+
"Narrative trust isolation integration"
|
|
139
|
+
"Narrative grounding validator integration"
|
|
140
|
+
"Narrative prose renderer integration"
|
|
141
|
+
"Narrative grounded evals integration"
|
|
142
|
+
"Narrative intent annotation integration"
|
|
113
143
|
"Publish-change helper integration"
|
|
114
144
|
"Workflow sidecar writer integration"
|
|
115
145
|
"Sidecar field preservation integration"
|
|
@@ -126,10 +156,15 @@ LANE_WORKFLOW_CONTRACTS=(
|
|
|
126
156
|
"Current.json per-actor integration"
|
|
127
157
|
"Liveness console relay integration"
|
|
128
158
|
"Console tenant isolation integration"
|
|
159
|
+
"Telemetry tool outcome integration"
|
|
160
|
+
"Telemetry delegation integration"
|
|
161
|
+
"Telemetry action-class integration"
|
|
129
162
|
)
|
|
130
163
|
|
|
131
164
|
LANE_RUNTIME_AND_KIT=(
|
|
132
165
|
"Goal Fit hook integration"
|
|
166
|
+
"Plain stop messaging integration"
|
|
167
|
+
"Goal Fit narrative exclusion integration"
|
|
133
168
|
"Hook category behavior integration"
|
|
134
169
|
"Workflow steering hook integration"
|
|
135
170
|
"Hook influence contract integration"
|
|
@@ -156,7 +191,10 @@ LANE_RUNTIME_AND_KIT=(
|
|
|
156
191
|
"Usage and cost integration"
|
|
157
192
|
"Telemetry usage pipeline integration"
|
|
158
193
|
"Telemetry tool usage integration"
|
|
194
|
+
"Telemetry sanitize usage integration"
|
|
195
|
+
"Telemetry task slug integration"
|
|
159
196
|
"Economics record integration"
|
|
197
|
+
"Capability declarations integration"
|
|
160
198
|
"Learning review proposals integration"
|
|
161
199
|
"Utterance check integration"
|
|
162
200
|
"Pull work provider integration"
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
# Grounded narrative evals corpus (#612)
|
|
2
|
+
|
|
3
|
+
A versioned, frozen-manifest-grounded adversarial fixture corpus and its scorer
|
|
4
|
+
for the narrative faithfulness program. This directory is the shared, externally
|
|
5
|
+
consumable package for the human-study and cross-presentation work in
|
|
6
|
+
kontourai/evals#95: the corpus + result schema are self-describing and can be
|
|
7
|
+
ingested unmodified.
|
|
8
|
+
|
|
9
|
+
## Package contract
|
|
10
|
+
|
|
11
|
+
- `corpus.json` (`schema_version: "narrative-evals-corpus/v1"`) enumerates every
|
|
12
|
+
fixture: its `id`, its `case_class` (one of the ten R1 classes), a declarative
|
|
13
|
+
`build` recipe (seeded source records materialized through the public
|
|
14
|
+
`snapshotNarrative` API into a frozen manifest — never a hand-fabricated
|
|
15
|
+
manifest), and a typed `expected` answer key (`verdict` of `accept` / `reject`
|
|
16
|
+
/ `known_gap`, plus `material_claims`, `epistemic_labels`, and citation
|
|
17
|
+
resolvability). Corruption fixtures additionally carry a `corruption` block and
|
|
18
|
+
the named `check` their defect must trip. The serialization references only
|
|
19
|
+
seeded records and fa1 source IDs, never internal flow-agents APIs.
|
|
20
|
+
- `schemas/narrative-eval-result.schema.json` (`schema_version:
|
|
21
|
+
"narrative-eval-result/v1"`, at the repo root) is the consolidated result
|
|
22
|
+
contract: per-fixture verdicts, aggregate faithfulness metrics
|
|
23
|
+
(unsupported-claim rate, citation precision/recall/resolvability, material-claim
|
|
24
|
+
coverage, per-class omission rate, epistemic-classification accuracy), an
|
|
25
|
+
`uncertainty` block (every metric carries a sample count + range), the DECLARED
|
|
26
|
+
cross-runtime `capability_parity` block, documented `known_gaps`, and per-fixture
|
|
27
|
+
`raw_source_links` for audit. `validateNarrativeEvalResult` (exported from the
|
|
28
|
+
package root) is the ajv-free validator.
|
|
29
|
+
- `scorer.mjs` is the hermetic scorer. `node scorer.mjs all` replays the whole
|
|
30
|
+
corpus and emits one schema-valid `narrative-eval-result/v1` object (write it to
|
|
31
|
+
a file with `NARRATIVE_EVAL_RESULT_OUT=<path>`); per-check modes
|
|
32
|
+
(`support` / `citation` / `coverage` / `epistemic` / `injection`) drive the
|
|
33
|
+
mutation battery. It imports only the BUILT modules under `build/`, so run
|
|
34
|
+
`npm run build` first.
|
|
35
|
+
|
|
36
|
+
## Case classes and detection
|
|
37
|
+
|
|
38
|
+
The ten R1 case classes (`passing`, `failing`, `ambiguous`, `contradictory`,
|
|
39
|
+
`redacted`, `nested-agent`, `timeout`, `no-op`, `created-file`,
|
|
40
|
+
`prompt-injection`) are honest narratives scored `accept`, except the
|
|
41
|
+
`contradictory` case which is disclosed as a documented `known_gap`
|
|
42
|
+
(contradiction detection is an upstream gap, sequenced #568/#425 — it is never
|
|
43
|
+
faked as real detection). Five R3 corruption fixtures (hallucinated statement,
|
|
44
|
+
omitted failure, dangling citation, mislabeled inference, injection-followed
|
|
45
|
+
prose) each carry one deliberate defect the scorer must detect (`reject`). Every
|
|
46
|
+
corruption class is the teeth-proving mutation target for its `/* eval-check:<name> */`
|
|
47
|
+
anchor: `evals/integration/test_narrative_evals.sh` disables each detection in
|
|
48
|
+
turn and proves the matching fixture flips `expected=reject -> actual=accept`,
|
|
49
|
+
then restores the scorer byte-for-byte.
|
|
50
|
+
|
|
51
|
+
Results are per-corpus MEASUREMENTS, not proofs: no metric is asserted from a
|
|
52
|
+
single fixture, model, or runtime, and capability gaps are asserted from the
|
|
53
|
+
#620 declarations (`queryCapability`), never probed from behavior.
|
|
54
|
+
|
|
55
|
+
## Running
|
|
56
|
+
|
|
57
|
+
```sh
|
|
58
|
+
npm run build
|
|
59
|
+
node evals/fixtures/narrative-evals/scorer.mjs all
|
|
60
|
+
# or the full gate (corpus + schema validation + mutation battery):
|
|
61
|
+
bash evals/integration/test_narrative_evals.sh
|
|
62
|
+
```
|