@kontourai/flow-agents 4.0.0 → 4.2.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 +8 -0
- package/CHANGELOG.md +34 -0
- package/CONTEXT.md +5 -0
- package/agents/tool-security-reviewer.json +1 -1
- package/build/src/cli/init.js +35 -3
- package/build/src/cli/kit.js +95 -2
- package/build/src/cli/pull-work-provider.js +7 -1
- package/build/src/cli/validate-workflow-artifacts.js +53 -0
- package/build/src/cli/workflow.js +5 -1
- package/build/src/flow-kit/provision.d.ts +23 -0
- package/build/src/flow-kit/provision.js +99 -0
- package/build/src/flow-kit/validate.d.ts +52 -0
- package/build/src/flow-kit/validate.js +214 -9
- package/build/src/runtime-adapters.js +1 -1
- package/context/contracts/execution-contract.md +30 -1
- package/context/contracts/review-contract.md +4 -0
- package/context/contracts/trigger-guards.md +73 -0
- package/context/scripts/telemetry/lib/config.sh +29 -0
- package/context/settings/backlog-provider-settings.json +1 -1
- package/context/settings/workspace-backlog-provider-settings.example.json +1 -1
- package/dist/base/build/package.json +1 -1
- package/dist/base/build/src/cli/init.js +35 -3
- package/dist/base/build/src/cli/kit.js +95 -2
- package/dist/base/build/src/cli/pull-work-provider.js +7 -1
- package/dist/base/build/src/cli/validate-workflow-artifacts.js +53 -0
- package/dist/base/build/src/cli/workflow.js +5 -1
- package/dist/base/build/src/flow-kit/provision.d.ts +23 -0
- package/dist/base/build/src/flow-kit/provision.js +99 -0
- package/dist/base/build/src/flow-kit/validate.d.ts +52 -0
- package/dist/base/build/src/flow-kit/validate.js +214 -9
- package/dist/base/build/src/runtime-adapters.js +1 -1
- package/dist/base/context/contracts/execution-contract.md +30 -1
- package/dist/base/context/contracts/review-contract.md +4 -0
- package/dist/base/context/contracts/trigger-guards.md +73 -0
- package/dist/base/context/scripts/telemetry/lib/config.sh +29 -0
- package/dist/base/context/settings/backlog-provider-settings.json +1 -1
- package/dist/base/context/settings/workspace-backlog-provider-settings.example.json +1 -1
- package/dist/base/docs/adr/0023-kit-provisioning.md +47 -0
- package/dist/base/docs/adr/index.md +1 -0
- package/dist/base/docs/architecture-engine-and-kits.md +17 -0
- package/dist/base/docs/context-map.md +3 -0
- package/dist/base/docs/decisions/backlog-readiness-source.md +89 -0
- package/dist/base/docs/decisions/index.md +1 -0
- package/dist/base/docs/developer-architecture.md +3 -3
- package/dist/base/docs/flow-kit-repository-contract.md +34 -3
- package/dist/base/docs/kit-authoring-guide.md +1 -1
- package/dist/base/docs/veritas-integration.md +12 -0
- package/dist/base/evals/ci/run-baseline.sh +4 -0
- package/dist/base/evals/integration/test_kit_provisioning.sh +112 -0
- package/dist/base/evals/integration/test_liveness_console_relay.sh +91 -1
- package/dist/base/evals/integration/test_liveness_heartbeat.sh +66 -0
- package/dist/base/evals/integration/test_pull_work_provider.sh +18 -0
- package/dist/base/evals/integration/test_veritas_governance_kit.sh +256 -0
- package/dist/base/evals/integration/test_workflow_artifacts.sh +257 -0
- package/dist/base/evals/static/test_package.sh +6 -0
- package/dist/base/evals/static/test_workflow_skills.sh +16 -0
- package/dist/base/install.sh +1 -1
- package/dist/base/kits/builder/flows/publish-learn.flow.json +9 -1
- package/dist/base/kits/builder/skills/execute-plan/SKILL.md +4 -3
- package/dist/base/kits/builder/skills/pull-work/SKILL.md +12 -0
- package/dist/base/kits/builder/skills/review-work/SKILL.md +11 -0
- package/dist/base/kits/veritas-governance/adapter/readiness-to-trust-bundle.mjs +19 -20
- package/dist/base/kits/veritas-governance/assets/starter-hooks/githooks/post-commit +13 -0
- package/dist/base/kits/veritas-governance/assets/starter-hooks/githooks/pre-push +13 -0
- package/dist/base/kits/veritas-governance/assets/starter-standards/veritas/GOVERNANCE.md +23 -0
- package/dist/base/kits/veritas-governance/assets/starter-standards/veritas/README.md +58 -0
- package/dist/base/kits/veritas-governance/assets/starter-standards/veritas/authority/default.authority-settings.json +30 -0
- package/dist/base/kits/veritas-governance/assets/starter-standards/veritas/repo-map.json +115 -0
- package/dist/base/kits/veritas-governance/assets/starter-standards/veritas/repo-standards/default.repo-standards.json +54 -0
- package/dist/base/kits/veritas-governance/assets/starter-standards/veritas.claims.json +179 -0
- package/dist/base/kits/veritas-governance/docs/README.md +141 -10
- package/dist/base/kits/veritas-governance/fixtures/standards-authoring/approved.trust-bundle.json +74 -0
- package/dist/base/kits/veritas-governance/fixtures/standards-authoring/not-approved.trust-bundle.json +74 -0
- package/dist/base/kits/veritas-governance/flows/standards-authoring.flow.json +35 -0
- package/dist/base/kits/veritas-governance/kit.json +65 -0
- package/dist/base/kits/veritas-governance/skills/consult-standards/SKILL.md +73 -0
- package/dist/base/kits/veritas-governance/skills/standards-authoring/SKILL.md +87 -0
- package/dist/base/schemas/backlog-provider-settings.schema.json +1 -1
- package/dist/base/schemas/workflow-waves.schema.json +347 -0
- package/dist/base/scripts/check-layer-boundary.mjs +98 -0
- package/dist/base/scripts/hooks/claude-telemetry-hook.js +6 -0
- package/dist/base/scripts/hooks/lib/liveness-heartbeat.js +42 -1
- package/dist/base/scripts/hooks/lib/liveness-write.js +109 -9
- package/dist/base/scripts/liveness/relay.sh +23 -11
- package/dist/base/scripts/telemetry/lib/config.sh +29 -0
- package/dist/catalog.json +2 -0
- package/dist/claude-code/.claude/agents/tool-security-reviewer.md +2 -1
- package/dist/claude-code/.claude/skills/consult-standards/SKILL.md +73 -0
- package/dist/claude-code/.claude/skills/execute-plan/SKILL.md +4 -3
- package/dist/claude-code/.claude/skills/pull-work/SKILL.md +12 -0
- package/dist/claude-code/.claude/skills/review-work/SKILL.md +11 -0
- package/dist/claude-code/.claude/skills/standards-authoring/SKILL.md +87 -0
- package/dist/claude-code/build/package.json +1 -1
- package/dist/claude-code/build/src/cli/init.js +35 -3
- package/dist/claude-code/build/src/cli/kit.js +95 -2
- package/dist/claude-code/build/src/cli/pull-work-provider.js +7 -1
- package/dist/claude-code/build/src/cli/validate-workflow-artifacts.js +53 -0
- package/dist/claude-code/build/src/cli/workflow.js +5 -1
- package/dist/claude-code/build/src/flow-kit/provision.d.ts +23 -0
- package/dist/claude-code/build/src/flow-kit/provision.js +99 -0
- package/dist/claude-code/build/src/flow-kit/validate.d.ts +52 -0
- package/dist/claude-code/build/src/flow-kit/validate.js +214 -9
- package/dist/claude-code/build/src/runtime-adapters.js +1 -1
- package/dist/claude-code/context/contracts/execution-contract.md +30 -1
- package/dist/claude-code/context/contracts/review-contract.md +4 -0
- package/dist/claude-code/context/contracts/trigger-guards.md +73 -0
- package/dist/claude-code/context/scripts/telemetry/lib/config.sh +29 -0
- package/dist/claude-code/context/settings/backlog-provider-settings.json +1 -1
- package/dist/claude-code/context/settings/workspace-backlog-provider-settings.example.json +1 -1
- package/dist/claude-code/docs/adr/0023-kit-provisioning.md +47 -0
- package/dist/claude-code/docs/adr/index.md +1 -0
- package/dist/claude-code/docs/architecture-engine-and-kits.md +17 -0
- package/dist/claude-code/docs/context-map.md +3 -0
- package/dist/claude-code/docs/decisions/backlog-readiness-source.md +89 -0
- package/dist/claude-code/docs/decisions/index.md +1 -0
- package/dist/claude-code/docs/developer-architecture.md +3 -3
- package/dist/claude-code/docs/flow-kit-repository-contract.md +34 -3
- package/dist/claude-code/docs/kit-authoring-guide.md +1 -1
- package/dist/claude-code/docs/veritas-integration.md +12 -0
- package/dist/claude-code/evals/ci/run-baseline.sh +4 -0
- package/dist/claude-code/evals/integration/test_kit_provisioning.sh +112 -0
- package/dist/claude-code/evals/integration/test_liveness_console_relay.sh +91 -1
- package/dist/claude-code/evals/integration/test_liveness_heartbeat.sh +66 -0
- package/dist/claude-code/evals/integration/test_pull_work_provider.sh +18 -0
- package/dist/claude-code/evals/integration/test_veritas_governance_kit.sh +256 -0
- package/dist/claude-code/evals/integration/test_workflow_artifacts.sh +257 -0
- package/dist/claude-code/evals/static/test_package.sh +6 -0
- package/dist/claude-code/evals/static/test_workflow_skills.sh +16 -0
- package/dist/claude-code/install.sh +1 -1
- package/dist/claude-code/kits/builder/flows/publish-learn.flow.json +9 -1
- package/dist/claude-code/kits/builder/skills/execute-plan/SKILL.md +4 -3
- package/dist/claude-code/kits/builder/skills/pull-work/SKILL.md +12 -0
- package/dist/claude-code/kits/builder/skills/review-work/SKILL.md +11 -0
- package/dist/claude-code/kits/veritas-governance/adapter/readiness-to-trust-bundle.mjs +19 -20
- package/dist/claude-code/kits/veritas-governance/assets/starter-hooks/githooks/post-commit +13 -0
- package/dist/claude-code/kits/veritas-governance/assets/starter-hooks/githooks/pre-push +13 -0
- package/dist/claude-code/kits/veritas-governance/assets/starter-standards/veritas/GOVERNANCE.md +23 -0
- package/dist/claude-code/kits/veritas-governance/assets/starter-standards/veritas/README.md +58 -0
- package/dist/claude-code/kits/veritas-governance/assets/starter-standards/veritas/authority/default.authority-settings.json +30 -0
- package/dist/claude-code/kits/veritas-governance/assets/starter-standards/veritas/repo-map.json +115 -0
- package/dist/claude-code/kits/veritas-governance/assets/starter-standards/veritas/repo-standards/default.repo-standards.json +54 -0
- package/dist/claude-code/kits/veritas-governance/assets/starter-standards/veritas.claims.json +179 -0
- package/dist/claude-code/kits/veritas-governance/docs/README.md +141 -10
- package/dist/claude-code/kits/veritas-governance/fixtures/standards-authoring/approved.trust-bundle.json +74 -0
- package/dist/claude-code/kits/veritas-governance/fixtures/standards-authoring/not-approved.trust-bundle.json +74 -0
- package/dist/claude-code/kits/veritas-governance/flows/standards-authoring.flow.json +35 -0
- package/dist/claude-code/kits/veritas-governance/kit.json +65 -0
- package/dist/claude-code/kits/veritas-governance/skills/consult-standards/SKILL.md +73 -0
- package/dist/claude-code/kits/veritas-governance/skills/standards-authoring/SKILL.md +87 -0
- package/dist/claude-code/schemas/backlog-provider-settings.schema.json +1 -1
- package/dist/claude-code/schemas/workflow-waves.schema.json +347 -0
- package/dist/claude-code/scripts/check-layer-boundary.mjs +98 -0
- package/dist/claude-code/scripts/hooks/claude-telemetry-hook.js +6 -0
- package/dist/claude-code/scripts/hooks/lib/liveness-heartbeat.js +42 -1
- package/dist/claude-code/scripts/hooks/lib/liveness-write.js +109 -9
- package/dist/claude-code/scripts/liveness/relay.sh +23 -11
- package/dist/claude-code/scripts/telemetry/lib/config.sh +29 -0
- package/dist/codex/.agents/skills/builder-shape/context/contracts/execution-contract.md +30 -1
- package/dist/codex/.agents/skills/consult-standards/SKILL.md +73 -0
- package/dist/codex/.agents/skills/deliver/context/contracts/execution-contract.md +30 -1
- package/dist/codex/.agents/skills/design-probe/context/contracts/execution-contract.md +30 -1
- package/dist/codex/.agents/skills/execute-plan/SKILL.md +4 -3
- package/dist/codex/.agents/skills/execute-plan/context/contracts/execution-contract.md +30 -1
- package/dist/codex/.agents/skills/fix-bug/context/contracts/execution-contract.md +30 -1
- package/dist/codex/.agents/skills/idea-to-backlog/context/contracts/execution-contract.md +30 -1
- package/dist/codex/.agents/skills/plan-work/context/contracts/execution-contract.md +30 -1
- package/dist/codex/.agents/skills/pull-work/SKILL.md +12 -0
- package/dist/codex/.agents/skills/pull-work/context/contracts/execution-contract.md +30 -1
- package/dist/codex/.agents/skills/review-work/SKILL.md +11 -0
- package/dist/codex/.agents/skills/review-work/context/contracts/execution-contract.md +30 -1
- package/dist/codex/.agents/skills/standards-authoring/SKILL.md +87 -0
- package/dist/codex/.agents/skills/tdd-workflow/context/contracts/execution-contract.md +30 -1
- package/dist/codex/.agents/skills/verify-work/context/contracts/execution-contract.md +30 -1
- package/dist/codex/.codex/agents/tool-security-reviewer.toml +1 -1
- package/dist/codex/build/package.json +1 -1
- package/dist/codex/build/src/cli/init.js +35 -3
- package/dist/codex/build/src/cli/kit.js +95 -2
- package/dist/codex/build/src/cli/pull-work-provider.js +7 -1
- package/dist/codex/build/src/cli/validate-workflow-artifacts.js +53 -0
- package/dist/codex/build/src/cli/workflow.js +5 -1
- package/dist/codex/build/src/flow-kit/provision.d.ts +23 -0
- package/dist/codex/build/src/flow-kit/provision.js +99 -0
- package/dist/codex/build/src/flow-kit/validate.d.ts +52 -0
- package/dist/codex/build/src/flow-kit/validate.js +214 -9
- package/dist/codex/build/src/runtime-adapters.js +1 -1
- package/dist/codex/context/contracts/execution-contract.md +30 -1
- package/dist/codex/context/contracts/review-contract.md +4 -0
- package/dist/codex/context/contracts/trigger-guards.md +73 -0
- package/dist/codex/context/scripts/telemetry/lib/config.sh +29 -0
- package/dist/codex/context/settings/backlog-provider-settings.json +1 -1
- package/dist/codex/context/settings/workspace-backlog-provider-settings.example.json +1 -1
- package/dist/codex/docs/adr/0023-kit-provisioning.md +47 -0
- package/dist/codex/docs/adr/index.md +1 -0
- package/dist/codex/docs/architecture-engine-and-kits.md +17 -0
- package/dist/codex/docs/context-map.md +3 -0
- package/dist/codex/docs/decisions/backlog-readiness-source.md +89 -0
- package/dist/codex/docs/decisions/index.md +1 -0
- package/dist/codex/docs/developer-architecture.md +3 -3
- package/dist/codex/docs/flow-kit-repository-contract.md +34 -3
- package/dist/codex/docs/kit-authoring-guide.md +1 -1
- package/dist/codex/docs/veritas-integration.md +12 -0
- package/dist/codex/evals/ci/run-baseline.sh +4 -0
- package/dist/codex/evals/integration/test_kit_provisioning.sh +112 -0
- package/dist/codex/evals/integration/test_liveness_console_relay.sh +91 -1
- package/dist/codex/evals/integration/test_liveness_heartbeat.sh +66 -0
- package/dist/codex/evals/integration/test_pull_work_provider.sh +18 -0
- package/dist/codex/evals/integration/test_veritas_governance_kit.sh +256 -0
- package/dist/codex/evals/integration/test_workflow_artifacts.sh +257 -0
- package/dist/codex/evals/static/test_package.sh +6 -0
- package/dist/codex/evals/static/test_workflow_skills.sh +16 -0
- package/dist/codex/install.sh +1 -1
- package/dist/codex/kits/builder/flows/publish-learn.flow.json +9 -1
- package/dist/codex/kits/builder/skills/execute-plan/SKILL.md +4 -3
- package/dist/codex/kits/builder/skills/pull-work/SKILL.md +12 -0
- package/dist/codex/kits/builder/skills/review-work/SKILL.md +11 -0
- package/dist/codex/kits/veritas-governance/adapter/readiness-to-trust-bundle.mjs +19 -20
- package/dist/codex/kits/veritas-governance/assets/starter-hooks/githooks/post-commit +13 -0
- package/dist/codex/kits/veritas-governance/assets/starter-hooks/githooks/pre-push +13 -0
- package/dist/codex/kits/veritas-governance/assets/starter-standards/veritas/GOVERNANCE.md +23 -0
- package/dist/codex/kits/veritas-governance/assets/starter-standards/veritas/README.md +58 -0
- package/dist/codex/kits/veritas-governance/assets/starter-standards/veritas/authority/default.authority-settings.json +30 -0
- package/dist/codex/kits/veritas-governance/assets/starter-standards/veritas/repo-map.json +115 -0
- package/dist/codex/kits/veritas-governance/assets/starter-standards/veritas/repo-standards/default.repo-standards.json +54 -0
- package/dist/codex/kits/veritas-governance/assets/starter-standards/veritas.claims.json +179 -0
- package/dist/codex/kits/veritas-governance/docs/README.md +141 -10
- package/dist/codex/kits/veritas-governance/fixtures/standards-authoring/approved.trust-bundle.json +74 -0
- package/dist/codex/kits/veritas-governance/fixtures/standards-authoring/not-approved.trust-bundle.json +74 -0
- package/dist/codex/kits/veritas-governance/flows/standards-authoring.flow.json +35 -0
- package/dist/codex/kits/veritas-governance/kit.json +65 -0
- package/dist/codex/kits/veritas-governance/skills/consult-standards/SKILL.md +73 -0
- package/dist/codex/kits/veritas-governance/skills/standards-authoring/SKILL.md +87 -0
- package/dist/codex/schemas/backlog-provider-settings.schema.json +1 -1
- package/dist/codex/schemas/workflow-waves.schema.json +347 -0
- package/dist/codex/scripts/check-layer-boundary.mjs +98 -0
- package/dist/codex/scripts/hooks/claude-telemetry-hook.js +6 -0
- package/dist/codex/scripts/hooks/lib/liveness-heartbeat.js +42 -1
- package/dist/codex/scripts/hooks/lib/liveness-write.js +109 -9
- package/dist/codex/scripts/liveness/relay.sh +23 -11
- package/dist/codex/scripts/telemetry/lib/config.sh +29 -0
- package/dist/kiro/agents/tool-security-reviewer.json +1 -1
- package/dist/kiro/build/package.json +1 -1
- package/dist/kiro/build/src/cli/init.js +35 -3
- package/dist/kiro/build/src/cli/kit.js +95 -2
- package/dist/kiro/build/src/cli/pull-work-provider.js +7 -1
- package/dist/kiro/build/src/cli/validate-workflow-artifacts.js +53 -0
- package/dist/kiro/build/src/cli/workflow.js +5 -1
- package/dist/kiro/build/src/flow-kit/provision.d.ts +23 -0
- package/dist/kiro/build/src/flow-kit/provision.js +99 -0
- package/dist/kiro/build/src/flow-kit/validate.d.ts +52 -0
- package/dist/kiro/build/src/flow-kit/validate.js +214 -9
- package/dist/kiro/build/src/runtime-adapters.js +1 -1
- package/dist/kiro/context/contracts/execution-contract.md +30 -1
- package/dist/kiro/context/contracts/review-contract.md +4 -0
- package/dist/kiro/context/contracts/trigger-guards.md +73 -0
- package/dist/kiro/context/scripts/telemetry/lib/config.sh +29 -0
- package/dist/kiro/context/settings/backlog-provider-settings.json +1 -1
- package/dist/kiro/context/settings/workspace-backlog-provider-settings.example.json +1 -1
- package/dist/kiro/docs/adr/0023-kit-provisioning.md +47 -0
- package/dist/kiro/docs/adr/index.md +1 -0
- package/dist/kiro/docs/architecture-engine-and-kits.md +17 -0
- package/dist/kiro/docs/context-map.md +3 -0
- package/dist/kiro/docs/decisions/backlog-readiness-source.md +89 -0
- package/dist/kiro/docs/decisions/index.md +1 -0
- package/dist/kiro/docs/developer-architecture.md +3 -3
- package/dist/kiro/docs/flow-kit-repository-contract.md +34 -3
- package/dist/kiro/docs/kit-authoring-guide.md +1 -1
- package/dist/kiro/docs/veritas-integration.md +12 -0
- package/dist/kiro/evals/ci/run-baseline.sh +4 -0
- package/dist/kiro/evals/integration/test_kit_provisioning.sh +112 -0
- package/dist/kiro/evals/integration/test_liveness_console_relay.sh +91 -1
- package/dist/kiro/evals/integration/test_liveness_heartbeat.sh +66 -0
- package/dist/kiro/evals/integration/test_pull_work_provider.sh +18 -0
- package/dist/kiro/evals/integration/test_veritas_governance_kit.sh +256 -0
- package/dist/kiro/evals/integration/test_workflow_artifacts.sh +257 -0
- package/dist/kiro/evals/static/test_package.sh +6 -0
- package/dist/kiro/evals/static/test_workflow_skills.sh +16 -0
- package/dist/kiro/install.sh +1 -1
- package/dist/kiro/kits/builder/flows/publish-learn.flow.json +9 -1
- package/dist/kiro/kits/builder/skills/execute-plan/SKILL.md +4 -3
- package/dist/kiro/kits/builder/skills/pull-work/SKILL.md +12 -0
- package/dist/kiro/kits/builder/skills/review-work/SKILL.md +11 -0
- package/dist/kiro/kits/veritas-governance/adapter/readiness-to-trust-bundle.mjs +19 -20
- package/dist/kiro/kits/veritas-governance/assets/starter-hooks/githooks/post-commit +13 -0
- package/dist/kiro/kits/veritas-governance/assets/starter-hooks/githooks/pre-push +13 -0
- package/dist/kiro/kits/veritas-governance/assets/starter-standards/veritas/GOVERNANCE.md +23 -0
- package/dist/kiro/kits/veritas-governance/assets/starter-standards/veritas/README.md +58 -0
- package/dist/kiro/kits/veritas-governance/assets/starter-standards/veritas/authority/default.authority-settings.json +30 -0
- package/dist/kiro/kits/veritas-governance/assets/starter-standards/veritas/repo-map.json +115 -0
- package/dist/kiro/kits/veritas-governance/assets/starter-standards/veritas/repo-standards/default.repo-standards.json +54 -0
- package/dist/kiro/kits/veritas-governance/assets/starter-standards/veritas.claims.json +179 -0
- package/dist/kiro/kits/veritas-governance/docs/README.md +141 -10
- package/dist/kiro/kits/veritas-governance/fixtures/standards-authoring/approved.trust-bundle.json +74 -0
- package/dist/kiro/kits/veritas-governance/fixtures/standards-authoring/not-approved.trust-bundle.json +74 -0
- package/dist/kiro/kits/veritas-governance/flows/standards-authoring.flow.json +35 -0
- package/dist/kiro/kits/veritas-governance/kit.json +65 -0
- package/dist/kiro/kits/veritas-governance/skills/consult-standards/SKILL.md +73 -0
- package/dist/kiro/kits/veritas-governance/skills/standards-authoring/SKILL.md +87 -0
- package/dist/kiro/schemas/backlog-provider-settings.schema.json +1 -1
- package/dist/kiro/schemas/workflow-waves.schema.json +347 -0
- package/dist/kiro/scripts/check-layer-boundary.mjs +98 -0
- package/dist/kiro/scripts/hooks/claude-telemetry-hook.js +6 -0
- package/dist/kiro/scripts/hooks/lib/liveness-heartbeat.js +42 -1
- package/dist/kiro/scripts/hooks/lib/liveness-write.js +109 -9
- package/dist/kiro/scripts/liveness/relay.sh +23 -11
- package/dist/kiro/scripts/telemetry/lib/config.sh +29 -0
- package/dist/opencode/.opencode/agents/tool-security-reviewer.md +2 -1
- package/dist/opencode/.opencode/skills/consult-standards/SKILL.md +73 -0
- package/dist/opencode/.opencode/skills/execute-plan/SKILL.md +4 -3
- package/dist/opencode/.opencode/skills/pull-work/SKILL.md +12 -0
- package/dist/opencode/.opencode/skills/review-work/SKILL.md +11 -0
- package/dist/opencode/.opencode/skills/standards-authoring/SKILL.md +87 -0
- package/dist/opencode/build/package.json +1 -1
- package/dist/opencode/build/src/cli/init.js +35 -3
- package/dist/opencode/build/src/cli/kit.js +95 -2
- package/dist/opencode/build/src/cli/pull-work-provider.js +7 -1
- package/dist/opencode/build/src/cli/validate-workflow-artifacts.js +53 -0
- package/dist/opencode/build/src/cli/workflow.js +5 -1
- package/dist/opencode/build/src/flow-kit/provision.d.ts +23 -0
- package/dist/opencode/build/src/flow-kit/provision.js +99 -0
- package/dist/opencode/build/src/flow-kit/validate.d.ts +52 -0
- package/dist/opencode/build/src/flow-kit/validate.js +214 -9
- package/dist/opencode/build/src/runtime-adapters.js +1 -1
- package/dist/opencode/context/contracts/execution-contract.md +30 -1
- package/dist/opencode/context/contracts/review-contract.md +4 -0
- package/dist/opencode/context/contracts/trigger-guards.md +73 -0
- package/dist/opencode/context/scripts/telemetry/lib/config.sh +29 -0
- package/dist/opencode/context/settings/backlog-provider-settings.json +1 -1
- package/dist/opencode/context/settings/workspace-backlog-provider-settings.example.json +1 -1
- package/dist/opencode/docs/adr/0023-kit-provisioning.md +47 -0
- package/dist/opencode/docs/adr/index.md +1 -0
- package/dist/opencode/docs/architecture-engine-and-kits.md +17 -0
- package/dist/opencode/docs/context-map.md +3 -0
- package/dist/opencode/docs/decisions/backlog-readiness-source.md +89 -0
- package/dist/opencode/docs/decisions/index.md +1 -0
- package/dist/opencode/docs/developer-architecture.md +3 -3
- package/dist/opencode/docs/flow-kit-repository-contract.md +34 -3
- package/dist/opencode/docs/kit-authoring-guide.md +1 -1
- package/dist/opencode/docs/veritas-integration.md +12 -0
- package/dist/opencode/evals/ci/run-baseline.sh +4 -0
- package/dist/opencode/evals/integration/test_kit_provisioning.sh +112 -0
- package/dist/opencode/evals/integration/test_liveness_console_relay.sh +91 -1
- package/dist/opencode/evals/integration/test_liveness_heartbeat.sh +66 -0
- package/dist/opencode/evals/integration/test_pull_work_provider.sh +18 -0
- package/dist/opencode/evals/integration/test_veritas_governance_kit.sh +256 -0
- package/dist/opencode/evals/integration/test_workflow_artifacts.sh +257 -0
- package/dist/opencode/evals/static/test_package.sh +6 -0
- package/dist/opencode/evals/static/test_workflow_skills.sh +16 -0
- package/dist/opencode/install.sh +1 -1
- package/dist/opencode/kits/builder/flows/publish-learn.flow.json +9 -1
- package/dist/opencode/kits/builder/skills/execute-plan/SKILL.md +4 -3
- package/dist/opencode/kits/builder/skills/pull-work/SKILL.md +12 -0
- package/dist/opencode/kits/builder/skills/review-work/SKILL.md +11 -0
- package/dist/opencode/kits/veritas-governance/adapter/readiness-to-trust-bundle.mjs +19 -20
- package/dist/opencode/kits/veritas-governance/assets/starter-hooks/githooks/post-commit +13 -0
- package/dist/opencode/kits/veritas-governance/assets/starter-hooks/githooks/pre-push +13 -0
- package/dist/opencode/kits/veritas-governance/assets/starter-standards/veritas/GOVERNANCE.md +23 -0
- package/dist/opencode/kits/veritas-governance/assets/starter-standards/veritas/README.md +58 -0
- package/dist/opencode/kits/veritas-governance/assets/starter-standards/veritas/authority/default.authority-settings.json +30 -0
- package/dist/opencode/kits/veritas-governance/assets/starter-standards/veritas/repo-map.json +115 -0
- package/dist/opencode/kits/veritas-governance/assets/starter-standards/veritas/repo-standards/default.repo-standards.json +54 -0
- package/dist/opencode/kits/veritas-governance/assets/starter-standards/veritas.claims.json +179 -0
- package/dist/opencode/kits/veritas-governance/docs/README.md +141 -10
- package/dist/opencode/kits/veritas-governance/fixtures/standards-authoring/approved.trust-bundle.json +74 -0
- package/dist/opencode/kits/veritas-governance/fixtures/standards-authoring/not-approved.trust-bundle.json +74 -0
- package/dist/opencode/kits/veritas-governance/flows/standards-authoring.flow.json +35 -0
- package/dist/opencode/kits/veritas-governance/kit.json +65 -0
- package/dist/opencode/kits/veritas-governance/skills/consult-standards/SKILL.md +73 -0
- package/dist/opencode/kits/veritas-governance/skills/standards-authoring/SKILL.md +87 -0
- package/dist/opencode/schemas/backlog-provider-settings.schema.json +1 -1
- package/dist/opencode/schemas/workflow-waves.schema.json +347 -0
- package/dist/opencode/scripts/check-layer-boundary.mjs +98 -0
- package/dist/opencode/scripts/hooks/claude-telemetry-hook.js +6 -0
- package/dist/opencode/scripts/hooks/lib/liveness-heartbeat.js +42 -1
- package/dist/opencode/scripts/hooks/lib/liveness-write.js +109 -9
- package/dist/opencode/scripts/liveness/relay.sh +23 -11
- package/dist/opencode/scripts/telemetry/lib/config.sh +29 -0
- package/dist/pi/.pi/skills/consult-standards/SKILL.md +73 -0
- package/dist/pi/.pi/skills/execute-plan/SKILL.md +4 -3
- package/dist/pi/.pi/skills/pull-work/SKILL.md +12 -0
- package/dist/pi/.pi/skills/review-work/SKILL.md +11 -0
- package/dist/pi/.pi/skills/standards-authoring/SKILL.md +87 -0
- package/dist/pi/build/package.json +1 -1
- package/dist/pi/build/src/cli/init.js +35 -3
- package/dist/pi/build/src/cli/kit.js +95 -2
- package/dist/pi/build/src/cli/pull-work-provider.js +7 -1
- package/dist/pi/build/src/cli/validate-workflow-artifacts.js +53 -0
- package/dist/pi/build/src/cli/workflow.js +5 -1
- package/dist/pi/build/src/flow-kit/provision.d.ts +23 -0
- package/dist/pi/build/src/flow-kit/provision.js +99 -0
- package/dist/pi/build/src/flow-kit/validate.d.ts +52 -0
- package/dist/pi/build/src/flow-kit/validate.js +214 -9
- package/dist/pi/build/src/runtime-adapters.js +1 -1
- package/dist/pi/context/contracts/execution-contract.md +30 -1
- package/dist/pi/context/contracts/review-contract.md +4 -0
- package/dist/pi/context/contracts/trigger-guards.md +73 -0
- package/dist/pi/context/scripts/telemetry/lib/config.sh +29 -0
- package/dist/pi/context/settings/backlog-provider-settings.json +1 -1
- package/dist/pi/context/settings/workspace-backlog-provider-settings.example.json +1 -1
- package/dist/pi/docs/adr/0023-kit-provisioning.md +47 -0
- package/dist/pi/docs/adr/index.md +1 -0
- package/dist/pi/docs/architecture-engine-and-kits.md +17 -0
- package/dist/pi/docs/context-map.md +3 -0
- package/dist/pi/docs/decisions/backlog-readiness-source.md +89 -0
- package/dist/pi/docs/decisions/index.md +1 -0
- package/dist/pi/docs/developer-architecture.md +3 -3
- package/dist/pi/docs/flow-kit-repository-contract.md +34 -3
- package/dist/pi/docs/kit-authoring-guide.md +1 -1
- package/dist/pi/docs/veritas-integration.md +12 -0
- package/dist/pi/evals/ci/run-baseline.sh +4 -0
- package/dist/pi/evals/integration/test_kit_provisioning.sh +112 -0
- package/dist/pi/evals/integration/test_liveness_console_relay.sh +91 -1
- package/dist/pi/evals/integration/test_liveness_heartbeat.sh +66 -0
- package/dist/pi/evals/integration/test_pull_work_provider.sh +18 -0
- package/dist/pi/evals/integration/test_veritas_governance_kit.sh +256 -0
- package/dist/pi/evals/integration/test_workflow_artifacts.sh +257 -0
- package/dist/pi/evals/static/test_package.sh +6 -0
- package/dist/pi/evals/static/test_workflow_skills.sh +16 -0
- package/dist/pi/install.sh +1 -1
- package/dist/pi/kits/builder/flows/publish-learn.flow.json +9 -1
- package/dist/pi/kits/builder/skills/execute-plan/SKILL.md +4 -3
- package/dist/pi/kits/builder/skills/pull-work/SKILL.md +12 -0
- package/dist/pi/kits/builder/skills/review-work/SKILL.md +11 -0
- package/dist/pi/kits/veritas-governance/adapter/readiness-to-trust-bundle.mjs +19 -20
- package/dist/pi/kits/veritas-governance/assets/starter-hooks/githooks/post-commit +13 -0
- package/dist/pi/kits/veritas-governance/assets/starter-hooks/githooks/pre-push +13 -0
- package/dist/pi/kits/veritas-governance/assets/starter-standards/veritas/GOVERNANCE.md +23 -0
- package/dist/pi/kits/veritas-governance/assets/starter-standards/veritas/README.md +58 -0
- package/dist/pi/kits/veritas-governance/assets/starter-standards/veritas/authority/default.authority-settings.json +30 -0
- package/dist/pi/kits/veritas-governance/assets/starter-standards/veritas/repo-map.json +115 -0
- package/dist/pi/kits/veritas-governance/assets/starter-standards/veritas/repo-standards/default.repo-standards.json +54 -0
- package/dist/pi/kits/veritas-governance/assets/starter-standards/veritas.claims.json +179 -0
- package/dist/pi/kits/veritas-governance/docs/README.md +141 -10
- package/dist/pi/kits/veritas-governance/fixtures/standards-authoring/approved.trust-bundle.json +74 -0
- package/dist/pi/kits/veritas-governance/fixtures/standards-authoring/not-approved.trust-bundle.json +74 -0
- package/dist/pi/kits/veritas-governance/flows/standards-authoring.flow.json +35 -0
- package/dist/pi/kits/veritas-governance/kit.json +65 -0
- package/dist/pi/kits/veritas-governance/skills/consult-standards/SKILL.md +73 -0
- package/dist/pi/kits/veritas-governance/skills/standards-authoring/SKILL.md +87 -0
- package/dist/pi/schemas/backlog-provider-settings.schema.json +1 -1
- package/dist/pi/schemas/workflow-waves.schema.json +347 -0
- package/dist/pi/scripts/check-layer-boundary.mjs +98 -0
- package/dist/pi/scripts/hooks/claude-telemetry-hook.js +6 -0
- package/dist/pi/scripts/hooks/lib/liveness-heartbeat.js +42 -1
- package/dist/pi/scripts/hooks/lib/liveness-write.js +109 -9
- package/dist/pi/scripts/liveness/relay.sh +23 -11
- package/dist/pi/scripts/telemetry/lib/config.sh +29 -0
- package/docs/adr/0023-kit-provisioning.md +47 -0
- package/docs/adr/index.md +1 -0
- package/docs/architecture-engine-and-kits.md +17 -0
- package/docs/context-map.md +3 -0
- package/docs/decisions/backlog-readiness-source.md +89 -0
- package/docs/decisions/index.md +1 -0
- package/docs/developer-architecture.md +3 -3
- package/docs/flow-kit-repository-contract.md +34 -3
- package/docs/kit-authoring-guide.md +1 -1
- package/docs/veritas-integration.md +12 -0
- package/evals/ci/run-baseline.sh +4 -0
- package/evals/integration/test_kit_provisioning.sh +112 -0
- package/evals/integration/test_liveness_console_relay.sh +91 -1
- package/evals/integration/test_liveness_heartbeat.sh +66 -0
- package/evals/integration/test_pull_work_provider.sh +18 -0
- package/evals/integration/test_veritas_governance_kit.sh +256 -0
- package/evals/integration/test_workflow_artifacts.sh +257 -0
- package/evals/static/test_package.sh +6 -0
- package/evals/static/test_workflow_skills.sh +16 -0
- package/kits/builder/flows/publish-learn.flow.json +9 -1
- package/kits/builder/skills/execute-plan/SKILL.md +4 -3
- package/kits/builder/skills/pull-work/SKILL.md +12 -0
- package/kits/builder/skills/review-work/SKILL.md +11 -0
- package/kits/veritas-governance/adapter/readiness-to-trust-bundle.mjs +19 -20
- package/kits/veritas-governance/assets/starter-hooks/githooks/post-commit +13 -0
- package/kits/veritas-governance/assets/starter-hooks/githooks/pre-push +13 -0
- package/kits/veritas-governance/assets/starter-standards/veritas/GOVERNANCE.md +23 -0
- package/kits/veritas-governance/assets/starter-standards/veritas/README.md +58 -0
- package/kits/veritas-governance/assets/starter-standards/veritas/authority/default.authority-settings.json +30 -0
- package/kits/veritas-governance/assets/starter-standards/veritas/repo-map.json +115 -0
- package/kits/veritas-governance/assets/starter-standards/veritas/repo-standards/default.repo-standards.json +54 -0
- package/kits/veritas-governance/assets/starter-standards/veritas.claims.json +179 -0
- package/kits/veritas-governance/docs/README.md +141 -10
- package/kits/veritas-governance/fixtures/standards-authoring/approved.trust-bundle.json +74 -0
- package/kits/veritas-governance/fixtures/standards-authoring/not-approved.trust-bundle.json +74 -0
- package/kits/veritas-governance/flows/standards-authoring.flow.json +35 -0
- package/kits/veritas-governance/kit.json +65 -0
- package/kits/veritas-governance/skills/consult-standards/SKILL.md +73 -0
- package/kits/veritas-governance/skills/standards-authoring/SKILL.md +87 -0
- package/package.json +2 -1
- package/schemas/backlog-provider-settings.schema.json +1 -1
- package/schemas/workflow-waves.schema.json +347 -0
- package/scripts/check-layer-boundary.mjs +98 -0
- package/scripts/hooks/claude-telemetry-hook.js +6 -0
- package/scripts/hooks/lib/liveness-heartbeat.js +42 -1
- package/scripts/hooks/lib/liveness-write.js +109 -9
- package/scripts/liveness/relay.sh +23 -11
- package/scripts/telemetry/lib/config.sh +29 -0
- package/src/cli/builder-flow-runtime.test.mjs +86 -0
- package/src/cli/flow-resolver-composition.test.mjs +20 -1
- package/src/cli/init.ts +31 -3
- package/src/cli/kit-metadata-security.test.mjs +163 -1
- package/src/cli/kit-provisioning.test.mjs +122 -0
- package/src/cli/kit.ts +83 -2
- package/src/cli/pull-work-provider.ts +7 -1
- package/src/cli/validate-waves.test.mjs +134 -0
- package/src/cli/validate-workflow-artifacts.ts +47 -0
- package/src/cli/workflow.ts +7 -1
- package/src/flow-kit/provision.ts +118 -0
- package/src/flow-kit/validate.ts +233 -10
- package/src/runtime-adapters.ts +1 -1
package/.github/workflows/ci.yml
CHANGED
|
@@ -68,6 +68,10 @@ jobs:
|
|
|
68
68
|
continue-on-error: true
|
|
69
69
|
run: bash evals/ci/run-baseline.sh --check content-boundary
|
|
70
70
|
|
|
71
|
+
- name: Layer boundary
|
|
72
|
+
continue-on-error: true
|
|
73
|
+
run: bash evals/ci/run-baseline.sh --check layer-boundary
|
|
74
|
+
|
|
71
75
|
- name: Hachure boundary
|
|
72
76
|
continue-on-error: true
|
|
73
77
|
run: bash evals/ci/run-baseline.sh --check hachure-boundary
|
|
@@ -326,6 +330,10 @@ jobs:
|
|
|
326
330
|
continue-on-error: true
|
|
327
331
|
run: bash evals/ci/run-baseline.sh --check flow-kit-repository-integration
|
|
328
332
|
|
|
333
|
+
- name: Kit provisioning integration
|
|
334
|
+
continue-on-error: true
|
|
335
|
+
run: bash evals/ci/run-baseline.sh --check kit-provisioning-integration
|
|
336
|
+
|
|
329
337
|
- name: Runtime adapter activation integration
|
|
330
338
|
continue-on-error: true
|
|
331
339
|
run: bash evals/ci/run-baseline.sh --check runtime-adapter-activation-integration
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,39 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [4.2.0](https://github.com/kontourai/flow-agents/compare/v4.1.0...v4.2.0) (2026-07-18)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Features
|
|
7
|
+
|
|
8
|
+
* **liveness:** conf-driven console relay enablement ([#567](https://github.com/kontourai/flow-agents/issues/567)) + richer real-liveness signals ([#705](https://github.com/kontourai/flow-agents/issues/705)) ([b1dd5b0](https://github.com/kontourai/flow-agents/commit/b1dd5b081280d49c07d4e92ff2ffc5103dc89800))
|
|
9
|
+
|
|
10
|
+
## [4.1.0](https://github.com/kontourai/flow-agents/compare/v4.0.0...v4.1.0) (2026-07-18)
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
### Features
|
|
14
|
+
|
|
15
|
+
* **backlog:** board-based readiness source decision + surfaced fallback warnings ([#441](https://github.com/kontourai/flow-agents/issues/441)) ([#692](https://github.com/kontourai/flow-agents/issues/692)) ([8dc292d](https://github.com/kontourai/flow-agents/commit/8dc292d8df1e25373e603fe4d81a598aed063584))
|
|
16
|
+
* **ci:** enforce kits wrap the veritas engine via CLI, not as a library ([#651](https://github.com/kontourai/flow-agents/issues/651)) ([#701](https://github.com/kontourai/flow-agents/issues/701)) ([1fd0380](https://github.com/kontourai/flow-agents/commit/1fd0380ff0310d89db9c168d363a74c0df5aee04))
|
|
17
|
+
* **kit:** kit-provisioning primitive — declare files a kit scaffolds into a consumer repo ([#647](https://github.com/kontourai/flow-agents/issues/647)) ([#691](https://github.com/kontourai/flow-agents/issues/691)) ([a85bdad](https://github.com/kontourai/flow-agents/commit/a85bdad05676415cd9948b470b2d5cc079d5e6c7))
|
|
18
|
+
* **kits:** standing trigger-guards contract and agent_spawn_triggers validation warning ([#664](https://github.com/kontourai/flow-agents/issues/664)) ([#686](https://github.com/kontourai/flow-agents/issues/686)) ([ffcf0d9](https://github.com/kontourai/flow-agents/commit/ffcf0d98febc1815882c1586234806b831b90912))
|
|
19
|
+
* **veritas-governance:** consult-standards skill — JIT guidance via veritas explain (flow-agents[#649](https://github.com/kontourai/flow-agents/issues/649)) ([#700](https://github.com/kontourai/flow-agents/issues/700)) ([f1e8db2](https://github.com/kontourai/flow-agents/commit/f1e8db288b241e55b132be5a09dbfbdc4aaaa6b7))
|
|
20
|
+
* **veritas-governance:** provision governance git hooks (flow-agents[#648](https://github.com/kontourai/flow-agents/issues/648)) ([#699](https://github.com/kontourai/flow-agents/issues/699)) ([22965dd](https://github.com/kontourai/flow-agents/commit/22965ddeaf408ee9d5f8241cea60869a793a6495))
|
|
21
|
+
* **veritas-governance:** scaffold starter Repo Standards via kit provisions (flow-agents[#647](https://github.com/kontourai/flow-agents/issues/647)) ([#696](https://github.com/kontourai/flow-agents/issues/696)) ([6943362](https://github.com/kontourai/flow-agents/commit/6943362e39088682fabdbef032283041a3567411))
|
|
22
|
+
* **veritas-governance:** standards-authoring flow + skill ([#647](https://github.com/kontourai/flow-agents/issues/647)) ([#698](https://github.com/kontourai/flow-agents/issues/698)) ([6591a26](https://github.com/kontourai/flow-agents/commit/6591a268b8d16b41622c5203f4c97ca051170e29))
|
|
23
|
+
* **workflow:** machine-checkable wave-result reconciliation manifest ([#663](https://github.com/kontourai/flow-agents/issues/663) slice 1) ([#702](https://github.com/kontourai/flow-agents/issues/702)) ([282d2fd](https://github.com/kontourai/flow-agents/commit/282d2fdd28a941e6eb2d17fcd312d2f478f5e72d))
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
### Fixes
|
|
27
|
+
|
|
28
|
+
* **builder:** declare pr-open-gate route-back so missing_evidence repairs at verify ([#695](https://github.com/kontourai/flow-agents/issues/695) item a) ([#697](https://github.com/kontourai/flow-agents/issues/697)) ([d8b83df](https://github.com/kontourai/flow-agents/commit/d8b83dfd484828fadca3561bc51afdfd5d691f34))
|
|
29
|
+
* make workflow critique usable for single-orchestrator review ([#689](https://github.com/kontourai/flow-agents/issues/689), [#690](https://github.com/kontourai/flow-agents/issues/690)) ([#704](https://github.com/kontourai/flow-agents/issues/704)) ([a838b2e](https://github.com/kontourai/flow-agents/commit/a838b2e162e3bd31f6cc7314507f9bee7ac4ef5d))
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
### Documentation
|
|
33
|
+
|
|
34
|
+
* reconcile flow-agents docs to the veritas engine/kit split ([#652](https://github.com/kontourai/flow-agents/issues/652)) ([#703](https://github.com/kontourai/flow-agents/issues/703)) ([147b87a](https://github.com/kontourai/flow-agents/commit/147b87a3de14e8cc0d127e866c8136b60ab9b5b7))
|
|
35
|
+
* **veritas-governance:** point to the ratified engine/surface seam doc; refresh fixed veritas[#106](https://github.com/kontourai/flow-agents/issues/106) status ([#688](https://github.com/kontourai/flow-agents/issues/688)) ([14ba90d](https://github.com/kontourai/flow-agents/commit/14ba90db7ec844286479fc0a31af1ae5c1bc12ed))
|
|
36
|
+
|
|
3
37
|
## [4.0.0](https://github.com/kontourai/flow-agents/compare/v3.12.1...v4.0.0) (2026-07-16)
|
|
4
38
|
|
|
5
39
|
|
package/CONTEXT.md
CHANGED
|
@@ -196,6 +196,11 @@ _Avoid_: Boundary Crossing as the generic Flow Agents term
|
|
|
196
196
|
An executable backlog or queue unit selected by a workflow. Work Items are provider-backed when a backlog provider is configured, and Flow Agents keeps a portable local-first Kontour Resource Contract shape for local use, tests, kit demos, and migration. A Work Item is smaller than an Initiative and large enough to move through one coherent Workflow Run with clear acceptance evidence.
|
|
197
197
|
_Avoid_: Task as the generic term, Issue as the provider-neutral term
|
|
198
198
|
|
|
199
|
+
### Backlog Readiness Source
|
|
200
|
+
|
|
201
|
+
The provider-backed signal that marks a Work Item intentionally ready for pickup, read by `pull-work` to build the ready queue. The readiness source is declared by backlog provider settings (currently the configured BoardProvider's ready statuses); a configured readiness source that yields nothing is a surfaced warning, never a silent fallback to unranked issue listing. The live decision is recorded in `docs/decisions/backlog-readiness-source.md`.
|
|
202
|
+
_Avoid_: ready label, board status as interchangeable generic terms
|
|
203
|
+
|
|
199
204
|
### Work Item Group
|
|
200
205
|
|
|
201
206
|
A Builder Kit Selected Scope containing multiple related Work Items delivered through one Delivery Run because grouping reduces coordination risk and preserves one coherent acceptance and evidence story. Work Item Groups are exceptions justified by `pull-work`; they do not replace Initiatives.
|
|
@@ -51,6 +51,6 @@
|
|
|
51
51
|
"tools" : [ "read", "imageRead", "glob", "grep", "ls", "code", "shell" ],
|
|
52
52
|
"name" : "tool-security-reviewer",
|
|
53
53
|
"description" : "Delegate to me for security analysis. Checks OWASP Top 10, secrets detection, input validation, injection vulnerabilities, auth/authz, and rate limiting. Read-only analysis with shell for scanning tools.",
|
|
54
|
-
"prompt" : "You are a security reviewer. You analyze source code for vulnerabilities and produce a structured security report.\n\n## Input\nYou receive:\n- A list of files to review\n- Optional focus area (auth, input handling, DB, etc.)\n\n## Security Checklist\n\nFor each file, check:\n- **Hardcoded secrets**: API keys, tokens, passwords, connection strings, private keys\n- **SQL injection**: string concatenation in queries, missing parameterization\n- **XSS**: unescaped user input in HTML/templates, innerHTML usage\n- **CSRF**: missing CSRF tokens on state-changing endpoints\n- **Path traversal**: user input in file paths without sanitization\n- **Auth bypasses**: missing auth checks, broken access control, privilege escalation\n- **Rate limiting**: unprotected endpoints susceptible to abuse\n- **Error leakage**: stack traces, internal paths, or system info in error responses\n- **Dependency vulnerabilities**: run npm audit / pip-audit / cargo audit if available\n\n## OWASP Top 10 Mapping\n\nTag each finding with its OWASP category:\n- A01: Broken Access Control\n- A02: Cryptographic Failures\n- A03: Injection\n- A04: Insecure Design\n- A05: Security Misconfiguration\n- A06: Vulnerable Components\n- A07: Auth Failures\n- A08: Data Integrity Failures\n- A09: Logging Failures\n- A10: SSRF\n\n## Trigger Conditions\n\nPrioritize review of code involving:\n- Authentication or authorization logic\n- User input handling (forms, query params, headers)\n- Database queries\n- File system operations\n- External API calls\n- Cryptographic operations\n- Payment or financial code\n\n## Secret Patterns\n\nScan for common patterns:\n- `AKIA[0-9A-Z]{16}` (AWS access keys)\n- `-----BEGIN (RSA |EC )?PRIVATE KEY-----`\n- `(password|secret|token|api_key)\\s*[:=]\\s*['\"][^'\"]+['\"]`\n- Base64-encoded strings >40 chars in assignments\n\n## Output\n\nReturn a structured security report:\n```markdown\n## Security Review\n\nFiles analyzed: <count>\nFindings: <count by severity>\n\n### Findings\n\n#### [CRITICAL/HIGH/MEDIUM/LOW] <OWASP-ID> — <file>:<line> — <title>\n<description with evidence>\n**Remediation:** <specific fix>\n\n### Summary\n<overall assessment>\n```\n\n## Rules\n- No false positives without evidence
|
|
54
|
+
"prompt" : "You are a security reviewer. You analyze source code for vulnerabilities and produce a structured security report.\n\n## Input\nYou receive:\n- A list of files to review\n- Optional focus area (auth, input handling, DB, etc.)\n\n## Security Checklist\n\nFor each file, check:\n- **Hardcoded secrets**: API keys, tokens, passwords, connection strings, private keys\n- **SQL injection**: string concatenation in queries, missing parameterization\n- **XSS**: unescaped user input in HTML/templates, innerHTML usage\n- **CSRF**: missing CSRF tokens on state-changing endpoints\n- **Path traversal**: user input in file paths without sanitization\n- **Auth bypasses**: missing auth checks, broken access control, privilege escalation\n- **Rate limiting**: unprotected endpoints susceptible to abuse\n- **Error leakage**: stack traces, internal paths, or system info in error responses\n- **Dependency vulnerabilities**: run npm audit / pip-audit / cargo audit if available\n\n## OWASP Top 10 Mapping\n\nTag each finding with its OWASP category:\n- A01: Broken Access Control\n- A02: Cryptographic Failures\n- A03: Injection\n- A04: Insecure Design\n- A05: Security Misconfiguration\n- A06: Vulnerable Components\n- A07: Auth Failures\n- A08: Data Integrity Failures\n- A09: Logging Failures\n- A10: SSRF\n\n## Trigger Conditions\n\nPrioritize review of code involving:\n- Authentication or authorization logic\n- User input handling (forms, query params, headers)\n- Database queries\n- File system operations\n- External API calls\n- Cryptographic operations\n- Payment or financial code\n\n## Secret Patterns\n\nScan for common patterns:\n- `AKIA[0-9A-Z]{16}` (AWS access keys)\n- `-----BEGIN (RSA |EC )?PRIVATE KEY-----`\n- `(password|secret|token|api_key)\\s*[:=]\\s*['\"][^'\"]+['\"]`\n- Base64-encoded strings >40 chars in assignments\n\n## Output\n\nReturn a structured security report:\n```markdown\n## Security Review\n\nFiles analyzed: <count>\nFindings: <count by severity>\n\n### Findings\n\n#### [CRITICAL/HIGH/MEDIUM/LOW] <OWASP-ID> — <file>:<line> — <title>\n<description with evidence>\n**Remediation:** <specific fix>\n\n### Summary\n<overall assessment>\n```\n\n## Rules\n- No false positives without evidence: cite the exact `file:line` and a one-line description of the weakness as the evidence.\n- Do NOT reproduce exploit payloads, working attack strings, or large copied blocks of vulnerable code in the report. A precise `file:line` reference plus a short description IS the evidence — reproduction detail belongs in the fix pass, not the recorded finding. (This keeps security findings recordable through `workflow critique`, whose reviewer runtime's provider may content-filter exploit-shaped prose.)\n- Run dependency audit tools if available (npm audit, pip-audit, cargo audit).\n- If no security issues found, say so clearly — don't invent findings.\n- This is read-only analysis. Do not modify any files.",
|
|
55
55
|
"model" : "claude-sonnet-4.6-1m"
|
|
56
56
|
}
|
package/build/src/cli/init.js
CHANGED
|
@@ -8,6 +8,7 @@ import { createInterface } from "node:readline/promises";
|
|
|
8
8
|
import { stdin as input, stdout as output } from "node:process";
|
|
9
9
|
import { parseArgs, flagBool, flagList, flagString } from "../lib/args.js";
|
|
10
10
|
import { activateCodexLocal } from "../runtime-adapters.js";
|
|
11
|
+
import { provisionKit, ProvisionConflictError } from "../flow-kit/provision.js";
|
|
11
12
|
import { main as buildBundles } from "../tools/build-universal-bundles.js";
|
|
12
13
|
import { root } from "../tools/common.js";
|
|
13
14
|
import { defaultCodexHome, durableInstallRecordPath, skillsManifestPath } from "../lib/local-artifact-root.js";
|
|
@@ -571,7 +572,21 @@ function installBundle(bundle, options) {
|
|
|
571
572
|
}
|
|
572
573
|
return result.status ?? 1;
|
|
573
574
|
}
|
|
574
|
-
function
|
|
575
|
+
function kitPathForInit(kitId, dest) {
|
|
576
|
+
const catalogPath = path.join(root, "kits", "catalog.json");
|
|
577
|
+
if (fs.existsSync(catalogPath)) {
|
|
578
|
+
const catalog = JSON.parse(fs.readFileSync(catalogPath, "utf8"));
|
|
579
|
+
const entry = Array.isArray(catalog.kits)
|
|
580
|
+
? catalog.kits.find((item) => typeof item === "object" && item !== null && item.id === kitId)
|
|
581
|
+
: undefined;
|
|
582
|
+
const rel = entry && typeof entry === "object" ? entry.path : undefined;
|
|
583
|
+
if (typeof rel === "string")
|
|
584
|
+
return path.resolve(root, rel);
|
|
585
|
+
}
|
|
586
|
+
const installed = path.join(dest, "kits", "local", "repositories", kitId);
|
|
587
|
+
return fs.existsSync(installed) ? installed : null;
|
|
588
|
+
}
|
|
589
|
+
async function activateKits(options) {
|
|
575
590
|
const activeKitIds = options.activeKitIds ?? [];
|
|
576
591
|
if (!options.activateKits || activeKitIds.length === 0 || options.runtime !== "codex")
|
|
577
592
|
return 0;
|
|
@@ -582,6 +597,23 @@ function activateKits(options) {
|
|
|
582
597
|
}
|
|
583
598
|
const generated = Array.isArray(result.generated_runtime_files) ? result.generated_runtime_files : [];
|
|
584
599
|
console.log(`Activated ${generated.length} Codex local runtime asset(s)`);
|
|
600
|
+
for (const kitId of activeKitIds) {
|
|
601
|
+
const kitDir = kitPathForInit(kitId, options.dest);
|
|
602
|
+
if (!kitDir)
|
|
603
|
+
throw new Error(`activated kit '${kitId}' could not be resolved for provisioning`);
|
|
604
|
+
try {
|
|
605
|
+
const provisioned = await provisionKit(kitDir, options.dest);
|
|
606
|
+
if (provisioned.files.length > 0)
|
|
607
|
+
console.log(`Provisioned ${provisioned.files.length} file(s) from kit '${kitId}'`);
|
|
608
|
+
}
|
|
609
|
+
catch (error) {
|
|
610
|
+
if (!(error instanceof ProvisionConflictError))
|
|
611
|
+
throw error;
|
|
612
|
+
for (const conflict of error.conflicts) {
|
|
613
|
+
console.warn(`flow-agents init: warning: skipped existing provision '${conflict.target}' from kit '${kitId}'`);
|
|
614
|
+
}
|
|
615
|
+
}
|
|
616
|
+
}
|
|
585
617
|
return 0;
|
|
586
618
|
}
|
|
587
619
|
/**
|
|
@@ -809,7 +841,7 @@ export async function main(argv = process.argv.slice(2)) {
|
|
|
809
841
|
if (installed !== 0)
|
|
810
842
|
return installed;
|
|
811
843
|
writeInstallRecord(options.dest, "codex", true, options.activeKitIds ?? []);
|
|
812
|
-
return activateKits(options);
|
|
844
|
+
return await activateKits(options);
|
|
813
845
|
}
|
|
814
846
|
// --global for pi: NOT_VERIFIED (no documented global dir). Warn and fall through to workspace install.
|
|
815
847
|
if (options.global && options.runtime === "pi") {
|
|
@@ -822,7 +854,7 @@ export async function main(argv = process.argv.slice(2)) {
|
|
|
822
854
|
if (installed !== 0)
|
|
823
855
|
return installed;
|
|
824
856
|
writeInstallRecord(options.dest, options.runtime, options.global, options.activeKitIds ?? []);
|
|
825
|
-
const activated = activateKits(options);
|
|
857
|
+
const activated = await activateKits(options);
|
|
826
858
|
// G2/G3: shared post-install auto-verify + summary tail. Applies
|
|
827
859
|
// identically whether main() reached here via headlessOptions() or
|
|
828
860
|
// interactiveOptions() -- never changes `activated`'s exit code.
|
package/build/src/cli/kit.js
CHANGED
|
@@ -6,7 +6,8 @@ import * as path from "node:path";
|
|
|
6
6
|
import { fileURLToPath } from "node:url";
|
|
7
7
|
import { parseArgs, flagBool, flagString } from "../lib/args.js";
|
|
8
8
|
import { assertPathContained, assertPathsDisjoint, atomicWriteJson, copyDirAtomic, ensureSafeDirectory, isoNow, readJson, walkFiles } from "../lib/fs.js";
|
|
9
|
-
import { assertKitRepository, deriveKitTargets, parseKitDependencies } from "../flow-kit/validate.js";
|
|
9
|
+
import { assertKitRepository, deriveKitTargets, parseKitDependencies, validateKitRepositoryDiagnostics } from "../flow-kit/validate.js";
|
|
10
|
+
import { provisionKit, ProvisionConflictError } from "../flow-kit/provision.js";
|
|
10
11
|
import { activateCodexLocal, activateStrandsLocal } from "../runtime-adapters.js";
|
|
11
12
|
import { defaultCodexHome } from "../lib/local-artifact-root.js";
|
|
12
13
|
import { root } from "../tools/common.js";
|
|
@@ -35,6 +36,18 @@ function resolveCatalogKitSource(source) {
|
|
|
35
36
|
return null;
|
|
36
37
|
return path.resolve(path.dirname(repoCatalogPath), "..", rel);
|
|
37
38
|
}
|
|
39
|
+
function resolveProvisionKitSource(source, dest) {
|
|
40
|
+
const localPath = path.resolve(source);
|
|
41
|
+
if (fs.existsSync(localPath))
|
|
42
|
+
return localPath;
|
|
43
|
+
const installed = loadRegistry(dest).kits.find((entry) => entry.id === source);
|
|
44
|
+
if (installed) {
|
|
45
|
+
const installedSource = installedPath(dest, source);
|
|
46
|
+
if (fs.existsSync(installedSource))
|
|
47
|
+
return installedSource;
|
|
48
|
+
}
|
|
49
|
+
return resolveCatalogKitSource(source);
|
|
50
|
+
}
|
|
38
51
|
function loadRegistry(dest) {
|
|
39
52
|
const file = registryPath(dest);
|
|
40
53
|
if (!fs.existsSync(file))
|
|
@@ -64,6 +77,17 @@ function warnUninstalledDependencies(manifest, manifestPath, dest) {
|
|
|
64
77
|
}
|
|
65
78
|
}
|
|
66
79
|
}
|
|
80
|
+
/**
|
|
81
|
+
* Print non-blocking kit-validation warnings (e.g. an agent-spawning trigger surface
|
|
82
|
+
* declared without complete guard config — context/contracts/trigger-guards.md).
|
|
83
|
+
* Shared by BOTH install source forms (local path and git clone) so the standing
|
|
84
|
+
* warning contract cannot silently diverge between them. Same non-blocking
|
|
85
|
+
* `warning:` convention as warnUninstalledDependencies above.
|
|
86
|
+
*/
|
|
87
|
+
async function printKitValidationWarnings(kitDir) {
|
|
88
|
+
for (const warning of (await validateKitRepositoryDiagnostics(kitDir)).warnings)
|
|
89
|
+
console.log(`warning: ${warning}`);
|
|
90
|
+
}
|
|
67
91
|
function contentHash(root) {
|
|
68
92
|
const hash = crypto.createHash("sha256");
|
|
69
93
|
for (const file of walkFiles(root)) {
|
|
@@ -122,6 +146,7 @@ async function installLocalSource(source, argv) {
|
|
|
122
146
|
let manifest;
|
|
123
147
|
try {
|
|
124
148
|
manifest = await assertKitRepository(source);
|
|
149
|
+
await printKitValidationWarnings(source);
|
|
125
150
|
}
|
|
126
151
|
catch (error) {
|
|
127
152
|
console.log("Flow Kit repository validation failed:");
|
|
@@ -211,6 +236,7 @@ async function installGitSource(rawUrl, argv) {
|
|
|
211
236
|
let manifest;
|
|
212
237
|
try {
|
|
213
238
|
manifest = await assertKitRepository(tmpBase);
|
|
239
|
+
await printKitValidationWarnings(tmpBase);
|
|
214
240
|
}
|
|
215
241
|
catch (error) {
|
|
216
242
|
console.log("Flow Kit repository validation failed:");
|
|
@@ -321,6 +347,69 @@ function activate(argv) {
|
|
|
321
347
|
console.log(JSON.stringify(result, null, 2));
|
|
322
348
|
return Array.isArray(result.errors) && result.errors.length ? 1 : 0;
|
|
323
349
|
}
|
|
350
|
+
async function validate(argv) {
|
|
351
|
+
const args = parseArgs(argv);
|
|
352
|
+
const kitDir = path.resolve(args.positionals[0] ?? ".");
|
|
353
|
+
const diagnostics = await validateKitRepositoryDiagnostics(kitDir);
|
|
354
|
+
for (const warning of diagnostics.warnings)
|
|
355
|
+
console.log(`warning: ${warning}`);
|
|
356
|
+
if (diagnostics.errors.length) {
|
|
357
|
+
console.log("Flow Kit repository validation failed:");
|
|
358
|
+
for (const error of diagnostics.errors)
|
|
359
|
+
console.log(` - ${error}`);
|
|
360
|
+
return 1;
|
|
361
|
+
}
|
|
362
|
+
console.log(`Flow Kit repository validation passed: ${kitDir}`);
|
|
363
|
+
return 0;
|
|
364
|
+
}
|
|
365
|
+
async function provision(argv) {
|
|
366
|
+
const args = parseArgs(argv);
|
|
367
|
+
const source = args.positionals[0];
|
|
368
|
+
if (!source) {
|
|
369
|
+
console.error("provision: missing <kit-id-or-path> argument");
|
|
370
|
+
console.error("usage: flow-agents kit provision <kit-id-or-path> [--target <dir>] [--force] [--dry-run]");
|
|
371
|
+
return 2;
|
|
372
|
+
}
|
|
373
|
+
const dest = resolveDest(args.flags);
|
|
374
|
+
const kitDir = resolveProvisionKitSource(source, dest);
|
|
375
|
+
if (!kitDir) {
|
|
376
|
+
console.error(`provision: kit '${source}' was not found as a local path, installed kit, or catalog kit`);
|
|
377
|
+
return 1;
|
|
378
|
+
}
|
|
379
|
+
const target = path.resolve(flagString(args.flags, "target", process.cwd()) ?? process.cwd());
|
|
380
|
+
try {
|
|
381
|
+
const result = await provisionKit(kitDir, target, {
|
|
382
|
+
force: flagBool(args.flags, "force"),
|
|
383
|
+
dryRun: flagBool(args.flags, "dry-run"),
|
|
384
|
+
});
|
|
385
|
+
for (const file of result.files)
|
|
386
|
+
console.log(`${result.dry_run ? "would provision" : "provisioned"}: ${file.source} -> ${file.destination}`);
|
|
387
|
+
if (result.dry_run)
|
|
388
|
+
console.log(`dry-run: ${result.files.length} file(s) declared by kit '${result.kit_id}'; no files written`);
|
|
389
|
+
else if (result.files.length === 0)
|
|
390
|
+
console.log(`kit '${result.kit_id}' declares no provisions`);
|
|
391
|
+
else
|
|
392
|
+
console.log(`provisioned ${result.files.length} file(s) from kit '${result.kit_id}' into ${target}`);
|
|
393
|
+
return 0;
|
|
394
|
+
}
|
|
395
|
+
catch (error) {
|
|
396
|
+
if (error instanceof ProvisionConflictError) {
|
|
397
|
+
console.error(`provision: ${error.message}; rerun with --force to overwrite`);
|
|
398
|
+
for (const conflict of error.conflicts)
|
|
399
|
+
console.error(`conflict: ${conflict.target} (${conflict.destination})`);
|
|
400
|
+
return 1;
|
|
401
|
+
}
|
|
402
|
+
const diagnostics = error.diagnostics;
|
|
403
|
+
if (diagnostics?.length) {
|
|
404
|
+
console.error("Flow Kit repository validation failed:");
|
|
405
|
+
for (const diagnostic of diagnostics)
|
|
406
|
+
console.error(` - ${diagnostic}`);
|
|
407
|
+
}
|
|
408
|
+
else
|
|
409
|
+
console.error(`provision: ${error.message}`);
|
|
410
|
+
return 1;
|
|
411
|
+
}
|
|
412
|
+
}
|
|
324
413
|
/**
|
|
325
414
|
* inspect <kit-dir> [--json]
|
|
326
415
|
*
|
|
@@ -375,9 +464,13 @@ export async function main(argv = process.argv.slice(2)) {
|
|
|
375
464
|
return status(rest);
|
|
376
465
|
if (command === "activate")
|
|
377
466
|
return activate(rest);
|
|
467
|
+
if (command === "validate")
|
|
468
|
+
return await validate(rest);
|
|
469
|
+
if (command === "provision")
|
|
470
|
+
return await provision(rest);
|
|
378
471
|
if (command === "inspect")
|
|
379
472
|
return await inspect(rest);
|
|
380
|
-
console.error("usage: flow-agents kit <install|activate|inspect|list|status> ...");
|
|
473
|
+
console.error("usage: flow-agents kit <install|activate|validate|provision|inspect|list|status> ...");
|
|
381
474
|
return 2;
|
|
382
475
|
}
|
|
383
476
|
// Use process.exitCode (not process.exit) to allow stdout to be flushed before exit.
|
|
@@ -804,7 +804,13 @@ export function main(argv = process.argv.slice(2)) {
|
|
|
804
804
|
const freshness = revisionFreshness(item, freshnessInputs);
|
|
805
805
|
return { ...item, dependency_impacts: dependencyImpacts(item, resolved), revision_freshness: freshness, readiness: applyFreshnessToReadiness(classify(item, settings, resolved), freshness) };
|
|
806
806
|
});
|
|
807
|
-
|
|
807
|
+
// A configured BoardProvider is the canonical readiness source (docs/decisions/backlog-readiness-source.md).
|
|
808
|
+
// Reaching this issue-level listing path with a board configured is a bypass that must be loud, never silent.
|
|
809
|
+
const bypassedBoard = asRecord(asRecord(settings.board_provider)?.board);
|
|
810
|
+
const warnings = bypassedBoard
|
|
811
|
+
? [{ code: "board_provider_bypassed", message: "A BoardProvider is configured but this pass used WorkItemProvider issue-level listing; board-driven selection is the canonical readiness source. Surface this bypass in the pull-work artifact instead of treating issue listing as a silent fallback." }]
|
|
812
|
+
: [];
|
|
813
|
+
console.log(JSON.stringify({ items, warnings }, null, 2));
|
|
808
814
|
return 0;
|
|
809
815
|
}
|
|
810
816
|
// Use process.exitCode (not process.exit) to allow stdout to be flushed before exit.
|
|
@@ -18,6 +18,7 @@ const sidecarSchemas = {
|
|
|
18
18
|
"critique.json": "schemas/workflow-critique.schema.json",
|
|
19
19
|
"release.json": "schemas/workflow-release.schema.json",
|
|
20
20
|
"learning.json": "schemas/workflow-learning.schema.json",
|
|
21
|
+
"waves.json": "schemas/workflow-waves.schema.json",
|
|
21
22
|
};
|
|
22
23
|
// Runtime coordination records live below a session but are not workflow
|
|
23
24
|
// sidecars. Recursing into them would validate continuation-driver/state.json
|
|
@@ -386,11 +387,63 @@ function validateSidecar(file) {
|
|
|
386
387
|
issues.push({ path: file, message: "deploy decision requires post_deploy_checks to be planned or pass" });
|
|
387
388
|
}
|
|
388
389
|
}
|
|
390
|
+
if (path.basename(file) === "waves.json") {
|
|
391
|
+
validateWaves(file, value, issues);
|
|
392
|
+
}
|
|
389
393
|
if (path.basename(file) === "state.json" && value && typeof value === "object" && !Array.isArray(value) && !("branch" in value)) {
|
|
390
394
|
warnings.push({ path: file, message: "state.json has no branch field (legacy/pre-#289 session) — re-run `ensure-session` to backfill agent/<actor>/<slug>." });
|
|
391
395
|
}
|
|
392
396
|
return { issues, warnings };
|
|
393
397
|
}
|
|
398
|
+
// #663 slice 1: wave-result reconciliation is machine-checkable, not prose. The schema
|
|
399
|
+
// (schemas/workflow-waves.schema.json) validates the shape; these semantic checks enforce the
|
|
400
|
+
// cross-record arithmetic the mini schema engine cannot express: exactly one terminal status
|
|
401
|
+
// record per declared worker, no undeclared reporters, reconciliation counts that match the
|
|
402
|
+
// records, and a `complete` claim that is impossible while any expected worker lacks a
|
|
403
|
+
// worker-landed terminal status. Missing workers must be recorded explicitly as not_reported —
|
|
404
|
+
// a reconciled wave never silently absorbs a dropped worker. Enforcement here is data-level
|
|
405
|
+
// validation only; stop-hook refusal of wave completion is #663 part 3 (slice 2).
|
|
406
|
+
function validateWaves(file, value, issues) {
|
|
407
|
+
const waves = Array.isArray(value?.waves) ? value.waves : [];
|
|
408
|
+
waves.forEach((wave, index) => {
|
|
409
|
+
const loc = `waves.json.waves[${index}]`;
|
|
410
|
+
const expected = Array.isArray(wave?.expected_workers) ? wave.expected_workers : [];
|
|
411
|
+
const results = Array.isArray(wave?.worker_results) ? wave.worker_results : [];
|
|
412
|
+
const expectedIds = expected.map((w) => w?.worker_id).filter((id) => typeof id === "string" && id.length > 0);
|
|
413
|
+
const expectedIdSet = new Set(expectedIds);
|
|
414
|
+
if (expectedIdSet.size !== expectedIds.length)
|
|
415
|
+
issues.push({ path: file, message: `${loc}.expected_workers must declare unique worker_id values` });
|
|
416
|
+
const resultIds = results.map((r) => r?.worker_id).filter((id) => typeof id === "string" && id.length > 0);
|
|
417
|
+
const seen = new Set();
|
|
418
|
+
for (const id of resultIds) {
|
|
419
|
+
if (seen.has(id))
|
|
420
|
+
issues.push({ path: file, message: `${loc}.worker_results has more than one terminal status record for worker ${id}; each worker lands exactly one` });
|
|
421
|
+
seen.add(id);
|
|
422
|
+
if (!expectedIdSet.has(id))
|
|
423
|
+
issues.push({ path: file, message: `${loc}.worker_results records worker ${id} that is not declared in expected_workers; declare every worker in the manifest before dispatch` });
|
|
424
|
+
}
|
|
425
|
+
const reconciliation = wave?.reconciliation;
|
|
426
|
+
if (!reconciliation || typeof reconciliation !== "object" || Array.isArray(reconciliation))
|
|
427
|
+
return;
|
|
428
|
+
const expectedCount = expectedIds.length;
|
|
429
|
+
const reportedIds = new Set(results.filter((r) => ["completed", "failed", "blocked"].includes(r?.status) && expectedIdSet.has(r?.worker_id)).map((r) => r.worker_id));
|
|
430
|
+
const reportedCount = reportedIds.size;
|
|
431
|
+
if (reconciliation.expected_count !== expectedCount)
|
|
432
|
+
issues.push({ path: file, message: `${loc}.reconciliation.expected_count is ${reconciliation.expected_count} but expected_workers declares ${expectedCount}` });
|
|
433
|
+
if (reconciliation.reported_count !== reportedCount)
|
|
434
|
+
issues.push({ path: file, message: `${loc}.reconciliation.reported_count is ${reconciliation.reported_count} but ${reportedCount} of ${expectedCount} expected workers have a worker-landed terminal status (completed|failed|blocked)` });
|
|
435
|
+
const missing = expectedIds.filter((id) => !results.some((r) => r?.worker_id === id));
|
|
436
|
+
for (const id of missing)
|
|
437
|
+
issues.push({ path: file, message: `${loc} is reconciled but worker ${id} has no terminal status record; record it explicitly as not_reported — never silently absorb a missing worker` });
|
|
438
|
+
const notReported = results.filter((r) => r?.status === "not_reported" && expectedIdSet.has(r?.worker_id));
|
|
439
|
+
if (reconciliation.status === "complete" && (missing.length > 0 || notReported.length > 0 || reportedCount !== expectedCount)) {
|
|
440
|
+
issues.push({ path: file, message: `${loc}.reconciliation.status complete requires every expected worker to have a worker-landed terminal status; got ${reportedCount} of ${expectedCount} reported` });
|
|
441
|
+
}
|
|
442
|
+
if (reconciliation.status === "incomplete" && missing.length === 0 && notReported.length === 0 && reportedCount === expectedCount) {
|
|
443
|
+
issues.push({ path: file, message: `${loc}.reconciliation.status incomplete contradicts the records: all ${expectedCount} expected workers reported` });
|
|
444
|
+
}
|
|
445
|
+
});
|
|
446
|
+
}
|
|
394
447
|
function validateLearningCorrections(file, status, records, issues) {
|
|
395
448
|
records.forEach((record, index) => {
|
|
396
449
|
const correction = record?.correction;
|
|
@@ -733,7 +733,11 @@ function assertDistinctReviewActor(sessionDir, slug) {
|
|
|
733
733
|
const assignment = readActiveAssignment(sessionDir, slug);
|
|
734
734
|
const caller = resolveCurrentAssignmentActor();
|
|
735
735
|
if (assignment.actor_key === caller.actorKey) {
|
|
736
|
-
throw new Error("workflow critique requires a reviewer identity distinct from the active implementation assignment actor"
|
|
736
|
+
throw new Error("workflow critique requires a reviewer identity distinct from the active implementation assignment actor. " +
|
|
737
|
+
"The reviewer identity is derived from the runtime actor, so an orchestrator that implemented and now reviews " +
|
|
738
|
+
"resolves to the same actor. To record an independent review, run the reviewer under a distinct actor: set " +
|
|
739
|
+
"FLOW_AGENTS_ACTOR=<reviewer-id> on the reviewing process, or run the reviewer in a separate runtime session " +
|
|
740
|
+
"(the runtime session id seeds the actor).");
|
|
737
741
|
}
|
|
738
742
|
return caller;
|
|
739
743
|
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export type ProvisionedFile = {
|
|
2
|
+
id: string;
|
|
3
|
+
target: string;
|
|
4
|
+
};
|
|
5
|
+
export type ProvisionPlanEntry = ProvisionedFile & {
|
|
6
|
+
source: string;
|
|
7
|
+
destination: string;
|
|
8
|
+
};
|
|
9
|
+
export type ProvisionResult = {
|
|
10
|
+
kit_id: string;
|
|
11
|
+
kit_hash?: string;
|
|
12
|
+
files: ProvisionPlanEntry[];
|
|
13
|
+
manifest_path?: string;
|
|
14
|
+
dry_run: boolean;
|
|
15
|
+
};
|
|
16
|
+
export declare class ProvisionConflictError extends Error {
|
|
17
|
+
readonly conflicts: ProvisionPlanEntry[];
|
|
18
|
+
constructor(conflicts: ProvisionPlanEntry[]);
|
|
19
|
+
}
|
|
20
|
+
export declare function provisionKit(kitDir: string, targetDir: string, options?: {
|
|
21
|
+
force?: boolean;
|
|
22
|
+
dryRun?: boolean;
|
|
23
|
+
}): Promise<ProvisionResult>;
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import * as crypto from "node:crypto";
|
|
2
|
+
import * as fs from "node:fs";
|
|
3
|
+
import * as path from "node:path";
|
|
4
|
+
import { atomicCopyFile, atomicWriteJson, canonicalProspectivePath, walkFiles } from "../lib/fs.js";
|
|
5
|
+
import { PROVISION_MANIFEST_DIR, assertKitRepository } from "./validate.js";
|
|
6
|
+
export class ProvisionConflictError extends Error {
|
|
7
|
+
conflicts;
|
|
8
|
+
constructor(conflicts) {
|
|
9
|
+
super(`provisioning conflicts with ${conflicts.length} existing destination(s)`);
|
|
10
|
+
this.name = "ProvisionConflictError";
|
|
11
|
+
this.conflicts = conflicts;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
function kitContentHash(kitDir) {
|
|
15
|
+
const hash = crypto.createHash("sha256");
|
|
16
|
+
for (const file of walkFiles(kitDir)) {
|
|
17
|
+
const rel = path.relative(kitDir, file).split(path.sep).join("/");
|
|
18
|
+
if (rel.split("/").some((part) => [".git", "__pycache__", ".pytest_cache"].includes(part)))
|
|
19
|
+
continue;
|
|
20
|
+
hash.update(rel);
|
|
21
|
+
hash.update("\0");
|
|
22
|
+
hash.update(fs.readFileSync(file));
|
|
23
|
+
hash.update("\0");
|
|
24
|
+
}
|
|
25
|
+
return `sha256:${hash.digest("hex")}`;
|
|
26
|
+
}
|
|
27
|
+
function isContained(root, candidate) {
|
|
28
|
+
const relative = path.relative(root, candidate);
|
|
29
|
+
return relative !== "" && !relative.startsWith("..") && !path.isAbsolute(relative);
|
|
30
|
+
}
|
|
31
|
+
function assertSafeDestination(rootReal, destination) {
|
|
32
|
+
const prospective = canonicalProspectivePath(destination);
|
|
33
|
+
if (!isContained(rootReal, prospective))
|
|
34
|
+
throw new Error(`provision target escapes consumer repository: ${destination}`);
|
|
35
|
+
if (!fs.existsSync(destination))
|
|
36
|
+
return;
|
|
37
|
+
const stat = fs.lstatSync(destination);
|
|
38
|
+
if (stat.isSymbolicLink())
|
|
39
|
+
throw new Error(`refusing provision target symlink: ${destination}`);
|
|
40
|
+
if (!stat.isFile())
|
|
41
|
+
throw new Error(`provision target is not a regular file: ${destination}`);
|
|
42
|
+
}
|
|
43
|
+
function manifestProvisions(manifest) {
|
|
44
|
+
if (!Array.isArray(manifest.provisions))
|
|
45
|
+
return [];
|
|
46
|
+
return manifest.provisions.map((entry) => {
|
|
47
|
+
const record = entry;
|
|
48
|
+
return {
|
|
49
|
+
id: String(record.id),
|
|
50
|
+
path: String(record.path),
|
|
51
|
+
target: path.posix.normalize(String(record.target).replace(/\\/g, "/")),
|
|
52
|
+
...(typeof record.description === "string" ? { description: record.description } : {}),
|
|
53
|
+
};
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
export async function provisionKit(kitDir, targetDir, options = {}) {
|
|
57
|
+
const kitRoot = fs.realpathSync(path.resolve(kitDir));
|
|
58
|
+
const targetPath = path.resolve(targetDir);
|
|
59
|
+
if (!fs.existsSync(targetPath) || !fs.statSync(targetPath).isDirectory()) {
|
|
60
|
+
throw new Error(`provision target must exist and be a directory: ${targetPath}`);
|
|
61
|
+
}
|
|
62
|
+
const targetRoot = fs.realpathSync(targetPath);
|
|
63
|
+
const manifest = await assertKitRepository(kitRoot);
|
|
64
|
+
const kitId = String(manifest.id);
|
|
65
|
+
const files = manifestProvisions(manifest).map((entry) => ({
|
|
66
|
+
id: entry.id,
|
|
67
|
+
target: entry.target,
|
|
68
|
+
source: path.resolve(kitRoot, entry.path),
|
|
69
|
+
destination: path.resolve(targetRoot, ...entry.target.split("/")),
|
|
70
|
+
}));
|
|
71
|
+
for (const file of files)
|
|
72
|
+
assertSafeDestination(targetRoot, file.destination);
|
|
73
|
+
// Defense in depth against a source swapped to a link after validation: re-assert the
|
|
74
|
+
// link-resolved source stays inside the kit before we read and copy its bytes.
|
|
75
|
+
for (const file of files) {
|
|
76
|
+
const realSource = fs.realpathSync(file.source);
|
|
77
|
+
if (realSource !== kitRoot && !realSource.startsWith(`${kitRoot}${path.sep}`)) {
|
|
78
|
+
throw new Error(`provision source escapes the kit directory: ${file.id}`);
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
const conflicts = options.force ? [] : files.filter((file) => fs.existsSync(file.destination));
|
|
82
|
+
if (conflicts.length)
|
|
83
|
+
throw new ProvisionConflictError(conflicts);
|
|
84
|
+
const kitHash = kitContentHash(kitRoot);
|
|
85
|
+
if (options.dryRun || files.length === 0)
|
|
86
|
+
return { kit_id: kitId, kit_hash: kitHash, files, dry_run: Boolean(options.dryRun) };
|
|
87
|
+
const manifestPath = path.join(targetRoot, ...PROVISION_MANIFEST_DIR.split("/"), `${kitId}.json`);
|
|
88
|
+
assertSafeDestination(targetRoot, manifestPath);
|
|
89
|
+
for (const file of files)
|
|
90
|
+
atomicCopyFile(targetRoot, file.source, file.destination);
|
|
91
|
+
atomicWriteJson(targetRoot, manifestPath, {
|
|
92
|
+
schema_version: "1.0",
|
|
93
|
+
kit_id: kitId,
|
|
94
|
+
kit_hash: kitHash,
|
|
95
|
+
provisioned_at: new Date().toISOString(),
|
|
96
|
+
files: files.map(({ id, target }) => ({ id, target })),
|
|
97
|
+
});
|
|
98
|
+
return { kit_id: kitId, kit_hash: kitHash, files, manifest_path: manifestPath, dry_run: false };
|
|
99
|
+
}
|
|
@@ -4,6 +4,13 @@ export interface KitDependencyEntry {
|
|
|
4
4
|
kit_id: string;
|
|
5
5
|
reason?: string;
|
|
6
6
|
}
|
|
7
|
+
export interface KitProvisionEntry {
|
|
8
|
+
id: string;
|
|
9
|
+
path: string;
|
|
10
|
+
target: string;
|
|
11
|
+
description?: string;
|
|
12
|
+
}
|
|
13
|
+
export declare const PROVISION_MANIFEST_DIR = ".kontourai/flow-agents/provisions";
|
|
7
14
|
export interface KitWorkflowTriggerEntry {
|
|
8
15
|
id: string;
|
|
9
16
|
when: string;
|
|
@@ -25,6 +32,18 @@ export interface KitHookInfluenceExpectationEntry {
|
|
|
25
32
|
must_include_guidance: string[];
|
|
26
33
|
must_include_actions: string[];
|
|
27
34
|
}
|
|
35
|
+
export interface KitAgentSpawnTriggerGuards {
|
|
36
|
+
dedup_key: string;
|
|
37
|
+
cooldown_seconds: number;
|
|
38
|
+
daily_cap: number;
|
|
39
|
+
max_concurrent: number;
|
|
40
|
+
}
|
|
41
|
+
export interface KitAgentSpawnTriggerEntry {
|
|
42
|
+
id: string;
|
|
43
|
+
description: string;
|
|
44
|
+
spawns_agent_runs: boolean;
|
|
45
|
+
guards?: KitAgentSpawnTriggerGuards;
|
|
46
|
+
}
|
|
28
47
|
export type KitSkillRole = "entrypoint" | "profile" | "step" | "shared-primitive" | "extension";
|
|
29
48
|
export interface KitSkillRoleEntry {
|
|
30
49
|
skill_id: string;
|
|
@@ -61,6 +80,29 @@ export declare function parseKitHookInfluenceExpectations(manifest: Record<strin
|
|
|
61
80
|
entries: KitHookInfluenceExpectationEntry[];
|
|
62
81
|
errors: string[];
|
|
63
82
|
};
|
|
83
|
+
/**
|
|
84
|
+
* Parse and shape-validate a kit manifest's optional `agent_spawn_triggers` field:
|
|
85
|
+
* perimeter trigger surfaces (check failures, schedules, watchers) that spawn agent
|
|
86
|
+
* runs, plus their guard config. Contract: context/contracts/trigger-guards.md.
|
|
87
|
+
*
|
|
88
|
+
* Shape rules (ERRORS):
|
|
89
|
+
* - `agent_spawn_triggers` (if present) must be an array of objects.
|
|
90
|
+
* - `id` must match the workflow-trigger identifier pattern and be unique.
|
|
91
|
+
* - `description` must be a non-empty string.
|
|
92
|
+
* - `spawns_agent_runs` must be a boolean.
|
|
93
|
+
* - `guards` (if present) must be an object with exactly the four guard fields when
|
|
94
|
+
* complete: `dedup_key` non-empty string; `cooldown_seconds`, `daily_cap`,
|
|
95
|
+
* `max_concurrent` integers >= 1. Unknown guard fields are errors.
|
|
96
|
+
*
|
|
97
|
+
* Guard-completeness (WARNINGS, never errors — declaration-first rollout, #664):
|
|
98
|
+
* - an entry with `spawns_agent_runs: true` and missing or incomplete `guards`
|
|
99
|
+
* produces a warning naming the missing guard fields and the contract doc.
|
|
100
|
+
*/
|
|
101
|
+
export declare function parseKitAgentSpawnTriggers(manifest: Record<string, unknown>, manifestPath: string): {
|
|
102
|
+
entries: KitAgentSpawnTriggerEntry[];
|
|
103
|
+
errors: string[];
|
|
104
|
+
warnings: string[];
|
|
105
|
+
};
|
|
64
106
|
export declare function parseKitSkillRoles(manifest: Record<string, unknown>, manifestPath: string): {
|
|
65
107
|
entries: KitSkillRoleEntry[];
|
|
66
108
|
errors: string[];
|
|
@@ -126,4 +168,14 @@ export interface KitTargetsResult {
|
|
|
126
168
|
*/
|
|
127
169
|
export declare function deriveKitTargets(manifest: Record<string, unknown>, kitDir?: string, sourceRoot?: string): Promise<KitTargetsResult>;
|
|
128
170
|
export declare function validateKitRepository(kitDir: string): Promise<string[]>;
|
|
171
|
+
/**
|
|
172
|
+
* Repository validation with a non-blocking warnings channel alongside the blocking
|
|
173
|
+
* errors `validateKitRepository` has always returned. Warnings are advisory quality
|
|
174
|
+
* findings (today: an agent-spawning trigger surface declared without complete guard
|
|
175
|
+
* config — context/contracts/trigger-guards.md); they never fail validation.
|
|
176
|
+
*/
|
|
177
|
+
export declare function validateKitRepositoryDiagnostics(kitDir: string): Promise<{
|
|
178
|
+
errors: string[];
|
|
179
|
+
warnings: string[];
|
|
180
|
+
}>;
|
|
129
181
|
export declare function assertKitRepository(kitDir: string): Promise<Record<string, unknown>>;
|