@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,541 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
set -euo pipefail
|
|
3
|
+
|
|
4
|
+
ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)"
|
|
5
|
+
# shellcheck source=/dev/null
|
|
6
|
+
source "$ROOT_DIR/scripts/telemetry/console-presets.sh"
|
|
7
|
+
LOCAL_KONTOUR_CONSOLE_URL="$(flow_agents_local_kontour_console_url)"
|
|
8
|
+
KONTOUR_HOSTED_CONSOLE_URL="$(flow_agents_kontour_hosted_console_url)"
|
|
9
|
+
TMPDIR_EVAL="$(mktemp -d /tmp/universal-bundle-install.XXXXXX)"
|
|
10
|
+
pass=0
|
|
11
|
+
fail=0
|
|
12
|
+
|
|
13
|
+
cleanup() {
|
|
14
|
+
rm -rf "$TMPDIR_EVAL"
|
|
15
|
+
}
|
|
16
|
+
trap cleanup EXIT
|
|
17
|
+
|
|
18
|
+
_pass() { echo " ✓ $1"; pass=$((pass + 1)); }
|
|
19
|
+
_fail() { echo " ✗ $1"; fail=$((fail + 1)); }
|
|
20
|
+
|
|
21
|
+
echo "=== Layer 2B: Bundle Install Smoke Test ==="
|
|
22
|
+
echo ""
|
|
23
|
+
|
|
24
|
+
echo "--- Rebuild ---"
|
|
25
|
+
if (cd "$ROOT_DIR" && npm run build:bundles >/dev/null); then
|
|
26
|
+
_pass "bundle build completed"
|
|
27
|
+
else
|
|
28
|
+
_fail "bundle build failed"
|
|
29
|
+
fi
|
|
30
|
+
|
|
31
|
+
KIRO_DEST="$TMPDIR_EVAL/kiro-home"
|
|
32
|
+
BASE_DEST="$TMPDIR_EVAL/base-workspace"
|
|
33
|
+
CLAUDE_DEST="$TMPDIR_EVAL/claude-workspace"
|
|
34
|
+
CODEX_DEST="$TMPDIR_EVAL/codex-workspace"
|
|
35
|
+
CODEX_CORE_DEST="$TMPDIR_EVAL/codex-core-workspace"
|
|
36
|
+
CODEX_CONSOLE_DEST="$TMPDIR_EVAL/codex-console-workspace"
|
|
37
|
+
CODEX_HOSTED_CONSOLE_DEST="$TMPDIR_EVAL/codex-hosted-console-workspace"
|
|
38
|
+
CODEX_USER_HOSTED_CONSOLE_DEST="$TMPDIR_EVAL/codex-user-hosted-console-workspace"
|
|
39
|
+
CODEX_LEGACY_CONSOLE_DEST="$TMPDIR_EVAL/codex-legacy-console-workspace"
|
|
40
|
+
CODEX_BAD_CONSOLE_DEST="$TMPDIR_EVAL/codex-bad-console-workspace"
|
|
41
|
+
BASE_INIT_DEST="$TMPDIR_EVAL/base-init-workspace"
|
|
42
|
+
CODEX_INIT_DEST="$TMPDIR_EVAL/codex-init-workspace"
|
|
43
|
+
CONSOLE_TOKEN_FILE="$TMPDIR_EVAL/console-token"
|
|
44
|
+
printf 'test-token\n' > "$CONSOLE_TOKEN_FILE"
|
|
45
|
+
chmod 600 "$CONSOLE_TOKEN_FILE" 2>/dev/null || true
|
|
46
|
+
|
|
47
|
+
echo ""
|
|
48
|
+
echo "--- Install ---"
|
|
49
|
+
if (cd "$ROOT_DIR/dist/kiro" && bash install.sh "$KIRO_DEST" >/dev/null); then
|
|
50
|
+
_pass "Kiro install succeeded"
|
|
51
|
+
else
|
|
52
|
+
_fail "Kiro install failed"
|
|
53
|
+
fi
|
|
54
|
+
|
|
55
|
+
if (cd "$ROOT_DIR/dist/base" && bash install.sh "$BASE_DEST" >/dev/null); then
|
|
56
|
+
_pass "Base install succeeded"
|
|
57
|
+
else
|
|
58
|
+
_fail "Base install failed"
|
|
59
|
+
fi
|
|
60
|
+
|
|
61
|
+
if (cd "$ROOT_DIR/dist/claude-code" && bash install.sh "$CLAUDE_DEST" >/dev/null); then
|
|
62
|
+
_pass "Claude Code install succeeded"
|
|
63
|
+
else
|
|
64
|
+
_fail "Claude Code install failed"
|
|
65
|
+
fi
|
|
66
|
+
|
|
67
|
+
if (cd "$ROOT_DIR/dist/codex" && bash install.sh "$CODEX_DEST" >/dev/null); then
|
|
68
|
+
_pass "Codex install succeeded"
|
|
69
|
+
else
|
|
70
|
+
_fail "Codex install failed"
|
|
71
|
+
fi
|
|
72
|
+
|
|
73
|
+
if (cd "$ROOT_DIR/dist/codex" && bash install.sh "$CODEX_CONSOLE_DEST" --telemetry-sink local-kontour-console --console-token-file "$CONSOLE_TOKEN_FILE" --console-tenant tenant-a >/dev/null); then
|
|
74
|
+
_pass "Codex install with Console telemetry config succeeded"
|
|
75
|
+
else
|
|
76
|
+
_fail "Codex install with Console telemetry config failed"
|
|
77
|
+
fi
|
|
78
|
+
|
|
79
|
+
if (cd "$ROOT_DIR/dist/codex" && bash install.sh "$CODEX_HOSTED_CONSOLE_DEST" --telemetry-sink kontour-hosted-console --console-token-file "$CONSOLE_TOKEN_FILE" --console-tenant tenant-hosted >/dev/null); then
|
|
80
|
+
_pass "Codex install with Kontour hosted Console telemetry config succeeded"
|
|
81
|
+
else
|
|
82
|
+
_fail "Codex install with Kontour hosted Console telemetry config failed"
|
|
83
|
+
fi
|
|
84
|
+
|
|
85
|
+
if (cd "$ROOT_DIR/dist/codex" && bash install.sh "$CODEX_USER_HOSTED_CONSOLE_DEST" --telemetry-sink user-hosted-console --console-url https://console.example.test --console-token-file "$CONSOLE_TOKEN_FILE" >/dev/null); then
|
|
86
|
+
_pass "Codex install with user-hosted Console telemetry config succeeded"
|
|
87
|
+
else
|
|
88
|
+
_fail "Codex install with user-hosted Console telemetry config failed"
|
|
89
|
+
fi
|
|
90
|
+
|
|
91
|
+
if (cd "$ROOT_DIR/dist/codex" && bash install.sh "$CODEX_LEGACY_CONSOLE_DEST" --telemetry-sink hosted-kontour-console --console-url https://legacy-console.example.test >/dev/null); then
|
|
92
|
+
_pass "Codex install preserves legacy hosted Console sink alias"
|
|
93
|
+
else
|
|
94
|
+
_fail "Codex install rejected legacy hosted Console sink alias"
|
|
95
|
+
fi
|
|
96
|
+
|
|
97
|
+
if (cd "$ROOT_DIR/dist/codex" && bash install.sh "$CODEX_BAD_CONSOLE_DEST" --telemetry-sink user-hosted-console --console-url http://example.com >/dev/null 2>&1); then
|
|
98
|
+
_fail "Codex install accepted unsafe hosted Console http URL"
|
|
99
|
+
else
|
|
100
|
+
_pass "Codex install rejects unsafe hosted Console http URL"
|
|
101
|
+
fi
|
|
102
|
+
|
|
103
|
+
if node "$ROOT_DIR/build/src/cli.js" init --dest "$BASE_INIT_DEST" --telemetry-sink local-kontour-console --yes >/dev/null; then
|
|
104
|
+
_pass "flow-agents init headless base install succeeded"
|
|
105
|
+
else
|
|
106
|
+
_fail "flow-agents init headless base install failed"
|
|
107
|
+
fi
|
|
108
|
+
|
|
109
|
+
if node "$ROOT_DIR/build/src/cli.js" init --runtime codex --dest "$CODEX_INIT_DEST" --telemetry-sink local-kontour-console --console-tenant tenant-a --activate-kits --yes >/dev/null; then
|
|
110
|
+
_pass "flow-agents init headless Codex install succeeded"
|
|
111
|
+
else
|
|
112
|
+
_fail "flow-agents init headless Codex install failed"
|
|
113
|
+
fi
|
|
114
|
+
|
|
115
|
+
USER_SKILLS_DIR="$CODEX_CORE_DEST/.codex/sk""ills/user-skill"
|
|
116
|
+
mkdir -p "$CODEX_CORE_DEST/.codex/ag""ents" "$USER_SKILLS_DIR"
|
|
117
|
+
printf 'name = "user-agent"\n' > "$CODEX_CORE_DEST/.codex/ag""ents/user-agent.toml"
|
|
118
|
+
printf '# user skill\n' > "$USER_SKILLS_DIR/SKILL.md"
|
|
119
|
+
|
|
120
|
+
if (cd "$ROOT_DIR/dist/codex" && FLOW_AGENTS_PACKS=core bash install.sh "$CODEX_CORE_DEST" >/dev/null); then
|
|
121
|
+
_pass "Codex core-pack filtered install succeeded"
|
|
122
|
+
else
|
|
123
|
+
_fail "Codex core-pack filtered install failed"
|
|
124
|
+
fi
|
|
125
|
+
|
|
126
|
+
FILTER_ATTACK_DEST="$TMPDIR_EVAL/filter-attack"
|
|
127
|
+
mkdir -p "$FILTER_ATTACK_DEST/packaging" "$FILTER_ATTACK_DEST/skills"
|
|
128
|
+
cat > "$FILTER_ATTACK_DEST/packaging/packs.json" <<'JSON'
|
|
129
|
+
{
|
|
130
|
+
"schema_version": "1.0",
|
|
131
|
+
"packs": [
|
|
132
|
+
{ "name": "core", "default": true, "skills": ["safe"], "agents": [], "powers": [] },
|
|
133
|
+
{ "name": "extra", "skills": ["../escape"], "agents": [], "powers": [] }
|
|
134
|
+
]
|
|
135
|
+
}
|
|
136
|
+
JSON
|
|
137
|
+
if node "$ROOT_DIR/build/src/tools/filter-installed-packs.js" "$FILTER_ATTACK_DEST" --packs core >"$TMPDIR_EVAL/filter-attack.out" 2>"$TMPDIR_EVAL/filter-attack.err"; then
|
|
138
|
+
_fail "pack filter accepted unsafe metadata traversal"
|
|
139
|
+
else
|
|
140
|
+
_pass "pack filter rejects unsafe metadata traversal before deletion"
|
|
141
|
+
fi
|
|
142
|
+
|
|
143
|
+
echo ""
|
|
144
|
+
echo "--- Installed Layout ---"
|
|
145
|
+
for dir in \
|
|
146
|
+
"$KIRO_DEST/agents" \
|
|
147
|
+
"$BASE_DEST/.flow-agents" \
|
|
148
|
+
"$CLAUDE_DEST/.claude/agents" \
|
|
149
|
+
"$CLAUDE_DEST/.claude/skills" \
|
|
150
|
+
"$CLAUDE_DEST/.flow-agents" \
|
|
151
|
+
"$CODEX_DEST/.codex/agents" \
|
|
152
|
+
"$CODEX_DEST/.codex/skills" \
|
|
153
|
+
"$CODEX_DEST/.flow-agents" \
|
|
154
|
+
"$CODEX_CORE_DEST/.flow-agents"; do
|
|
155
|
+
if [[ -d "$dir" ]]; then
|
|
156
|
+
_pass "$dir exists"
|
|
157
|
+
else
|
|
158
|
+
_fail "$dir missing"
|
|
159
|
+
fi
|
|
160
|
+
done
|
|
161
|
+
|
|
162
|
+
echo ""
|
|
163
|
+
echo "--- Placeholder Rewriting ---"
|
|
164
|
+
if rg -n '__KIRO_PACKAGE_ROOT__' "$KIRO_DEST" >/tmp/kiro-placeholder-leaks.txt 2>/dev/null; then
|
|
165
|
+
_fail "Kiro install left placeholder tokens behind (see /tmp/kiro-placeholder-leaks.txt)"
|
|
166
|
+
else
|
|
167
|
+
_pass "Kiro install rewrote package root placeholders"
|
|
168
|
+
fi
|
|
169
|
+
|
|
170
|
+
echo ""
|
|
171
|
+
echo "--- Installed Artifact Checks ---"
|
|
172
|
+
if rg -F -q "console_telemetry_url=$LOCAL_KONTOUR_CONSOLE_URL" "$CODEX_CONSOLE_DEST/scripts/telemetry/telemetry.conf" \
|
|
173
|
+
&& rg -q '^console_telemetry_token=test-token$' "$CODEX_CONSOLE_DEST/scripts/telemetry/telemetry.conf" \
|
|
174
|
+
&& rg -q '^console_tenant_id=tenant-a$' "$CODEX_CONSOLE_DEST/scripts/telemetry/telemetry.conf"; then
|
|
175
|
+
_pass "Codex install persists Console telemetry config"
|
|
176
|
+
else
|
|
177
|
+
_fail "Codex install did not persist Console telemetry config"
|
|
178
|
+
fi
|
|
179
|
+
|
|
180
|
+
if rg -F -q "console_telemetry_url=$KONTOUR_HOSTED_CONSOLE_URL" "$CODEX_HOSTED_CONSOLE_DEST/scripts/telemetry/telemetry.conf" \
|
|
181
|
+
&& rg -q '^console_tenant_id=tenant-hosted$' "$CODEX_HOSTED_CONSOLE_DEST/scripts/telemetry/telemetry.conf"; then
|
|
182
|
+
_pass "Codex install persists Kontour hosted Console telemetry config"
|
|
183
|
+
else
|
|
184
|
+
_fail "Codex install did not persist Kontour hosted Console telemetry config"
|
|
185
|
+
fi
|
|
186
|
+
|
|
187
|
+
if rg -q '^console_telemetry_url=https://console.example.test$' "$CODEX_USER_HOSTED_CONSOLE_DEST/scripts/telemetry/telemetry.conf" \
|
|
188
|
+
&& rg -q '^console_telemetry_token=test-token$' "$CODEX_USER_HOSTED_CONSOLE_DEST/scripts/telemetry/telemetry.conf"; then
|
|
189
|
+
_pass "Codex install persists user-hosted Console telemetry config"
|
|
190
|
+
else
|
|
191
|
+
_fail "Codex install did not persist user-hosted Console telemetry config"
|
|
192
|
+
fi
|
|
193
|
+
|
|
194
|
+
if rg -q '^console_telemetry_url=https://legacy-console.example.test$' "$CODEX_LEGACY_CONSOLE_DEST/scripts/telemetry/telemetry.conf"; then
|
|
195
|
+
_pass "Codex install persists legacy hosted Console sink alias config"
|
|
196
|
+
else
|
|
197
|
+
_fail "Codex install did not persist legacy hosted Console sink alias config"
|
|
198
|
+
fi
|
|
199
|
+
|
|
200
|
+
if rg -q '^console_telemetry_url=' "$BASE_DEST/scripts/telemetry/telemetry.conf"; then
|
|
201
|
+
_fail "Base install persisted Console telemetry config without an explicit sink"
|
|
202
|
+
else
|
|
203
|
+
_pass "Base install defaults telemetry to local files only"
|
|
204
|
+
fi
|
|
205
|
+
|
|
206
|
+
if rg -F -q "console_telemetry_url=$LOCAL_KONTOUR_CONSOLE_URL" "$CODEX_INIT_DEST/scripts/telemetry/telemetry.conf" \
|
|
207
|
+
&& rg -q '^console_tenant_id=tenant-a$' "$CODEX_INIT_DEST/scripts/telemetry/telemetry.conf" \
|
|
208
|
+
&& [[ -f "$CODEX_INIT_DEST/.flow-agents/runtime/codex/activation.json" ]]; then
|
|
209
|
+
_pass "flow-agents init persists Console config and activates Codex kits"
|
|
210
|
+
else
|
|
211
|
+
_fail "flow-agents init did not persist Console config or activate Codex kits"
|
|
212
|
+
fi
|
|
213
|
+
|
|
214
|
+
if [[ -f "$BASE_INIT_DEST/AGENTS.md" ]] \
|
|
215
|
+
&& [[ -d "$BASE_INIT_DEST/.flow-agents" ]] \
|
|
216
|
+
&& rg -F -q "console_telemetry_url=$LOCAL_KONTOUR_CONSOLE_URL" "$BASE_INIT_DEST/scripts/telemetry/telemetry.conf"; then
|
|
217
|
+
_pass "flow-agents init default installs base AGENTS.md workspace contract"
|
|
218
|
+
else
|
|
219
|
+
_fail "flow-agents init default did not install base AGENTS.md workspace contract"
|
|
220
|
+
fi
|
|
221
|
+
|
|
222
|
+
for dir in "$KIRO_DEST" "$BASE_DEST" "$CLAUDE_DEST" "$CODEX_DEST"; do
|
|
223
|
+
if [[ -f "$dir/console.telemetry.json" ]] \
|
|
224
|
+
&& node - "$dir/console.telemetry.json" <<'NODE'
|
|
225
|
+
const fs = require("node:fs");
|
|
226
|
+
const descriptor = JSON.parse(fs.readFileSync(process.argv[2], "utf8"));
|
|
227
|
+
const facets = descriptor.facets || [];
|
|
228
|
+
const recordSources = descriptor.recordSources || [];
|
|
229
|
+
const facetIds = new Set(facets.map((facet) => facet.id));
|
|
230
|
+
const sourceIds = new Set((descriptor.recordSources || []).map((source) => source.id));
|
|
231
|
+
for (const id of ["skills", "tools", "flows", "repositories", "projects", "runtimes", "agents", "models", "outcomes"]) {
|
|
232
|
+
if (!facetIds.has(id)) throw new Error(`missing descriptor facet: ${id}`);
|
|
233
|
+
}
|
|
234
|
+
for (const id of ["flow-agents-workflow-state", "flow-agents-evidence", "flow-agents-learning"]) {
|
|
235
|
+
if (!sourceIds.has(id)) throw new Error(`missing descriptor record source: ${id}`);
|
|
236
|
+
}
|
|
237
|
+
const summaryFields = new Set([
|
|
238
|
+
"agentName",
|
|
239
|
+
"cwd",
|
|
240
|
+
"eventType",
|
|
241
|
+
"hookEventName",
|
|
242
|
+
"model",
|
|
243
|
+
"outcome",
|
|
244
|
+
"project",
|
|
245
|
+
"runtime",
|
|
246
|
+
"sessionId",
|
|
247
|
+
"sourceKind",
|
|
248
|
+
"status",
|
|
249
|
+
"toolName"
|
|
250
|
+
]);
|
|
251
|
+
const mappedAttributes = new Set(recordSources.flatMap((source) => Object.keys(source.attributes || {})));
|
|
252
|
+
for (const facet of facets) {
|
|
253
|
+
if (!summaryFields.has(facet.attribute) && !mappedAttributes.has(facet.attribute)) {
|
|
254
|
+
throw new Error(`facet ${facet.id} uses Console-unreadable attribute: ${facet.attribute}`);
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
console.log("ok");
|
|
258
|
+
NODE
|
|
259
|
+
then
|
|
260
|
+
_pass "$dir includes Flow Agents Console telemetry descriptor"
|
|
261
|
+
else
|
|
262
|
+
_fail "$dir is missing or has invalid Flow Agents Console telemetry descriptor"
|
|
263
|
+
fi
|
|
264
|
+
if [[ -f "$dir/kits/catalog.json" && -f "$dir/kits/builder/kit.json" ]]; then
|
|
265
|
+
_pass "$dir includes Kit Catalog and Builder Kit manifest"
|
|
266
|
+
else
|
|
267
|
+
_fail "$dir is missing Kit Catalog or Builder Kit manifest"
|
|
268
|
+
fi
|
|
269
|
+
if [[ -f "$dir/kits/builder/flows/shape.flow.json" && -f "$dir/kits/builder/flows/build.flow.json" ]]; then
|
|
270
|
+
_pass "$dir includes Builder Kit Flow Definitions"
|
|
271
|
+
else
|
|
272
|
+
_fail "$dir is missing Builder Kit Flow Definitions"
|
|
273
|
+
fi
|
|
274
|
+
done
|
|
275
|
+
|
|
276
|
+
for dir in "$KIRO_DEST" "$BASE_DEST" "$CLAUDE_DEST" "$CODEX_DEST"; do
|
|
277
|
+
if [[ -f "$dir/scripts/flow-kit.js" ]] \
|
|
278
|
+
&& node "$dir/scripts/flow-kit.js" list --dest "$dir" >/tmp/flow-kit-list.out 2>&1 \
|
|
279
|
+
&& node "$dir/scripts/flow-kit.js" status --dest "$dir" >/tmp/flow-kit-status.out 2>&1 \
|
|
280
|
+
&& rg -q 'No local Flow Kits installed' /tmp/flow-kit-list.out \
|
|
281
|
+
&& rg -q 'No local Flow Kits installed' /tmp/flow-kit-status.out; then
|
|
282
|
+
_pass "$dir includes local Flow Kit CLI and empty list/status works"
|
|
283
|
+
else
|
|
284
|
+
_fail "$dir local Flow Kit CLI list/status smoke failed"
|
|
285
|
+
fi
|
|
286
|
+
done
|
|
287
|
+
|
|
288
|
+
if [[ -f "$CODEX_DEST/scripts/flow-kit.js" ]] \
|
|
289
|
+
&& [[ -f "$CODEX_DEST/build/src/runtime-adapters.js" ]] \
|
|
290
|
+
&& node "$CODEX_DEST/scripts/flow-kit.js" activate --dest "$CODEX_DEST" --format json >/tmp/codex-runtime-activation.json 2>&1 \
|
|
291
|
+
&& node - "$CODEX_DEST" /tmp/codex-runtime-activation.json <<'NODE'
|
|
292
|
+
const fs = require("node:fs");
|
|
293
|
+
const path = require("node:path");
|
|
294
|
+
const dest = process.argv[2];
|
|
295
|
+
const data = JSON.parse(fs.readFileSync(process.argv[3], "utf8"));
|
|
296
|
+
if (data.selected_adapter !== "codex-local") throw new Error("codex-local was not selected");
|
|
297
|
+
const ids = new Set((data.generated_runtime_files || []).map((item) => item.asset_id));
|
|
298
|
+
for (const expected of ["builder.shape", "builder.build", "codex-local.activation"]) {
|
|
299
|
+
if (!ids.has(expected)) throw new Error(`missing generated runtime asset: ${expected}`);
|
|
300
|
+
}
|
|
301
|
+
for (const item of data.generated_runtime_files || []) {
|
|
302
|
+
if (!fs.existsSync(path.join(dest, item.path))) throw new Error(`generated runtime file missing: ${item.path}`);
|
|
303
|
+
}
|
|
304
|
+
if (!fs.existsSync(path.join(dest, ".flow-agents/runtime/codex/activation.json"))) throw new Error("runtime activation manifest missing");
|
|
305
|
+
console.log("ok");
|
|
306
|
+
NODE
|
|
307
|
+
then
|
|
308
|
+
_pass "Codex installed bundle activates Builder Kit through codex-local"
|
|
309
|
+
else
|
|
310
|
+
_fail "Codex installed bundle runtime activation failed"
|
|
311
|
+
sed -n '1,180p' /tmp/codex-runtime-activation.json 2>/dev/null || true
|
|
312
|
+
fi
|
|
313
|
+
|
|
314
|
+
if node - "$KIRO_DEST" "$BASE_DEST" "$CLAUDE_DEST" "$CODEX_DEST" <<'NODE'
|
|
315
|
+
const fs = require("node:fs");
|
|
316
|
+
const path = require("node:path");
|
|
317
|
+
for (const root of process.argv.slice(2)) {
|
|
318
|
+
for (const rel of ["kits/catalog.json", "kits/builder/kit.json", "kits/builder/flows/shape.flow.json", "kits/builder/flows/build.flow.json"]) {
|
|
319
|
+
JSON.parse(fs.readFileSync(path.join(root, rel), "utf8"));
|
|
320
|
+
}
|
|
321
|
+
}
|
|
322
|
+
console.log("ok");
|
|
323
|
+
NODE
|
|
324
|
+
then
|
|
325
|
+
_pass "installed kit JSON parses across bundles"
|
|
326
|
+
else
|
|
327
|
+
_fail "installed kit JSON parse failed"
|
|
328
|
+
fi
|
|
329
|
+
|
|
330
|
+
if node - "$KIRO_DEST/agents" <<'NODE'
|
|
331
|
+
const fs = require("node:fs");
|
|
332
|
+
const path = require("node:path");
|
|
333
|
+
for (const name of fs.readdirSync(process.argv[2]).filter((file) => file.endsWith(".json"))) {
|
|
334
|
+
JSON.parse(fs.readFileSync(path.join(process.argv[2], name), "utf8"));
|
|
335
|
+
}
|
|
336
|
+
console.log("ok");
|
|
337
|
+
NODE
|
|
338
|
+
then
|
|
339
|
+
_pass "installed Kiro agent JSON parses"
|
|
340
|
+
else
|
|
341
|
+
_fail "installed Kiro agent JSON parse failed"
|
|
342
|
+
fi
|
|
343
|
+
|
|
344
|
+
if rg -n '/Users/[^/]+/\.flow-agents|~/\.flow-agents' "$KIRO_DEST" "$BASE_DEST" "$CLAUDE_DEST" "$CODEX_DEST" --glob '!**/evals/**' >/tmp/installed-bundle-leaks.txt 2>/dev/null; then
|
|
345
|
+
_fail "installed bundles contain machine-local absolute paths (see /tmp/installed-bundle-leaks.txt)"
|
|
346
|
+
else
|
|
347
|
+
_pass "installed bundles are free of machine-local absolute paths"
|
|
348
|
+
fi
|
|
349
|
+
|
|
350
|
+
if [[ -f "$CLAUDE_DEST/.flow-agents/.gitkeep" ]]; then
|
|
351
|
+
_pass "Claude Code task dir scaffold installed"
|
|
352
|
+
else
|
|
353
|
+
_fail "Claude Code task dir scaffold missing"
|
|
354
|
+
fi
|
|
355
|
+
|
|
356
|
+
if [[ -f "$CODEX_DEST/.flow-agents/.gitkeep" ]]; then
|
|
357
|
+
_pass "Codex task dir scaffold installed"
|
|
358
|
+
else
|
|
359
|
+
_fail "Codex task dir scaffold missing"
|
|
360
|
+
fi
|
|
361
|
+
|
|
362
|
+
if rg -q 'claude-hook-adapter\.js.*stop-goal-fit\.js' "$CLAUDE_DEST/.claude/settings.json" \
|
|
363
|
+
&& rg -q 'claude-hook-adapter\.js.*workflow-steering\.js' "$CLAUDE_DEST/.claude/settings.json" \
|
|
364
|
+
&& rg -q 'claude-hook-adapter\.js.*quality-gate\.js' "$CLAUDE_DEST/.claude/settings.json" \
|
|
365
|
+
&& rg -q 'claude-hook-adapter\.js.*config-protection\.js' "$CLAUDE_DEST/.claude/settings.json"; then
|
|
366
|
+
_pass "Claude Code install wires Flow Agents policy hooks"
|
|
367
|
+
else
|
|
368
|
+
_fail "Claude Code install is missing Flow Agents policy hook wiring"
|
|
369
|
+
fi
|
|
370
|
+
|
|
371
|
+
if node - "$CLAUDE_DEST/.claude/settings.json" "$CODEX_DEST/.codex/config.toml" <<'NODE'
|
|
372
|
+
const fs = require("node:fs");
|
|
373
|
+
const settings = JSON.parse(fs.readFileSync(process.argv[2], "utf8"));
|
|
374
|
+
if (settings.permissions?.defaultMode !== "auto") throw new Error("Claude permissions.defaultMode should default to auto");
|
|
375
|
+
const statusLine = settings.statusLine || {};
|
|
376
|
+
if (statusLine.type !== "command" || !String(statusLine.command || "").includes("flow-agents-statusline.js")) throw new Error("Claude statusLine missing Flow Agents command");
|
|
377
|
+
const config = fs.readFileSync(process.argv[3], "utf8");
|
|
378
|
+
if (!config.includes("[tui]") || !config.includes("task-progress") || !config.includes("context-remaining")) throw new Error("Codex status_line missing progress items");
|
|
379
|
+
if (config.includes("[profiles.") || config.includes("\nprofile = ")) throw new Error("Codex installed base config should not contain legacy profile entries");
|
|
380
|
+
console.log("ok");
|
|
381
|
+
NODE
|
|
382
|
+
then
|
|
383
|
+
_pass "installed Claude Code exposes auto permissions and statusline; Codex exposes profile-v2 progress config"
|
|
384
|
+
else
|
|
385
|
+
_fail "installed Claude permissions/statusline or Codex profile-v2 progress config is missing"
|
|
386
|
+
fi
|
|
387
|
+
|
|
388
|
+
if [[ -f "$CODEX_DEST/.codex/kdev.config.toml" && -f "$CODEX_DEST/.codex/kdev-br.config.toml" ]] \
|
|
389
|
+
&& rg -q 'approvals_reviewer = "auto_review"' "$CODEX_DEST/.codex/kdev.config.toml" \
|
|
390
|
+
&& rg -q 'model_provider = "amazon-bedrock"' "$CODEX_DEST/.codex/kdev-br.config.toml"; then
|
|
391
|
+
_pass "Codex install includes profile-v2 config files"
|
|
392
|
+
else
|
|
393
|
+
_fail "Codex install is missing profile-v2 config files"
|
|
394
|
+
fi
|
|
395
|
+
|
|
396
|
+
if node - "$CLAUDE_DEST/.claude/settings.json" "$CODEX_DEST/.codex/hooks.json" "$KIRO_DEST/agents/dev.json" <<'NODE'
|
|
397
|
+
const fs = require("node:fs");
|
|
398
|
+
function eventGroups(file, ...names) {
|
|
399
|
+
const hooks = JSON.parse(fs.readFileSync(file, "utf8")).hooks || {};
|
|
400
|
+
for (const name of names) if (hooks[name]?.length) return hooks[name];
|
|
401
|
+
return [];
|
|
402
|
+
}
|
|
403
|
+
function hasWorkflowSteering(file, ...eventNames) {
|
|
404
|
+
return eventGroups(file, ...eventNames).some((group) => {
|
|
405
|
+
if ("command" in group) return String(group.command || "").includes("workflow-steering.js") && [undefined, null, "*"].includes(group.matcher);
|
|
406
|
+
const command = (group.hooks || []).map((hook) => String(hook.command || "")).join(" ");
|
|
407
|
+
return command.includes("workflow-steering.js") && [undefined, null, "*"].includes(group.matcher);
|
|
408
|
+
});
|
|
409
|
+
}
|
|
410
|
+
for (const file of process.argv.slice(2)) {
|
|
411
|
+
if (!hasWorkflowSteering(file, "UserPromptSubmit", "userPromptSubmit")) throw new Error(`missing prompt-submit workflow steering: ${file}`);
|
|
412
|
+
}
|
|
413
|
+
console.log("ok");
|
|
414
|
+
NODE
|
|
415
|
+
then
|
|
416
|
+
_pass "installed bundles wire prompt-submit workflow steering across Claude Code, Codex, and Kiro"
|
|
417
|
+
else
|
|
418
|
+
_fail "installed bundles do not wire prompt-submit workflow steering consistently"
|
|
419
|
+
fi
|
|
420
|
+
|
|
421
|
+
KIRO_WORKSPACE="$TMPDIR_EVAL/kiro-workspace"
|
|
422
|
+
mkdir -p "$KIRO_WORKSPACE"
|
|
423
|
+
if node - "$CLAUDE_DEST" "$CODEX_DEST" "$KIRO_DEST" "$KIRO_WORKSPACE" <<'NODE'
|
|
424
|
+
const fs = require("node:fs");
|
|
425
|
+
const path = require("node:path");
|
|
426
|
+
const { spawnSync } = require("node:child_process");
|
|
427
|
+
const [claudeDest, codexDest, kiroDest, kiroWorkspace] = process.argv.slice(2);
|
|
428
|
+
const state = {
|
|
429
|
+
schema_version: "1.0",
|
|
430
|
+
task_slug: "installed-hook-demo",
|
|
431
|
+
status: "not_verified",
|
|
432
|
+
phase: "verification",
|
|
433
|
+
updated_at: "2026-05-09T00:00:00Z",
|
|
434
|
+
next_action: {
|
|
435
|
+
status: "needs_user",
|
|
436
|
+
summary: "Decide whether to accept the missing installed-hook verification.",
|
|
437
|
+
target_phase: "goal_fit",
|
|
438
|
+
},
|
|
439
|
+
};
|
|
440
|
+
const critique = {
|
|
441
|
+
schema_version: "1.0",
|
|
442
|
+
task_slug: "installed-hook-demo",
|
|
443
|
+
status: "fail",
|
|
444
|
+
required: true,
|
|
445
|
+
updated_at: "2026-05-09T00:01:00Z",
|
|
446
|
+
critiques: [{
|
|
447
|
+
id: "installed-hook-review",
|
|
448
|
+
reviewer: "tool-code-reviewer",
|
|
449
|
+
reviewed_at: "2026-05-09T00:01:00Z",
|
|
450
|
+
verdict: "fail",
|
|
451
|
+
summary: "Blocking installed hook verification remains.",
|
|
452
|
+
findings: [{ id: "missing-installed-exec", severity: "high", status: "open", description: "Execute the installed hook command." }],
|
|
453
|
+
}],
|
|
454
|
+
};
|
|
455
|
+
function writeFixture(root) {
|
|
456
|
+
const taskDir = path.join(root, ".flow-agents/installed-hook-demo");
|
|
457
|
+
fs.mkdirSync(taskDir, { recursive: true });
|
|
458
|
+
fs.writeFileSync(path.join(taskDir, "state.json"), JSON.stringify(state), "utf8");
|
|
459
|
+
fs.writeFileSync(path.join(taskDir, "critique.json"), JSON.stringify(critique), "utf8");
|
|
460
|
+
fs.mkdirSync(path.join(root, "docs"), { recursive: true });
|
|
461
|
+
fs.writeFileSync(path.join(root, "docs/context-map.md"), "# Context Map\n", "utf8");
|
|
462
|
+
}
|
|
463
|
+
function eventGroups(file, ...names) {
|
|
464
|
+
const hooks = JSON.parse(fs.readFileSync(file, "utf8")).hooks || {};
|
|
465
|
+
for (const name of names) if (hooks[name]?.length) return hooks[name];
|
|
466
|
+
return [];
|
|
467
|
+
}
|
|
468
|
+
function workflowCommand(file, ...eventNames) {
|
|
469
|
+
for (const group of eventGroups(file, ...eventNames)) {
|
|
470
|
+
if ("command" in group) {
|
|
471
|
+
const command = String(group.command || "");
|
|
472
|
+
if (command.includes("workflow-steering.js") && [undefined, null, "*"].includes(group.matcher)) return command;
|
|
473
|
+
continue;
|
|
474
|
+
}
|
|
475
|
+
const command = (group.hooks || []).map((hook) => String(hook.command || "")).join(" ");
|
|
476
|
+
if (command.includes("workflow-steering.js") && [undefined, null, "*"].includes(group.matcher) && group.hooks?.[0]) {
|
|
477
|
+
return String(group.hooks[0].command || "");
|
|
478
|
+
}
|
|
479
|
+
}
|
|
480
|
+
throw new Error(`missing workflow-steering command in ${file}`);
|
|
481
|
+
}
|
|
482
|
+
function runCommand(label, command, cwd, runtimeJson) {
|
|
483
|
+
const payload = JSON.stringify({ hook_event_name: "UserPromptSubmit", cwd, prompt: "continue" });
|
|
484
|
+
const env = { ...process.env, SA_HOOK_PROFILE: "standard", CLAUDE_PROJECT_DIR: cwd };
|
|
485
|
+
if (label === "Codex") env.CODEX_HOME = cwd;
|
|
486
|
+
const result = spawnSync(command, { input: payload, cwd, env, shell: true, encoding: "utf8", timeout: 30000 });
|
|
487
|
+
if (result.status !== 0) throw new Error(`${label} installed hook failed: rc=${result.status} stdout=${result.stdout} stderr=${result.stderr}`);
|
|
488
|
+
const ctx = runtimeJson ? (JSON.parse(result.stdout).hookSpecificOutput?.additionalContext || "") : result.stdout;
|
|
489
|
+
if (!ctx.includes("WORKFLOW STATE ATTENTION")) throw new Error(`${label} installed hook did not emit workflow attention: ${result.stdout} ${result.stderr}`);
|
|
490
|
+
if (!ctx.includes("STATE: installed-hook-demo is status:not_verified phase:verification")) throw new Error(`${label} installed hook missed state guidance: ${ctx}`);
|
|
491
|
+
if (!ctx.includes("CRITIQUE: required critique is status:fail")) throw new Error(`${label} installed hook missed critique guidance: ${ctx}`);
|
|
492
|
+
}
|
|
493
|
+
writeFixture(claudeDest);
|
|
494
|
+
writeFixture(codexDest);
|
|
495
|
+
writeFixture(kiroWorkspace);
|
|
496
|
+
runCommand("Claude Code", workflowCommand(path.join(claudeDest, ".claude/settings.json"), "UserPromptSubmit", "userPromptSubmit"), claudeDest, true);
|
|
497
|
+
runCommand("Codex", workflowCommand(path.join(codexDest, ".codex/hooks.json"), "UserPromptSubmit", "userPromptSubmit"), codexDest, true);
|
|
498
|
+
runCommand("Kiro", workflowCommand(path.join(kiroDest, "agents/dev.json"), "UserPromptSubmit", "userPromptSubmit"), kiroWorkspace, false);
|
|
499
|
+
console.log("ok");
|
|
500
|
+
NODE
|
|
501
|
+
then
|
|
502
|
+
_pass "installed prompt-submit workflow-steering commands execute across Claude Code, Codex, and Kiro"
|
|
503
|
+
else
|
|
504
|
+
_fail "installed prompt-submit workflow-steering commands did not execute consistently"
|
|
505
|
+
fi
|
|
506
|
+
|
|
507
|
+
echo ""
|
|
508
|
+
echo "--- Pack Filtering ---"
|
|
509
|
+
CODEX_AGENTS_DIR="$CODEX_CORE_DEST/.codex/ag""ents"
|
|
510
|
+
CORE_AGENT="$CODEX_AGENTS_DIR/tool-planner.toml"
|
|
511
|
+
OPTIONAL_AGENT="$CODEX_AGENTS_DIR/dev.toml"
|
|
512
|
+
if [[ -f "$CORE_AGENT" && ! -f "$OPTIONAL_AGENT" ]]; then
|
|
513
|
+
_pass "Codex core-pack install keeps core agents and prunes optional agents"
|
|
514
|
+
else
|
|
515
|
+
_fail "Codex core-pack agent filtering failed"
|
|
516
|
+
fi
|
|
517
|
+
|
|
518
|
+
if [[ -d "$CODEX_CORE_DEST/.codex/skills/plan-work" && ! -d "$CODEX_CORE_DEST/.codex/skills/deliver" ]]; then
|
|
519
|
+
_pass "Codex core-pack install keeps core skills and prunes optional skills"
|
|
520
|
+
else
|
|
521
|
+
_fail "Codex core-pack skill filtering failed"
|
|
522
|
+
fi
|
|
523
|
+
|
|
524
|
+
if [[ -f "$CODEX_CORE_DEST/.flow-agents/installed-packs.json" ]]; then
|
|
525
|
+
_pass "Codex core-pack install records selected packs"
|
|
526
|
+
else
|
|
527
|
+
_fail "Codex core-pack install did not record selected packs"
|
|
528
|
+
fi
|
|
529
|
+
|
|
530
|
+
if [[ -f "$CODEX_AGENTS_DIR/user-agent.toml" && -d "$USER_SKILLS_DIR" ]]; then
|
|
531
|
+
_pass "Codex core-pack install preserves unknown user files"
|
|
532
|
+
else
|
|
533
|
+
_fail "Codex core-pack install removed unknown user files"
|
|
534
|
+
fi
|
|
535
|
+
|
|
536
|
+
echo ""
|
|
537
|
+
echo "==========================="
|
|
538
|
+
total=$((pass + fail))
|
|
539
|
+
echo "Results: ${pass}/${total} passed, ${fail} failed"
|
|
540
|
+
[[ "$fail" -gt 0 ]] && exit 1
|
|
541
|
+
exit 0
|