@kontourai/flow-agents 0.1.1
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/.githooks/pre-push +11 -0
- package/.github/workflows/ci.yml +210 -0
- package/.github/workflows/docs-pages.yml +52 -0
- package/.github/workflows/publish-npm.yml +104 -0
- package/AGENTS.md +26 -0
- package/CHANGELOG.md +66 -0
- package/CODE_OF_CONDUCT.md +25 -0
- package/CONTEXT.md +300 -0
- package/CONTRIBUTING.md +44 -0
- package/LICENSE +201 -0
- package/README.md +129 -0
- package/SECURITY.md +33 -0
- package/agent-cards/dev.json +19 -0
- package/agents/dev.json +127 -0
- package/agents/tool-code-reviewer.json +61 -0
- package/agents/tool-dependencies-updater.json +118 -0
- package/agents/tool-explore-config.json +92 -0
- package/agents/tool-explore-deps.json +92 -0
- package/agents/tool-explore-entry.json +92 -0
- package/agents/tool-explore-patterns.json +92 -0
- package/agents/tool-explore-structure.json +92 -0
- package/agents/tool-explore-tests.json +92 -0
- package/agents/tool-planner.json +57 -0
- package/agents/tool-playwright.json +145 -0
- package/agents/tool-security-reviewer.json +56 -0
- package/agents/tool-verifier.json +61 -0
- package/agents/tool-worker.json +58 -0
- package/build/src/cli/console-learning-projection.js +123 -0
- package/build/src/cli/docs-preview.js +39 -0
- package/build/src/cli/effective-backlog-settings.js +102 -0
- package/build/src/cli/export-bookmarks.js +38 -0
- package/build/src/cli/fixture-retirement-audit.js +140 -0
- package/build/src/cli/flow-kit.js +138 -0
- package/build/src/cli/import-bookmarks.js +50 -0
- package/build/src/cli/init.js +239 -0
- package/build/src/cli/instinct-cli.js +93 -0
- package/build/src/cli/promote-workflow-artifact.js +63 -0
- package/build/src/cli/publish-change-helper.js +154 -0
- package/build/src/cli/pull-work-provider.js +469 -0
- package/build/src/cli/runtime-adapter.js +23 -0
- package/build/src/cli/telemetry-doctor.js +221 -0
- package/build/src/cli/usage-feedback.js +443 -0
- package/build/src/cli/validate-hook-influence.js +152 -0
- package/build/src/cli/validate-source-tree.js +31 -0
- package/build/src/cli/validate-workflow-artifacts.js +486 -0
- package/build/src/cli/veritas-governance.js +262 -0
- package/build/src/cli/workflow-artifact-cleanup-audit.js +272 -0
- package/build/src/cli/workflow-sidecar.js +816 -0
- package/build/src/cli.js +89 -0
- package/build/src/flow-kit/validate.js +75 -0
- package/build/src/lib/args.js +45 -0
- package/build/src/lib/fs.js +62 -0
- package/build/src/lib/workflow-learning-projection.js +334 -0
- package/build/src/runtime-adapters.js +146 -0
- package/build/src/tools/build-universal-bundles.js +397 -0
- package/build/src/tools/common.js +56 -0
- package/build/src/tools/filter-installed-packs.js +132 -0
- package/build/src/tools/generate-context-map.js +198 -0
- package/build/src/tools/validate-package.js +64 -0
- package/build/src/tools/validate-source-tree.js +622 -0
- package/console.telemetry.json +176 -0
- package/context/base-rules.md +17 -0
- package/context/code-review-standards.md +62 -0
- package/context/coding-standards.md +42 -0
- package/context/common/orchestrators.md +12 -0
- package/context/common/subagents.md +28 -0
- package/context/contracts/artifact-contract.md +182 -0
- package/context/contracts/builder-kit-workflow-state-contract.md +319 -0
- package/context/contracts/delivery-contract.md +69 -0
- package/context/contracts/execution-contract.md +53 -0
- package/context/contracts/governance-adapter-contract.md +67 -0
- package/context/contracts/planning-contract.md +85 -0
- package/context/contracts/review-contract.md +104 -0
- package/context/contracts/sandbox-policy.md +52 -0
- package/context/contracts/verification-contract.md +134 -0
- package/context/contracts/work-item-contract.md +215 -0
- package/context/deferred/demo-mode.md +33 -0
- package/context/deferred/languages/go.md +31 -0
- package/context/deferred/languages/python.md +31 -0
- package/context/deferred/languages/typescript.md +34 -0
- package/context/deferred/parallelization.md +35 -0
- package/context/deferred/worktree-isolation.md +24 -0
- package/context/development-workflow.md +50 -0
- package/context/scripts/context-budget/budget-scan.sh +166 -0
- package/context/scripts/detect-tools.sh +3 -0
- package/context/scripts/discover-agents.sh +28 -0
- package/context/scripts/git-status.sh +49 -0
- package/context/scripts/hooks/config-protection.js +79 -0
- package/context/scripts/hooks/desktop-notify.sh +39 -0
- package/context/scripts/hooks/governance-audit.sh +135 -0
- package/context/scripts/hooks/lib/audit-transport.sh +40 -0
- package/context/scripts/hooks/lib/hook-flags.js +49 -0
- package/context/scripts/hooks/lib/patterns.sh +57 -0
- package/context/scripts/hooks/lib/resolve-formatter.js +80 -0
- package/context/scripts/hooks/post-edit-accumulator.js +66 -0
- package/context/scripts/hooks/pre-commit-quality.js +194 -0
- package/context/scripts/hooks/quality-gate.js +93 -0
- package/context/scripts/hooks/report-only-guard.js +21 -0
- package/context/scripts/hooks/run-hook.js +136 -0
- package/context/scripts/hooks/stop-format-typecheck.js +141 -0
- package/context/scripts/hooks/stop-goal-fit.js +337 -0
- package/context/scripts/hooks/workflow-steering.js +250 -0
- package/context/scripts/telemetry/console-presets.sh +14 -0
- package/context/scripts/telemetry/install-console-config.sh +214 -0
- package/context/scripts/telemetry/lib/config.sh +85 -0
- package/context/scripts/telemetry/lib/enrich.sh +115 -0
- package/context/scripts/telemetry/lib/redact.sh +22 -0
- package/context/scripts/telemetry/lib/session.sh +63 -0
- package/context/scripts/telemetry/lib/transport.sh +183 -0
- package/context/scripts/telemetry/lib/usage.sh +29 -0
- package/context/scripts/telemetry/sync-agents.sh +173 -0
- package/context/scripts/telemetry/telemetry.conf +23 -0
- package/context/scripts/telemetry/telemetry.sh +387 -0
- package/context/scripts/validate-package.sh +89 -0
- package/context/settings/backlog-provider-settings.json +54 -0
- package/context/templates/core/identity.md +26 -0
- package/context/templates/core/user.md +15 -0
- package/docs/_config.yml +15 -0
- package/docs/_layouts/default.html +87 -0
- package/docs/adr/0001-flow-agents-consumes-flow.md +77 -0
- package/docs/adr/0002-flow-kits-as-extension-unit.md +13 -0
- package/docs/adr/0003-flow-agents-coordinates-kits-and-adapters.md +13 -0
- package/docs/adr/0004-gates-expect-surface-claims.md +15 -0
- package/docs/adr/0005-kubernetes-inspired-resource-contracts.md +48 -0
- package/docs/adr/0006-typescript-first-source-policy.md +98 -0
- package/docs/agent-system-guidebook.md +391 -0
- package/docs/agent-usage-feedback-loop.md +351 -0
- package/docs/assets/favicon.svg +13 -0
- package/docs/assets/og-image.png +0 -0
- package/docs/assets/site.css +774 -0
- package/docs/assets/site.js +139 -0
- package/docs/configurable-workflow-routing.md +174 -0
- package/docs/context-map.md +145 -0
- package/docs/developer-architecture.md +145 -0
- package/docs/developer-hook-setup.md +61 -0
- package/docs/fixture-ownership.md +44 -0
- package/docs/flow-kit-repository-contract.md +180 -0
- package/docs/index.md +129 -0
- package/docs/kontour-resource-contract.md +358 -0
- package/docs/migrations.md +64 -0
- package/docs/north-star.md +322 -0
- package/docs/operating-layers.md +110 -0
- package/docs/repository-structure.md +132 -0
- package/docs/sandbox-policy.md +56 -0
- package/docs/skills-map.md +203 -0
- package/docs/standards-register.md +96 -0
- package/docs/veritas-integration.md +165 -0
- package/docs/work-item-adapters.md +72 -0
- package/docs/workflow-artifact-lifecycle.md +141 -0
- package/docs/workflow-eval-strategy.md +295 -0
- package/docs/workflow-shared-contracts.md +51 -0
- package/docs/workflow-usage-guide.md +443 -0
- package/evals/ARCHITECTURE.md +143 -0
- package/evals/CONVENTIONS.md +58 -0
- package/evals/README.md +128 -0
- package/evals/acceptance/run.sh +29 -0
- package/evals/acceptance/test_claude_harness.sh +242 -0
- package/evals/acceptance/test_codex_harness.sh +108 -0
- package/evals/acceptance/test_kiro_harness.sh +128 -0
- package/evals/cases/dev/404.html +97 -0
- package/evals/cases/dev/code-review.yaml +44 -0
- package/evals/cases/dev/dashboard.html +300 -0
- package/evals/cases/dev/deliver.yaml +66 -0
- package/evals/cases/dev/dependency-update.yaml +16 -0
- package/evals/cases/dev/explore.yaml +20 -0
- package/evals/cases/dev/index.html +370 -0
- package/evals/cases/dev/package-lock.json +28 -0
- package/evals/cases/dev/package.json +16 -0
- package/evals/cases/dev/plan-work.yaml +20 -0
- package/evals/cases/dev/promptfooconfig.yaml +666 -0
- package/evals/cases/dev/search-first.yaml +20 -0
- package/evals/cases/dev/tdd-workflow.yaml +48 -0
- package/evals/cases/dev/verify-work.yaml +44 -0
- package/evals/cases/dev/workflow.yaml +34 -0
- package/evals/ci/run-baseline.sh +283 -0
- package/evals/fixtures/backlog-provider-settings/global-default.json +44 -0
- package/evals/fixtures/backlog-provider-settings/project-override.json +53 -0
- package/evals/fixtures/builder-kit-workflow-state/baseline-freshness-resolution-hint.json +139 -0
- package/evals/fixtures/builder-kit-workflow-state/direct-primitive-stop.json +59 -0
- package/evals/fixtures/builder-kit-workflow-state/empty-board-route-shape.json +55 -0
- package/evals/fixtures/builder-kit-workflow-state/happy-path.json +71 -0
- package/evals/fixtures/builder-kit-workflow-state/mid-work-resume.json +80 -0
- package/evals/fixtures/builder-kit-workflow-state/missing-prestep-recovery.json +65 -0
- package/evals/fixtures/builder-kit-workflow-state/product-build-chaining.json +60 -0
- package/evals/fixtures/builder-kit-workflow-state/stale-continuation-requires-new-probe.json +57 -0
- package/evals/fixtures/console-learning-projection/artifacts/console-learning-correction/learning.json +50 -0
- package/evals/fixtures/console-learning-projection/artifacts/console-learning-open-route/learning.json +41 -0
- package/evals/fixtures/flow-kit-repository/invalid-absolute-path/kit.json +8 -0
- package/evals/fixtures/flow-kit-repository/invalid-asset-section/flows/review.flow.json +6 -0
- package/evals/fixtures/flow-kit-repository/invalid-asset-section/kit.json +11 -0
- package/evals/fixtures/flow-kit-repository/invalid-duplicate-flow/flows/review.flow.json +6 -0
- package/evals/fixtures/flow-kit-repository/invalid-duplicate-flow/kit.json +9 -0
- package/evals/fixtures/flow-kit-repository/invalid-id/flows/review.flow.json +6 -0
- package/evals/fixtures/flow-kit-repository/invalid-id/kit.json +8 -0
- package/evals/fixtures/flow-kit-repository/invalid-malformed-json/kit.json +8 -0
- package/evals/fixtures/flow-kit-repository/invalid-missing-flow/kit.json +8 -0
- package/evals/fixtures/flow-kit-repository/invalid-missing-id/flows/review.flow.json +6 -0
- package/evals/fixtures/flow-kit-repository/invalid-missing-id/kit.json +7 -0
- package/evals/fixtures/flow-kit-repository/invalid-missing-schema-version/flows/review.flow.json +6 -0
- package/evals/fixtures/flow-kit-repository/invalid-missing-schema-version/kit.json +7 -0
- package/evals/fixtures/flow-kit-repository/invalid-name/flows/review.flow.json +6 -0
- package/evals/fixtures/flow-kit-repository/invalid-name/kit.json +8 -0
- package/evals/fixtures/flow-kit-repository/invalid-schema-version/flows/review.flow.json +6 -0
- package/evals/fixtures/flow-kit-repository/invalid-schema-version/kit.json +8 -0
- package/evals/fixtures/flow-kit-repository/invalid-traversal/kit.json +8 -0
- package/evals/fixtures/flow-kit-repository/mixed-runtime-kit/adapters/example.json +3 -0
- package/evals/fixtures/flow-kit-repository/mixed-runtime-kit/assets/example.txt +1 -0
- package/evals/fixtures/flow-kit-repository/mixed-runtime-kit/docs/README.md +3 -0
- package/evals/fixtures/flow-kit-repository/mixed-runtime-kit/flows/runtime.flow.json +26 -0
- package/evals/fixtures/flow-kit-repository/mixed-runtime-kit/kit-evals/example.json +3 -0
- package/evals/fixtures/flow-kit-repository/mixed-runtime-kit/kit-skills/mixed/SKILL.md +3 -0
- package/evals/fixtures/flow-kit-repository/mixed-runtime-kit/kit.json +44 -0
- package/evals/fixtures/flow-kit-repository/valid-local-kit/docs/README.md +3 -0
- package/evals/fixtures/flow-kit-repository/valid-local-kit/flows/review.flow.json +26 -0
- package/evals/fixtures/flow-kit-repository/valid-local-kit/kit.json +20 -0
- package/evals/fixtures/hook-influence/cases.json +336 -0
- package/evals/fixtures/pull-work-provider/github-issues.json +170 -0
- package/evals/fixtures/pull-work-wip-shepherding/global-wip-informs.json +43 -0
- package/evals/fixtures/pull-work-wip-shepherding/personal-wip-blocks.json +42 -0
- package/evals/fixtures/surface-trust/accepted-claim-trust-report.json +31 -0
- package/evals/fixtures/surface-trust/artifact-absent.json +19 -0
- package/evals/fixtures/surface-trust/integrity-mismatch-trust-report.json +32 -0
- package/evals/fixtures/surface-trust/missing-authority-trust-report.json +27 -0
- package/evals/fixtures/surface-trust/provider-absent.json +19 -0
- package/evals/fixtures/surface-trust/rejected-claim-trust-report.json +30 -0
- package/evals/fixtures/surface-trust/stale-claim-trust-snapshot.json +31 -0
- package/evals/fixtures/usage-feedback/sample-full.jsonl +11 -0
- package/evals/fixtures/usage-feedback/sample-outcomes.jsonl +1 -0
- package/evals/fixtures/veritas-governance-adapter/fake-veritas-pass.sh +18 -0
- package/evals/fixtures/veritas-governance-adapter/fake-veritas-secret-fail.sh +10 -0
- package/evals/fixtures/veritas-governance-adapter/fake-veritas-unconfigured.sh +4 -0
- package/evals/integration/test_bundle_install.sh +541 -0
- package/evals/integration/test_console_learning_projection.sh +192 -0
- package/evals/integration/test_context_map.sh +65 -0
- package/evals/integration/test_effective_backlog_settings.sh +58 -0
- package/evals/integration/test_fixture_retirement_audit.sh +58 -0
- package/evals/integration/test_flow_agents_statusline.sh +93 -0
- package/evals/integration/test_flow_kit_repository.sh +90 -0
- package/evals/integration/test_goal_fit_hook.sh +482 -0
- package/evals/integration/test_hook_category_behaviors.sh +190 -0
- package/evals/integration/test_hook_influence_cases.sh +69 -0
- package/evals/integration/test_local_flow_kit_install.sh +145 -0
- package/evals/integration/test_publish_change_helper.sh +176 -0
- package/evals/integration/test_pull_work_provider.sh +140 -0
- package/evals/integration/test_runtime_adapter_activation.sh +106 -0
- package/evals/integration/test_telemetry.sh +485 -0
- package/evals/integration/test_telemetry_doctor.sh +193 -0
- package/evals/integration/test_usage_feedback_dashboard.sh +169 -0
- package/evals/integration/test_usage_feedback_global.sh +117 -0
- package/evals/integration/test_usage_feedback_import.sh +227 -0
- package/evals/integration/test_usage_feedback_outcomes.sh +165 -0
- package/evals/integration/test_usage_feedback_report.sh +263 -0
- package/evals/integration/test_veritas_governance_adapter.sh +235 -0
- package/evals/integration/test_workflow_artifact_cleanup_audit.sh +287 -0
- package/evals/integration/test_workflow_artifacts.sh +1247 -0
- package/evals/integration/test_workflow_sidecar_writer.sh +2112 -0
- package/evals/integration/test_workflow_steering_hook.sh +337 -0
- package/evals/lib/assertions/delegated-to.js +40 -0
- package/evals/lib/assertions/max-tool-calls.js +15 -0
- package/evals/lib/assertions/no-write-tools.js +27 -0
- package/evals/lib/assertions/pass-at-k.js +39 -0
- package/evals/lib/assertions/telemetry-utils.js +105 -0
- package/evals/lib/assertions/tool-called.js +39 -0
- package/evals/lib/assertions/verify-after-fix.js +61 -0
- package/evals/lib/claude-judge.sh +40 -0
- package/evals/lib/claude-provider.sh +74 -0
- package/evals/lib/codex-judge.sh +39 -0
- package/evals/lib/codex-provider.sh +81 -0
- package/evals/lib/eval-dev.sh +5 -0
- package/evals/lib/eval-judge.sh +22 -0
- package/evals/lib/eval-provider.sh +26 -0
- package/evals/lib/eval-report.sh +73 -0
- package/evals/lib/kiro-dev.sh +4 -0
- package/evals/lib/kiro-judge.sh +17 -0
- package/evals/lib/kiro-provider.sh +62 -0
- package/evals/lib/node.sh +111 -0
- package/evals/promptfooconfig.yaml +70 -0
- package/evals/run.sh +309 -0
- package/evals/static/test_evidence_refs.sh +141 -0
- package/evals/static/test_package.sh +407 -0
- package/evals/static/test_repo_hooks.sh +68 -0
- package/evals/static/test_universal_bundles.sh +274 -0
- package/evals/static/test_workflow_skills.sh +1207 -0
- package/install.sh +64 -0
- package/integrations/veritas/flow-agents.adapter.json +138 -0
- package/integrations/veritas/flow-agents.authority-settings.json +26 -0
- package/integrations/veritas/flow-agents.repo-standards.json +82 -0
- package/kits/builder/flows/build.flow.json +218 -0
- package/kits/builder/flows/shape.flow.json +127 -0
- package/kits/builder/kit.json +19 -0
- package/kits/catalog.json +11 -0
- package/package.json +130 -0
- package/packaging/README.md +60 -0
- package/packaging/manifest.json +173 -0
- package/packaging/packs.json +69 -0
- package/powers/dependency-checker/POWER.md +20 -0
- package/powers/dependency-checker/mcp.json +20 -0
- package/powers/playwright/POWER.md +25 -0
- package/powers/playwright/mcp.json +12 -0
- package/prompts/code-audit.md +123 -0
- package/prompts/kcommit.md +88 -0
- package/schemas/backlog-provider-settings.schema.json +138 -0
- package/schemas/workflow-acceptance.schema.json +216 -0
- package/schemas/workflow-critique.schema.json +113 -0
- package/schemas/workflow-evidence.schema.json +357 -0
- package/schemas/workflow-handoff.schema.json +52 -0
- package/schemas/workflow-learning.schema.json +223 -0
- package/schemas/workflow-release.schema.json +172 -0
- package/schemas/workflow-state.schema.json +80 -0
- package/scripts/README.md +111 -0
- package/scripts/build-universal-bundles.js +3 -0
- package/scripts/check-content-boundary.cjs +99 -0
- package/scripts/context-budget/budget-scan.sh +166 -0
- package/scripts/detect-tools.sh +3 -0
- package/scripts/discover-agents.sh +28 -0
- package/scripts/effective-backlog-settings.js +2 -0
- package/scripts/filter-installed-packs.js +2 -0
- package/scripts/flow-kit.js +2 -0
- package/scripts/generate-context-map.js +2 -0
- package/scripts/git-status.sh +49 -0
- package/scripts/hooks/claude-hook-adapter.js +174 -0
- package/scripts/hooks/claude-telemetry-hook.js +115 -0
- package/scripts/hooks/codex-hook-adapter.js +176 -0
- package/scripts/hooks/codex-telemetry-hook.js +95 -0
- package/scripts/hooks/config-protection.js +79 -0
- package/scripts/hooks/desktop-notify.sh +39 -0
- package/scripts/hooks/governance-audit.sh +135 -0
- package/scripts/hooks/lib/audit-transport.sh +40 -0
- package/scripts/hooks/lib/hook-flags.js +49 -0
- package/scripts/hooks/lib/patterns.sh +57 -0
- package/scripts/hooks/lib/resolve-formatter.js +80 -0
- package/scripts/hooks/post-edit-accumulator.js +66 -0
- package/scripts/hooks/pre-commit-quality.js +194 -0
- package/scripts/hooks/quality-gate.js +93 -0
- package/scripts/hooks/report-only-guard.js +21 -0
- package/scripts/hooks/run-hook.js +136 -0
- package/scripts/hooks/stop-format-typecheck.js +141 -0
- package/scripts/hooks/stop-goal-fit.js +337 -0
- package/scripts/hooks/workflow-steering.js +250 -0
- package/scripts/install-codex-home.sh +106 -0
- package/scripts/package.json +3 -0
- package/scripts/promote-workflow-artifact.js +2 -0
- package/scripts/publish-change-helper.js +2 -0
- package/scripts/pull-work-provider.js +2 -0
- package/scripts/setup-repo-hooks.sh +8 -0
- package/scripts/statusline/flow-agents-statusline.js +157 -0
- package/scripts/telemetry/console-presets.sh +14 -0
- package/scripts/telemetry/install-console-config.sh +214 -0
- package/scripts/telemetry/lib/config.sh +85 -0
- package/scripts/telemetry/lib/enrich.sh +115 -0
- package/scripts/telemetry/lib/redact.sh +22 -0
- package/scripts/telemetry/lib/session.sh +63 -0
- package/scripts/telemetry/lib/transport.sh +183 -0
- package/scripts/telemetry/lib/usage.sh +29 -0
- package/scripts/telemetry/sync-agents.sh +173 -0
- package/scripts/telemetry/telemetry.conf +23 -0
- package/scripts/telemetry/telemetry.sh +387 -0
- package/scripts/usage-feedback.js +2 -0
- package/scripts/validate-hook-influence-cases.js +2 -0
- package/scripts/validate-package.sh +89 -0
- package/scripts/validate-source-tree.js +9 -0
- package/skills/agentic-engineering/SKILL.md +62 -0
- package/skills/browser-test/SKILL.md +51 -0
- package/skills/builder-shape/SKILL.md +76 -0
- package/skills/context-budget/SKILL.md +40 -0
- package/skills/deliver/SKILL.md +241 -0
- package/skills/dependency-update/SKILL.md +68 -0
- package/skills/design-probe/SKILL.md +107 -0
- package/skills/eval-rebuild/SKILL.md +39 -0
- package/skills/evidence-gate/SKILL.md +186 -0
- package/skills/execute-plan/SKILL.md +110 -0
- package/skills/explore/SKILL.md +137 -0
- package/skills/feedback-loop/SKILL.md +87 -0
- package/skills/fix-bug/SKILL.md +133 -0
- package/skills/frontend-design/SKILL.md +80 -0
- package/skills/github-cli/SKILL.md +63 -0
- package/skills/idea-to-backlog/SKILL.md +267 -0
- package/skills/knowledge-capture/SKILL.md +55 -0
- package/skills/learning-review/SKILL.md +115 -0
- package/skills/pickup-probe/SKILL.md +114 -0
- package/skills/plan-work/SKILL.md +176 -0
- package/skills/pull-work/SKILL.md +309 -0
- package/skills/release-readiness/SKILL.md +121 -0
- package/skills/review-work/SKILL.md +161 -0
- package/skills/search-first/SKILL.md +66 -0
- package/skills/tdd-workflow/SKILL.md +140 -0
- package/skills/verify-work/SKILL.md +109 -0
- package/src/cli/console-learning-projection.ts +140 -0
- package/src/cli/effective-backlog-settings.ts +99 -0
- package/src/cli/fixture-retirement-audit.ts +154 -0
- package/src/cli/flow-kit.ts +139 -0
- package/src/cli/init.ts +248 -0
- package/src/cli/promote-workflow-artifact.ts +64 -0
- package/src/cli/publish-change-helper.ts +143 -0
- package/src/cli/pull-work-provider.ts +481 -0
- package/src/cli/runtime-adapter.ts +24 -0
- package/src/cli/telemetry-doctor.ts +243 -0
- package/src/cli/usage-feedback.ts +418 -0
- package/src/cli/validate-hook-influence.ts +119 -0
- package/src/cli/validate-source-tree.ts +30 -0
- package/src/cli/validate-workflow-artifacts.ts +411 -0
- package/src/cli/veritas-governance.ts +322 -0
- package/src/cli/workflow-artifact-cleanup-audit.ts +281 -0
- package/src/cli/workflow-sidecar.ts +676 -0
- package/src/cli.ts +95 -0
- package/src/flow-kit/validate.ts +74 -0
- package/src/lib/args.ts +43 -0
- package/src/lib/fs.ts +62 -0
- package/src/lib/workflow-learning-projection.ts +491 -0
- package/src/runtime-adapters.ts +154 -0
- package/src/tools/build-universal-bundles.ts +366 -0
- package/src/tools/common.ts +61 -0
- package/src/tools/filter-installed-packs.ts +129 -0
- package/src/tools/generate-context-map.ts +199 -0
- package/src/tools/validate-package.ts +57 -0
- package/src/tools/validate-source-tree.ts +488 -0
- package/tsconfig.json +19 -0
- package/veritas.claims.json +6 -0
|
@@ -0,0 +1,319 @@
|
|
|
1
|
+
# Builder Kit Workflow State Contract
|
|
2
|
+
|
|
3
|
+
This contract defines the durable routing state for Builder Kit build-flow pickup and resume. It keeps `state.json` limited to canonical Flow Agents workflow routing and stores rich pickup decisions in a documented Probe record sidecar referenced by `state.json`, `handoff.json`, and the session artifact.
|
|
4
|
+
|
|
5
|
+
Builder Kit owns product-level build-flow coordination. Flow Agents owns the workflow harness, artifact conventions, primitive execution, and evidence gates. Flow remains the owner of Flow gate semantics. Builder Kit contracts may route to Flow Agents primitives, but must not redefine pass, fail, approval, or release authority semantics.
|
|
6
|
+
|
|
7
|
+
## State Surfaces
|
|
8
|
+
|
|
9
|
+
Builder Kit routing uses these surfaces together:
|
|
10
|
+
|
|
11
|
+
| Surface | Owner | Purpose |
|
|
12
|
+
| --- | --- | --- |
|
|
13
|
+
| `state.json` | Flow Agents workflow state | Durable current phase, status, next action, and routing target. |
|
|
14
|
+
| `handoff.json` | Flow Agents handoff | Human and machine-readable pause, resume, delegation, or blocker summary. |
|
|
15
|
+
| Builder Kit Probe record | Builder Kit contract sidecar | Rich pickup/design decisions used to choose the next build-flow step. |
|
|
16
|
+
| session artifact | active orchestrator or worker | Human-readable execution progress, modified files, evidence, and links. |
|
|
17
|
+
| plan, acceptance, evidence, critique, release, learning sidecars | phase owners | Phase-specific gates and proof. |
|
|
18
|
+
|
|
19
|
+
`state.json` must not be overloaded with detailed Probe decisions. It should reference the Probe record path in `artifact_paths` or `next_action.target_artifact` when the Probe record is the target for resuming or deciding the next step. `handoff.json` should also reference the Probe record whenever a paused Builder Kit build-flow cannot be resumed correctly from `state.json` alone.
|
|
20
|
+
|
|
21
|
+
## Required Routing Fields
|
|
22
|
+
|
|
23
|
+
Every Builder Kit build-flow pause, resume, or step transition must make the following fields recoverable from artifacts alone.
|
|
24
|
+
|
|
25
|
+
| Field | Durable location | Required meaning |
|
|
26
|
+
| --- | --- | --- |
|
|
27
|
+
| current step | `state.phase`, `state.status`, and Probe record `current_step` | The current Builder Kit step or direct Flow Agents primitive. |
|
|
28
|
+
| next step | `state.next_action` and Probe record `next_step` | The next step to run after resume or after the current primitive exits. |
|
|
29
|
+
| route reason | Probe record `route_reason`; summarized in `state.next_action.summary` | Why this route was selected, including missing state, evidence, decisions, or blockers. |
|
|
30
|
+
| selected work item refs | Probe record `selected_work_items`; optionally linked in `handoff.json` | Neutral work item references from the work-item contract. |
|
|
31
|
+
| missing evidence | Probe record `missing_evidence`; evidence sidecar for verification gaps | Evidence needed before planning, execution, verification, or release can proceed. |
|
|
32
|
+
| unresolved questions | Probe record `unresolved_questions`; handoff summary when user input is needed | Open decisions that block or shape the next step. |
|
|
33
|
+
| accepted gaps | Probe record `accepted_gaps`; acceptance sidecar when tied to criteria | Known gaps explicitly accepted for this iteration. |
|
|
34
|
+
| resume prompt | Probe record `resume_prompt`; handoff summary for future sessions | The concise instruction needed to resume without chat memory. |
|
|
35
|
+
| artifact references | `state.artifact_paths`, `state.next_action.target_artifact`, handoff refs, and Probe record `artifact_refs` | Paths to sidecars, plans, evidence, source refs, and docs needed for pickup. |
|
|
36
|
+
| automation mode | Probe record `automation_mode` and route reason | The active Builder Kit automation boundary: `manual`, `guided`, `strict`, or `autonomous-bounded`. |
|
|
37
|
+
| recovery mode | Probe record `recovery_mode` | Whether the workflow came from a direct primitive invocation or Builder Kit build-flow recovery. |
|
|
38
|
+
| probe status | Probe record `probe_status` and handoff summary | Machine-checkable pickup Probe outcome: `missing`, `required`, `in_progress`, `passed`, `accepted_gap`, or `blocked`. |
|
|
39
|
+
| probe artifact ref | Probe record `probe_artifact_ref` | The artifact or sidecar path that contains the current pickup Probe evidence. |
|
|
40
|
+
| grouping decision | Probe record `grouping_decision` | Whether selected work is a single item, independent multi-item set, justified bundle, unsafe group, or empty board. |
|
|
41
|
+
| WIP/shepherding decision | pull-work artifact `wip_assessment`, `my_active_work`, `shepherding_candidates`, `stale_worktrees`, `open_prs_by_me`, `global_conflicts`, `dependency_impacts`, and `start_new_work_decision` | Whether starting new work is appropriate or whether existing personal work should be shepherded first. |
|
|
42
|
+
| worktree lifecycle | pull-work artifact `worktree_lifecycle`; handoff summary when cleanup is pending | How long an isolated worktree should be retained, who owns cleanup, and which command removes it after merge/abandonment. |
|
|
43
|
+
| Flow boundary | Probe record `flow_boundary` | Explicit preservation of Flow gate authority and Flow Agents harness ownership. |
|
|
44
|
+
|
|
45
|
+
## Probe Record
|
|
46
|
+
|
|
47
|
+
A Builder Kit Probe record is a JSON sidecar beside the other workflow artifacts, for example `.flow-agents/<slug>/builder-kit-probe.json`. It is the durable location for pickup/design context that would otherwise make `state.json` too broad.
|
|
48
|
+
|
|
49
|
+
Required shape:
|
|
50
|
+
|
|
51
|
+
```json
|
|
52
|
+
{
|
|
53
|
+
"schema_version": "1.0",
|
|
54
|
+
"task_slug": "example-task",
|
|
55
|
+
"current_step": "design-probe",
|
|
56
|
+
"next_step": "plan-work",
|
|
57
|
+
"route_reason": "selected work item has enough evidence and no unresolved blocking questions",
|
|
58
|
+
"automation_mode": "guided",
|
|
59
|
+
"recovery_mode": "builder-kit-build-flow",
|
|
60
|
+
"probe_status": "passed",
|
|
61
|
+
"probe_artifact_ref": ".flow-agents/example-task/builder-kit-probe.json",
|
|
62
|
+
"grouping_decision": {
|
|
63
|
+
"status": "single-item",
|
|
64
|
+
"justification": "one selected work item"
|
|
65
|
+
},
|
|
66
|
+
"selected_work_items": [
|
|
67
|
+
{
|
|
68
|
+
"provider": "github",
|
|
69
|
+
"ref": "#68",
|
|
70
|
+
"title": "Builder Kit workflow state contract"
|
|
71
|
+
}
|
|
72
|
+
],
|
|
73
|
+
"missing_evidence": [],
|
|
74
|
+
"unresolved_questions": [],
|
|
75
|
+
"accepted_gaps": [],
|
|
76
|
+
"resolution_hints": [],
|
|
77
|
+
"resume_prompt": "Resume Builder Kit build-flow by running plan-work from the selected work item and Probe record.",
|
|
78
|
+
"artifact_refs": [
|
|
79
|
+
".flow-agents/example-task/state.json",
|
|
80
|
+
".flow-agents/example-task/handoff.json"
|
|
81
|
+
],
|
|
82
|
+
"flow_boundary": {
|
|
83
|
+
"builder_kit_owns": "product-level build-flow coordination and next-step selection",
|
|
84
|
+
"flow_agents_owns": "workflow artifacts, primitive execution, and evidence harness",
|
|
85
|
+
"flow_owns": "gate authority semantics"
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
Allowed `current_step` and `next_step` values are Builder Kit step names or direct Flow Agents primitive names. Use `pull-work`, `design-probe`, `pickup-probe`, `plan-work`, `execute-plan`, `verify-work`, `evidence-gate`, `release-readiness`, `learning-review`, `blocked`, or `done` unless a downstream contract defines a narrower Builder Kit flow. The Builder Kit flow step remains `design-probe`; `pickup-probe` is the Builder Kit specialization record or skill used to prepare a selected work item for planning.
|
|
91
|
+
|
|
92
|
+
`selected_work_items` should use the neutral fields from `context/contracts/work-item-contract.md` where available. Provider-specific IDs may be included, but routing must not depend on a provider-specific shape when the neutral reference is present.
|
|
93
|
+
|
|
94
|
+
## Resolution Hints
|
|
95
|
+
|
|
96
|
+
Builder Kit Probe records may include optional `resolution_hints` for missing evidence, `NOT_VERIFIED`, or accepted-gap readiness states. Use them when Builder Kit can name the blocked readiness claim, deterministic blocked references, required evidence, and the step that should resolve the gap. Omit them when the Probe record has no actionable readiness gap or when a direct Flow Agents primitive has all inputs needed without Builder Kit build-flow context.
|
|
97
|
+
|
|
98
|
+
The canonical machine storage for `resolution_hints` is the Builder Kit Probe JSON record. Markdown pull-work, pickup, plan, or session artifacts may summarize the hints or link to the Probe record for humans, but they are not a second machine contract and must not introduce divergent machine-readable hint shapes.
|
|
99
|
+
|
|
100
|
+
Stable hint fields:
|
|
101
|
+
|
|
102
|
+
| Field | Meaning |
|
|
103
|
+
| --- | --- |
|
|
104
|
+
| `gap_id` | Stable identifier for the gap class Builder Kit is describing, such as `revision_freshness_not_verified`. |
|
|
105
|
+
| `claim_id` | Builder Kit-owned readiness claim affected by the gap, such as `planning.baseline.current`. This is not a Flow gate schema or Veritas claim requirement. |
|
|
106
|
+
| `reason_code` | Stable reason the claim is missing, inconclusive, `NOT_VERIFIED`, or accepted as a gap. |
|
|
107
|
+
| `blocked_refs[]` | Deterministic references blocked by the gap. Entries should be objects with stable `kind` and `id` values, for example `acceptance_criterion` / `AC2`, `workflow_gate` / `plan-work.readiness`, and `flow_step` / `builder.build.plan`. |
|
|
108
|
+
| `resolve_at` | The Builder Kit or Flow Agents step expected to resolve or explicitly accept the gap. Use an object with at least `step`; include `owner` or `artifact` when useful. |
|
|
109
|
+
| `required_evidence[]` | Evidence records needed to resolve the claim. Entries should have stable ids, a short description, and expected source or artifact refs when known. |
|
|
110
|
+
| `fallback_policy_id` | Stable policy id for an explicitly accepted fallback path when fresh evidence cannot be recovered for this iteration. The fallback is an accepted gap, not proof that the missing evidence is fresh. |
|
|
111
|
+
| `summary` | Human-readable summary of what is blocked and how to resolve it. |
|
|
112
|
+
|
|
113
|
+
Baseline freshness example for missing historical `planned_base_sha`:
|
|
114
|
+
|
|
115
|
+
```json
|
|
116
|
+
{
|
|
117
|
+
"probe_status": "accepted_gap",
|
|
118
|
+
"accepted_gaps": [
|
|
119
|
+
{
|
|
120
|
+
"gap_id": "revision_freshness_not_verified",
|
|
121
|
+
"claim_id": "planning.baseline.current",
|
|
122
|
+
"reason_code": "missing_planned_base_sha",
|
|
123
|
+
"summary": "Historical planned_base_sha was not recorded; current main and provider history are accepted as the fallback baseline for this iteration."
|
|
124
|
+
}
|
|
125
|
+
],
|
|
126
|
+
"resolution_hints": [
|
|
127
|
+
{
|
|
128
|
+
"gap_id": "revision_freshness_not_verified",
|
|
129
|
+
"claim_id": "planning.baseline.current",
|
|
130
|
+
"reason_code": "missing_planned_base_sha",
|
|
131
|
+
"blocked_refs": [
|
|
132
|
+
{
|
|
133
|
+
"kind": "acceptance_criterion",
|
|
134
|
+
"id": "AC2"
|
|
135
|
+
},
|
|
136
|
+
{
|
|
137
|
+
"kind": "workflow_gate",
|
|
138
|
+
"id": "plan-work.readiness"
|
|
139
|
+
},
|
|
140
|
+
{
|
|
141
|
+
"kind": "flow_step",
|
|
142
|
+
"id": "builder.build.plan"
|
|
143
|
+
}
|
|
144
|
+
],
|
|
145
|
+
"resolve_at": {
|
|
146
|
+
"step": "pickup-probe",
|
|
147
|
+
"owner": "builder-kit"
|
|
148
|
+
},
|
|
149
|
+
"required_evidence": [
|
|
150
|
+
{
|
|
151
|
+
"id": "current_target_ref",
|
|
152
|
+
"description": "Current target branch or ref recorded during pickup.",
|
|
153
|
+
"source": "pull-work provider scan or local git baseline",
|
|
154
|
+
"example_value": "main"
|
|
155
|
+
},
|
|
156
|
+
{
|
|
157
|
+
"id": "current_target_sha",
|
|
158
|
+
"description": "Current target commit SHA recorded during pickup.",
|
|
159
|
+
"source": "pull-work provider scan or local git baseline",
|
|
160
|
+
"example_value": "73f050b275290838a5b8f3a5a1e9eb8715830c46"
|
|
161
|
+
},
|
|
162
|
+
{
|
|
163
|
+
"id": "provider_history",
|
|
164
|
+
"description": "Provider issue/project history or equivalent source proving the selected work context inspected during pickup.",
|
|
165
|
+
"source": "provider adapter output",
|
|
166
|
+
"example_value": ".flow-agents/builder-kit-not-verified-resolution-hints/builder-kit-not-verified-resolution-hints--pull-work.md"
|
|
167
|
+
},
|
|
168
|
+
{
|
|
169
|
+
"id": "source_artifact",
|
|
170
|
+
"description": "Source shaped artifact or pickup artifact used to accept the fallback baseline.",
|
|
171
|
+
"source": ".flow-agents/<slug>/<slug>--idea-to-backlog.md",
|
|
172
|
+
"example_value": ".flow-agents/builder-kit-not-verified-resolution-hints/builder-kit-not-verified-resolution-hints--idea-to-backlog.md"
|
|
173
|
+
}
|
|
174
|
+
],
|
|
175
|
+
"fallback_policy_id": "accepted_fallback_baseline.current_target_plus_provider_history",
|
|
176
|
+
"summary": "Resolve missing planned_base_sha at pickup-probe by recording the current target ref and SHA, provider history/source artifact evidence, and the accepted fallback baseline policy before planning."
|
|
177
|
+
}
|
|
178
|
+
]
|
|
179
|
+
}
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
This example is intentionally limited to baseline freshness for missing or inconclusive `planned_base_sha`. It does not make the fallback baseline fresh planned evidence; it records an accepted Builder Kit readiness gap with deterministic repair guidance.
|
|
183
|
+
|
|
184
|
+
Boundary and non-goal rules:
|
|
185
|
+
|
|
186
|
+
- Builder Kit owns readiness guidance, including optional `resolution_hints`, Builder Kit `claim_id` names, and product-flow next-step selection.
|
|
187
|
+
- Flow Agents owns workflow artifacts, sidecars, primitive execution, modified-file recording, and evidence harness behavior.
|
|
188
|
+
- Flow owns gate semantics. `resolution_hints` must not redefine Flow pass, fail, approval, release, or route-back authority.
|
|
189
|
+
- Veritas remains optional evidence. A hint may reference Veritas output when present, but Builder Kit Probe records must not require Veritas schemas or duplicate Veritas policy contracts.
|
|
190
|
+
- Generic Flow Agents sidecar schemas, including `schemas/workflow-evidence.schema.json`, are not extended by this Builder Kit field.
|
|
191
|
+
- Direct primitive workflows remain valid without Builder Kit-specific `resolution_hints`.
|
|
192
|
+
|
|
193
|
+
## Product Flow Chaining And Primitive Stopping
|
|
194
|
+
|
|
195
|
+
Product-level Builder Kit flows may guide the next step; direct primitives must not surprise the user by auto-continuing.
|
|
196
|
+
|
|
197
|
+
- `builder-shape` is the product-level shape entry point. It delegates to `idea-to-backlog` without requiring the user to name that primitive, then stops at the backlog gate unless issue sync or continuation was explicitly requested.
|
|
198
|
+
- Builder Kit `build` is the product-level build entry point. It may guide `pull-work -> design-probe / pickup-probe -> plan-work` when the user asked for the Builder Kit build flow.
|
|
199
|
+
- Direct `idea-to-backlog`, direct `pull-work`, and direct `plan-work` remain standalone primitives. They record state and report the expected next step, but they do not auto-continue merely because a product flow exists.
|
|
200
|
+
- If a direct primitive is invoked with missing upstream Builder Kit state, it must explain the missing pre-step and offer the product-level entry point or the correct previous primitive instead of fabricating state.
|
|
201
|
+
- If the user declines guided continuation, record `automation_mode: "manual"` and the expected `next_step` in the Probe record or handoff.
|
|
202
|
+
|
|
203
|
+
## Pull Work WIP And Worktree Lifecycle
|
|
204
|
+
|
|
205
|
+
Builder Kit build pickup must not treat all active work equally. `pull-work` records two separate views before selecting new work:
|
|
206
|
+
|
|
207
|
+
- Personal WIP controls whether new work should start. This includes the current user's dirty worktrees, local branches, open PRs, active sidecars, review/verification/release decisions, and stale worktrees.
|
|
208
|
+
- Global work informs safety and priority. Work by others blocks only when it creates file-scope conflict, dependency, sequencing, release-lane, provider-state, or artifact-contract risk.
|
|
209
|
+
|
|
210
|
+
The pull-work artifact must record:
|
|
211
|
+
|
|
212
|
+
- `my_active_work`
|
|
213
|
+
- `shepherding_candidates`
|
|
214
|
+
- `stale_worktrees`
|
|
215
|
+
- `open_prs_by_me`
|
|
216
|
+
- `global_conflicts`
|
|
217
|
+
- `dependency_impacts`
|
|
218
|
+
- `start_new_work_decision`
|
|
219
|
+
|
|
220
|
+
`start_new_work_decision` is the durable gate for pickup. Use `proceed` only when personal WIP is within policy and global risks are recorded or accepted. Use `shepherd_existing`, `cleanup_required`, `blocked`, or `needs_user` when existing work, stale worktrees, unresolved PRs, or decisions should be handled first.
|
|
221
|
+
|
|
222
|
+
When a worktree is selected, the artifact must also record `worktree_lifecycle`:
|
|
223
|
+
|
|
224
|
+
- path
|
|
225
|
+
- branch
|
|
226
|
+
- retain-until condition: PR merged, branch abandoned, or user override
|
|
227
|
+
- cleanup owner
|
|
228
|
+
- cleanup command
|
|
229
|
+
- cleanup blockers such as open PR, pending review, pending CI, dirty files, unpublished commits, or user decision
|
|
230
|
+
|
|
231
|
+
Publish-change retains the worktree so review, CI, and follow-up fixes can happen in the same isolated checkout. Final acceptance, release cleanup, or explicit abandonment owns `git worktree remove <path>` and any branch deletion when safe. Files should not be copied back to a main checkout by hand.
|
|
232
|
+
|
|
233
|
+
## Automation Modes
|
|
234
|
+
|
|
235
|
+
Builder Kit routing must record one automation mode:
|
|
236
|
+
|
|
237
|
+
| Mode | Boundary |
|
|
238
|
+
| --- | --- |
|
|
239
|
+
| `manual` | Surface state, recommendations, and resume prompt only. Do not advance to the next primitive without explicit user instruction. |
|
|
240
|
+
| `guided` | Recommend and prepare the next step. Ask before crossing from Probe/design into planning or execution when unresolved questions or missing evidence remain. |
|
|
241
|
+
| `strict` | Advance only when all required artifacts, evidence, conflict checks, and acceptance inputs are present. Missing upstream state routes to `decision_gap` through `design-probe`. |
|
|
242
|
+
| `autonomous-bounded` | Advance within the approved work item, file ownership, sandbox, and Definition of Done boundaries. Stop for scope expansion, missing gate evidence, destructive actions, or Flow authority decisions. |
|
|
243
|
+
|
|
244
|
+
Mode changes must be explicit in the Probe record route reason or handoff. A stricter mode may stop earlier than the table permits. A looser mode must not bypass Flow Agents evidence gates or Flow authority.
|
|
245
|
+
|
|
246
|
+
## Direct Primitive Recovery
|
|
247
|
+
|
|
248
|
+
Direct primitive invocation remains valid. A user or orchestrator may call `pull-work`, `plan-work`, `execute-plan`, `verify-work`, or another primitive without Builder Kit build-flow state.
|
|
249
|
+
|
|
250
|
+
When a direct primitive has sufficient required inputs, it should proceed according to that primitive's own contract and update the standard Flow Agents artifacts. It may create a Probe record only if Builder Kit resume will need richer pickup context.
|
|
251
|
+
|
|
252
|
+
When Builder Kit build-flow recovery detects missing upstream state, selected work item evidence, or unresolved route decisions, it must distinguish that from direct primitive use:
|
|
253
|
+
|
|
254
|
+
| Scenario | Required route |
|
|
255
|
+
| --- | --- |
|
|
256
|
+
| Direct primitive has complete primitive inputs | Continue the primitive and record standard state/handoff. |
|
|
257
|
+
| Direct primitive lacks required primitive inputs | Mark `state.next_action.status` as `needs_user` or `blocked` and summarize the missing input. |
|
|
258
|
+
| Builder Kit build-flow lacks selected work item or design context | Route `decision_gap` to `design-probe` in the Probe record and summarize that in `state.next_action`. |
|
|
259
|
+
| Builder Kit build-flow has selected work item but incomplete pickup evidence | Route to `pickup-probe` or `design-probe` with `missing_evidence` populated. |
|
|
260
|
+
| Builder Kit build-flow has complete pickup context | Route to `plan-work` with the Probe record and selected work item refs linked. |
|
|
261
|
+
|
|
262
|
+
`decision_gap` is a route reason, not a new `state.phase`. Use the existing `pickup` or `planning` phase as appropriate and put the detailed reason in the Probe record.
|
|
263
|
+
|
|
264
|
+
Primitive recovery prompts should name the next intended step. Examples:
|
|
265
|
+
|
|
266
|
+
- Missing backlog item: "This needs Builder Kit shape / idea-to-backlog before pull-work can select executable work."
|
|
267
|
+
- Missing pickup Probe: "This Builder Kit build-flow plan request lacks pickup Probe evidence; route `decision_gap -> design-probe` and complete `pickup-probe` before planning."
|
|
268
|
+
- Manual mode: "Direct primitive mode selected; next expected step is `plan-work` after you approve the recorded handoff."
|
|
269
|
+
|
|
270
|
+
## Guided Next-Step Behavior
|
|
271
|
+
|
|
272
|
+
The default Builder Kit build-flow route is:
|
|
273
|
+
|
|
274
|
+
```text
|
|
275
|
+
pull-work -> design-probe / pickup-probe -> plan-work -> execute-plan -> verify-work -> evidence-gate
|
|
276
|
+
```
|
|
277
|
+
|
|
278
|
+
Routing rules:
|
|
279
|
+
|
|
280
|
+
- After `pull-work`, if no work item is selected, route to `design-probe` with route reason `decision_gap`.
|
|
281
|
+
- After `pull-work`, if one or more work items are selected but evidence is incomplete, route to `pickup-probe` with `missing_evidence` populated.
|
|
282
|
+
- After `pickup-probe`, if unresolved questions remain and are not accepted gaps, route to `design-probe` or user input according to the automation mode.
|
|
283
|
+
- After `design-probe` or `pickup-probe`, if the selected work item, acceptance criteria, evidence, conflict scan, and ownership boundaries are sufficient, route to `plan-work`.
|
|
284
|
+
- After `plan-work`, route to `execute-plan` only when the plan is approved by the active workflow mode and ownership boundaries remain valid.
|
|
285
|
+
- Mid-work resume must choose the next action from artifacts, not chat memory.
|
|
286
|
+
|
|
287
|
+
## Per-Item Pickup Probe Enforcement
|
|
288
|
+
|
|
289
|
+
Every selected work item or explicitly bundled work group in Builder Kit `build` needs a fresh pickup Probe before planning.
|
|
290
|
+
|
|
291
|
+
- One item is the default selection after `pull-work`.
|
|
292
|
+
- Multiple items are allowed only when the Probe record includes `grouping_decision.status: "independent-items"` or `"justified-bundle"` and records the bundle or independence justification plus conflict risks.
|
|
293
|
+
- A broad prior instruction such as "continue through all waves" or "pick up the next tasks" must not authorize planning for a newly selected item after a merge. The workflow may inspect the queue, but must create a fresh Probe record before planning or execution.
|
|
294
|
+
- Unsafe grouped work must route back to `pull-work` with `grouping_decision.status: "unsafe-group"` and a split recommendation.
|
|
295
|
+
- Empty board state must route to Builder Kit shape / `idea-to-backlog`; do not improvise implementation work.
|
|
296
|
+
|
|
297
|
+
Planning may proceed only when `probe_status` is `passed` or `accepted_gap` and `probe_artifact_ref`, selected work refs, grouping decision, accepted gaps, expected modified files, conflict risks, and resume prompt are present.
|
|
298
|
+
|
|
299
|
+
## Resume Requirements
|
|
300
|
+
|
|
301
|
+
A future session must be able to resume Builder Kit build-flow from these artifacts alone:
|
|
302
|
+
|
|
303
|
+
- `state.json` identifies current phase/status and the next action target.
|
|
304
|
+
- `handoff.json` summarizes the pause, blocker, delegation, or resume target.
|
|
305
|
+
- The Probe record explains the current step, next step, route reason, selected work item refs, missing evidence, unresolved questions, accepted gaps, automation mode, and recovery mode.
|
|
306
|
+
- The session artifact records modified files and progress.
|
|
307
|
+
- Phase sidecars record acceptance criteria, evidence, critique, release, or learning state when those gates have started.
|
|
308
|
+
|
|
309
|
+
If any required resume field is absent, Builder Kit build-flow must route through `design-probe` or `pickup-probe` before planning or execution. Direct primitive recovery may instead ask for the missing primitive input.
|
|
310
|
+
|
|
311
|
+
## Downstream Contract Target
|
|
312
|
+
|
|
313
|
+
Issues #64, #51, and #62 are downstream consumers of this contract. They may add implementation, hooks, provider behavior, or fixtures, but they must preserve:
|
|
314
|
+
|
|
315
|
+
- `state.json` as the routing-focused Flow Agents state sidecar.
|
|
316
|
+
- Builder Kit Probe records as the rich pickup/design decision surface.
|
|
317
|
+
- Direct primitive invocation as valid outside Builder Kit build-flow.
|
|
318
|
+
- Builder Kit build-flow recovery through `decision_gap` to `design-probe` when upstream state is missing.
|
|
319
|
+
- Flow boundary preservation: Builder Kit coordinates product flow, Flow Agents coordinates harness artifacts and primitives, and Flow owns gate authority semantics.
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
# Delivery Contract
|
|
2
|
+
|
|
3
|
+
Delivery chains planning, execution, review, verification, Goal Fit, and final acceptance until the user-facing goal is genuinely handled.
|
|
4
|
+
|
|
5
|
+
## Workflow
|
|
6
|
+
|
|
7
|
+
1. Create or resume a session artifact that follows `context/contracts/artifact-contract.md`.
|
|
8
|
+
2. Plan with `context/contracts/planning-contract.md`.
|
|
9
|
+
3. Execute with `context/contracts/execution-contract.md`.
|
|
10
|
+
4. Review code quality and security where relevant. Reviews are report-only.
|
|
11
|
+
5. Verify with `context/contracts/verification-contract.md`.
|
|
12
|
+
6. Route failures, findings, and `NOT_VERIFIED` gaps back through execution or to an explicit user decision.
|
|
13
|
+
7. Complete the Goal Fit Gate before final response.
|
|
14
|
+
8. Publish verified changes before release readiness: commit the verified diff, push the branch, open or update the provider change record or record an explicit no-provider-change reason, and collect provider check evidence.
|
|
15
|
+
9. Run release readiness against the provider change/branch/check state, not only local verification.
|
|
16
|
+
10. Complete Final Acceptance and docs promotion after CI, merge, release, or explicit acceptance.
|
|
17
|
+
|
|
18
|
+
## Delegation Gates
|
|
19
|
+
|
|
20
|
+
Delivery orchestrators must invoke the primitive delegates for the planning and verification gates:
|
|
21
|
+
|
|
22
|
+
- `plan-work` delegates planning to `tool-planner`.
|
|
23
|
+
- `review-work` delegates critique to `tool-code-reviewer` and conditionally to `tool-security-reviewer`.
|
|
24
|
+
- `verify-work` delegates verification to `tool-verifier`.
|
|
25
|
+
- UI or browser-facing verification also delegates to `tool-playwright`.
|
|
26
|
+
|
|
27
|
+
These gates still apply when the environment is read-only, the repository is not writable, or a prerequisite is missing. In blocked environments, attempt the required delegation first when the tool is available, then report the blocked result as `NOT_VERIFIED` or `FAIL` with evidence. Do not replace the delegate gate with a local summary.
|
|
28
|
+
|
|
29
|
+
When reporting gate progress or final delivery evidence, name the exact delegate ids (`tool-planner`, `tool-worker`, `tool-code-reviewer`, `tool-security-reviewer`, `tool-verifier`, `tool-playwright`) rather than generic labels like planner, worker, reviewer, verifier, or browser verifier. Exact names make telemetry gaps and text-only evals auditable.
|
|
30
|
+
|
|
31
|
+
## Goal Fit Gate
|
|
32
|
+
|
|
33
|
+
Before claiming delivery, the session artifact must answer:
|
|
34
|
+
|
|
35
|
+
- [ ] Original user goal restated
|
|
36
|
+
- [ ] Every acceptance criterion has evidence
|
|
37
|
+
- [ ] User-facing workflow was exercised or documented
|
|
38
|
+
- [ ] Local/project and global scope are handled when relevant
|
|
39
|
+
- [ ] Unknown, NOT_VERIFIED, and TODO gaps are resolved or explicitly accepted
|
|
40
|
+
- [ ] Dashboard/UI changes have visual evidence when relevant
|
|
41
|
+
- [ ] Durable docs target is updated, scheduled for final acceptance, or marked not needed with reason
|
|
42
|
+
|
|
43
|
+
## Loop Rules
|
|
44
|
+
|
|
45
|
+
- Reviewers and verifiers are report-only.
|
|
46
|
+
- Any code change after review or verification requires another clean review and verification pass.
|
|
47
|
+
- CRITICAL or HIGH review findings route through re-planning unless the fix is explicitly narrow and safe.
|
|
48
|
+
- MEDIUM findings and verification FAIL items route through an execution fix pass.
|
|
49
|
+
- The loop exits only when review and verification are clean in the same iteration and Goal Fit is complete or explicitly accepted.
|
|
50
|
+
|
|
51
|
+
## Final Acceptance
|
|
52
|
+
|
|
53
|
+
After CI passes and the work is merged, released, or otherwise accepted:
|
|
54
|
+
|
|
55
|
+
- [ ] CI/relevant checks passed
|
|
56
|
+
- [ ] verified diff committed and pushed
|
|
57
|
+
- [ ] provider change record created or updated, or explicit no-provider-change reason recorded
|
|
58
|
+
- [ ] merge, release, or hold decision recorded
|
|
59
|
+
- [ ] working artifacts archived or linked
|
|
60
|
+
- [ ] long-lived docs updated with why and how the feature was built
|
|
61
|
+
- [ ] durable docs link back to the provider record, archived plan, or session artifact when useful
|
|
62
|
+
- [ ] local `.flow-agents/` runtime artifacts remain untracked, and durable outcomes are promoted before merge to `main`
|
|
63
|
+
- [ ] follow-up issues or learning-review items created for deferred work
|
|
64
|
+
|
|
65
|
+
## Distribution Rule
|
|
66
|
+
|
|
67
|
+
This contract is shared across Codex, Kiro, Claude Code, and future distributions. Distribution-specific files may adapt paths, tool names, and hook wiring, but they should not redefine the workflow rules independently.
|
|
68
|
+
|
|
69
|
+
GitHub PRs are the first `ChangeProvider` adapter example: in GitHub-backed projects, the provider change record is normally a PR and provider checks are normally PR checks.
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
# Execution Contract
|
|
2
|
+
|
|
3
|
+
Execution turns an approved plan artifact into code and local evidence while preserving parallel safety.
|
|
4
|
+
|
|
5
|
+
## Required Inputs
|
|
6
|
+
|
|
7
|
+
- plan artifact path
|
|
8
|
+
- session artifact path
|
|
9
|
+
- task description, files, acceptance criteria, and Definition Of Done items relevant to the task
|
|
10
|
+
- prior wave results when executing a later wave
|
|
11
|
+
- sandbox mode and escalation policy from `context/contracts/sandbox-policy.md`
|
|
12
|
+
|
|
13
|
+
## Worker Rules
|
|
14
|
+
|
|
15
|
+
- Validate scope before writing code.
|
|
16
|
+
- Confirm the planned `sandbox_mode` still fits the task before mutating files or systems.
|
|
17
|
+
- Check existing task artifacts for overlapping modified files.
|
|
18
|
+
- Work with existing user or agent changes; do not revert unrelated work.
|
|
19
|
+
- Follow local project patterns and use the smallest implementation that satisfies the plan.
|
|
20
|
+
- Update the session or worker task artifact with modified files and progress. Modified files are required execution evidence for conflict detection, verification scope, and optional governance providers.
|
|
21
|
+
- Prefer `npm run workflow:sidecar -- advance-state` when available to update `state.json` and `handoff.json` at phase boundaries.
|
|
22
|
+
- Run relevant validation for the files changed.
|
|
23
|
+
- If instructions are insufficient, another in-progress task blocks the work, the required sandbox mode is stronger than planned, or approval is missing, stop and report the blocker rather than guessing.
|
|
24
|
+
|
|
25
|
+
## Sandbox Modes
|
|
26
|
+
|
|
27
|
+
Use the vocabulary in `context/contracts/sandbox-policy.md`:
|
|
28
|
+
|
|
29
|
+
- `local-read-only`
|
|
30
|
+
- `local-edit`
|
|
31
|
+
- `worktree`
|
|
32
|
+
- `container`
|
|
33
|
+
- `cloud-sandbox`
|
|
34
|
+
- `privileged-integration`
|
|
35
|
+
|
|
36
|
+
Execution may upgrade to a stronger mode when risk increases. Downgrades require a recorded reason.
|
|
37
|
+
|
|
38
|
+
## Parallel Wave Rules
|
|
39
|
+
|
|
40
|
+
- Independent tasks with no shared files can run in the same wave.
|
|
41
|
+
- Shared files, generated artifacts, migrations, and cross-cutting contracts should be serialized unless the plan gives explicit file ownership.
|
|
42
|
+
- Worker delegation must name the exact worker role (`tool-worker`) rather than spawning an unnamed/default implementation agent.
|
|
43
|
+
- After each wave, collect results, check conflicts, and update the session artifact before starting the next wave.
|
|
44
|
+
|
|
45
|
+
## Completion Rules
|
|
46
|
+
|
|
47
|
+
Execution is complete only when:
|
|
48
|
+
- all planned waves are complete or explicitly blocked
|
|
49
|
+
- modified files are recorded in the session/deliver artifact or an evidence sidecar that the verifier can read; do not store them in `state.json` unless the workflow state schema supports that field
|
|
50
|
+
- sandbox mode and approval/rollback assumptions are recorded when relevant
|
|
51
|
+
- local validation attempted for changed areas
|
|
52
|
+
- failures caused by the execution are fixed or reported as blockers
|
|
53
|
+
- remaining gaps are ready for verification rather than hidden in the final summary
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
# Governance Adapter Contract
|
|
2
|
+
|
|
3
|
+
Governance adapters let Flow Agents ask an external tool for policy, proof, or trust evidence without baking repo-specific policy into Flow Agents core.
|
|
4
|
+
|
|
5
|
+
## Boundary
|
|
6
|
+
|
|
7
|
+
Flow Agents owns:
|
|
8
|
+
|
|
9
|
+
- workflow phase routing
|
|
10
|
+
- acceptance criteria and goal-fit checks
|
|
11
|
+
- `evidence.json` references to external proof
|
|
12
|
+
- release, learning, and handoff decisions
|
|
13
|
+
|
|
14
|
+
The adapter owns:
|
|
15
|
+
|
|
16
|
+
- repo-local policy semantics
|
|
17
|
+
- evidence check selection and execution
|
|
18
|
+
- native evidence artifact shape
|
|
19
|
+
- rule explanations and just-in-time guidance
|
|
20
|
+
- policy promotion or retirement logic
|
|
21
|
+
|
|
22
|
+
Flow Agents must not copy an adapter's rule model into core skills. It should invoke the adapter when configured, record the artifact reference, and route the resulting pass/fail/not-verified status through normal evidence gates.
|
|
23
|
+
|
|
24
|
+
## Minimum Adapter Shape
|
|
25
|
+
|
|
26
|
+
An adapter integration should define:
|
|
27
|
+
|
|
28
|
+
- `id`: stable adapter id, such as `veritas`
|
|
29
|
+
- `availability_check`: command or file probe that proves the adapter is installed/configured
|
|
30
|
+
- `readiness_command`: optional command that explains required proof or verification budget
|
|
31
|
+
- `evidence_command`: command that produces a native evidence artifact or machine-readable result
|
|
32
|
+
- `feedback_command`: optional command that emits concise agent-facing guidance
|
|
33
|
+
- `artifact_pattern`: where native evidence artifacts are written
|
|
34
|
+
- `standard`: evidence standard used in Flow Agents sidecars, such as `veritas`, `sarif`, or `opentelemetry-log`
|
|
35
|
+
- `sandbox_mode`: minimum mode required by `context/contracts/sandbox-policy.md`
|
|
36
|
+
- `failure_routing`: whether failures return to planning, execution, verification, release readiness, or human decision
|
|
37
|
+
|
|
38
|
+
## Veritas Boundary
|
|
39
|
+
|
|
40
|
+
Veritas is the first known fit for this contract.
|
|
41
|
+
|
|
42
|
+
Use Veritas when a repo has Veritas configuration and the work needs repo-local standards, authority, evidence checks, readiness, or JIT rule guidance.
|
|
43
|
+
|
|
44
|
+
Do not require Veritas for the Flow Agents core surface or Builder Kit. Treat it as an optional development/governance provider:
|
|
45
|
+
|
|
46
|
+
- `veritas readiness --check evidence --working-tree`: readiness evidence, native report, and feedback draft
|
|
47
|
+
- `veritas readiness --check boundaries --working-tree`: protected-area and ownership signal
|
|
48
|
+
- `veritas readiness --check coverage --working-tree`: evidence coverage signal
|
|
49
|
+
- `veritas explain <rule|file|surface>`: just-in-time guidance
|
|
50
|
+
|
|
51
|
+
When a Veritas artifact is used, write a Flow Agents evidence check with `standard_refs[].standard: "veritas"` and `standard_refs[].ref` pointing at the Veritas artifact. If the artifact is outside the workflow directory, also add `external_evidence`.
|
|
52
|
+
|
|
53
|
+
## Stop Conditions
|
|
54
|
+
|
|
55
|
+
Stop and route to the user or plan when:
|
|
56
|
+
|
|
57
|
+
- the adapter is not installed or configured and the plan requires it
|
|
58
|
+
- the adapter needs a stronger sandbox mode than the plan recorded
|
|
59
|
+
- the adapter reports blocking policy failures
|
|
60
|
+
- the adapter output cannot be tied to changed files, acceptance criteria, or release risk
|
|
61
|
+
- the native evidence artifact is missing or unreadable
|
|
62
|
+
|
|
63
|
+
## Non-Goals
|
|
64
|
+
|
|
65
|
+
- Do not turn adapter-specific rules into Flow Agents universal rules.
|
|
66
|
+
- Do not make Veritas or any governance adapter mandatory for ordinary Flow Agents usage.
|
|
67
|
+
- Do not flatten native evidence artifacts into long Markdown summaries when a stable artifact reference is available.
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
# Planning Contract
|
|
2
|
+
|
|
3
|
+
Planning turns a user goal into an executable implementation plan without writing production code.
|
|
4
|
+
|
|
5
|
+
## Required Inputs
|
|
6
|
+
|
|
7
|
+
- original user goal
|
|
8
|
+
- working directory
|
|
9
|
+
- relevant constraints from conversation, AGENTS.md, and active skills
|
|
10
|
+
- session artifact path when part of a larger workflow
|
|
11
|
+
- research findings when the work depends on unfamiliar external APIs, libraries, or current behavior
|
|
12
|
+
|
|
13
|
+
## Required Output
|
|
14
|
+
|
|
15
|
+
Produce a plan artifact that follows `context/contracts/artifact-contract.md`.
|
|
16
|
+
|
|
17
|
+
Also create or update structured sidecars beside the Markdown artifacts:
|
|
18
|
+
|
|
19
|
+
- `state.json`: phase `planning`, then `planned` status once the plan is ready.
|
|
20
|
+
- `acceptance.json`: each acceptance criterion from the Definition Of Done, with `pending` status and expected evidence references when known.
|
|
21
|
+
- `handoff.json`: summary and next steps when the plan is ready for execution or user approval.
|
|
22
|
+
|
|
23
|
+
Use the sidecar writer when available:
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
npm run workflow:sidecar -- init-plan .flow-agents/<slug>/<slug>--deliver.md \
|
|
27
|
+
--source-request "<original request>" \
|
|
28
|
+
--summary "<planning summary>" \
|
|
29
|
+
--next-action "<next execution step>"
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
The plan body must include:
|
|
33
|
+
|
|
34
|
+
```markdown
|
|
35
|
+
## Plan
|
|
36
|
+
|
|
37
|
+
<one-paragraph approach and key decisions>
|
|
38
|
+
|
|
39
|
+
## Definition Of Done
|
|
40
|
+
|
|
41
|
+
- **User outcome:** <what the user can understand, run, decide, or operate after delivery>
|
|
42
|
+
- **Scope:** <included work and explicitly excluded work>
|
|
43
|
+
- **Acceptance criteria:**
|
|
44
|
+
- [ ] AC1 `<stable-id>`: <criterion> - Evidence: <test, command, screenshot, dashboard, doc, CI, or manual check>; Source evidence: <expected file/line refs or provider permalink expectation when implementation behavior is claimed>
|
|
45
|
+
- **Usefulness checks:**
|
|
46
|
+
- [ ] User-facing workflow is documented or discoverable
|
|
47
|
+
- [ ] Local and global/project scope are separated when relevant
|
|
48
|
+
- [ ] Dashboard/UI changes have visual evidence when relevant
|
|
49
|
+
- [ ] Unknown, NOT_VERIFIED, and TODO gaps are resolved or explicitly accepted
|
|
50
|
+
- **Stop-short risks:** <ways this could technically pass while still not meeting the user's goal>
|
|
51
|
+
- **Durable docs target:** <docs path to update after CI/merge, or "not needed" with reason>
|
|
52
|
+
- **Sandbox mode:** <one of `local-read-only`, `local-edit`, `worktree`, `container`, `cloud-sandbox`, or `privileged-integration`; see `context/contracts/sandbox-policy.md`>
|
|
53
|
+
|
|
54
|
+
## Baseline and AC revalidation
|
|
55
|
+
|
|
56
|
+
- **Current target:** <latest target ref/SHA used for planning, or `not applicable` for direct local planning>
|
|
57
|
+
- **Freshness source:** <pull-work or pickup Probe artifact ref, `revision_freshness`, and planned base ref/SHA when present>
|
|
58
|
+
- **Accepted gap baseline:** <explicit accepted gap such as missing historical `planned_base_sha` with fallback baseline, or `none`; missing `planned_base_sha` is not fresh>
|
|
59
|
+
- **AC revalidation against drift:** <each upstream AC id revalidated against current target, changed scope intersections, dependency/provider state, and provider history>
|
|
60
|
+
- **Stale assumptions:** <assumptions invalidated by target movement, changed files, contracts, dependencies, provider state, or `none`>
|
|
61
|
+
- **Route-back decision:** <`none`, route back to pickup Probe for unresolved pickup/planning gaps, or route stale shaped work back to idea-to-backlog>
|
|
62
|
+
|
|
63
|
+
### Wave 1 (parallel)
|
|
64
|
+
|
|
65
|
+
#### Task: <name>
|
|
66
|
+
- **Files:** <create/modify/delete list>
|
|
67
|
+
- **Changes:** <specific behavior changes>
|
|
68
|
+
- **Acceptance:** <criterion-level evidence expected>
|
|
69
|
+
- **Supports:** <AC ids and requirement ids supported by this task>
|
|
70
|
+
- **Context:** <patterns, constraints, or references>
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
## Planning Rules
|
|
74
|
+
|
|
75
|
+
- Explore enough codebase context to make the plan executable.
|
|
76
|
+
- Reuse existing patterns before inventing new ones.
|
|
77
|
+
- Separate independent tasks into parallel waves and dependent tasks into later waves.
|
|
78
|
+
- Every task must have concrete acceptance criteria.
|
|
79
|
+
- Preserve stable requirement and acceptance ids from upstream backlog issues when they exist; otherwise create stable ids in the plan before execution.
|
|
80
|
+
- Every implementation task must map back to the acceptance criteria it supports.
|
|
81
|
+
- Acceptance criteria for implementation behavior must name expected command/test evidence and expected source evidence. Source evidence means structured refs with `kind`, `url`, `file`, `line_start`, `line_end`, and `excerpt` where applicable; use immutable GitHub blob permalinks pinned to a commit SHA when provider URLs are available, and local file/line refs only as pre-publish fallback.
|
|
82
|
+
- Plans should state that provider, PR, issue, closure, and final acceptance comments need an `Acceptance Evidence` table with columns `AC id`, `Status`, `Command/Test Evidence`, `Source Evidence / Permalinks`, and `Gaps`.
|
|
83
|
+
- The Definition Of Done is the stop condition, not a decorative section.
|
|
84
|
+
- If the goal is exploratory or uncertain, define what the user should be able to take away from the work.
|
|
85
|
+
- Call out stop-short risks during planning, especially when a technical implementation could pass while the user still cannot run, inspect, understand, or act on the result.
|