@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,407 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# test_package.sh — Layer 1: Static validation of installed agent package
|
|
3
|
+
# Extends validate-package.sh with comprehensive checks
|
|
4
|
+
set -uo pipefail
|
|
5
|
+
|
|
6
|
+
ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)"
|
|
7
|
+
source "$ROOT_DIR/evals/lib/node.sh"
|
|
8
|
+
AGENTS_DIR="$HOME/.kiro/agents"
|
|
9
|
+
TMP_INSTALL_DIR=""
|
|
10
|
+
cleanup() {
|
|
11
|
+
[[ -n "$TMP_INSTALL_DIR" ]] && rm -rf "$TMP_INSTALL_DIR"
|
|
12
|
+
}
|
|
13
|
+
trap cleanup EXIT
|
|
14
|
+
|
|
15
|
+
# Auto-detect install mode: local (default) or VS-installed packages
|
|
16
|
+
# Override: EVAL_MODE=vs bash evals/run.sh static
|
|
17
|
+
EVAL_MODE="${EVAL_MODE:-auto}"
|
|
18
|
+
if [[ "$EVAL_MODE" == "auto" ]]; then
|
|
19
|
+
if [[ -f "$ROOT_DIR/scripts/build-universal-bundles.js" && -d "$ROOT_DIR/agents" ]]; then
|
|
20
|
+
EVAL_MODE="repo"
|
|
21
|
+
elif ls "$AGENTS_DIR"/*.json &>/dev/null; then
|
|
22
|
+
EVAL_MODE="local"
|
|
23
|
+
else
|
|
24
|
+
EVAL_MODE="vs"
|
|
25
|
+
fi
|
|
26
|
+
fi
|
|
27
|
+
|
|
28
|
+
if [[ "$EVAL_MODE" == "repo" ]]; then
|
|
29
|
+
if [[ ! -d "$ROOT_DIR/dist/kiro/agents" ]]; then
|
|
30
|
+
(cd "$ROOT_DIR" && flow_agents_node scripts/build-universal-bundles.js >/dev/null)
|
|
31
|
+
fi
|
|
32
|
+
TMP_INSTALL_DIR="$(mktemp -d /tmp/kiro-static-package.XXXXXX)"
|
|
33
|
+
(cd "$ROOT_DIR/dist/kiro" && bash install.sh "$TMP_INSTALL_DIR" >/dev/null)
|
|
34
|
+
PACKAGE_DIR="$TMP_INSTALL_DIR"
|
|
35
|
+
AGENT_GLOB="$PACKAGE_DIR/agents/*.json"
|
|
36
|
+
elif [[ "$EVAL_MODE" == "local" ]]; then
|
|
37
|
+
PACKAGE_DIR="$HOME/.flow-agents"
|
|
38
|
+
AGENT_GLOB="$AGENTS_DIR/*.json"
|
|
39
|
+
else
|
|
40
|
+
PACKAGE_DIR="$HOME/.flow-agents"
|
|
41
|
+
AGENT_GLOB="$AGENTS_DIR/kiro-agents-*.json"
|
|
42
|
+
fi
|
|
43
|
+
# Collect matching agent files once
|
|
44
|
+
AGENT_FILES=()
|
|
45
|
+
for _f in $AGENT_GLOB; do [[ -f "$_f" ]] && AGENT_FILES+=("$_f"); done
|
|
46
|
+
pass=0; fail=0; skip=0
|
|
47
|
+
|
|
48
|
+
_pass() { echo " ✓ $1"; pass=$((pass + 1)); }
|
|
49
|
+
_fail() { echo " ✗ $1"; fail=$((fail + 1)); }
|
|
50
|
+
_skip() { echo " ○ $1"; skip=$((skip + 1)); }
|
|
51
|
+
|
|
52
|
+
echo "=== Layer 1: Static Package Validation ==="
|
|
53
|
+
echo "Mode: ${EVAL_MODE}"
|
|
54
|
+
echo ""
|
|
55
|
+
|
|
56
|
+
if [[ "$EVAL_MODE" == "repo" ]]; then
|
|
57
|
+
echo "--- Source Tree ---"
|
|
58
|
+
if (cd "$ROOT_DIR" && flow_agents_node scripts/validate-source-tree.js >/tmp/source-tree-validation.txt 2>&1); then
|
|
59
|
+
_pass "source tree validation passed"
|
|
60
|
+
else
|
|
61
|
+
_fail "source tree validation failed (see /tmp/source-tree-validation.txt)"
|
|
62
|
+
fi
|
|
63
|
+
if node - "$ROOT_DIR/package.json" <<'NODE'
|
|
64
|
+
const fs = require("node:fs");
|
|
65
|
+
const pkg = JSON.parse(fs.readFileSync(process.argv[2], "utf8"));
|
|
66
|
+
const files = pkg.files;
|
|
67
|
+
if (!Array.isArray(files) || files.length === 0) {
|
|
68
|
+
throw new Error("package.json must define an explicit npm files allowlist");
|
|
69
|
+
}
|
|
70
|
+
const required = [
|
|
71
|
+
"agents/",
|
|
72
|
+
"build/",
|
|
73
|
+
"console.telemetry.json",
|
|
74
|
+
"context/",
|
|
75
|
+
"docs/",
|
|
76
|
+
"evals/",
|
|
77
|
+
"install.sh",
|
|
78
|
+
"kits/",
|
|
79
|
+
"packaging/",
|
|
80
|
+
"scripts/",
|
|
81
|
+
"skills/",
|
|
82
|
+
"src/",
|
|
83
|
+
];
|
|
84
|
+
for (const entry of required) {
|
|
85
|
+
if (!files.includes(entry)) throw new Error(`package files allowlist missing ${entry}`);
|
|
86
|
+
}
|
|
87
|
+
const requiredExcludes = [
|
|
88
|
+
"!evals/cases/dev/node_modules/",
|
|
89
|
+
"!**/.flow-agents/",
|
|
90
|
+
"!**/.surface/",
|
|
91
|
+
"!**/.telemetry/",
|
|
92
|
+
"!**/.veritas/",
|
|
93
|
+
"!**/node_modules/",
|
|
94
|
+
];
|
|
95
|
+
for (const entry of requiredExcludes) {
|
|
96
|
+
if (!files.includes(entry)) throw new Error(`package files allowlist missing exclusion ${entry}`);
|
|
97
|
+
}
|
|
98
|
+
const forbidden = [
|
|
99
|
+
".agents/",
|
|
100
|
+
".codex/",
|
|
101
|
+
".claude/",
|
|
102
|
+
".flow-agents/",
|
|
103
|
+
".surface/",
|
|
104
|
+
".telemetry/",
|
|
105
|
+
".veritas/",
|
|
106
|
+
"dist/",
|
|
107
|
+
"node_modules/",
|
|
108
|
+
"_site/",
|
|
109
|
+
"test-results/",
|
|
110
|
+
];
|
|
111
|
+
for (const entry of files) {
|
|
112
|
+
if (!entry.startsWith("!") && forbidden.includes(entry)) throw new Error(`package files allowlist includes runtime/generated path ${entry}`);
|
|
113
|
+
}
|
|
114
|
+
NODE
|
|
115
|
+
then
|
|
116
|
+
_pass "package uses explicit npm files allowlist"
|
|
117
|
+
else
|
|
118
|
+
_fail "package npm files allowlist is missing or unsafe"
|
|
119
|
+
fi
|
|
120
|
+
if node - "$ROOT_DIR/console.telemetry.json" <<'NODE'
|
|
121
|
+
const fs = require("node:fs");
|
|
122
|
+
const descriptor = JSON.parse(fs.readFileSync(process.argv[2], "utf8"));
|
|
123
|
+
for (const id of ["builder.shape", "builder.build"]) {
|
|
124
|
+
const flow = (descriptor.flows || []).find((candidate) => candidate.id === id);
|
|
125
|
+
if (!flow) throw new Error(`missing ${id} flow descriptor`);
|
|
126
|
+
if (!flow.detailAttributes || Array.isArray(flow.detailAttributes) || typeof flow.detailAttributes !== "object") {
|
|
127
|
+
throw new Error(`${id} detailAttributes must be a label-to-attribute object`);
|
|
128
|
+
}
|
|
129
|
+
for (const [label, attribute] of Object.entries(flow.detailAttributes)) {
|
|
130
|
+
if (!label || typeof attribute !== "string" || !attribute) throw new Error(`${id} has malformed detailAttributes entry`);
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
NODE
|
|
134
|
+
then
|
|
135
|
+
_pass "Console telemetry descriptor exposes builder detail attributes"
|
|
136
|
+
else
|
|
137
|
+
_fail "Console telemetry descriptor missing builder detail attributes"
|
|
138
|
+
fi
|
|
139
|
+
legacy_pattern='[Kk]agents|K''AGENTS|[Kk]agents\.dev'
|
|
140
|
+
if (cd "$ROOT_DIR" && git ls-files -z | xargs -0 rg -n "$legacy_pattern" >/tmp/legacy-product-refs.txt 2>&1); then
|
|
141
|
+
_fail "tracked source contains legacy Flow Agents rename references (see /tmp/legacy-product-refs.txt)"
|
|
142
|
+
else
|
|
143
|
+
_pass "tracked source has no legacy Flow Agents rename references"
|
|
144
|
+
fi
|
|
145
|
+
if (cd "$ROOT_DIR" && FLOW_AGENTS_CONTENT_BOUNDARY_FILES='.flow-agents/example/state.json' node scripts/check-content-boundary.cjs >/tmp/content-boundary-runtime.out 2>&1); then
|
|
146
|
+
_fail "content boundary allows ordinary workflow runtime artifacts"
|
|
147
|
+
elif rg -q 'Flow Agents runtime artifact must not be tracked' /tmp/content-boundary-runtime.out; then
|
|
148
|
+
_pass "content boundary blocks ordinary workflow runtime artifacts"
|
|
149
|
+
else
|
|
150
|
+
_fail "content boundary runtime rejection was not actionable"
|
|
151
|
+
fi
|
|
152
|
+
if (cd "$ROOT_DIR" && FLOW_AGENTS_CONTENT_BOUNDARY_FILES='.flow-agents/nested/example/closeout.md' node scripts/check-content-boundary.cjs >/tmp/content-boundary-nested.out 2>&1); then
|
|
153
|
+
_fail "content boundary allows nested workflow runtime artifacts"
|
|
154
|
+
elif rg -q 'Flow Agents runtime artifact must not be tracked' /tmp/content-boundary-nested.out; then
|
|
155
|
+
_pass "content boundary blocks nested workflow runtime artifacts"
|
|
156
|
+
else
|
|
157
|
+
_fail "content boundary nested runtime rejection was not actionable"
|
|
158
|
+
fi
|
|
159
|
+
current_branch="$(cd "$ROOT_DIR" && git branch --show-current 2>/dev/null || true)"
|
|
160
|
+
tracked_runtime_artifacts="$(cd "$ROOT_DIR" && git ls-files -- '.flow-agents' 2>/dev/null || true)"
|
|
161
|
+
if [[ "$current_branch" == "main" && -n "$tracked_runtime_artifacts" ]]; then
|
|
162
|
+
printf '%s\n' "$tracked_runtime_artifacts" >/tmp/tracked-flow-agent-runtime-artifacts.txt
|
|
163
|
+
_fail "main contains tracked workflow runtime artifacts (see /tmp/tracked-flow-agent-runtime-artifacts.txt)"
|
|
164
|
+
elif [[ "$current_branch" == "main" ]]; then
|
|
165
|
+
_pass "main has no tracked workflow runtime artifacts"
|
|
166
|
+
else
|
|
167
|
+
_skip "tracked workflow runtime artifact main-branch guard skipped off main"
|
|
168
|
+
fi
|
|
169
|
+
echo ""
|
|
170
|
+
|
|
171
|
+
echo "--- Flow Kits ---"
|
|
172
|
+
if [[ -f "$PACKAGE_DIR/kits/catalog.json" && -f "$PACKAGE_DIR/kits/builder/kit.json" ]]; then
|
|
173
|
+
_pass "installed bundle includes Kit Catalog and Builder Kit manifest"
|
|
174
|
+
else
|
|
175
|
+
_fail "installed bundle is missing Kit Catalog or Builder Kit manifest"
|
|
176
|
+
fi
|
|
177
|
+
if [[ -f "$PACKAGE_DIR/kits/builder/flows/shape.flow.json" && -f "$PACKAGE_DIR/kits/builder/flows/build.flow.json" ]]; then
|
|
178
|
+
_pass "installed bundle includes Builder Kit Flow Definitions"
|
|
179
|
+
else
|
|
180
|
+
_fail "installed bundle is missing Builder Kit Flow Definitions"
|
|
181
|
+
fi
|
|
182
|
+
if node - "$PACKAGE_DIR/kits/catalog.json" "$PACKAGE_DIR/kits/builder/kit.json" "$PACKAGE_DIR/kits/builder/flows/shape.flow.json" "$PACKAGE_DIR/kits/builder/flows/build.flow.json" <<'NODE'
|
|
183
|
+
const fs = require("node:fs");
|
|
184
|
+
for (const file of process.argv.slice(2)) JSON.parse(fs.readFileSync(file, "utf8"));
|
|
185
|
+
console.log("ok");
|
|
186
|
+
NODE
|
|
187
|
+
then
|
|
188
|
+
_pass "installed kit JSON parses"
|
|
189
|
+
else
|
|
190
|
+
_fail "installed kit JSON parse failed"
|
|
191
|
+
fi
|
|
192
|
+
if node - "$PACKAGE_DIR/kits/builder/flows/build.flow.json" <<'NODE'
|
|
193
|
+
const fs = require("node:fs");
|
|
194
|
+
const flow = JSON.parse(fs.readFileSync(process.argv[2], "utf8"));
|
|
195
|
+
const steps = Object.fromEntries((flow.steps || []).map((step) => [step.id, step.next]));
|
|
196
|
+
if (steps["pull-work"] !== "design-probe") throw new Error("pull-work should route to design-probe");
|
|
197
|
+
if (steps["design-probe"] !== "plan") throw new Error("design-probe should route to plan");
|
|
198
|
+
const designGate = flow.gates?.["design-probe-gate"] || {};
|
|
199
|
+
const expectIds = new Set((designGate.expects || []).map((item) => item.id));
|
|
200
|
+
for (const required of ["pickup-probe-readiness", "probe-decisions-or-accepted-gaps"]) if (!expectIds.has(required)) throw new Error(`design-probe-gate missing ${required}`);
|
|
201
|
+
const gateText = JSON.stringify(designGate);
|
|
202
|
+
for (const term of ["goal fit", "blockers", "dependencies", "dependency freshness", "acceptance criteria quality", "provider state", "stop-short risks", "planning readiness", "accepted gaps"]) {
|
|
203
|
+
if (!gateText.includes(term)) throw new Error(`design-probe-gate missing pickup Probe term: ${term}`);
|
|
204
|
+
}
|
|
205
|
+
const expected = { missing_evidence: "verify", implementation_defect: "execute", plan_gap: "plan", decision_gap: "design-probe" };
|
|
206
|
+
for (const gateId of ["verify-gate", "merge-ready-gate"]) {
|
|
207
|
+
const gate = flow.gates?.[gateId] || {};
|
|
208
|
+
for (const [reason, target] of Object.entries(expected)) if (gate.on_route_back?.[reason] !== target) throw new Error(`${gateId} ${reason} should route to ${target}`);
|
|
209
|
+
if (gate.route_back_policy?.on_exceeded !== "block") throw new Error(`${gateId} route_back_policy should block on exceeded attempts`);
|
|
210
|
+
}
|
|
211
|
+
const expectations = Object.values(flow.gates || {}).flatMap((gate) => gate.expects || []);
|
|
212
|
+
if (!expectations.length) throw new Error("Builder build flow should declare gate expectations");
|
|
213
|
+
for (const expectation of expectations) {
|
|
214
|
+
if (expectation.kind !== "surface.claim") throw new Error(`${expectation.id || "<unknown>"} should remain a surface.claim expectation`);
|
|
215
|
+
if (!expectation.claim?.type || !expectation.claim?.accepted_statuses) throw new Error(`${expectation.id || "<unknown>"} should declare claim type and accepted statuses`);
|
|
216
|
+
}
|
|
217
|
+
const flowText = JSON.stringify(flow).toLowerCase();
|
|
218
|
+
for (const term of ["veritas", "trust_provider", "trust-provider", "provider_name", "provider_ref", "veritas_policy", "veritas_readiness"]) {
|
|
219
|
+
if (flowText.includes(term)) throw new Error(`Builder build flow should not name provider-specific trust field: ${term}`);
|
|
220
|
+
}
|
|
221
|
+
console.log("ok");
|
|
222
|
+
NODE
|
|
223
|
+
then
|
|
224
|
+
_pass "installed Builder Kit build flow keeps provider-neutral surface.claim gates"
|
|
225
|
+
else
|
|
226
|
+
_fail "installed Builder Kit build flow route-back or provider-neutral gate policy missing or wrong"
|
|
227
|
+
fi
|
|
228
|
+
echo ""
|
|
229
|
+
fi
|
|
230
|
+
|
|
231
|
+
# --- 1. Agent count ---
|
|
232
|
+
count=${#AGENT_FILES[@]}
|
|
233
|
+
echo "Agents found: ${count}"
|
|
234
|
+
[[ "$count" -eq 0 ]] && echo "✗ No agents found" && exit 1
|
|
235
|
+
|
|
236
|
+
# --- 2. Schema validation ---
|
|
237
|
+
echo ""
|
|
238
|
+
echo "--- Schema ---"
|
|
239
|
+
for f in "${AGENT_FILES[@]}"; do
|
|
240
|
+
name=$(jq -r '.name // empty' "$f" 2>/dev/null)
|
|
241
|
+
[[ -z "$name" ]] && { _fail "$(basename "$f"): missing .name"; continue; }
|
|
242
|
+
|
|
243
|
+
has_all=$(jq -r 'if .name and .prompt and .model and .description then "yes" else "no" end' "$f" 2>/dev/null)
|
|
244
|
+
if [[ "$has_all" != "yes" ]]; then
|
|
245
|
+
_fail "$name: missing required field (name/prompt/model/description)"
|
|
246
|
+
elif ! echo "$name" | grep -qE '^[a-z][a-z0-9-]*$'; then
|
|
247
|
+
_fail "$name: invalid name format (must match ^[a-z][a-z0-9-]*$)"
|
|
248
|
+
else
|
|
249
|
+
_pass "$name: schema valid"
|
|
250
|
+
fi
|
|
251
|
+
done
|
|
252
|
+
|
|
253
|
+
# --- 3. No unresolved templates ---
|
|
254
|
+
echo ""
|
|
255
|
+
echo "--- Templates ---"
|
|
256
|
+
for f in "${AGENT_FILES[@]}"; do
|
|
257
|
+
name=$(jq -r '.name' "$f" 2>/dev/null)
|
|
258
|
+
if grep -q '{{aim:' "$f" 2>/dev/null; then
|
|
259
|
+
_fail "$name: unresolved {{aim:}} template"
|
|
260
|
+
else
|
|
261
|
+
_pass "$name: templates resolved"
|
|
262
|
+
fi
|
|
263
|
+
done
|
|
264
|
+
|
|
265
|
+
# --- 4. Hook scripts exist ---
|
|
266
|
+
echo ""
|
|
267
|
+
echo "--- Hooks ---"
|
|
268
|
+
for f in "${AGENT_FILES[@]}"; do
|
|
269
|
+
name=$(jq -r '.name' "$f" 2>/dev/null)
|
|
270
|
+
hook_fail=0
|
|
271
|
+
while read -r cmd; do
|
|
272
|
+
[[ -z "$cmd" ]] && continue
|
|
273
|
+
script=$(echo "$cmd" | sed 's/^bash //' | awk '{print $1}')
|
|
274
|
+
if [[ -f "$script" ]] || command -v "$script" >/dev/null 2>&1; then
|
|
275
|
+
:
|
|
276
|
+
else
|
|
277
|
+
_fail "$name: hook script missing: $(basename "$script")"
|
|
278
|
+
hook_fail=1
|
|
279
|
+
fi
|
|
280
|
+
done < <(jq -r '.hooks // {} | to_entries[] | .value[] | .command // empty' "$f" 2>/dev/null)
|
|
281
|
+
hcount=$(jq '[.hooks // {} | .[] | .[]] | length' "$f" 2>/dev/null)
|
|
282
|
+
[[ "$hcount" -gt 0 && "$hook_fail" -eq 0 ]] && _pass "$name: $hcount hooks, scripts exist"
|
|
283
|
+
done
|
|
284
|
+
|
|
285
|
+
# --- 5. Resource paths resolve ---
|
|
286
|
+
echo ""
|
|
287
|
+
echo "--- Resources ---"
|
|
288
|
+
for f in "${AGENT_FILES[@]}"; do
|
|
289
|
+
name=$(jq -r '.name' "$f" 2>/dev/null)
|
|
290
|
+
rfail=0
|
|
291
|
+
while read -r res; do
|
|
292
|
+
rpath="${res#file://}"
|
|
293
|
+
rpath="${rpath/#\~/$HOME}"
|
|
294
|
+
[[ "$rpath" == *"*"* || "$rpath" != /* ]] && continue
|
|
295
|
+
if [[ ! -f "$rpath" && ! -d "$rpath" ]]; then
|
|
296
|
+
_fail "$name: resource missing: $rpath"
|
|
297
|
+
rfail=1
|
|
298
|
+
fi
|
|
299
|
+
done < <(jq -r '.resources // [] | .[] | select(type == "string") | select(startswith("file://"))' "$f" 2>/dev/null)
|
|
300
|
+
[[ "$rfail" -eq 0 ]] && _pass "$name: file:// resources resolve"
|
|
301
|
+
done
|
|
302
|
+
|
|
303
|
+
# --- 6. Subagent routing ---
|
|
304
|
+
echo ""
|
|
305
|
+
echo "--- Subagent Routing ---"
|
|
306
|
+
all_agents=$(for f in "${AGENT_FILES[@]}"; do jq -r '.name' "$f" 2>/dev/null; done)
|
|
307
|
+
for f in "${AGENT_FILES[@]}"; do
|
|
308
|
+
name=$(jq -r '.name' "$f" 2>/dev/null)
|
|
309
|
+
patterns=$(jq -r '.toolsSettings.subagent.availableAgents // [] | .[]' "$f" 2>/dev/null)
|
|
310
|
+
[[ -z "$patterns" ]] && continue
|
|
311
|
+
for pat in $patterns; do
|
|
312
|
+
# Convert glob to regex
|
|
313
|
+
regex=$(echo "$pat" | sed 's/\*/.*/')
|
|
314
|
+
matched=$(echo "$all_agents" | grep -cE "^${regex}$")
|
|
315
|
+
if [[ "$matched" -gt 0 ]]; then
|
|
316
|
+
_pass "$name: pattern '$pat' matches $matched agent(s)"
|
|
317
|
+
else
|
|
318
|
+
_fail "$name: pattern '$pat' matches no installed agents"
|
|
319
|
+
fi
|
|
320
|
+
done
|
|
321
|
+
done
|
|
322
|
+
|
|
323
|
+
# --- 7. MCP servers on PATH ---
|
|
324
|
+
echo ""
|
|
325
|
+
echo "--- MCP Servers ---"
|
|
326
|
+
for f in "${AGENT_FILES[@]}"; do
|
|
327
|
+
name=$(jq -r '.name' "$f" 2>/dev/null)
|
|
328
|
+
jq -r '.mcpServers // {} | to_entries[] | .value.command' "$f" 2>/dev/null | while read -r cmd; do
|
|
329
|
+
[[ -z "$cmd" ]] && continue
|
|
330
|
+
if command -v "$cmd" >/dev/null 2>&1; then
|
|
331
|
+
_pass "$name: MCP '$cmd' on PATH"
|
|
332
|
+
else
|
|
333
|
+
_fail "$name: MCP '$cmd' not on PATH"
|
|
334
|
+
fi
|
|
335
|
+
done
|
|
336
|
+
done
|
|
337
|
+
|
|
338
|
+
# --- 8. Knowledge base sources ---
|
|
339
|
+
echo ""
|
|
340
|
+
echo "--- Knowledge Bases ---"
|
|
341
|
+
for f in "${AGENT_FILES[@]}"; do
|
|
342
|
+
name=$(jq -r '.name' "$f" 2>/dev/null)
|
|
343
|
+
while read -r src; do
|
|
344
|
+
spath="${src#file://}"
|
|
345
|
+
spath="${spath/#\~/$HOME}"
|
|
346
|
+
if [[ -d "$spath" ]]; then
|
|
347
|
+
fcount=$(find "$spath" -type f 2>/dev/null | head -100 | wc -l | tr -d ' ')
|
|
348
|
+
_pass "$name: KB source '$spath' exists ($fcount files)"
|
|
349
|
+
else
|
|
350
|
+
_fail "$name: KB source missing: $spath"
|
|
351
|
+
fi
|
|
352
|
+
done < <(jq -r '.resources // [] | .[] | select(type == "object") | select(.type == "knowledgeBase") | .source' "$f" 2>/dev/null)
|
|
353
|
+
done
|
|
354
|
+
|
|
355
|
+
# --- 9. tool-* agents should not have write tools ---
|
|
356
|
+
echo ""
|
|
357
|
+
echo "--- Write Tool Invariant ---"
|
|
358
|
+
WRITE_TOOLS='write files|write'
|
|
359
|
+
for f in "${AGENT_FILES[@]}"; do
|
|
360
|
+
name=$(jq -r '.name' "$f" 2>/dev/null)
|
|
361
|
+
[[ "$name" != tool-* ]] && continue
|
|
362
|
+
allowed=$(jq -r '.allowedTools // [] | .[]' "$f" 2>/dev/null)
|
|
363
|
+
if echo "$allowed" | grep -qE "^(${WRITE_TOOLS})$"; then
|
|
364
|
+
# Allow write if scoped via toolsSettings.write.allowedPaths
|
|
365
|
+
scoped=$(jq -r '.toolsSettings.write.allowedPaths // [] | length' "$f" 2>/dev/null)
|
|
366
|
+
if [[ "$scoped" -gt 0 ]]; then
|
|
367
|
+
paths=$(jq -r '.toolsSettings.write.allowedPaths | join(", ")' "$f" 2>/dev/null)
|
|
368
|
+
_pass "$name: write scoped to [$paths]"
|
|
369
|
+
else
|
|
370
|
+
_fail "$name: has write tools in allowedTools"
|
|
371
|
+
fi
|
|
372
|
+
else
|
|
373
|
+
_pass "$name: no write tools (read-only)"
|
|
374
|
+
fi
|
|
375
|
+
done
|
|
376
|
+
|
|
377
|
+
# --- 10. Agent cards match installed agents ---
|
|
378
|
+
echo ""
|
|
379
|
+
echo "--- Agent Cards ---"
|
|
380
|
+
card_globs=()
|
|
381
|
+
if [[ "$EVAL_MODE" == "repo" ]]; then
|
|
382
|
+
_skip "repo mode installs a temp bundle; agent-card matching is not applicable"
|
|
383
|
+
elif [[ "$EVAL_MODE" == "local" ]]; then
|
|
384
|
+
card_globs=("$PACKAGE_DIR"/../*/agent-card.json "$PACKAGE_DIR"/../../*/agent-card.json)
|
|
385
|
+
else
|
|
386
|
+
card_globs=("$PACKAGE_DIR"/agent-card.json)
|
|
387
|
+
fi
|
|
388
|
+
if [[ "${#card_globs[@]}" -gt 0 ]]; then
|
|
389
|
+
for card in "${card_globs[@]}"; do
|
|
390
|
+
[[ -f "$card" ]] || continue
|
|
391
|
+
agent=$(node -e 'const fs=require("node:fs"); console.log(JSON.parse(fs.readFileSync(process.argv[1],"utf8")).agent || "")' "$card" 2>/dev/null)
|
|
392
|
+
[[ -z "$agent" ]] && continue
|
|
393
|
+
if ls "$AGENTS_DIR"/*-"${agent}.json" &>/dev/null; then
|
|
394
|
+
_pass "Agent card '$agent' has matching installed agent"
|
|
395
|
+
else
|
|
396
|
+
_fail "Agent card '$agent' has no matching installed agent"
|
|
397
|
+
fi
|
|
398
|
+
done
|
|
399
|
+
fi
|
|
400
|
+
|
|
401
|
+
# --- Summary ---
|
|
402
|
+
echo ""
|
|
403
|
+
echo "==========================="
|
|
404
|
+
total=$((pass + fail))
|
|
405
|
+
echo "Results: ${pass}/${total} passed, ${fail} failed, ${skip} skipped"
|
|
406
|
+
[[ "$fail" -gt 0 ]] && exit 1
|
|
407
|
+
exit 0
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
set -euo pipefail
|
|
3
|
+
|
|
4
|
+
ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)"
|
|
5
|
+
cd "$ROOT_DIR"
|
|
6
|
+
|
|
7
|
+
pass() {
|
|
8
|
+
echo "PASS: $1"
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
fail() {
|
|
12
|
+
echo "FAIL: $1" >&2
|
|
13
|
+
exit 1
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
require_file() {
|
|
17
|
+
[[ -f "$1" ]] || fail "$1 is missing"
|
|
18
|
+
pass "$1 exists"
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
require_contains() {
|
|
22
|
+
local file="$1"
|
|
23
|
+
local pattern="$2"
|
|
24
|
+
local label="$3"
|
|
25
|
+
grep -Fq -- "$pattern" "$file" || fail "$label"
|
|
26
|
+
pass "$label"
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
require_not_contains() {
|
|
30
|
+
local file="$1"
|
|
31
|
+
local pattern="$2"
|
|
32
|
+
local label="$3"
|
|
33
|
+
if grep -Fq -- "$pattern" "$file"; then
|
|
34
|
+
fail "$label"
|
|
35
|
+
fi
|
|
36
|
+
pass "$label"
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
require_file ".githooks/pre-push"
|
|
40
|
+
[[ -x ".githooks/pre-push" ]] || fail ".githooks/pre-push is not executable"
|
|
41
|
+
pass ".githooks/pre-push is executable"
|
|
42
|
+
|
|
43
|
+
git ls-files --error-unmatch ".githooks/pre-push" >/dev/null 2>&1 || fail ".githooks/pre-push is not tracked"
|
|
44
|
+
pass ".githooks/pre-push is tracked"
|
|
45
|
+
|
|
46
|
+
mode="$(git ls-files --stage ".githooks/pre-push" | awk '{print $1}')"
|
|
47
|
+
[[ "$mode" == "100755" ]] || fail ".githooks/pre-push index mode is $mode, expected 100755"
|
|
48
|
+
pass ".githooks/pre-push is tracked with executable mode"
|
|
49
|
+
|
|
50
|
+
require_contains ".githooks/pre-push" "npm run validate:repo-hooks --silent" "pre-push runs repo hook drift check"
|
|
51
|
+
require_contains ".githooks/pre-push" "npm run validate:source --silent" "pre-push runs source validation"
|
|
52
|
+
require_not_contains ".githooks/pre-push" "--global" "pre-push does not use global Git config"
|
|
53
|
+
|
|
54
|
+
require_file "scripts/setup-repo-hooks.sh"
|
|
55
|
+
require_contains "scripts/setup-repo-hooks.sh" "git config --local core.hooksPath .githooks" "setup uses repo-local hooksPath"
|
|
56
|
+
require_not_contains "scripts/setup-repo-hooks.sh" "--global" "setup does not use global Git config"
|
|
57
|
+
|
|
58
|
+
require_contains "package.json" "\"setup:repo-hooks\": \"bash scripts/setup-repo-hooks.sh\"" "package exposes repo hook setup command"
|
|
59
|
+
require_contains "package.json" "\"validate:repo-hooks\": \"bash evals/static/test_repo_hooks.sh\"" "package exposes repo hook drift check"
|
|
60
|
+
|
|
61
|
+
require_file "docs/developer-hook-setup.md"
|
|
62
|
+
require_contains "docs/developer-hook-setup.md" ".githooks/pre-push" "docs mention repo pre-push hook"
|
|
63
|
+
require_contains "docs/developer-hook-setup.md" "git config --local core.hooksPath .githooks" "docs use local hooksPath setup"
|
|
64
|
+
require_contains "docs/developer-hook-setup.md" "scripts/hooks/" "docs distinguish runtime hooks path"
|
|
65
|
+
require_contains "docs/developer-hook-setup.md" "Runtime hooks" "docs distinguish runtime hooks"
|
|
66
|
+
require_not_contains "docs/developer-hook-setup.md" "git config --global core.hooksPath" "docs avoid global hooksPath setup"
|
|
67
|
+
|
|
68
|
+
echo "Repo Git hook drift checks passed."
|