@tyroneross/build-loop 0.30.3
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/.agents/plugins/marketplace.json +10 -0
- package/.claude-plugin/marketplace.json +38 -0
- package/.claude-plugin/plugin.json +30 -0
- package/.codex-plugin/plugin.json +41 -0
- package/.cursor/rules/build-loop-surface.mdc +22 -0
- package/AGENTS.md +498 -0
- package/LICENSE +202 -0
- package/README.md +403 -0
- package/agents/alignment-checker.md +124 -0
- package/agents/api-assessor.md +136 -0
- package/agents/architecture-scout.md +185 -0
- package/agents/assessment-orchestrator.md +163 -0
- package/agents/build-orchestrator.md +198 -0
- package/agents/database-assessor.md +133 -0
- package/agents/design-contract-specialist.md +239 -0
- package/agents/fact-checker.md +69 -0
- package/agents/fix-critique.md +161 -0
- package/agents/frontend-assessor.md +136 -0
- package/agents/implementer.md +185 -0
- package/agents/independent-auditor.md +143 -0
- package/agents/mock-scanner.md +78 -0
- package/agents/optimize-runner.md +112 -0
- package/agents/overfitting-reviewer.md +96 -0
- package/agents/performance-assessor.md +159 -0
- package/agents/plan-critic.md +85 -0
- package/agents/promotion-reviewer.md +121 -0
- package/agents/recurring-pattern-detector.md +248 -0
- package/agents/retrospective-synthesizer.md +109 -0
- package/agents/root-cause-investigator.md +285 -0
- package/agents/scope-auditor.md +121 -0
- package/agents/security-reviewer.md +151 -0
- package/agents/self-improvement-architect.md +125 -0
- package/agents/synthesis-critic.md +99 -0
- package/agents/transcript-pattern-miner.md +165 -0
- package/agents/ui-validator.md +193 -0
- package/codex-skills/build-loop/SKILL.md +20 -0
- package/codex-skills/debug-loop/SKILL.md +18 -0
- package/codex-skills/handoff/SKILL.md +22 -0
- package/codex-skills/knowledge/SKILL.md +21 -0
- package/codex-skills/optimize/SKILL.md +18 -0
- package/codex-skills/research/SKILL.md +18 -0
- package/commands/agent-rally-point.md +301 -0
- package/commands/assess.md +41 -0
- package/commands/debug.md +20 -0
- package/commands/debugger-detail.md +34 -0
- package/commands/debugger-scan.md +15 -0
- package/commands/debugger-status.md +20 -0
- package/commands/debugger.md +32 -0
- package/commands/handoff.md +113 -0
- package/commands/knowledge-review.md +16 -0
- package/commands/optimize.md +31 -0
- package/commands/plan-verify.md +39 -0
- package/commands/promote-experiment.md +129 -0
- package/commands/research.md +22 -0
- package/commands/run.md +12 -0
- package/commands/self-review.md +51 -0
- package/commands/start-prd.md +57 -0
- package/commands/test.md +34 -0
- package/dist/src/assessment-orchestrator.d.ts +78 -0
- package/dist/src/assessment-orchestrator.d.ts.map +1 -0
- package/dist/src/assessment-orchestrator.js +304 -0
- package/dist/src/assessment-orchestrator.js.map +1 -0
- package/dist/src/audit-miner.d.ts +21 -0
- package/dist/src/audit-miner.d.ts.map +1 -0
- package/dist/src/audit-miner.js +421 -0
- package/dist/src/audit-miner.js.map +1 -0
- package/dist/src/batch-operations.d.ts +30 -0
- package/dist/src/batch-operations.d.ts.map +1 -0
- package/dist/src/batch-operations.js +339 -0
- package/dist/src/batch-operations.js.map +1 -0
- package/dist/src/config.d.ts +83 -0
- package/dist/src/config.d.ts.map +1 -0
- package/dist/src/config.js +176 -0
- package/dist/src/config.js.map +1 -0
- package/dist/src/context-engine.d.ts +45 -0
- package/dist/src/context-engine.d.ts.map +1 -0
- package/dist/src/context-engine.js +135 -0
- package/dist/src/context-engine.js.map +1 -0
- package/dist/src/debug-wrapper.d.ts +58 -0
- package/dist/src/debug-wrapper.d.ts.map +1 -0
- package/dist/src/debug-wrapper.js +285 -0
- package/dist/src/debug-wrapper.js.map +1 -0
- package/dist/src/index.d.ts +31 -0
- package/dist/src/index.d.ts.map +1 -0
- package/dist/src/index.js +149 -0
- package/dist/src/index.js.map +1 -0
- package/dist/src/interactive-verifier.d.ts +26 -0
- package/dist/src/interactive-verifier.d.ts.map +1 -0
- package/dist/src/interactive-verifier.js +435 -0
- package/dist/src/interactive-verifier.js.map +1 -0
- package/dist/src/lessons.d.ts +59 -0
- package/dist/src/lessons.d.ts.map +1 -0
- package/dist/src/lessons.js +172 -0
- package/dist/src/lessons.js.map +1 -0
- package/dist/src/log-reader.d.ts +39 -0
- package/dist/src/log-reader.d.ts.map +1 -0
- package/dist/src/log-reader.js +291 -0
- package/dist/src/log-reader.js.map +1 -0
- package/dist/src/logger.d.ts +59 -0
- package/dist/src/logger.d.ts.map +1 -0
- package/dist/src/logger.js +328 -0
- package/dist/src/logger.js.map +1 -0
- package/dist/src/parallel-retrieval.d.ts +52 -0
- package/dist/src/parallel-retrieval.d.ts.map +1 -0
- package/dist/src/parallel-retrieval.js +309 -0
- package/dist/src/parallel-retrieval.js.map +1 -0
- package/dist/src/pattern-extractor.d.ts +30 -0
- package/dist/src/pattern-extractor.d.ts.map +1 -0
- package/dist/src/pattern-extractor.js +386 -0
- package/dist/src/pattern-extractor.js.map +1 -0
- package/dist/src/result-aggregator.d.ts +44 -0
- package/dist/src/result-aggregator.d.ts.map +1 -0
- package/dist/src/result-aggregator.js +315 -0
- package/dist/src/result-aggregator.js.map +1 -0
- package/dist/src/retrieval.d.ts +139 -0
- package/dist/src/retrieval.d.ts.map +1 -0
- package/dist/src/retrieval.js +724 -0
- package/dist/src/retrieval.js.map +1 -0
- package/dist/src/setup/auto-setup.d.ts +15 -0
- package/dist/src/setup/auto-setup.d.ts.map +1 -0
- package/dist/src/setup/auto-setup.js +157 -0
- package/dist/src/setup/auto-setup.js.map +1 -0
- package/dist/src/setup/configure-hooks.d.ts +8 -0
- package/dist/src/setup/configure-hooks.d.ts.map +1 -0
- package/dist/src/setup/configure-hooks.js +16 -0
- package/dist/src/setup/configure-hooks.js.map +1 -0
- package/dist/src/setup/create-slash-commands.d.ts +8 -0
- package/dist/src/setup/create-slash-commands.d.ts.map +1 -0
- package/dist/src/setup/create-slash-commands.js +101 -0
- package/dist/src/setup/create-slash-commands.js.map +1 -0
- package/dist/src/setup/index.d.ts +8 -0
- package/dist/src/setup/index.d.ts.map +1 -0
- package/dist/src/setup/index.js +17 -0
- package/dist/src/setup/index.js.map +1 -0
- package/dist/src/setup/inject-claude-md.d.ts +10 -0
- package/dist/src/setup/inject-claude-md.d.ts.map +1 -0
- package/dist/src/setup/inject-claude-md.js +150 -0
- package/dist/src/setup/inject-claude-md.js.map +1 -0
- package/dist/src/setup/uninstall.d.ts +22 -0
- package/dist/src/setup/uninstall.d.ts.map +1 -0
- package/dist/src/setup/uninstall.js +235 -0
- package/dist/src/setup/uninstall.js.map +1 -0
- package/dist/src/storage.d.ts +192 -0
- package/dist/src/storage.d.ts.map +1 -0
- package/dist/src/storage.js +1037 -0
- package/dist/src/storage.js.map +1 -0
- package/dist/src/string-similarity.d.ts +8 -0
- package/dist/src/string-similarity.d.ts.map +1 -0
- package/dist/src/string-similarity.js +57 -0
- package/dist/src/string-similarity.js.map +1 -0
- package/dist/src/traces/adapters/browser.d.ts +69 -0
- package/dist/src/traces/adapters/browser.d.ts.map +1 -0
- package/dist/src/traces/adapters/browser.js +280 -0
- package/dist/src/traces/adapters/browser.js.map +1 -0
- package/dist/src/traces/adapters/index.d.ts +23 -0
- package/dist/src/traces/adapters/index.d.ts.map +1 -0
- package/dist/src/traces/adapters/index.js +67 -0
- package/dist/src/traces/adapters/index.js.map +1 -0
- package/dist/src/traces/adapters/langchain.d.ts +42 -0
- package/dist/src/traces/adapters/langchain.d.ts.map +1 -0
- package/dist/src/traces/adapters/langchain.js +151 -0
- package/dist/src/traces/adapters/langchain.js.map +1 -0
- package/dist/src/traces/adapters/opentelemetry.d.ts +46 -0
- package/dist/src/traces/adapters/opentelemetry.d.ts.map +1 -0
- package/dist/src/traces/adapters/opentelemetry.js +164 -0
- package/dist/src/traces/adapters/opentelemetry.js.map +1 -0
- package/dist/src/traces/adapters/sentry.d.ts +58 -0
- package/dist/src/traces/adapters/sentry.d.ts.map +1 -0
- package/dist/src/traces/adapters/sentry.js +212 -0
- package/dist/src/traces/adapters/sentry.js.map +1 -0
- package/dist/src/traces/index.d.ts +10 -0
- package/dist/src/traces/index.d.ts.map +1 -0
- package/dist/src/traces/index.js +45 -0
- package/dist/src/traces/index.js.map +1 -0
- package/dist/src/traces/storage.d.ts +78 -0
- package/dist/src/traces/storage.d.ts.map +1 -0
- package/dist/src/traces/storage.js +399 -0
- package/dist/src/traces/storage.js.map +1 -0
- package/dist/src/traces/summarizer.d.ts +83 -0
- package/dist/src/traces/summarizer.d.ts.map +1 -0
- package/dist/src/traces/summarizer.js +247 -0
- package/dist/src/traces/summarizer.js.map +1 -0
- package/dist/src/traces/types.d.ts +365 -0
- package/dist/src/traces/types.d.ts.map +1 -0
- package/dist/src/traces/types.js +14 -0
- package/dist/src/traces/types.js.map +1 -0
- package/dist/src/types.d.ts +495 -0
- package/dist/src/types.d.ts.map +1 -0
- package/dist/src/types.js +27 -0
- package/dist/src/types.js.map +1 -0
- package/docs/agent-surface-policy.md +45 -0
- package/docs/memory-setup.md +226 -0
- package/hooks/_arch_scan_bg.py +88 -0
- package/hooks/_plugin_drift_check_bg.py +85 -0
- package/hooks/_session_start_lib.sh +42 -0
- package/hooks/git/pre-push +141 -0
- package/hooks/hooks.json +126 -0
- package/hooks/post-commit +30 -0
- package/hooks/pre-commit +29 -0
- package/hooks/pre-edit-apppulse.sh +6 -0
- package/hooks/pre-edit-architecture.sh +106 -0
- package/hooks/pre-edit-rally-point.sh +92 -0
- package/hooks/session-start-apppulse.sh +6 -0
- package/hooks/session-start-architecture.sh +10 -0
- package/hooks/session-start-git-hooks.sh +12 -0
- package/hooks/session-start-plugin-drift.sh +27 -0
- package/hooks/session-start-rally-point.sh +44 -0
- package/hooks/session-start-retrieval.sh +24 -0
- package/hooks/session-start-worktree-gc.sh +105 -0
- package/hooks/test_apppulse_hooks.sh +6 -0
- package/hooks/test_rally_point_hooks.sh +388 -0
- package/hooks/test_sec008_hooks.sh +66 -0
- package/package.json +111 -0
- package/scripts/README.md +301 -0
- package/scripts/_db_url.py +61 -0
- package/scripts/_paths.py +445 -0
- package/scripts/blm.py +162 -0
- package/scripts/blm_api.py +263 -0
- package/scripts/check_cache_sync.py +490 -0
- package/scripts/embed_backend.py +475 -0
- package/scripts/install_memory.py +556 -0
- package/scripts/lessons_index/__init__.py +77 -0
- package/scripts/lessons_index/__main__.py +135 -0
- package/scripts/lessons_index/ingest.py +288 -0
- package/scripts/lessons_index/query.py +285 -0
- package/scripts/lessons_index/schema.py +114 -0
- package/scripts/memory_context/__init__.py +610 -0
- package/scripts/memory_graph/__init__.py +393 -0
- package/scripts/project_resolver.py +172 -0
- package/scripts/prune_codex_plugin_cache.py +23 -0
- package/scripts/prune_plugin_cache.py +359 -0
- package/scripts/semantic_index/__init__.py +482 -0
- package/scripts/semantic_index/_bench_hybrid.py +175 -0
- package/scripts/semantic_index/backfill.py +263 -0
- package/scripts/semantic_index/hybrid.py +174 -0
- package/scripts/semantic_index/test_backfill.py +292 -0
- package/scripts/semantic_index/test_hybrid.py +541 -0
- package/scripts/sync_navgator_lessons.py +666 -0
- package/scripts/sync_plugin_cache.py +388 -0
- package/skills/agent-rally-point/SKILL.md +165 -0
- package/skills/agent-rally-watcher/SKILL.md +83 -0
- package/skills/api-registry-bridge/SKILL.md +59 -0
- package/skills/architecture/dead/SKILL.md +56 -0
- package/skills/architecture/impact/SKILL.md +88 -0
- package/skills/architecture/review/SKILL.md +227 -0
- package/skills/architecture/rules/SKILL.md +72 -0
- package/skills/architecture/scan/SKILL.md +79 -0
- package/skills/architecture/trace/SKILL.md +65 -0
- package/skills/attribution-standard/SKILL.md +122 -0
- package/skills/authentication/SKILL.md +81 -0
- package/skills/authentication/references/better-auth-magic-link.md +135 -0
- package/skills/authentication/references/better-auth-setup.md +224 -0
- package/skills/authentication/references/google-calendar-sync.md +278 -0
- package/skills/authentication/references/google-cloud-console.md +159 -0
- package/skills/authentication/references/google-geocoding-directions.md +126 -0
- package/skills/authentication/references/google-lessons-example-web-app.md +177 -0
- package/skills/authentication/references/google-maps.md +162 -0
- package/skills/authentication/references/google-oauth-setup.md +343 -0
- package/skills/authentication/references/google-places.md +173 -0
- package/skills/authentication/references/lessons-example-web-app-better-auth.md +126 -0
- package/skills/authentication/references/resend-email.md +227 -0
- package/skills/authentication/references/resend-otp-magic-link.md +153 -0
- package/skills/authentication/references/supabase-auth.md +172 -0
- package/skills/auto-decision-capture/SKILL.md +419 -0
- package/skills/build-loop/SKILL.md +516 -0
- package/skills/build-loop/detect-plugins.mjs +82 -0
- package/skills/build-loop/eval-guide.md +65 -0
- package/skills/build-loop/fallbacks.md +549 -0
- package/skills/build-loop/phases/fact-check.md +42 -0
- package/skills/build-loop/phases/ui-validation.md +267 -0
- package/skills/build-loop/references/apple-native-planning.md +439 -0
- package/skills/build-loop/references/capability-routing.md +181 -0
- package/skills/build-loop/references/codex-subagents.md +98 -0
- package/skills/build-loop/references/coordination.md +161 -0
- package/skills/build-loop/references/correction-aware-capture.md +177 -0
- package/skills/build-loop/references/independent-auditor.md +72 -0
- package/skills/build-loop/references/intent-capability-pack.md +170 -0
- package/skills/build-loop/references/intent-exploration-prompts.md +96 -0
- package/skills/build-loop/references/leadership.md +72 -0
- package/skills/build-loop/references/memory.md +284 -0
- package/skills/build-loop/references/modular-systems-pack.md +96 -0
- package/skills/build-loop/references/output-style.md +129 -0
- package/skills/build-loop/references/pay-it-forward-arch.md +98 -0
- package/skills/build-loop/references/phase-1-assess.md +218 -0
- package/skills/build-loop/references/phase-2-plan.md +77 -0
- package/skills/build-loop/references/phase-3-execute.md +47 -0
- package/skills/build-loop/references/phase-4-review.md +310 -0
- package/skills/build-loop/references/phase-5-iterate.md +71 -0
- package/skills/build-loop/references/phase-6-learn.md +56 -0
- package/skills/build-loop/references/recent-design-structures.md +274 -0
- package/skills/build-loop/references/refactor-history/ASSESSMENT.md +85 -0
- package/skills/build-loop/references/refactor-history/STANDALONE_TEST_RUN.md +149 -0
- package/skills/build-loop/references/refactor-history/scenarios/01-simple-bugfix.md +32 -0
- package/skills/build-loop/references/refactor-history/scenarios/02-ui-build-with-iteration.md +48 -0
- package/skills/build-loop/references/refactor-history/scenarios/03-multi-failure-escalation.md +60 -0
- package/skills/build-loop/references/refactor-history/scenarios/04-ui-build-ibr-absent.md +51 -0
- package/skills/build-loop/references/refactor-history/scenarios/05-refactor-navgator-absent.md +71 -0
- package/skills/build-loop/references/refactor-history/scenarios/06-recurring-bug-debugger-absent.md +52 -0
- package/skills/build-loop/references/refactor-history/trace-comparison.md +202 -0
- package/skills/build-loop/references/self-recursive-dev.md +77 -0
- package/skills/build-loop/references/self-review.md +232 -0
- package/skills/build-loop/references/ui-io-contract.md +116 -0
- package/skills/build-loop/scanners/audit-design-rules.mjs +476 -0
- package/skills/build-loop/scanners/require-visual-evidence.mjs +239 -0
- package/skills/build-loop/templates/backlog-item.md +35 -0
- package/skills/build-loop/templates/codex-worker-prompt.md +89 -0
- package/skills/build-loop/templates/ui-subagent-prompt.md +179 -0
- package/skills/build-loop/templates/ux-fix-plan.md +40 -0
- package/skills/building-with-deepagents/SKILL.md +195 -0
- package/skills/building-with-deepagents/references/anti-patterns.md +141 -0
- package/skills/building-with-deepagents/references/api-quick-reference.md +184 -0
- package/skills/capabilities/SKILL.md +91 -0
- package/skills/debug-loop/SKILL.md +278 -0
- package/skills/debug-loop/references/convergence-rules.md +145 -0
- package/skills/debug-loop/references/swiftui-macos-clunky-ui-debugger.html +823 -0
- package/skills/debugging/assess/SKILL.md +111 -0
- package/skills/debugging/debug-loop/SKILL.md +231 -0
- package/skills/debugging/memory/SKILL.md +147 -0
- package/skills/debugging/store/SKILL.md +153 -0
- package/skills/debugging-memory/SKILL.md +440 -0
- package/skills/debugging-memory/examples/incident-example.json +67 -0
- package/skills/debugging-memory/references/incident-documentation.md +280 -0
- package/skills/debugging-memory/references/ios-notification-alarm-playbook.md +300 -0
- package/skills/debugging-memory/references/pattern-extraction.md +163 -0
- package/skills/debugging-memory/references/subagent-integration.md +312 -0
- package/skills/defenseclaw-bridge/SKILL.md +156 -0
- package/skills/defenseclaw-bridge/references/dc-config-mapping.md +162 -0
- package/skills/defenseclaw-bridge/references/output-format.md +108 -0
- package/skills/handoff/SKILL.md +94 -0
- package/skills/ibr-bridge/SKILL.md +68 -0
- package/skills/knowledge/SKILL.md +127 -0
- package/skills/knowledge/references/recall-integration.md +83 -0
- package/skills/knowledge/templates/madr-minimal.md +56 -0
- package/skills/knowledge-review/SKILL.md +112 -0
- package/skills/logging-tracer/SKILL.md +202 -0
- package/skills/logging-tracer/references/log-analysis.md +128 -0
- package/skills/logging-tracer/references/stack-templates.md +274 -0
- package/skills/logging-tracer-bridge/SKILL.md +70 -0
- package/skills/mcp-builder/SKILL.md +278 -0
- package/skills/mcp-builder/references/mcp-security.md +106 -0
- package/skills/model-tiering/SKILL.md +216 -0
- package/skills/native-ax-driver/SKILL.md +220 -0
- package/skills/native-ax-driver/scripts/layout_fill.py +222 -0
- package/skills/native-ax-driver/scripts/native_driver.py +495 -0
- package/skills/native-ax-driver/swift/bl-ax-driver/Package.swift +20 -0
- package/skills/native-ax-driver/swift/bl-ax-driver/Sources/main.swift +542 -0
- package/skills/optimize/SKILL.md +202 -0
- package/skills/optimize/profiles.md +61 -0
- package/skills/plan-verify/SKILL.md +115 -0
- package/skills/plan-verify/test-fixtures/example-app-v20-findings.json +27 -0
- package/skills/plan-verify/test-fixtures/example-app-v20.md +42 -0
- package/skills/plan-verify/test-fixtures/example-app-v22-findings.json +15 -0
- package/skills/plan-verify/test-fixtures/example-app-v22.md +1608 -0
- package/skills/plan-verify/test-fixtures/unrelated-good-plan-findings.json +15 -0
- package/skills/plan-verify/test-fixtures/unrelated-good-plan.md +55 -0
- package/skills/plugin-builder/SKILL.md +329 -0
- package/skills/plugin-builder/references/authoritative-sources.md +104 -0
- package/skills/plugin-builder/references/build-loop-phase-guidance.md +94 -0
- package/skills/plugin-builder/references/components-guide.md +221 -0
- package/skills/plugin-builder/references/distribution.md +317 -0
- package/skills/plugin-builder/references/dual-host-claude-codex.md +220 -0
- package/skills/plugin-builder/references/hooks-reference.md +210 -0
- package/skills/plugin-builder/references/manifest-schema.md +111 -0
- package/skills/plugin-builder/references/plugin-hygiene-lessons.md +307 -0
- package/skills/plugin-tests/SKILL.md +94 -0
- package/skills/prd-bridge/SKILL.md +135 -0
- package/skills/research/SKILL.md +80 -0
- package/skills/security-methodology/SKILL.md +105 -0
- package/skills/security-methodology/references/cross-source-matrix.md +77 -0
- package/skills/security-methodology/references/mitre-atlas-starter.md +83 -0
- package/skills/security-methodology/references/nist-600-1-mapping.md +119 -0
- package/skills/security-methodology/references/owasp-agentic-top-10.md +157 -0
- package/skills/security-methodology/references/owasp-llm-top-10.md +144 -0
- package/skills/security-methodology/references/owasp-web-top-10.md +65 -0
- package/skills/self-improve/SKILL.md +298 -0
- package/skills/spec-writing/SKILL.md +548 -0
- package/skills/spec-writing/scripts/check_checklist.py +478 -0
- package/skills/sync-skills/SKILL.md +132 -0
- package/skills/telemetry/SKILL.md +66 -0
- package/skills/ui-design/SKILL.md +75 -0
- package/skills/ui-design/references/design-patterns-multi.md +165 -0
- package/skills/ui-design/references/design-preferences-from-owned-apps.md +150 -0
- package/skills/ui-design/references/evidence-capture-policy.md +55 -0
- package/skills/ui-design/references/ui-guidance-sources.md +330 -0
- package/skills/ui-design/references/universal-design-principles.alt.md +182 -0
- package/skills/ui-design/references/universal-design-principles.md +419 -0
- package/templates/memory/MEMORY.md.template +55 -0
- package/templates/memory/constitution.md.template +64 -0
- package/templates/memory/manifest.json +47 -0
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
<!-- SPDX-FileCopyrightText: 2025-2026 Tyrone Ross, Jr <46267523+tyroneross@users.noreply.github.com> | SPDX-License-Identifier: Apache-2.0 -->
|
|
2
|
+
|
|
3
|
+
# DefenseClaw Config Mapping
|
|
4
|
+
|
|
5
|
+
Field-by-field mapping from each agent-builder template to the DefenseClaw config row(s) it produces. The bridge skill (`SKILL.md`) walks this mapping when generating `<project>/.defenseclaw/generated/`.
|
|
6
|
+
|
|
7
|
+
**Canonical agent-builder template paths** (when the plugin is installed locally):
|
|
8
|
+
|
|
9
|
+
- `~/dev/git-folder/agent-builder/plugin/references/templates/agentic-handoff/tool-contract.md`
|
|
10
|
+
- `~/dev/git-folder/agent-builder/plugin/references/templates/agentic-handoff/agent-manifest.md`
|
|
11
|
+
- `~/dev/git-folder/agent-builder/plugin/references/templates/agentic-handoff/guardrail.md`
|
|
12
|
+
- `~/dev/git-folder/agent-builder/plugin/references/templates/agentic-handoff/system-boundary.md`
|
|
13
|
+
- `~/dev/git-folder/agent-builder/plugin/references/templates/agentic-handoff/flow-topology.md`
|
|
14
|
+
- `~/dev/git-folder/agent-builder/plugin/references/templates/agentic-handoff/role-card.md`
|
|
15
|
+
|
|
16
|
+
When the plugin is not installed locally, the project's own copies of these templates (filled in for the build) are the input. Filename match drives the bridge; plugin presence is not required.
|
|
17
|
+
|
|
18
|
+
## Mapping reference (DefenseClaw schema)
|
|
19
|
+
|
|
20
|
+
DefenseClaw's three-pillar model — **Govern / Inspect / Prove** — drives the config layout. Each agent-builder field maps to one of:
|
|
21
|
+
|
|
22
|
+
- **Govern** — admission control: scanner profiles, install-source policies, allow/block lists, OPA Rego policies on tool calls.
|
|
23
|
+
- **Inspect** — runtime guardrails: rule-pack entries that fire pre-call (against the prompt) or post-call (against the model output / tool output).
|
|
24
|
+
- **Prove** — audit: sink configuration (SQLite, JSONL, OTLP, Splunk HEC, webhook), retention, log fields.
|
|
25
|
+
|
|
26
|
+
The mapping matrix below uses these three column tags. A row may produce config in more than one pillar; both are listed.
|
|
27
|
+
|
|
28
|
+
## tool-contract.md → DefenseClaw
|
|
29
|
+
|
|
30
|
+
| Agent-builder field | Pillar | DefenseClaw artifact / field | Notes |
|
|
31
|
+
|---|---|---|---|
|
|
32
|
+
| `tool_contract.tool_id` | Govern | `scanner-profile.yaml :: tools[].id` | Stable identifier; used as the policies/<id>.rego filename |
|
|
33
|
+
| `tool_contract.tool_name` | Govern | `scanner-profile.yaml :: tools[].name` | Human-readable label only |
|
|
34
|
+
| `tool_contract.purpose` | (none) | (none — context only) | Goes in generated README |
|
|
35
|
+
| `tool_contract.type` (function / MCP / hosted / shell / browser / external_api / agent) | Govern | `scanner-profile.yaml :: tools[].surface` | Drives which scanners apply (e.g., shell tools always get CodeGuard injection scan) |
|
|
36
|
+
| `tool_contract.allowed_agents` | Govern | `policies/<tool_id>.rego :: data.defenseclaw.tools.<tool_id>.allowed_agents` | Rego predicate; agent IDs from agent-manifest's `agents:` block |
|
|
37
|
+
| `tool_contract.input_schema` | Govern + Inspect | `policies/<tool_id>.rego` (input validation) + `rule-packs/inspect.yaml` (pre-call schema check) | Schema check happens twice — admission-time deny + runtime-time block |
|
|
38
|
+
| `tool_contract.output_schema` | Inspect | `rule-packs/inspect.yaml :: post-call rule for <tool_id>` | If the schema is violated post-call, the rule fires |
|
|
39
|
+
| `tool_contract.allowed_actions` / `forbidden_actions` | Govern | `policies/<tool_id>.rego :: allowed_actions` / `forbidden_actions` | Rego sets, intersected at request time |
|
|
40
|
+
| `tool_contract.permission_tier` (T0–T5) | Govern + Inspect | Drives default scanner intensity AND default approval rule | T0–T2 → minimal scan, no approval. T3 → write-action approval gate. T4 → external-comms approval. T5 → strong-approval + diff-preview required |
|
|
41
|
+
| `tool_contract.auth_scope` | Govern | `policies/<tool_id>.rego :: auth_scope` | Identity propagation gate; bridge writes `TODO:` if scope is "ambient agent credentials" (likely ASI03 finding) |
|
|
42
|
+
| `tool_contract.data_access_scope` | Govern | `policies/<tool_id>.rego :: data_scope` | Tenant boundary check |
|
|
43
|
+
| `tool_contract.rate_limits` | Inspect | `rule-packs/inspect.yaml :: rate-limit rule for <tool_id>` | Backstop for LLM04 (DoS) |
|
|
44
|
+
| `tool_contract.timeout` | Inspect | Same row as rate_limits | |
|
|
45
|
+
| `tool_contract.side_effects` | Prove | `dc-config.yaml :: audit.side_effect_capture: true` if any tool declares side effects | Always-on audit when side effects exist |
|
|
46
|
+
| `tool_contract.requires_human_approval` | Govern | `policies/<tool_id>.rego :: requires_approval = true` | Hard gate |
|
|
47
|
+
| `tool_contract.approval_preview_fields` | Govern | `policies/<tool_id>.rego :: preview_fields` | Operator UI consumes this |
|
|
48
|
+
| `tool_contract.rollback_strategy` | (none) | (none — context only, in README) | Operations concern, not config |
|
|
49
|
+
| `tool_contract.audit_log_fields` | Prove | `dc-config.yaml :: audit.fields` | Union of all tools' audit fields |
|
|
50
|
+
| `tool_contract.failure_modes` / `error_behavior` | Inspect | `rule-packs/inspect.yaml :: post-call error-shape rule` | Detect deviations from declared error shape |
|
|
51
|
+
| `tool_contract.examples` / `test_cases` | (none) | (none — used by other build-loop phases, not DefenseClaw) | |
|
|
52
|
+
|
|
53
|
+
## agent-manifest.md → DefenseClaw
|
|
54
|
+
|
|
55
|
+
| Agent-builder field | Pillar | DefenseClaw artifact / field | Notes |
|
|
56
|
+
|---|---|---|---|
|
|
57
|
+
| `agent_manifest.name` / `version` | (top) | `dc-config.yaml :: project.name` / `project.version` | |
|
|
58
|
+
| `agent_manifest.mission` / `north_star_metric` | (none) | (none — context only) | |
|
|
59
|
+
| `agent_manifest.users` | Govern | `dc-config.yaml :: tenancy.users` | If multi-user, drives per-user audit scoping |
|
|
60
|
+
| `agent_manifest.autonomy_level` (A0–A4) | Govern | `dc-config.yaml :: autonomy_default` | Higher autonomy → stricter default rules |
|
|
61
|
+
| `agent_manifest.architecture_pattern` | (none) | (context in README) | |
|
|
62
|
+
| `agent_manifest.sdk_choice` | Govern | `dc-config.yaml :: sdk_hooks` | Drives which fetch interceptor / proxy adapter to wire |
|
|
63
|
+
| `agent_manifest.model_routes` | Inspect + Prove | `dc-config.yaml :: providers[]` (per route) | Auth headers (`X-DC-Target-URL`, `X-AI-Auth`, `X-DC-Auth`) — bridge writes `TODO:` placeholders |
|
|
64
|
+
| `agent_manifest.tools[]` | Govern | Each tool walks `tool-contract.md` mapping | One-to-many: the manifest lists tools, each has its own contract |
|
|
65
|
+
| `agent_manifest.memory.{working_state, session_memory, long_term_memory}` | Govern + Inspect | `scanner-profile.yaml :: memory_scanners` + `rule-packs/inspect.yaml :: memory_write_rules` | Long-term memory always gets ASI06 detection rules |
|
|
66
|
+
| `agent_manifest.protocols.mcp` / `agent_manifest.protocols.a2a` | Govern | `scanner-profile.yaml :: mcp_servers[]` / `a2a_peers[]` | MCP servers get install-source check + signature verification (when available); A2A peers get TODO for signing (ASI07 gap) |
|
|
67
|
+
| `agent_manifest.guardrails.{input, tool, output, handoff}` | Inspect | Each guardrail walks `guardrail.md` mapping | |
|
|
68
|
+
| `agent_manifest.human_checkpoints` | Govern | `policies/checkpoints.rego` | Human-in-loop predicates |
|
|
69
|
+
| `agent_manifest.evals` | (none) | (context) | |
|
|
70
|
+
| `agent_manifest.observability` | Prove | `dc-config.yaml :: sinks` | Default: SQLite + JSONL; OTLP if `observability.otlp_endpoint` set |
|
|
71
|
+
| `agent_manifest.deployment` | (none) | (context) | |
|
|
72
|
+
| `agent_manifest.deactivation` | (none) | (context — kill-switch path noted in README) | |
|
|
73
|
+
| `agent_manifest.agents[]` (per-agent registry) | Govern | `policies/agents.rego :: data.defenseclaw.agents` | Agent IDs, autonomy, allowed_tools, can_handoff_to — drives the A2A handoff allow-graph |
|
|
74
|
+
| `agent_manifest.agents[].review_required` | Govern | Per-agent `policies/agent-<id>.rego :: review_required` | When true, all decisions of that agent route through human approval |
|
|
75
|
+
| `agent_manifest.security_posture` (when present, per security-references rec) | Govern + Inspect + Prove | Top-level coverage attestation in `dc-config.yaml :: risk_coverage` | Mirrors the `risk_coverage` block from the agent manifest verbatim |
|
|
76
|
+
|
|
77
|
+
## guardrail.md → DefenseClaw
|
|
78
|
+
|
|
79
|
+
| Agent-builder field | Pillar | DefenseClaw artifact / field | Notes |
|
|
80
|
+
|---|---|---|---|
|
|
81
|
+
| `guardrail_id` | Inspect | `rule-packs/inspect.yaml :: rules[].id` | Stable ID |
|
|
82
|
+
| `name` | Inspect | `rule-packs/inspect.yaml :: rules[].name` | Human-readable |
|
|
83
|
+
| `applies_to` (agent IDs) | Inspect | `rule-packs/inspect.yaml :: rules[].applies_to_agents` | Filter — rule fires only when the active agent is in scope |
|
|
84
|
+
| `trigger` | Inspect | `rule-packs/inspect.yaml :: rules[].trigger.regex` (or `llm_judge_prompt` if non-regex) | Bridge writes regex placeholder; project-specific patterns are TODO |
|
|
85
|
+
| `check` | Inspect | `rule-packs/inspect.yaml :: rules[].check` | Multi-step check description; lifecycle_phase derived from semantics |
|
|
86
|
+
| `action` | Inspect | `rule-packs/inspect.yaml :: rules[].action` | "block" / "redact" / "log" / "approve_required" |
|
|
87
|
+
| `severity` (low / medium / high) | Inspect | `rule-packs/inspect.yaml :: rules[].severity` | Drives default mode: high → action mode (block); low → observe mode (log only) |
|
|
88
|
+
| `escalation` | Govern | `policies/escalation.rego :: escalations` | When the guardrail hits, who gets paged |
|
|
89
|
+
| (new field rec) `lifecycle_phase` | Inspect | `rule-packs/inspect.yaml :: rules[].lifecycle_phase` | Required: pre-call / post-call / in-tool / post-handoff |
|
|
90
|
+
| (new field rec) `enforcement_type` | Inspect | `rule-packs/inspect.yaml :: rules[].enforcement_type` | regex / policy / llm-judge / external-service |
|
|
91
|
+
| (new field rec) `mode` | Inspect | `rule-packs/inspect.yaml :: rules[].mode` | observe / action |
|
|
92
|
+
| (new field rec) `mapped_owasp_risks` | Inspect + Prove | `rule-packs/inspect.yaml :: rules[].mapped_risks` AND `dc-config.yaml :: risk_coverage` rolls up | Cross-cite for audit |
|
|
93
|
+
|
|
94
|
+
## system-boundary.md → DefenseClaw
|
|
95
|
+
|
|
96
|
+
| Agent-builder field | Pillar | DefenseClaw artifact / field | Notes |
|
|
97
|
+
|---|---|---|---|
|
|
98
|
+
| `system_boundary.in_scope_tasks` | Govern | `dc-config.yaml :: sandbox.allowed_surfaces` | Allow-list driver for OpenShell sandbox |
|
|
99
|
+
| `system_boundary.out_of_scope_tasks` | Govern | `dc-config.yaml :: sandbox.blocked_surfaces` | Block-list driver |
|
|
100
|
+
| Other fields (mission, users) | (none) | (context only) | |
|
|
101
|
+
|
|
102
|
+
The bridge writes a `TODO: OpenShell sandbox config — system-boundary is too coarse to drive a precise sandbox profile. Refine in-scope/out-of-scope to filesystem paths, allowed network destinations, allowed syscalls.` in the generated README.
|
|
103
|
+
|
|
104
|
+
## flow-topology.md → DefenseClaw
|
|
105
|
+
|
|
106
|
+
| Agent-builder field | Pillar | DefenseClaw artifact / field | Notes |
|
|
107
|
+
|---|---|---|---|
|
|
108
|
+
| Agent-to-agent edges (who can hand off to whom) | Govern | `policies/handoffs.rego :: allowed_handoffs` | Mirrors `agent_manifest.agents[].can_handoff_to` |
|
|
109
|
+
| Tool-call edges (which agent calls which tool) | Govern | (already covered by tool-contract.allowed_agents) | Cross-check; mismatch with manifest is a finding |
|
|
110
|
+
| External system edges | Govern | `policies/egress.rego :: allowed_destinations` | Outbound URL allow-list |
|
|
111
|
+
|
|
112
|
+
If `flow-topology.md` describes A2A edges, the bridge writes a `TODO: ASI07 — A2A trust model is project-specific. DefenseClaw does not provide a built-in inter-agent message-signing layer. Consider per-edge signing keys + nonces. Document the A2A trust model here.` in the generated README.
|
|
113
|
+
|
|
114
|
+
## role-card.md → DefenseClaw
|
|
115
|
+
|
|
116
|
+
| Agent-builder field | Pillar | DefenseClaw artifact / field | Notes |
|
|
117
|
+
|---|---|---|---|
|
|
118
|
+
| Role's allowed_tools | Govern | Cross-check vs `agent_manifest.agents[].allowed_tools` | Mismatch is a finding (role cards drift) |
|
|
119
|
+
| Role's autonomy | Govern | Cross-check vs `agent_manifest.agents[].autonomy_level` | Mismatch is a finding |
|
|
120
|
+
| Role's review_required | Govern | Cross-check vs `agent_manifest.agents[].review_required` | Mismatch is a finding |
|
|
121
|
+
|
|
122
|
+
Role cards are mostly cross-validated; they don't add new config rows of their own. When they drift from the manifest, the bridge surfaces this as a `TODO:` in the README so the project can reconcile.
|
|
123
|
+
|
|
124
|
+
## Permission-tier (T0–T5) → DefenseClaw scanner intensity
|
|
125
|
+
|
|
126
|
+
| Permission tier | Default scanner profile | Default approval rule |
|
|
127
|
+
|---|---|---|
|
|
128
|
+
| T0 (no tool access) | none | n/a |
|
|
129
|
+
| T1 (read-only local) | minimal — schema-only | none |
|
|
130
|
+
| T2 (read external) | minimal + supply-chain check | none if data is in scope |
|
|
131
|
+
| T3 (write reversible) | full CodeGuard (secrets, dangerous exec, deserialization, weak crypto, injection) | preview / undo required |
|
|
132
|
+
| T4 (external comms) | full CodeGuard + outbound URL allowlist + payload PII scan | human approval required |
|
|
133
|
+
| T5 (irreversible / high impact) | full CodeGuard + diff-preview + dual-control | strong human approval required |
|
|
134
|
+
|
|
135
|
+
T0 and T1 produce the most minimal rule sets; T4 and T5 produce the most aggressive. The bridge uses these defaults; projects can tighten per-tool by editing the generated config.
|
|
136
|
+
|
|
137
|
+
## Cross-source matrix → DefenseClaw column
|
|
138
|
+
|
|
139
|
+
For each row in `skills/security-methodology/references/cross-source-matrix.md`, the DefenseClaw column names the operational control. The bridge consults this column when picking which rule-pack entries to generate for a guardrail whose `mapped_owasp_risks` covers a given row.
|
|
140
|
+
|
|
141
|
+
## Lossy fields (intentionally not mapped)
|
|
142
|
+
|
|
143
|
+
| Field | Why not mapped |
|
|
144
|
+
|---|---|
|
|
145
|
+
| `tool_contract.examples` / `test_cases` | Used by build-loop's eval phase, not by runtime enforcement |
|
|
146
|
+
| `agent_manifest.north_star_metric` / `mission` | Strategic context, not operational policy |
|
|
147
|
+
| `agent_manifest.architecture_pattern` | Architecture description, not policy input |
|
|
148
|
+
| `agent_manifest.deactivation` | Operations runbook, not enforcement config |
|
|
149
|
+
| `system_boundary.users_served` (verbose narrative) | Used in agent-manifest.users + role-cards instead |
|
|
150
|
+
| `role_card.background` / freeform narrative | Documentation, not policy |
|
|
151
|
+
|
|
152
|
+
These fields are referenced in the generated `README.md` for context but do not drive any config row. Operators should still write them in the source artifacts — they're part of the design record even when DefenseClaw doesn't consume them.
|
|
153
|
+
|
|
154
|
+
## When the schema drifts
|
|
155
|
+
|
|
156
|
+
DefenseClaw's `dc-config.yaml` schema evolves. This mapping is pinned to the schema as of canon-write time (May 2026). When the schema changes:
|
|
157
|
+
|
|
158
|
+
1. The bridge's generated `README.md` includes a `# Schema version: <pinned>` line.
|
|
159
|
+
2. Operators deploying to a newer DefenseClaw should validate the generated spec against the current schema before running.
|
|
160
|
+
3. Schema drift in DefenseClaw is the project's responsibility to track; the bridge does not auto-update.
|
|
161
|
+
|
|
162
|
+
For the live schema and config reference, see `https://github.com/cisco-ai-defense/defenseclaw`.
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
<!-- SPDX-FileCopyrightText: 2025-2026 Tyrone Ross, Jr <46267523+tyroneross@users.noreply.github.com> | SPDX-License-Identifier: Apache-2.0 -->
|
|
2
|
+
|
|
3
|
+
# Output Format
|
|
4
|
+
|
|
5
|
+
Where the bridge writes generated DefenseClaw spec, what each file contains, and what guarantees the spec carries.
|
|
6
|
+
|
|
7
|
+
## Output directory
|
|
8
|
+
|
|
9
|
+
```
|
|
10
|
+
<project>/.defenseclaw/generated/
|
|
11
|
+
├── README.md # Generated explanation; lists inputs, mapping, TODOs
|
|
12
|
+
├── dc-config.yaml # Top-level DefenseClaw config skeleton
|
|
13
|
+
├── scanner-profile.yaml # Govern pillar — admission scanners
|
|
14
|
+
├── policies/ # OPA Rego stubs
|
|
15
|
+
│ ├── tool-<tool_id>.rego # One per tool contract
|
|
16
|
+
│ ├── agents.rego # Per-agent registry policies
|
|
17
|
+
│ ├── handoffs.rego # A2A handoff allow-graph (when flow-topology present)
|
|
18
|
+
│ ├── egress.rego # Outbound URL allow-list (when flow-topology present)
|
|
19
|
+
│ ├── checkpoints.rego # Human-in-loop predicates (when manifest declares them)
|
|
20
|
+
│ └── escalation.rego # Guardrail escalation paths
|
|
21
|
+
├── rule-packs/
|
|
22
|
+
│ └── inspect.yaml # Inspect pillar — pre/post-call rules
|
|
23
|
+
└── suppressions.yaml # Empty stub with documentation
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
## Why `.defenseclaw/generated/`
|
|
27
|
+
|
|
28
|
+
- **`.defenseclaw/`** is DefenseClaw's namespace per the user-preference in `~/.claude/CLAUDE.md`: every plugin/tool stores data under `.<toolname>/`. If DefenseClaw is also installed in the project, its runtime state lives in the same directory tree (`.defenseclaw/audit.sqlite`, etc.) but never under `generated/`.
|
|
29
|
+
- **`generated/`** signals that everything inside is regeneratable from the source artifacts. Operators can `rm -rf .defenseclaw/generated/` and re-run the bridge; nothing in here is ground truth.
|
|
30
|
+
- **No collision** with DefenseClaw runtime files. The bridge never writes to `.defenseclaw/audit.sqlite`, `.defenseclaw/incidents/`, or any other path DefenseClaw owns directly.
|
|
31
|
+
|
|
32
|
+
## File guarantees
|
|
33
|
+
|
|
34
|
+
### `dc-config.yaml`
|
|
35
|
+
|
|
36
|
+
- Header comment names the input artifacts and the bridge version.
|
|
37
|
+
- Top-level keys: `project`, `tenancy`, `autonomy_default`, `sdk_hooks`, `providers`, `sinks`, `audit`, `mode`, `risk_coverage`.
|
|
38
|
+
- Default `mode: observe` (log-only). Operators flip to `mode: action` only after tuning.
|
|
39
|
+
- Default `sinks` write to `.defenseclaw/audit.sqlite` and `.defenseclaw/audit.jsonl`. OTLP and Splunk HEC sinks added only when the manifest's `observability` block names them.
|
|
40
|
+
- `risk_coverage` block mirrors the agent-manifest's `security_posture.risk_coverage` (when present); empty when not.
|
|
41
|
+
- YAML-1.1 valid; `python3 -c "import yaml; yaml.safe_load(open('dc-config.yaml'))"` succeeds.
|
|
42
|
+
|
|
43
|
+
### `scanner-profile.yaml`
|
|
44
|
+
|
|
45
|
+
- Header comment names the input artifacts.
|
|
46
|
+
- Top-level keys: `tools`, `mcp_servers`, `a2a_peers`, `memory_scanners`.
|
|
47
|
+
- One `tools[]` entry per tool listed in agent-manifest. Surface (`function`/`MCP`/`hosted`/`shell`/`browser`/`external_api`/`agent`) drives default scanner set per the permission-tier table in `dc-config-mapping.md`.
|
|
48
|
+
- `mcp_servers[]` entries always include `install_source_check: true` and `signature_verification: TODO`.
|
|
49
|
+
- `a2a_peers[]` entries include `TODO: ASI07 — message-signing model not yet defined.`
|
|
50
|
+
|
|
51
|
+
### `policies/<tool>.rego`
|
|
52
|
+
|
|
53
|
+
- One file per tool contract, named `tool-<tool_id>.rego` (lowercase, dashes).
|
|
54
|
+
- Package convention: `package defenseclaw.tools.<tool_id_dotted>`.
|
|
55
|
+
- Always begins with `default allow = false` so missing rules deny.
|
|
56
|
+
- Predicates: `allowed_agents`, `allowed_actions`, `forbidden_actions`, `auth_scope`, `data_scope`, `requires_approval`, `preview_fields`.
|
|
57
|
+
- `TODO:` markers where project-specific predicates are required (e.g., "what argument values count as a high-impact write").
|
|
58
|
+
- Parses with `opa parse` when OPA is installed locally (not required; nice-to-have).
|
|
59
|
+
|
|
60
|
+
### `policies/agents.rego`, `policies/handoffs.rego`, `policies/egress.rego`, `policies/checkpoints.rego`, `policies/escalation.rego`
|
|
61
|
+
|
|
62
|
+
- Generated only when the corresponding source artifact provides material (manifest's `agents:`, flow-topology, etc.).
|
|
63
|
+
- Same conventions: `default allow = false`, `package defenseclaw.<concern>`.
|
|
64
|
+
- Each is a thin policy with TODO predicates where project-specific logic is required.
|
|
65
|
+
|
|
66
|
+
### `rule-packs/inspect.yaml`
|
|
67
|
+
|
|
68
|
+
- One `rules[]` entry per guardrail in `guardrail.md`.
|
|
69
|
+
- Required fields per rule: `id`, `name`, `applies_to_agents`, `lifecycle_phase`, `enforcement_type`, `mode`, `severity`, `mapped_risks`, `trigger`, `check`, `action`.
|
|
70
|
+
- `trigger.regex` is `TODO:` placeholder by default unless the source guardrail's `trigger:` field is itself a regex (rare).
|
|
71
|
+
- `mapped_risks` always present, even if just `["TODO: cite OWASP/ASI/NIST IDs"]`.
|
|
72
|
+
|
|
73
|
+
### `suppressions.yaml`
|
|
74
|
+
|
|
75
|
+
- Empty `suppressions: []` by default.
|
|
76
|
+
- Documentation comments explain when to add: known false positives, scoped exemptions, sunset dates.
|
|
77
|
+
- Operators are expected to fill this file in over time.
|
|
78
|
+
|
|
79
|
+
### `README.md`
|
|
80
|
+
|
|
81
|
+
The README is the operator's entry point. Required sections:
|
|
82
|
+
|
|
83
|
+
1. **Inputs** — list every source artifact the bridge consumed, with timestamps.
|
|
84
|
+
2. **Mapping summary** — concise table of "this source artifact produced these output rows".
|
|
85
|
+
3. **Coverage attestation** — which OWASP/ASI/NIST risks have a generated control; which are gaps.
|
|
86
|
+
4. **TODOs** — every `TODO:` marker in the generated files, listed with file:row references for follow-up.
|
|
87
|
+
5. **Schema version** — pinned DefenseClaw schema version this output targets.
|
|
88
|
+
6. **Limitations** — explicit list of what the bridge does not generate (live patterns, sandbox config, runtime auth headers, LLM-judge config).
|
|
89
|
+
7. **How to deploy** — pointer at `https://github.com/cisco-ai-defense/defenseclaw`. The bridge does not install DefenseClaw; it only writes spec.
|
|
90
|
+
|
|
91
|
+
## Idempotency
|
|
92
|
+
|
|
93
|
+
- Re-running the bridge against unchanged source artifacts produces byte-identical output.
|
|
94
|
+
- Re-running against changed source artifacts overwrites only the affected output files (the bridge tracks which file produced which output via the README's mapping table).
|
|
95
|
+
- The bridge **never deletes** files in `.defenseclaw/generated/` that it didn't author. If the directory contains a hand-edited file the bridge doesn't recognize, it warns and leaves the file alone.
|
|
96
|
+
|
|
97
|
+
## Failure modes
|
|
98
|
+
|
|
99
|
+
- **Source artifact malformed** (YAML syntax error in tool-contract): bridge emits a clear error citing the artifact + line number, writes nothing, exits non-zero.
|
|
100
|
+
- **Multiple tools share the same `tool_id`**: bridge errors. tool_id is a stable identifier; collisions are upstream defects.
|
|
101
|
+
- **Manifest references a tool that has no contract file**: bridge writes `policies/tool-<id>.rego` with a `TODO: tool contract missing — fill in input/output schema before deploying.` placeholder and surfaces the gap in the README.
|
|
102
|
+
- **Reference file missing** (`dc-config-mapping.md` or `cross-source-matrix.md`): bridge errors per the standalone-fallback rule in `SKILL.md`. No partial output.
|
|
103
|
+
|
|
104
|
+
## What this output is not
|
|
105
|
+
|
|
106
|
+
- **Not a working DefenseClaw install.** Operators must clone DefenseClaw, install its dependencies, point its config loader at the generated `dc-config.yaml`, fill in TODOs, and tune in `observe` mode before flipping to `action`.
|
|
107
|
+
- **Not an audit deliverable.** The risk-coverage attestation in the README is generated from the manifest's declared coverage; it does not certify that controls actually catch what they claim.
|
|
108
|
+
- **Not a replacement for project-specific security review.** The bridge generates spec; the security team reviews it. Generated spec without review is no better than no spec.
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: handoff
|
|
3
|
+
description: "Compose a complete, durable build-loop handoff document from the current run state, and optionally launch a fresh session with it injected. Use when crossing a context boundary (context limit, planned restart, worktree GC). Triggers: 'hand off', 'handoff', 'new session', 'context limit', 'restart', 'fresh session', '/build-loop:handoff'."
|
|
4
|
+
user-invocable: true
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
<!-- SPDX-FileCopyrightText: 2025-2026 Tyrone Ross, Jr <46267523+tyroneross@users.noreply.github.com> | SPDX-License-Identifier: Apache-2.0 -->
|
|
8
|
+
|
|
9
|
+
# Build-Loop Handoff
|
|
10
|
+
|
|
11
|
+
Compose a complete, durable handoff document from the current build-loop run state,
|
|
12
|
+
then (optionally) launch a fresh session in the STABLE checkout with that document injected.
|
|
13
|
+
|
|
14
|
+
## When to use
|
|
15
|
+
|
|
16
|
+
- Context window approaching limit mid-build.
|
|
17
|
+
- Planned restart at a session boundary (e.g. deploying a plugin update requires a restart).
|
|
18
|
+
- A worktree about to be GC'd — extract state before the folder disappears.
|
|
19
|
+
- Handing off work to a peer agent or co-developer.
|
|
20
|
+
|
|
21
|
+
## What it composes
|
|
22
|
+
|
|
23
|
+
The handoff doc has eight fixed sections (always the same order; absent data renders as "n/a"):
|
|
24
|
+
|
|
25
|
+
| # | Section | Source |
|
|
26
|
+
|---|---------|--------|
|
|
27
|
+
| 1 | North Star (intent) | `.build-loop/intent.md` |
|
|
28
|
+
| 2 | Current Goal | `.build-loop/goal.md` |
|
|
29
|
+
| 3 | Phase + Live Checklist | `.build-loop/state.json` (execution + runs[]) |
|
|
30
|
+
| 4 | Git State | `git status` + `git log` |
|
|
31
|
+
| 5 | Queues | `followup/`, `backlog/`, `ux-queue/`, `issues/` |
|
|
32
|
+
| 6 | Gotchas / Lessons | `.build-loop/feedback.md` |
|
|
33
|
+
| 7 | Last Run Summary | `state.json.runs[-1]` |
|
|
34
|
+
| 8 | Resume Instructions | generated (workdir, phase context) |
|
|
35
|
+
|
|
36
|
+
## Usage — no flag (emit doc)
|
|
37
|
+
|
|
38
|
+
```bash
|
|
39
|
+
python3 ${CLAUDE_PLUGIN_ROOT}/scripts/handoff --workdir "$PWD"
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
Prints the handoff doc to stdout. Pipe to a file or share directly.
|
|
43
|
+
|
|
44
|
+
```bash
|
|
45
|
+
python3 ${CLAUDE_PLUGIN_ROOT}/scripts/handoff --workdir "$PWD" --output handoff.md
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
Writes to a file instead.
|
|
49
|
+
|
|
50
|
+
```bash
|
|
51
|
+
python3 ${CLAUDE_PLUGIN_ROOT}/scripts/handoff --workdir "$PWD" --json
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
Emits a JSON envelope `{document, sources, errors, ts}` for programmatic use.
|
|
55
|
+
|
|
56
|
+
## Usage — `--launch` (fresh session)
|
|
57
|
+
|
|
58
|
+
The command surface (`/build-loop:handoff --launch`) handles this. The skill provides
|
|
59
|
+
the doc; the command layer handles host-specific launch.
|
|
60
|
+
|
|
61
|
+
**What `--launch` does:**
|
|
62
|
+
1. Compose the handoff doc from the CURRENT run state.
|
|
63
|
+
2. Write it to `.build-loop/handoff-latest.md` in the STABLE checkout.
|
|
64
|
+
3. Start a fresh host session at the STABLE checkout root (not the worktree).
|
|
65
|
+
4. Inject the handoff doc so the new session opens with full context.
|
|
66
|
+
|
|
67
|
+
**Host behavior:**
|
|
68
|
+
|
|
69
|
+
| Host | Launch method | Handoff injection |
|
|
70
|
+
|------|--------------|-------------------|
|
|
71
|
+
| Claude Code | `claude --print` with doc as initial prompt prefix | Inline in opening message |
|
|
72
|
+
| Codex | `codex` with `--context` flag or stdin | Depends on Codex version |
|
|
73
|
+
| Unknown / unsupported | Emit doc + print instructions, exit 0 | Manual paste |
|
|
74
|
+
|
|
75
|
+
The `--launch` path always writes `.build-loop/handoff-latest.md` regardless of host
|
|
76
|
+
support — the doc is the primary deliverable; launch is a convenience.
|
|
77
|
+
|
|
78
|
+
**Important:** launch always targets the STABLE checkout (`git worktree list` → the
|
|
79
|
+
`[bare]` or main entry), not the current worktree. Worktrees may be GC'd before the
|
|
80
|
+
new session starts.
|
|
81
|
+
|
|
82
|
+
## KISS/DRY note
|
|
83
|
+
|
|
84
|
+
`scripts/handoff/__main__.py` reads `.build-loop/` using only `json`, `pathlib`,
|
|
85
|
+
and `subprocess` from the standard library — no new dependencies. It does NOT
|
|
86
|
+
re-implement state parsing; it reads `state.json` directly at the same paths the
|
|
87
|
+
orchestrator already writes. Tests: `scripts/handoff/test_handoff.py` (13 tests).
|
|
88
|
+
|
|
89
|
+
## Host-agnostic design
|
|
90
|
+
|
|
91
|
+
The skill provides **structured data + instructions**. The host coding agent's LLM
|
|
92
|
+
interprets and acts on the handoff doc. No vendor-specific API calls. The `--launch`
|
|
93
|
+
CLI path uses the host's own CLI, isolated in `commands/handoff.md`'s conditional
|
|
94
|
+
block — the skill logic is identical across Claude Code, Codex, and future hosts.
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: build-loop:ibr-bridge
|
|
3
|
+
description: Routing bridge to the IBR plugin for UI visual verification. Build-loop prefers IBR `scan` / `scan_macos` when the IBR plugin is installed; otherwise falls back to build-loop's own `native-ax-driver` / `ui-validator`. Never falls back to nm/strings.
|
|
4
|
+
version: 0.3.0
|
|
5
|
+
user-invocable: false
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
<!-- SPDX-FileCopyrightText: 2025-2026 Tyrone Ross, Jr <46267523+tyroneross@users.noreply.github.com> | SPDX-License-Identifier: Apache-2.0 -->
|
|
9
|
+
|
|
10
|
+
# IBR Bridge (Primary-When-Present, Native-Fallback)
|
|
11
|
+
|
|
12
|
+
Build-loop routes UI visual verification through IBR when the IBR plugin is installed, and through its own native verifiers when it isn't. There is no third path — `nm`/`strings`/`git grep` over symbols never satisfies the visual-evidence gate (enforced by `skills/build-loop/scanners/require-visual-evidence.mjs` at chunk-close and Phase 4-B).
|
|
13
|
+
|
|
14
|
+
The previous "explicit-only" policy was reversed 2026-06-04 because it left the macOS path without a default visual verifier in projects that didn't have IBR — the symbol-only escape hatch then carried briefs past the (prose-only) verify mandate.
|
|
15
|
+
|
|
16
|
+
## Routing rule
|
|
17
|
+
|
|
18
|
+
At Phase 1 Assess, the orchestrator reads `state.json.availablePlugins.ibr` (populated by `detect-plugins.mjs`).
|
|
19
|
+
|
|
20
|
+
| Build-loop need | Primary (when `availablePlugins.ibr == true`) | Fallback (when IBR absent) |
|
|
21
|
+
|---|---|---|
|
|
22
|
+
| Web UI verify | IBR `scan` against the dev-server route | `ui-validator` agent + browser/screenshot tooling |
|
|
23
|
+
| macOS UI verify | IBR `scan_macos` against the running `.app` | `native-ax-driver` (`skills/native-ax-driver/`) pid-anchored AX-tree + screenshot |
|
|
24
|
+
| iOS sim UI verify | IBR `scan` against the booted sim (when supported) | `xcrun simctl io booted screenshot` + `idb ui` for interaction |
|
|
25
|
+
| Visual-evidence at chunk-close | Whichever of the above ran | (same) |
|
|
26
|
+
|
|
27
|
+
Subagent dispatch briefs MAY name `IBR scan` / `scan_macos` as the verifier — BUT only after the orchestrator has confirmed `availablePlugins.ibr == true`. When it is false, the brief MUST name the native-fallback verifier instead (per the [ME] guardrail in `agents/build-orchestrator.md` §"Phase 3 Execute" — never name a tool the implementer can't reach).
|
|
28
|
+
|
|
29
|
+
## Allowed scope
|
|
30
|
+
|
|
31
|
+
When the bridge is the primary route (IBR present):
|
|
32
|
+
- Run `scan` / `scan_macos` against the running app or dev-server route, capture the result envelope, and pass it forward as the chunk's `evidence_paths` / `verification` text.
|
|
33
|
+
- Use IBR token / design-system checks as comparison input.
|
|
34
|
+
- Run a project-authored `.ibr-test.json` suite.
|
|
35
|
+
- Generate `.ibr-test.json` drafts only when the build's plan explicitly authorizes IBR test generation.
|
|
36
|
+
|
|
37
|
+
When the bridge is the fallback route (IBR absent):
|
|
38
|
+
- Skip with a one-line note (`ibr: not installed; falling back to native-ax-driver / ui-validator`); do NOT write to `.ibr/`.
|
|
39
|
+
- Do NOT install or download IBR mid-build.
|
|
40
|
+
|
|
41
|
+
## Forbidden
|
|
42
|
+
|
|
43
|
+
- Do NOT fall back to `nm` / `strings` / `git grep` over compiled symbols as UI verification. The BL-1 gate (`scanners/require-visual-evidence.mjs`) rejects this with exit 2 and routes the chunk back to Iterate.
|
|
44
|
+
- Do NOT invoke IBR viewer / dashboard / UI surfaces from build-loop.
|
|
45
|
+
- Do NOT write `.ibr/` unless the build's plan or the user's request requires an IBR output directory.
|
|
46
|
+
|
|
47
|
+
## Output contract
|
|
48
|
+
|
|
49
|
+
The bridge returns results in the same envelope shape regardless of which route fired:
|
|
50
|
+
|
|
51
|
+
```json
|
|
52
|
+
{
|
|
53
|
+
"status": "ran | skipped | failed",
|
|
54
|
+
"route": "ibr | native | fallback-skipped",
|
|
55
|
+
"verifier": "scan_macos | scan | native-ax-driver | ui-validator | none",
|
|
56
|
+
"artifacts": ["path-or-url-or-pid-anchor"],
|
|
57
|
+
"verification": "<freeform text suitable for the BL-1 gate envelope>",
|
|
58
|
+
"findings": [{"severity": "info|warn|blocker", "message": "..."}]
|
|
59
|
+
}
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
The orchestrator forwards `verification` and `artifacts` to the BL-1 gate envelope as the chunk's `verification` and `evidence_paths` fields.
|
|
63
|
+
|
|
64
|
+
## Status: 0.3.0 (2026-06-04)
|
|
65
|
+
|
|
66
|
+
- Reversed the explicit-only default. IBR is now the preferred primary when present; build-loop-owned `native-ax-driver` / `ui-validator` is the always-available fallback.
|
|
67
|
+
- The bridge stays `user-invocable: false` because it's part of the orchestrator's verify-path routing, not a manual user command.
|
|
68
|
+
- Canonical build-loop design and validation artifacts remain `.build-loop/app-contract/*`, `ui-validator` envelopes, and Review-G outputs whichever route fires.
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: knowledge
|
|
3
|
+
description: Canonical build-loop-memory framework. Use when the user asks to "record a decision", "log an ADR", "write an MADR", "capture this choice", "regenerate the decisions index", "validate knowledge", "migrate feedback to decisions", or "recall <topic>". Active durable writes go to `~/dev/git-folder/build-loop-memory`; legacy `.episodic/` paths are migration/archive inputs only.
|
|
4
|
+
user-invocable: true
|
|
5
|
+
when_to_use: |
|
|
6
|
+
- User wants to record a substantive choice with rationale
|
|
7
|
+
- User asks to regenerate canonical decision indexes or validate decision files
|
|
8
|
+
- User asks to validate frontmatter or supersession links
|
|
9
|
+
- User asks to migrate `.build-loop/feedback.md` into MADR files
|
|
10
|
+
- User asks to migrate playbooks to `.procedural/`
|
|
11
|
+
- User asks to recall prior decisions on a topic (Phase 2 retrieval)
|
|
12
|
+
- Auto-capture (Phase 3) and consolidation (Phase 4) are NOT yet
|
|
13
|
+
implemented; this skill covers Phase 1 (manual + scripted) and
|
|
14
|
+
Phase 2 (Postgres + pgvector retrieval) only.
|
|
15
|
+
namespace: ~/dev/git-folder/build-loop-memory/ (canonical), .build-loop/events.jsonl (repo-local runtime), legacy .episodic/ (migration/archive only)
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
<!-- SPDX-FileCopyrightText: 2025-2026 Tyrone Ross, Jr <46267523+tyroneross@users.noreply.github.com> | SPDX-License-Identifier: Apache-2.0 -->
|
|
19
|
+
|
|
20
|
+
# Knowledge — Canonical Build-Loop Memory (Phases 1 + 2)
|
|
21
|
+
|
|
22
|
+
This skill is the entrypoint for the four-memory-types framework. The
|
|
23
|
+
full design lives at
|
|
24
|
+
`~/dev/research/topics/repo-episodic-memory-framework/repo-episodic-memory-framework.md`
|
|
25
|
+
(see §11–§14 for the four-memory-type taxonomy, extraction pipeline,
|
|
26
|
+
and Postgres schema). Read it before making structural changes.
|
|
27
|
+
|
|
28
|
+
## What lives where
|
|
29
|
+
|
|
30
|
+
```
|
|
31
|
+
~/dev/git-folder/build-loop-memory/
|
|
32
|
+
├── projects/<project>/decisions/ # canonical MADR decisions + INDEX.md
|
|
33
|
+
├── projects/<project>/lessons/ # project-specific lessons
|
|
34
|
+
├── lessons/ # cross-project lessons
|
|
35
|
+
├── indexes/ # generated canonical indexes
|
|
36
|
+
└── db/ # Postgres helper material
|
|
37
|
+
|
|
38
|
+
<repo>/.build-loop/events.jsonl # repo-local runtime timeline
|
|
39
|
+
<repo>/.episodic/ # legacy migration/archive input only
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
## Phase 1 surface — file-only operations
|
|
43
|
+
|
|
44
|
+
| Need | Tool |
|
|
45
|
+
|---|---|
|
|
46
|
+
| Write a decision (file only) | `python3 scripts/write_decision/__main__.py …` |
|
|
47
|
+
| Validate frontmatter + links | `python3 scripts/validate_knowledge.py …` |
|
|
48
|
+
| Regenerate INDEX files | `python3 scripts/regenerate_knowledge_index.py …` |
|
|
49
|
+
| Migrate `feedback.md` to MADR | `python3 scripts/migrate_feedback_to_decisions.py …` |
|
|
50
|
+
| Migrate playbooks to procedural | `python3 scripts/migrate_playbooks_to_procedural.py …` |
|
|
51
|
+
|
|
52
|
+
## Phase 2 surface — DB-backed retrieval
|
|
53
|
+
|
|
54
|
+
`write_decision.py` dual-writes (file canonical + best-effort DB row +
|
|
55
|
+
embedding via `embed_backend`). DB errors do NOT fail the file write — the DB
|
|
56
|
+
is regenerable from files.
|
|
57
|
+
|
|
58
|
+
| Need | Tool |
|
|
59
|
+
|---|---|
|
|
60
|
+
| Initialize schema | `psql -d agent_memory -f scripts/init_agent_memory_schema.sql` |
|
|
61
|
+
| Recall decisions on a topic | `python3 scripts/recall.py --query "…" --limit 5 …` |
|
|
62
|
+
| Rebuild DB from canonical files | `python3 scripts/sync_db_from_files.py --rebuild` |
|
|
63
|
+
|
|
64
|
+
`recall.py` is the entry point for Phase 1 Assess to load only the most
|
|
65
|
+
relevant prior memory rather than reading INDEX.md wholesale. See
|
|
66
|
+
`references/recall-integration.md`.
|
|
67
|
+
|
|
68
|
+
## Authoring a decision (manual)
|
|
69
|
+
|
|
70
|
+
1. Read `.semantic/TAXONOMY.md` to pick `primary_tag`, secondary
|
|
71
|
+
`tags`, `entity`, and `confidence`.
|
|
72
|
+
2. Run `write_decision.py` with the required flags. The script:
|
|
73
|
+
- Allocates the next sequential ID (zero-padded 4-digit).
|
|
74
|
+
- Writes the MADR to
|
|
75
|
+
`~/dev/git-folder/build-loop-memory/projects/<project>/decisions/<canonical-id>.md` using
|
|
76
|
+
`skills/knowledge/templates/madr-minimal.md` as the body
|
|
77
|
+
scaffold (filled from CLI flags).
|
|
78
|
+
- Regenerates the canonical decisions `INDEX.md`.
|
|
79
|
+
- Appends one event to `<repo>/.build-loop/events.jsonl`.
|
|
80
|
+
- Embeds the body via local Ollama and inserts a row into
|
|
81
|
+
`agent_memory.<schema>.semantic_facts` (best-effort; file
|
|
82
|
+
write succeeds even if DB is down).
|
|
83
|
+
|
|
84
|
+
File writes are atomic (lock + tempfile + replace).
|
|
85
|
+
|
|
86
|
+
## Topic identity & overwrite rules
|
|
87
|
+
|
|
88
|
+
`primary_tag + entity` is the topic-identity key. Two decisions sharing
|
|
89
|
+
both fields describe the same topic; the writer enforces the
|
|
90
|
+
overwrite ladder defined in `TAXONOMY.md` §3:
|
|
91
|
+
|
|
92
|
+
- Higher confidence auto-supersedes lower (no flag needed).
|
|
93
|
+
- Equal confidence requires `--supersedes <id>` (explicit user direction).
|
|
94
|
+
- Lower confidence cannot displace higher.
|
|
95
|
+
|
|
96
|
+
Superseded decisions move to `_history/<id>-v<N>.md`; INDEX shows only
|
|
97
|
+
the current version.
|
|
98
|
+
|
|
99
|
+
## Validation
|
|
100
|
+
|
|
101
|
+
`validate_knowledge.py` checks:
|
|
102
|
+
- Frontmatter shape (required keys, value types, enum membership)
|
|
103
|
+
- `tags` and `primary_tag` against TAXONOMY's vocabulary
|
|
104
|
+
- `supersedes` / `superseded_by` links resolve to existing files
|
|
105
|
+
|
|
106
|
+
`write_decision.py` calls the validator as a pre-write gate; you can
|
|
107
|
+
also run it standalone over the whole tree.
|
|
108
|
+
|
|
109
|
+
## Postgres connection
|
|
110
|
+
|
|
111
|
+
DB-side scripts read connection from
|
|
112
|
+
`~/.config/agent-memory/connection.env` (DATABASE_URL=
|
|
113
|
+
postgresql://tyroneross@localhost:5432/agent_memory). Per-project schema:
|
|
114
|
+
this repo uses `build_loop_memory`. The schema name is configurable via
|
|
115
|
+
the `--schema` flag on each DB-aware script.
|
|
116
|
+
|
|
117
|
+
## What's NOT in this skill
|
|
118
|
+
|
|
119
|
+
- Auto-capture from conversation — Phase 3 (`auto-decision-capture`
|
|
120
|
+
skill, Stop hook with `scan_transcript_for_decisions.py`)
|
|
121
|
+
- Memory consolidation — Phase 4 (`consolidate_memory.py`)
|
|
122
|
+
- `/knowledge:review` slash command — Phase 4
|
|
123
|
+
- `derived/libraries.json` and `derived/CHANGELOG.md` generators —
|
|
124
|
+
Phase 1.5 / 4
|
|
125
|
+
|
|
126
|
+
Use this skill only for Phase 1 (manual + scripted) and Phase 2
|
|
127
|
+
(retrieval) operations.
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
<!-- SPDX-FileCopyrightText: 2025-2026 Tyrone Ross, Jr <46267523+tyroneross@users.noreply.github.com> | SPDX-License-Identifier: Apache-2.0 -->
|
|
2
|
+
|
|
3
|
+
# Recall integration — Phase 1 Assess
|
|
4
|
+
|
|
5
|
+
`scripts/recall.py` is the retrieval entry point for repo-local episodic
|
|
6
|
+
memory. It runs hybrid search (cosine + pg_trgm + full-text) over
|
|
7
|
+
`agent_memory.<schema>.semantic_facts` and `episode_events`, returning a
|
|
8
|
+
compact text summary suitable for direct injection into Phase 1 Assess
|
|
9
|
+
context.
|
|
10
|
+
|
|
11
|
+
## Why this exists
|
|
12
|
+
|
|
13
|
+
Phase 1 Assess today reads `INDEX.md`, `MEMORY.md`, recent
|
|
14
|
+
`runs[]` and recent feedback files wholesale (~10–20K tokens). For
|
|
15
|
+
small projects this is fine; once the corpus crosses ~50 decisions it
|
|
16
|
+
dominates Assess context. `recall.py` replaces the wholesale read with
|
|
17
|
+
a query-specific top-K plus neighbor expansion (~500–1500 tokens).
|
|
18
|
+
|
|
19
|
+
The cost is one Ollama embedding call (~30 ms locally) plus one psql
|
|
20
|
+
hybrid search (~10–50 ms with HNSW). Both are local; no cloud cost.
|
|
21
|
+
|
|
22
|
+
## Status: documented but NOT wired (per brief)
|
|
23
|
+
|
|
24
|
+
This document specifies the integration. **The orchestrator does NOT
|
|
25
|
+
call `recall.py` yet.** Wiring Phase 1 Assess is a deliberate follow-up
|
|
26
|
+
after pilot data shows the recall quality is high enough on real
|
|
27
|
+
queries. The planned wiring is below for reference.
|
|
28
|
+
|
|
29
|
+
## Planned wiring (do NOT implement until pilot data is in)
|
|
30
|
+
|
|
31
|
+
In `agents/build-orchestrator.md` Phase 1 Assess, this now sits behind
|
|
32
|
+
`scripts/context_bootstrap.py`. If the pilot graduates, replace the
|
|
33
|
+
bootstrap's canonical-memory recall sub-step, not the whole context packet:
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
# Build-relevant recall: the goal text is the query.
|
|
37
|
+
python3 scripts/recall.py \
|
|
38
|
+
--query "$GOAL_TEXT" \
|
|
39
|
+
--limit 8 \
|
|
40
|
+
--confidence-floor confirmed \
|
|
41
|
+
--neighbor-window 3 \
|
|
42
|
+
> .build-loop/recall.md
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
The orchestrator then loads `.build-loop/recall.md` instead of the full
|
|
46
|
+
INDEX/MEMORY tree. The unfiltered files remain available for the user
|
|
47
|
+
to inspect; recall.md is the agent-facing summary.
|
|
48
|
+
|
|
49
|
+
## Trigger conditions
|
|
50
|
+
|
|
51
|
+
`recall.py` makes sense when:
|
|
52
|
+
|
|
53
|
+
- The agent is starting a new build/turn that needs prior context.
|
|
54
|
+
- The query is well-defined (a specific topic or symptom).
|
|
55
|
+
|
|
56
|
+
`recall.py` is NOT a substitute when:
|
|
57
|
+
|
|
58
|
+
- The agent needs to enumerate ALL prior decisions on a topic
|
|
59
|
+
(use `INDEX.md` directly with `--confidence-floor inferred` to widen).
|
|
60
|
+
- Auto-capture is in flight and `_candidates.jsonl` hasn't been
|
|
61
|
+
consolidated yet (Phase 4 concern).
|
|
62
|
+
- The DB is unreachable (recall returns exit 2; orchestrator should
|
|
63
|
+
fall back to `INDEX.md` read).
|
|
64
|
+
|
|
65
|
+
## Invariants
|
|
66
|
+
|
|
67
|
+
1. The DB is the index, not the source of truth. `recall.py` returning
|
|
68
|
+
nothing useful does NOT mean the answer isn't in the corpus —
|
|
69
|
+
re-run `sync_db_from_files.py --rebuild` and try again. If recall
|
|
70
|
+
still misses, the underlying decision is missing from `.episodic/`.
|
|
71
|
+
2. The summary is bounded by `--char-budget` (default 8K chars,
|
|
72
|
+
~1500 tokens). Truncation is explicit ("[truncated to char budget]").
|
|
73
|
+
3. Confidence floor is `confirmed` by default. Pass `--confidence-floor
|
|
74
|
+
inferred` to include lower-trust auto-captured decisions (Phase 3).
|
|
75
|
+
|
|
76
|
+
## Pilot exit criteria
|
|
77
|
+
|
|
78
|
+
Wire into Phase 1 Assess after:
|
|
79
|
+
|
|
80
|
+
- 30+ decisions have been migrated/captured into the corpus
|
|
81
|
+
- Manual sampling shows top-3 recall quality ≥ 80% on goal-shaped
|
|
82
|
+
queries
|
|
83
|
+
- Token budget proves to be ≤ 1500 tokens on realistic queries
|