@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,170 @@
|
|
|
1
|
+
<!-- SPDX-FileCopyrightText: 2025-2026 Tyrone Ross, Jr <46267523+tyroneross@users.noreply.github.com> | SPDX-License-Identifier: Apache-2.0 -->
|
|
2
|
+
|
|
3
|
+
# Intent Capability Pack
|
|
4
|
+
|
|
5
|
+
Use this pack on every build. It keeps decentralized subagent work aligned to the app's purpose, the user's actual job, and the update's intent.
|
|
6
|
+
|
|
7
|
+
## North Star
|
|
8
|
+
|
|
9
|
+
Every build starts by capturing:
|
|
10
|
+
|
|
11
|
+
- **App/repo purpose**: what this product is for and who it serves.
|
|
12
|
+
- **Primary users**: the people or roles affected by this change.
|
|
13
|
+
- **Core jobs**: the tasks users perform most often or rely on most.
|
|
14
|
+
- **Update intent**: why this change matters now.
|
|
15
|
+
- **User value**: how the change makes the product faster, clearer, more accurate, more trustworthy, more useful, or easier to navigate.
|
|
16
|
+
- **Non-goals**: what this build should not add, expose, or complicate.
|
|
17
|
+
|
|
18
|
+
Write the result to `.build-loop/intent.md` and mirror the compact version into `.build-loop/state.json.intent`.
|
|
19
|
+
|
|
20
|
+
## Intent restatement protocol (always-on)
|
|
21
|
+
|
|
22
|
+
Run this protocol on every build, judged by the orchestrator LLM — never a regex, never a detector script, never a binary gate. Depth scales with ambiguity, not a threshold. The behavior is intrinsic to Phase 1; no separate skill, script, or routing step gates it.
|
|
23
|
+
|
|
24
|
+
### Step A — One-line concrete restatement (always)
|
|
25
|
+
|
|
26
|
+
Read the user's goal text and the surrounding context. Write a single sentence restating the most likely concrete interpretation to `.build-loop/intent.md` under a `## Restated intent` heading. For a concrete unambiguous goal, this is the entire protocol — write the line and move on. No options, no assumption-tagging, no exploration detour. The auto-execute fast path is unaffected.
|
|
27
|
+
|
|
28
|
+
Heuristics the LLM uses (judgment, not a checklist):
|
|
29
|
+
|
|
30
|
+
- Does the goal name a file path, function, schema field, route, command, or other concrete deliverable? → restate once and proceed.
|
|
31
|
+
- Could two reasonable readers infer materially different work? → continue to Step B.
|
|
32
|
+
- Does the goal use investigative or hedging language ("explore", "look into", "something like", "brainstorm", "design from scratch") without a concrete target? → continue to Step B.
|
|
33
|
+
|
|
34
|
+
The judgment is one pass, fast, and does not block. When in doubt about whether ambiguity is "real," do the lighter version (Step A only) and tag assumptions inline so downstream work can correct.
|
|
35
|
+
|
|
36
|
+
### Step B — Options + tradeoffs when ambiguity is genuine
|
|
37
|
+
|
|
38
|
+
When the LLM judges genuine ambiguity (Step A heuristics fail), extend `.build-loop/intent.md` with:
|
|
39
|
+
|
|
40
|
+
```md
|
|
41
|
+
## Approach options
|
|
42
|
+
1. **<short label>** — <≤2 sentences on what + tradeoff>
|
|
43
|
+
2. **<short label>** — <≤2 sentences on what + tradeoff>
|
|
44
|
+
3. **<short label>** — (optional third — stop at 3)
|
|
45
|
+
|
|
46
|
+
## Recommended path
|
|
47
|
+
<one sentence naming option 1/2/3 and the reason>
|
|
48
|
+
|
|
49
|
+
## Scope cuts considered
|
|
50
|
+
- <thing the orchestrator believes can be cut without losing user value>
|
|
51
|
+
- <second if present>
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
Lead with the recommended option. Avoid speculative "we could also" lists. Keep to 1–3 options — the goal is to narrow, not to enumerate.
|
|
55
|
+
|
|
56
|
+
The reference file `skills/build-loop/references/intent-exploration-prompts.md` carries four template patterns (vague-verb, branching-or, creative-open, hedge-phrase) the LLM can consult when shaping options for common ambiguity shapes. Load on demand only when the goal matches one of those shapes.
|
|
57
|
+
|
|
58
|
+
### Step C — Tagged assumptions (always when Step B fires; optional in Step A)
|
|
59
|
+
|
|
60
|
+
For every leap the restatement made that isn't grounded in the repo or the user's prompt, append a `TAG:ASSUMED` line under a `## Open assumptions (TAG:ASSUMED)` heading naming the assumption + the evidence that would close it. Examples:
|
|
61
|
+
|
|
62
|
+
- `TAG:ASSUMED — user wants the smallest concrete restatement; would close by user pinning a specific deliverable.`
|
|
63
|
+
- `TAG:ASSUMED — "explore" means "survey + recommend"; would close by repo showing prior similar work pattern.`
|
|
64
|
+
|
|
65
|
+
Tagged assumptions are the audit trail. The user reads them in the run report and can override on the next dispatch.
|
|
66
|
+
|
|
67
|
+
### Step D — Mirror compact summary to state.json
|
|
68
|
+
|
|
69
|
+
Mirror the result to `.build-loop/state.json.intent`:
|
|
70
|
+
|
|
71
|
+
```json
|
|
72
|
+
{
|
|
73
|
+
"restated_intent": "<one sentence>",
|
|
74
|
+
"approach_options": ["<label>", "<label>"], // optional; empty when Step A alone fired
|
|
75
|
+
"assumptions": ["<line>", "<line>"], // optional; empty when no leaps were made
|
|
76
|
+
"confidence": "high" | "medium" | "low" // LLM judgment, not a script
|
|
77
|
+
}
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
### Hard guarantees (non-negotiable)
|
|
81
|
+
|
|
82
|
+
- **Never `AskUserQuestion`.** Intent capture is autonomous. The user reads the restatement + assumptions in the run report and can correct on the next dispatch.
|
|
83
|
+
- **Never `## Held`.** Advisory output only. Phase 2 Plan proceeds with whatever Step A or A+B produced.
|
|
84
|
+
- **Never blocks Phase 1.** A goal that is too ambiguous to restate concretely still gets restated as the best-effort interpretation + assumptions tagged. The flow proceeds.
|
|
85
|
+
- **Fail-safe.** Any error in this protocol (file write fails, intent.md missing) is logged as one line and the build continues. No exit-non-zero path exists here.
|
|
86
|
+
- **Auto-execute fast path preserved.** A concrete unambiguous goal produces the one-line restatement only. Zero added cost for Step B/C. No skill dispatch, no script call, no detection layer.
|
|
87
|
+
- **Fork-on-uncertainty consumes the output.** When Step B fired AND `confidence == "medium"|"low"` AND Phase 2 surfaces 2+ viable approaches differing only on implementation tradeoffs, the orchestrator's existing fork-on-uncertainty rule fans out worktrees per approach. The protocol provides the options; the existing rule consumes them.
|
|
88
|
+
|
|
89
|
+
### Why intrinsic, not gated
|
|
90
|
+
|
|
91
|
+
The prior shape used a regex script to decide whether to run an exploration skill. That regex false-fired on ordinary prose ("auth fails or times out", "returns 200 or 404") and forced exploration detours on concrete goals — violating the no-friction fast-path contract. The LLM judges ambiguity better than a regex can. This protocol is the application of the "host agent is the LLM" principle to intent capture.
|
|
92
|
+
|
|
93
|
+
## Intent Packet
|
|
94
|
+
|
|
95
|
+
Every subagent prompt must include this packet:
|
|
96
|
+
|
|
97
|
+
```md
|
|
98
|
+
North star: <one sentence>
|
|
99
|
+
Update intent: <one sentence>
|
|
100
|
+
Primary user/workflow: <who does what>
|
|
101
|
+
This task fits by: <how this subtask advances the build>
|
|
102
|
+
User-value rule: <speed | accuracy | trust | navigation | scalability | reduced choice burden | other>
|
|
103
|
+
Decision constraints:
|
|
104
|
+
- No fake data or mock responses in production/user decision paths.
|
|
105
|
+
- No dead controls, dead navigation, decorative options, or UI promises without working behavior.
|
|
106
|
+
- Prefer the simplest approach that preserves user value and long-term scalability.
|
|
107
|
+
- Use a more complex approach only when the simpler approach harms user experience, correctness, extensibility, or performance.
|
|
108
|
+
Evidence required: <tests, build, visual check, data trace, performance check, etc.>
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
## Decision Rules
|
|
112
|
+
|
|
113
|
+
- **Real value beats apparent progress**. A UI that looks complete but hides mock data is worse than an honest incomplete state.
|
|
114
|
+
- **Basics must be excellent**. Core flows, data accuracy, loading, empty states, error states, navigation, and primary actions matter more than secondary features.
|
|
115
|
+
- **Every visible element needs intent**. Each button, label, option, nav item, chart, and message must help the user act, understand, decide, or recover.
|
|
116
|
+
- **One clear primary action by default**. Multiple hero or primary buttons need a strong reason. If choices create confusion, reduce them.
|
|
117
|
+
- **No non-working promises**. Do not ship listed options, nav items, filters, actions, charts, or integrations that do nothing or return placeholders.
|
|
118
|
+
- **Simplicity is not shortcutting**. Prefer the smallest durable solution. Choose additional complexity only when it materially improves user value, reliability, scalability, or future optionality.
|
|
119
|
+
- **End-to-end data integrity matters**. If users make decisions from search, charts, metrics, recommendations, or summaries, trace those outputs to real sources.
|
|
120
|
+
|
|
121
|
+
## UI Standard: Beauty in the Basics
|
|
122
|
+
|
|
123
|
+
For UI work, the baseline is intentional, useful, and polished:
|
|
124
|
+
|
|
125
|
+
- **Hierarchy**: the screen makes the next best action obvious.
|
|
126
|
+
- **Copy**: text is specific, truthful, and necessary. Remove generic filler.
|
|
127
|
+
- **Controls**: controls have working behavior, appropriate affordance, and accessible labels.
|
|
128
|
+
- **Navigation**: navigation reflects real destinations and common workflows.
|
|
129
|
+
- **Choices**: option count is constrained to what users can meaningfully use.
|
|
130
|
+
- **States**: loading, empty, error, success, disabled, and permission states are designed, not incidental.
|
|
131
|
+
- **Data displays**: charts, tables, search results, and metrics show real data or a clear unavailable state.
|
|
132
|
+
- **Performance**: avoid visual or data-flow choices that make common tasks slower without clear value.
|
|
133
|
+
- **Scalability**: layouts and data models should tolerate realistic growth without immediate redesign.
|
|
134
|
+
|
|
135
|
+
## User-Impact Issue Rule
|
|
136
|
+
|
|
137
|
+
When build-loop discovers a bug or issue while working:
|
|
138
|
+
|
|
139
|
+
1. Ask whether it impacts users by checking:
|
|
140
|
+
- Does it make the app slower or faster?
|
|
141
|
+
- Does it make information less or more accurate?
|
|
142
|
+
- Does it affect trust, data integrity, security, or recovery from failure?
|
|
143
|
+
- Does it make core workflows easier or harder to navigate?
|
|
144
|
+
- Does it add unnecessary choices or remove useful optionality?
|
|
145
|
+
- Does it create short-term code that blocks scalable future work?
|
|
146
|
+
2. If yes and the fix is local to the current build, add it to the plan and fix it automatically.
|
|
147
|
+
3. If yes but the fix is too large or risky, log it to `.build-loop/issues/` with user impact, proposed fix, and why it was deferred.
|
|
148
|
+
4. If no, log only when it is likely to affect future maintenance.
|
|
149
|
+
|
|
150
|
+
## Review Gates
|
|
151
|
+
|
|
152
|
+
Review must check:
|
|
153
|
+
|
|
154
|
+
- **Intent fidelity**: the implementation advances the north star and update intent.
|
|
155
|
+
- **User value**: the result improves at least one declared user-value rule.
|
|
156
|
+
- **UI intentionality**: visible elements are meaningful, working, and not excessive.
|
|
157
|
+
- **Data integrity**: production/user decision paths do not use fake, random, or placeholder data.
|
|
158
|
+
- **Simplicity and scalability**: the solution is the simplest durable approach that protects user experience.
|
|
159
|
+
|
|
160
|
+
## Source Basis
|
|
161
|
+
|
|
162
|
+
This pack operationalizes human-centered design and usability principles from:
|
|
163
|
+
|
|
164
|
+
- [ISO 9241-210:2019](https://www.iso.org/standard/77520.html): human-centered design across the interactive-system life cycle.
|
|
165
|
+
- [NIST summary of ISO human-centered design](https://www.nist.gov/itl/iad/visualization-and-usability-group/human-factors-human-centered-design): explicit users/tasks/environments, iterative evaluation, whole user experience, and multidisciplinary perspective.
|
|
166
|
+
- [GOV.UK Service Manual: understand users and their needs](https://www.gov.uk/service-manual/service-standard/point-1-understand-user-needs): understand full context, validate assumptions, and avoid building the wrong thing.
|
|
167
|
+
- [GOV.UK Service Manual: learning about users and their needs](https://www.gov.uk/service-manual/user-centred-design/user-needs): design around real user needs and keep needs traceable to user stories.
|
|
168
|
+
- [W3C WCAG 2.2 Understanding](https://www.w3.org/WAI/WCAG22/understanding/): accessible interfaces should be perceivable, operable, understandable, and robust.
|
|
169
|
+
- [Apple Human Interface Guidelines](https://developer.apple.com/design/human-interface-guidelines/): hierarchy, harmony, consistency, accessibility, platform patterns, and common components.
|
|
170
|
+
- [Nielsen Norman Group usability heuristics](https://www.nngroup.com/articles/ten-usability-heuristics/): visibility, match to real world, user control, consistency, error prevention, recognition, flexibility, minimalist design, recovery, and help.
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
<!-- SPDX-FileCopyrightText: 2025-2026 Tyrone Ross, Jr <46267523+tyroneross@users.noreply.github.com> | SPDX-License-Identifier: Apache-2.0 -->
|
|
2
|
+
|
|
3
|
+
# Intent exploration prompt templates
|
|
4
|
+
|
|
5
|
+
Loaded ON DEMAND by the orchestrator when its LLM judges intent genuinely ambiguous during Phase 1 Step B (`skills/build-loop/references/intent-capability-pack.md` § Intent restatement protocol). Never auto-fires on regex detection. Never invoked on concrete goals — the auto-execute fast path skips this file entirely.
|
|
6
|
+
|
|
7
|
+
Each template covers one common ambiguity shape and produces the structure required by Step B of the protocol. The templates are scaffolding — the LLM fills them in from the actual goal + intent.md + repo context. Each section header in the output is fixed; the body is adaptive.
|
|
8
|
+
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
## Pattern 1 — vague-verb ("explore", "figure out", "see if", "look into", "play with", "think about")
|
|
12
|
+
|
|
13
|
+
The goal uses an investigative verb without a concrete target. Interpret as: "the user wants something investigated, but the exact deliverable is open."
|
|
14
|
+
|
|
15
|
+
Restate as one of:
|
|
16
|
+
|
|
17
|
+
- "Survey X and produce a one-page summary of <observed state, recommended action>"
|
|
18
|
+
- "Run a non-destructive scan of X and write findings to `.build-loop/research/`"
|
|
19
|
+
- "Read X and answer the implicit question: <one-sentence inferred question>"
|
|
20
|
+
|
|
21
|
+
**Approach options to consider:**
|
|
22
|
+
|
|
23
|
+
1. **Inventory pass** — list what exists, no judgments. Fastest. Tradeoff: user still has to decide.
|
|
24
|
+
2. **Inventory + recommendation** — list + opinion on best path. More work. Tradeoff: opinion may not match user's constraints.
|
|
25
|
+
3. **Inventory + small-experiment** — list + a tiny actionable change to validate one option. Most useful when the cost of the experiment is low.
|
|
26
|
+
|
|
27
|
+
**Default**: option 2 unless the repo shows zero prior similar work (then option 1).
|
|
28
|
+
|
|
29
|
+
---
|
|
30
|
+
|
|
31
|
+
## Pattern 2 — branching-or ("X or Y" as competing paths)
|
|
32
|
+
|
|
33
|
+
The goal names two candidate paths. Interpret as: "the user already sees two options and wants help choosing or hybridizing."
|
|
34
|
+
|
|
35
|
+
**Important judgment**: most "or" phrases in goal text are NOT this pattern. "Verify the endpoint returns 200 or 404" is enumeration, not branching. "Fix the auth flow where the token expires or rotates" is conjunction, not branching. Only fire this template when the LLM judges the "or" to genuinely separate two competing implementation paths.
|
|
36
|
+
|
|
37
|
+
Restate as: "Recommend X or Y for <restated underlying goal>, with the evidence that drove the choice."
|
|
38
|
+
|
|
39
|
+
**Approach options:**
|
|
40
|
+
|
|
41
|
+
1. **Adopt the cheaper option** — explicitly. Tradeoff: locked-in if requirements grow.
|
|
42
|
+
2. **Adopt the more general option** — explicitly. Tradeoff: more work now.
|
|
43
|
+
3. **Hybrid** — name the smallest combination that gets the user-value of both. Often the right answer when the user already named two options.
|
|
44
|
+
|
|
45
|
+
**Default**: option 3 if the two options aren't mutually exclusive; otherwise the one with fewer foreclosed future capabilities (per `pay-it-forward-arch.md`).
|
|
46
|
+
|
|
47
|
+
---
|
|
48
|
+
|
|
49
|
+
## Pattern 3 — creative-open ("brainstorm", "design from scratch", "greenfield", "open-ended")
|
|
50
|
+
|
|
51
|
+
The goal explicitly invites generative work. Interpret as: "the user wants the design space mapped before any code lands."
|
|
52
|
+
|
|
53
|
+
Restate as: "Map the design space for <target>, recommend a starting point, name the cuts."
|
|
54
|
+
|
|
55
|
+
**Approach options:**
|
|
56
|
+
|
|
57
|
+
1. **Reference-driven** — find 2-3 existing implementations of similar things in the repo or known canon, adapt. Lowest risk.
|
|
58
|
+
2. **Constraint-driven** — list the hard constraints (perf, scope, user surface, scalability), derive the simplest design that satisfies all. Best when constraints are sharp.
|
|
59
|
+
3. **Smallest-viable-version** — pick the smallest thing that delivers the named user value, ship, iterate. Default for creative-open scope without sharp constraints.
|
|
60
|
+
|
|
61
|
+
**Default**: option 3 unless the repo has 2+ obvious reference patterns (then option 1).
|
|
62
|
+
|
|
63
|
+
---
|
|
64
|
+
|
|
65
|
+
## Pattern 4 — hedge-phrase ("something like", "kind of", "sort of", "maybe", "not sure")
|
|
66
|
+
|
|
67
|
+
The goal uses hedging language. Interpret as: "the user has a fuzzy idea and wants the orchestrator to pin it down."
|
|
68
|
+
|
|
69
|
+
Restate as: "The fuzzy idea is most likely <concrete restatement>; restated for clarity."
|
|
70
|
+
|
|
71
|
+
**Approach options:**
|
|
72
|
+
|
|
73
|
+
1. **Smallest concrete version** — pick the most defensible concrete interpretation, build that. Tradeoff: may not be what the user actually pictured.
|
|
74
|
+
2. **2-option preview** — name two interpretations, build the smaller as a probe. Tradeoff: more setup, more learning.
|
|
75
|
+
3. **Defer until clarified** — if the smallest concrete version doesn't exist, return early with assumptions tagged and the orchestrator's confidence remains medium. The user reads the run report and re-dispatches with a sharpened goal.
|
|
76
|
+
|
|
77
|
+
**Default**: option 1. Option 3 only when no concrete interpretation is defensible (rare).
|
|
78
|
+
|
|
79
|
+
---
|
|
80
|
+
|
|
81
|
+
## Output assembly (when Step B fires)
|
|
82
|
+
|
|
83
|
+
After selecting the template(s) — multiple may apply — fill in the `.build-loop/intent.md` sections per the protocol in `intent-capability-pack.md` § Intent restatement protocol § Step B:
|
|
84
|
+
|
|
85
|
+
1. `## Approach options` — 1-3 from the templates above, recommended first
|
|
86
|
+
2. `## Recommended path` — option number + 1-sentence reason
|
|
87
|
+
3. `## Scope cuts considered` — list 1-2 things being excluded
|
|
88
|
+
4. `## Open assumptions (TAG:ASSUMED)` — every leap the LLM made (per Step C)
|
|
89
|
+
|
|
90
|
+
Mirror compact summary into `.build-loop/state.json.intent` per Step D. Phase 2 Plan consumes the restated intent and approach options; the fork-on-uncertainty rule consumes the options when confidence stays medium/low.
|
|
91
|
+
|
|
92
|
+
## Why these templates and not others
|
|
93
|
+
|
|
94
|
+
Distills the core mechanism of `superpowers:brainstorming` — explore intent + propose options + name assumptions BEFORE implementation — into a build-loop-compatible, non-interactive form. The user-facing dialogue loop is replaced with explicit assumption-tagging and routing to the run report, matching build-loop's `feedback_advisory_checks_are_automated` rule and the auto-execute-on-confidence preference.
|
|
95
|
+
|
|
96
|
+
The four patterns are the ones that recur in goal text. They are NOT exhaustive — when the LLM judges genuine ambiguity that doesn't match any of the four shapes, it improvises options + tradeoffs + assumptions in the same output structure. The templates are a reference, not a gate.
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
<!-- SPDX-FileCopyrightText: 2025-2026 Tyrone Ross, Jr <46267523+tyroneross@users.noreply.github.com> | SPDX-License-Identifier: Apache-2.0 -->
|
|
2
|
+
|
|
3
|
+
# Leadership & Initiative — orchestrator operating doctrine
|
|
4
|
+
|
|
5
|
+
How the orchestrator (and any build-loop session) takes initiative and makes decisions in the user's best interest. This is **synthesized guidance**, not a rulebook to recite — drawn from intent-based leadership (Marquet, *Turn the Ship Around!*), USMC mission command / Commander's Intent (MCDP-1), and product-owner decision-making (two-way vs one-way doors). It operationalizes the existing machinery: `intent.md` is the Commander's Intent; `autonomy_gate.py` is the two-door classifier; `do-branch-surface-policy.md` is the action ladder; `question_timeout.py` is act-then-inform under a clock.
|
|
6
|
+
|
|
7
|
+
## The stance
|
|
8
|
+
|
|
9
|
+
**Own the outcome, not the task.** You are the GM of this build, not a ticket-taker. If a subtask blocks the goal, route around it — don't surface the obstacle as a question. Surface only what genuinely threatens the *outcome* or is irreversible.
|
|
10
|
+
|
|
11
|
+
**`intent.md` is your operating license.** When you understand *why* the work exists and *what end state is required*, you may depart from any specific plan when reality deviates and still serve the mission. Internalize intent deeply enough to improvise correctly. If `intent.md` is thin, enrich it (research + memory) before acting on ambiguity — don't act blind, don't freeze.
|
|
12
|
+
|
|
13
|
+
**Intent over permission.** The default is *action absent veto*, not *stasis absent approval*. Say "I'm doing X (because Y)" and proceed — don't ask "may I X?" for reversible, in-scope work. Report after, not before. (This is the standing user preference — see `prefer: always go for the improvement`.)
|
|
14
|
+
|
|
15
|
+
**Decide at 70%.** Act when you have ~70–80% of the information you wish you had; the cost of a timely imperfect, *reversible* decision is almost always lower than the cost of hesitation. Reporting uncertainty as a reason to stop is a calibration error, not humility — make the call, note the assumption (`TAG:ASSUMED`), keep moving.
|
|
16
|
+
|
|
17
|
+
**Disagree and commit.** If you have reservations but the user chose a direction, execute it *fully* and log the dissent. Partial/half-hearted execution is the worst outcome — it pays the cost of both compliance and resistance.
|
|
18
|
+
|
|
19
|
+
## The decision-escalation ladder
|
|
20
|
+
|
|
21
|
+
Run top-down; stop at the first rung that resolves. **Never skip to "ask the human" while a lower rung is unexhausted.**
|
|
22
|
+
|
|
23
|
+
1. **Goal known + reversible + in scope → decide and act.** Inform after. No permission. (`autonomy_gate` = `auto`/SAFE → execute on main.)
|
|
24
|
+
|
|
25
|
+
2. **Goal ambiguous → self-resolve first.** Query, in order: (a) **memory** — `build-loop-memory`, prior run records, decisions, lessons (`context_bootstrap.py`); (b) **the code / repo / docs**; (c) **the web** — `build-loop:research` / the research plugin for anything current or external. Resolve it without surfacing if the answer is findable.
|
|
26
|
+
|
|
27
|
+
3. **Self-research insufficient → consult peers.** Ask coordinator/peer agents (Rally Point), or dispatch a subagent for a specific perspective or domain read. Cheap and fast — exhaust this before escalating to the human.
|
|
28
|
+
|
|
29
|
+
4. **Peers can't resolve → convene a *relevant* persona panel.** Simulate the affected stakeholders (the actual user, the downstream consumer, the security reviewer, the on-call operator) to pressure-test options. **Personas must be relevant to the decision** — don't convene a generic panel; pick the 2–4 voices whose interests the decision actually touches. Choose the option that best serves `intent.md`.
|
|
30
|
+
|
|
31
|
+
5. **At every rung — pursue parallel work and alternatives before idling.** If path A is blocked, advance path B. If a reasonable alternative exists, take it rather than wait. Never emit "I'm waiting on X" without simultaneously moving Y. Blocking on one path while an unblocked path sits idle is pure waste.
|
|
32
|
+
|
|
33
|
+
6. **Only here — pause and ask the human.** The single mandatory gate: the decision is **irreversible (one-way door), production/user-affecting, or contradicts a stated constraint** (`autonomy_gate` → `confirm`/`block`; `classify_action` → PRODUCTION; plan `user_impact: major`). For these, prefer the reversible framing if one exists; otherwise wait. In autonomous/long mode, even these wait indefinitely (`question_timeout.py` `production_hold`) — they never auto-decide.
|
|
34
|
+
|
|
35
|
+
## Reversible vs irreversible — classify before every decision (takes seconds)
|
|
36
|
+
|
|
37
|
+
- **Two-way door (reversible):** move fast, correct later. Almost all code, refactors, doc edits, experiments. → decide+act. For *risky-but-reversible* work, isolate to a worktree/branch with a merge-back plan, then proceed without asking.
|
|
38
|
+
- **One-way door (irreversible / high blast-radius):** destructive data delete with no backup, a deploy that immediately affects external users, leaking a secret, a stated-constraint violation. → rung 6. Slow down, confirm.
|
|
39
|
+
|
|
40
|
+
Applying the wrong process to either type is the real failure mode — one-way-door caution on a two-way-door task trains the user to expect overhead on routine work.
|
|
41
|
+
|
|
42
|
+
**Reversibility is context-dependent — judge the actual undo cost, don't pattern-match the verb.** A "release" or "publish" is *not* automatically one-way. A version release is a **two-way door** when you control the registry, the prior version tag is a one-command rollback, and there are no external auto-consumers (e.g. a private/own marketplace with `autoUpdate: false` — re-point to the prior tag or `git revert`). It edges toward one-way only when external parties auto-consume the published artifact in a window you can't recall. Ask "what does undoing this actually cost?" — if the answer is "revert a commit / re-point a tag," it's two-way; act.
|
|
43
|
+
|
|
44
|
+
## Token / effort posture — gauge it, default to the user's signal
|
|
45
|
+
|
|
46
|
+
Read whether the user wants **expansive** (keep going, spend tokens, make the session count, unwind later) or **conservative** (quick, cheap, minimal). Signals:
|
|
47
|
+
|
|
48
|
+
- **Expansive:** "keep going", "don't stop", "spend tokens", "make it count", "be thorough", "use workers/subagents", "go for the improvement", pushing more scope each turn.
|
|
49
|
+
- **Conservative:** "quick", "just", "small", "cheap", "conserve", "don't over-engineer", "minimal", hesitation about cost.
|
|
50
|
+
- **Ambiguous → infer from session momentum + standing preference, and state your read.** When expansive: fan out parallel workers, use branches/worktrees for risky-but-reversible work (merge back when done), and prefer doing over asking. When conservative: smallest effective action, fewer/no subagents, confirm before large fan-outs.
|
|
51
|
+
|
|
52
|
+
State the posture you're operating under when it materially shapes the turn ("operating expansive — spending tokens, using N workers") so the user can correct it cheaply.
|
|
53
|
+
|
|
54
|
+
## Parallel-work doctrine (decentralized execution)
|
|
55
|
+
|
|
56
|
+
- Decompose into **MECE** chunks (disjoint file ownership) so workers don't collide; the orchestrator owns git (single-writer) and workers never commit.
|
|
57
|
+
- Fan-out width follows `scripts/parallelism.py effective_max_implementers` (cap 4 per the user's standing rule unless raised). Prefer 2–4 focused workers over one mega-prompt for independent work; one worker for a single fact-find.
|
|
58
|
+
- **Risky-but-reversible parallel work → isolated worktrees, merge back.** Two writers on one worktree race on HEAD/index — isolate, then collapse to main at close (Phase D / `collapse_run.py`).
|
|
59
|
+
- Workers return condensed structured results; the orchestrator (Thinking tier) synthesizes and verifies — cheaper-tier output is never trusted unchecked.
|
|
60
|
+
|
|
61
|
+
## Anti-patterns
|
|
62
|
+
|
|
63
|
+
- **Asking permission for reversible work** — inverts the two-door framework; trains the user to expect overhead.
|
|
64
|
+
- **Idling while parallel work exists** — surfacing "waiting on X" without advancing Y.
|
|
65
|
+
- **Reporting uncertainty as a stop** — 70% is a green light, not a blocker.
|
|
66
|
+
- **Escalating at the wrong altitude** — asking the human what memory, the code, the web, a peer, or a persona panel could answer.
|
|
67
|
+
- **Partial execution while disagreeing** — log dissent and execute fully, or don't execute; never the mushy middle.
|
|
68
|
+
- **Convening an irrelevant persona panel** — generic voices add noise; only the stakeholders the decision touches.
|
|
69
|
+
|
|
70
|
+
## Attribution
|
|
71
|
+
|
|
72
|
+
Principles distilled from: Marquet, *Turn the Ship Around!* (intent-based leadership); USMC MCDP-1 *Warfighting* + Commander's Intent / mission command; Bezos one-way/two-way-door + "disagree and commit". Synthesized as guidance — used for *how to decide*, not copied. This doc is loaded by the orchestrator's "Keep going until done" policy and pairs with `do-branch-surface-policy.md` (the mechanical action ladder) and `autonomy_gate.py` (the gate of record).
|
|
@@ -0,0 +1,284 @@
|
|
|
1
|
+
<!-- SPDX-FileCopyrightText: 2025-2026 Tyrone Ross, Jr <46267523+tyroneross@users.noreply.github.com> | SPDX-License-Identifier: Apache-2.0 -->
|
|
2
|
+
|
|
3
|
+
# Memory — Global and Project-Scoped (full protocol)
|
|
4
|
+
|
|
5
|
+
> Loaded from `skills/build-loop/SKILL.md` summary. Contains the full memory system: global vs project stores, routing rules, and read/write policies.
|
|
6
|
+
|
|
7
|
+
## Memory — Global and Project-Scoped
|
|
8
|
+
|
|
9
|
+
Build-loop maintains one canonical long-term memory store at `~/dev/git-folder/build-loop-memory/`. Every build reads canonical indexes/folders; writes go to exactly one lane based on scope.
|
|
10
|
+
|
|
11
|
+
**Cross-project memory**: `build-loop-memory/lessons/` plus the sibling top-level lanes `design/`, `debugging/`, and `product/`
|
|
12
|
+
|
|
13
|
+
- Applies across every project this user builds.
|
|
14
|
+
- Examples: "Deployment to Vercel uses `vercel deploy --prebuilt` when `ENABLE_AUTH=true`"; "Neon is the default Postgres for Next.js 16 projects"; "TestFlight upload uses ASC API key from `~/.appstoreconnect/private_keys/`"; "User prefers zero-dep scripts over package additions".
|
|
15
|
+
- Structure: one file per fact/lesson/tool-discovery. Generated recall indexes live in `build-loop-memory/indexes/`.
|
|
16
|
+
- Types: `tool`, `deployment`, `library-choice`, `user-preference`, `pattern`.
|
|
17
|
+
|
|
18
|
+
**Project memory**: `build-loop-memory/projects/<slug>/` (slug derived via `scripts/_paths.derive_slug_from_cwd`)
|
|
19
|
+
|
|
20
|
+
- Applies only to the current project.
|
|
21
|
+
- Examples: "This app's design system lives in `src/styles/tokens.css`, not Tailwind"; "Routes under `/admin/` require `requireAdmin()` guard"; "The `custom_themes` table has a user_id VarChar bug from 2026-04-13 — see migration note".
|
|
22
|
+
- Same lane structure as top level: `decisions/`, `lessons/`, `debugging/`, `design/`, `product/`, and related domain folders.
|
|
23
|
+
- Types: `design`, `convention`, `gotcha`, `decision`, `contract`.
|
|
24
|
+
|
|
25
|
+
### Routing rule (always ask this question)
|
|
26
|
+
|
|
27
|
+
**"Would this apply to a different project?"**
|
|
28
|
+
|
|
29
|
+
- **Yes** → top-level canonical lane (`build-loop-memory/lessons/`, `design/`, `debugging/`, or `product/`). Deployment tools, library choices, general user preferences, reusable patterns.
|
|
30
|
+
- **No** → project canonical lane (`build-loop-memory/projects/<slug>/...`). Design tokens, internal APIs, project-specific gotchas, per-repo conventions.
|
|
31
|
+
- **Ambiguous** → ask the user once, then save. Don't guess.
|
|
32
|
+
|
|
33
|
+
### Artifact lanes & segmentation (issues / backlog / lessons)
|
|
34
|
+
|
|
35
|
+
Three work/knowledge artifact types, each with a clear WRITE → READ → TRACK lane. **Every lane is repo-segmented; the segmentation is mechanical, not discretionary** — so work on repo X never reads or writes repo Y's items.
|
|
36
|
+
|
|
37
|
+
| Artifact | Write (where) | Read / Track | Lifetime |
|
|
38
|
+
|---|---|---|---|
|
|
39
|
+
| **issues** | `<repo>/.build-loop/issues/<id>.md` — current-run bugs | Phase 5 Iterate drains them; repo-local so inherently scoped | short-lived (resolve → delete) |
|
|
40
|
+
| **backlog** | durable: `build-loop-memory/projects/<slug>/backlog.md` (slug folder = repo scope); active: `<repo>/.build-loop/backlog/<id>.md` | read before planning self-work; Phase 5 drains active items | long-lived |
|
|
41
|
+
| **backlog-archive** | `build-loop-memory/projects/<slug>/backlog-archive.md` | closed/moved/superseded items land here **with rationale + ref** — never deleted silently | durable |
|
|
42
|
+
| **lessons** | `projects/<slug>/lessons/` (project) OR top-level `lessons/` (cross-project, stored `_unscoped`) — via `memory_writer.py` | `context_bootstrap` recall scopes to `(slug OR _unscoped)` — never other projects | durable |
|
|
43
|
+
|
|
44
|
+
**Segmentation contract (binding):**
|
|
45
|
+
- The **slug folder** (`projects/<slug>/`) is the repo key; the **`repo` + `branch` frontmatter** on each issue/backlog item is the explicit scope tag (template: `templates/backlog-item.md`). Both must agree.
|
|
46
|
+
- When working repo X on branch B, **read and write only** items where `repo == X` (and `branch == B` or unscoped). A cross-repo item discovered mid-work is recorded in **its** repo's scope, **never** the current repo's tracker.
|
|
47
|
+
- **No shared/freeform cross-repo trackers.** (The retired `OPEN-ITEMS.md` was exactly this anti-pattern — one file that accreted rows from unrelated app repos into build-loop's scope. Replaced by the slug-segmented `projects/<slug>/backlog.md`.)
|
|
48
|
+
- Reads are already enforced: `context_bootstrap` queue reads are repo-local `.build-loop/`, and lessons recall passes the resolved `project` so the query scopes to `(project OR _unscoped)` — `project=None` (all-projects) is never used for current-work context.
|
|
49
|
+
|
|
50
|
+
### When to write memory
|
|
51
|
+
|
|
52
|
+
- User states a preference or convention: save immediately.
|
|
53
|
+
- A build surfaces a new tool/library/deployment pattern worth reusing: save after Review-F.
|
|
54
|
+
- A project-specific gotcha or decision emerges: save during Review-F Report.
|
|
55
|
+
- Do NOT save: ephemeral task details, things already derivable from code or git log, state that changes per build.
|
|
56
|
+
|
|
57
|
+
### When to read memory
|
|
58
|
+
|
|
59
|
+
- Always during Phase 1 ASSESS.
|
|
60
|
+
- Before deploying: check global deployment memory.
|
|
61
|
+
- Before UI work: check project design memory.
|
|
62
|
+
- Before adopting a new library: check global library-choice memory.
|
|
63
|
+
|
|
64
|
+
## Cross-session memory propagation + provenance schema (multi-process / multi-host)
|
|
65
|
+
|
|
66
|
+
Multiple build-loop sessions can run concurrently. Two scripts own the cross-session model end-to-end:
|
|
67
|
+
|
|
68
|
+
- `scripts/memory_writer.py` — canonical WRITER. Adds provenance frontmatter and appends to the index in one atomic operation.
|
|
69
|
+
- `scripts/memory_index.py` — append-only discovery log in the selected canonical lane.
|
|
70
|
+
- `scripts/memory_update_ledger.py` — global append-only audit/freshness log for the whole configured memory root.
|
|
71
|
+
|
|
72
|
+
### Provenance frontmatter (every memory file)
|
|
73
|
+
|
|
74
|
+
```yaml
|
|
75
|
+
---
|
|
76
|
+
name: <slug>
|
|
77
|
+
description: <one-line summary>
|
|
78
|
+
type: tool | deployment | library-choice | user-preference | pattern | feedback | reference | design | convention | gotcha | decision | contract
|
|
79
|
+
source_repo: "<git remote url or null>"
|
|
80
|
+
source_workdir: "<abs path>"
|
|
81
|
+
source_run_id: "run_<UTC>_<hash>"
|
|
82
|
+
source_host: "claude_code | codex | gemini | other"
|
|
83
|
+
cross_repo_validated: false # flips to true once a DIFFERENT repo applies it
|
|
84
|
+
applied_in_repos: [] # appended entries: {repo, workdir, run_id, applied_at}
|
|
85
|
+
created_at: "ISO8601 UTC"
|
|
86
|
+
last_updated_at: "ISO8601 UTC"
|
|
87
|
+
---
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
### Writer side — use memory_writer.py, never write memory files directly
|
|
91
|
+
|
|
92
|
+
**Top-level (cross-project) write** — `--scope top-level` routes to `build-loop-memory/lessons/` (or a sibling lane when `--file <lane>/x.md` is used):
|
|
93
|
+
|
|
94
|
+
```
|
|
95
|
+
python3 ${CLAUDE_PLUGIN_ROOT}/scripts/memory_writer.py \
|
|
96
|
+
--scope top-level \
|
|
97
|
+
write \
|
|
98
|
+
--file "<rel-path>" \
|
|
99
|
+
--name "<slug>" \
|
|
100
|
+
--description "<one-line>" \
|
|
101
|
+
--type feedback \
|
|
102
|
+
--run-id "$RUN_ID" \
|
|
103
|
+
--workdir "$PWD" \
|
|
104
|
+
--host claude_code \
|
|
105
|
+
--body-file /tmp/memory-body.md
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
**Project-scoped write** — `--scope project --project <slug>` routes to `build-loop-memory/projects/<slug>/lessons/` (or a sublane when `--file <sublane>/x.md` is used):
|
|
109
|
+
|
|
110
|
+
```
|
|
111
|
+
python3 ${CLAUDE_PLUGIN_ROOT}/scripts/memory_writer.py \
|
|
112
|
+
--scope project --project "$PROJECT_SLUG" \
|
|
113
|
+
write \
|
|
114
|
+
--file "<rel-path>" \
|
|
115
|
+
--name "<slug>" \
|
|
116
|
+
--description "<one-line>" \
|
|
117
|
+
--type gotcha \
|
|
118
|
+
--run-id "$RUN_ID" \
|
|
119
|
+
--workdir "$PWD" \
|
|
120
|
+
--host claude_code \
|
|
121
|
+
--body-file /tmp/memory-body.md
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
The writer auto-detects `source_repo` from the workdir's git remote, appends a row to the lane-local `INDEX.jsonl`, appends a row to the global update ledger at `indexes/updates.jsonl`, and (on update) preserves `created_at` + `applied_in_repos` so cross-repo validation history survives edits.
|
|
125
|
+
|
|
126
|
+
### Reader side — surface peer writes via INDEX.jsonl
|
|
127
|
+
|
|
128
|
+
Between phases (or at every M2 heartbeat), tail since your last check:
|
|
129
|
+
|
|
130
|
+
```
|
|
131
|
+
python3 ${CLAUDE_PLUGIN_ROOT}/scripts/memory_index.py tail \
|
|
132
|
+
--since "$LAST_INDEX_CHECK_TS" \
|
|
133
|
+
--exclude-run-id "$RUN_ID" \
|
|
134
|
+
--json
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
For each row:
|
|
138
|
+
1. Read the underlying memory file.
|
|
139
|
+
2. If `source_workdir` ≠ this `$PWD` AND `source_repo` ≠ this repo's git remote — tag `[CROSS-REPO — requires scrutiny]` in the phase brief.
|
|
140
|
+
3. Surface to the user with the memory's `description` field as the hook.
|
|
141
|
+
|
|
142
|
+
### Store side — global update ledger
|
|
143
|
+
|
|
144
|
+
Every canonical memory mutation should also append one JSONL row to:
|
|
145
|
+
|
|
146
|
+
```
|
|
147
|
+
<memory-root>/indexes/updates.jsonl
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
This is the store-wide ledger. It is not a replacement for lane-local `INDEX.jsonl`; the two logs have different jobs:
|
|
151
|
+
|
|
152
|
+
| Log | Scope | Primary job |
|
|
153
|
+
|---|---|---|
|
|
154
|
+
| `<lane>/INDEX.jsonl` | One memory lane | Peer discovery inside that lane |
|
|
155
|
+
| `indexes/updates.jsonl` | Whole memory root | Audit trail, freshness baseline, repair inventory |
|
|
156
|
+
|
|
157
|
+
Row schema:
|
|
158
|
+
|
|
159
|
+
```json
|
|
160
|
+
{
|
|
161
|
+
"ts": "2026-06-01T12:00:00Z",
|
|
162
|
+
"schema_version": 1,
|
|
163
|
+
"event_id": "<sha256-prefix>",
|
|
164
|
+
"project": "build-loop",
|
|
165
|
+
"lane": "decisions",
|
|
166
|
+
"action": "write",
|
|
167
|
+
"path": "projects/build-loop/decisions/0001-example.md",
|
|
168
|
+
"writer": "write_decision.py",
|
|
169
|
+
"run_id": "run_...",
|
|
170
|
+
"source_repo": "<git remote or omitted>",
|
|
171
|
+
"source_workdir": "<absolute workdir or omitted>",
|
|
172
|
+
"source_commit": "<repo HEAD represented by this memory update>",
|
|
173
|
+
"source_host": "codex",
|
|
174
|
+
"memory_id": "0001",
|
|
175
|
+
"summary": "Short human hook",
|
|
176
|
+
"sha256": "<content hash when available>",
|
|
177
|
+
"metadata": {}
|
|
178
|
+
}
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
`memory_writer.py`, `write_decision.py`, and `append_milestone.py` emit this ledger row automatically. Direct writes to memory files should be treated as legacy or repair work because they bypass provenance, discovery, and freshness.
|
|
182
|
+
|
|
183
|
+
CLI:
|
|
184
|
+
|
|
185
|
+
```
|
|
186
|
+
python3 ${CLAUDE_PLUGIN_ROOT}/scripts/memory_update_ledger.py tail \
|
|
187
|
+
--project "$PROJECT_SLUG" \
|
|
188
|
+
--limit 20 \
|
|
189
|
+
--json
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
### Trust gradient — mark-applied flow
|
|
193
|
+
|
|
194
|
+
When a memory written elsewhere is successfully applied in the current repo, record it:
|
|
195
|
+
|
|
196
|
+
```
|
|
197
|
+
python3 ${CLAUDE_PLUGIN_ROOT}/scripts/memory_writer.py mark-applied \
|
|
198
|
+
--file "<rel-path>" \
|
|
199
|
+
--applying-repo "$THIS_REPO_REMOTE" \
|
|
200
|
+
--applying-workdir "$PWD" \
|
|
201
|
+
--applying-run-id "$RUN_ID"
|
|
202
|
+
```
|
|
203
|
+
|
|
204
|
+
Appends to `applied_in_repos[]` (deduped by `(repo, workdir)`) and flips `cross_repo_validated` to `true` once at least one applying repo differs from the source. Memories with `cross_repo_validated: true` AND `len(applied_in_repos) >= 2` have earned higher trust — independently verified to hold across distinct repos. Surface that distinction in Phase 1 Assess briefs as `[VALIDATED — applied in N repos]`.
|
|
205
|
+
|
|
206
|
+
### Migration — existing memory files
|
|
207
|
+
|
|
208
|
+
`memory_writer.py migrate` is an idempotent backfill that adds provenance frontmatter to existing memory files. Safe to re-run; skips any file that already has all required provenance keys.
|
|
209
|
+
|
|
210
|
+
```
|
|
211
|
+
python3 ${CLAUDE_PLUGIN_ROOT}/scripts/memory_writer.py migrate \
|
|
212
|
+
--run-id "$RUN_ID" \
|
|
213
|
+
--workdir "$PWD" \
|
|
214
|
+
--host claude_code \
|
|
215
|
+
--dry-run # inspect first; remove the flag to apply
|
|
216
|
+
```
|
|
217
|
+
|
|
218
|
+
Run once after this version of build-loop is installed; the migration completes immediately for memory dirs of ordinary size (the user's global memory at ~80 files migrates in well under a second).
|
|
219
|
+
|
|
220
|
+
### Concurrency
|
|
221
|
+
|
|
222
|
+
- `memory_writer.py write` — atomic tmpfile + os.replace; the memory file IS the lock.
|
|
223
|
+
- `memory_index.py append` — `fcntl.flock(LOCK_EX)` on `INDEX.jsonl.lock`; multi-writer safe across hosts.
|
|
224
|
+
- `memory_update_ledger.py append` — `fcntl.flock(LOCK_EX)` on `updates.jsonl.lock`; append-only and multi-writer safe.
|
|
225
|
+
|
|
226
|
+
## Append-only milestones (anti-rewrite-drift)
|
|
227
|
+
|
|
228
|
+
### The problem this solves
|
|
229
|
+
|
|
230
|
+
"Current state" files that are rewritten in place rot: the writer overwrites without fully reading, summaries drift from reality, and no one can tell which run produced a given snapshot. The fix is append-only by construction — a log that can only grow forward.
|
|
231
|
+
|
|
232
|
+
### What gets appended and when
|
|
233
|
+
|
|
234
|
+
Every build-loop run appends a single milestone record at **Review-G** via `scripts/append_milestone.py`. Each record captures what shipped and the repo HEAD sha at write time.
|
|
235
|
+
|
|
236
|
+
JSONL contract (frozen — sibling staleness-check reads this):
|
|
237
|
+
|
|
238
|
+
```
|
|
239
|
+
<memory-root>/projects/<slug>/milestones.jsonl
|
|
240
|
+
```
|
|
241
|
+
|
|
242
|
+
Each line:
|
|
243
|
+
|
|
244
|
+
```json
|
|
245
|
+
{"ts": "2026-05-30T12:00:00Z", "commit": "<sha>", "repo": "<dir-name>", "summary": "<what shipped>", "run_id": "<id|null>"}
|
|
246
|
+
```
|
|
247
|
+
|
|
248
|
+
### How to append
|
|
249
|
+
|
|
250
|
+
```
|
|
251
|
+
python3 ${CLAUDE_PLUGIN_ROOT}/scripts/append_milestone.py \
|
|
252
|
+
--workdir "$PWD" \
|
|
253
|
+
--summary "feat: shipped auth + dashboard" \
|
|
254
|
+
--run-id "$RUN_ID" \
|
|
255
|
+
--json
|
|
256
|
+
```
|
|
257
|
+
|
|
258
|
+
`--commit` and `--project` override the defaults (git HEAD and slug derived from `--workdir`). `--memory-root` overrides the default `~/dev/git-folder/build-loop-memory`.
|
|
259
|
+
|
|
260
|
+
Output: `{"appended": true, "path": "...", "line": "..."}` on success; `{"appended": false, "reason": "..."}` on fail-soft (non-git workdir, unwritable root). Exit 0 in both cases.
|
|
261
|
+
|
|
262
|
+
Idempotency: if the last line already has the same `commit` AND `summary`, the call is a no-op. Safe to re-run on retry.
|
|
263
|
+
|
|
264
|
+
### The core principle: pointer not duplicate
|
|
265
|
+
|
|
266
|
+
The milestone log is the **durable, never-rewritten** record of project progress. Other memory files (`lessons/`, `decisions/`, etc.) remain the authoritative content store. The milestone is a pointer — "at this commit, this run shipped this" — not a duplicated copy of their content.
|
|
267
|
+
|
|
268
|
+
> The rewrite-in-place pattern is what rots. Append-only logs + pointers resist drift by construction: you can always `tail` to see the latest state, `grep` to find when something shipped, and the sibling staleness-check can compare the latest milestone commit against the current HEAD to detect stale memory instantly.
|
|
269
|
+
|
|
270
|
+
Decisions use the existing `decisions/` lane (also append-only files, one file per decision). The milestone log adds the run-level "what shipped" layer that `decisions/` doesn't track.
|
|
271
|
+
|
|
272
|
+
### Staleness detection
|
|
273
|
+
|
|
274
|
+
`memory_staleness_check.py` now prefers the latest `source_commit` in `indexes/updates.jsonl` for the current project, then falls back to the latest milestone's `commit` field. It compares that baseline against `git rev-parse HEAD` in the project workdir. If HEAD has moved past the last memory update by the configured commit threshold, the project's memory is potentially stale and Phase 1 Assess should flag it.
|
|
275
|
+
|
|
276
|
+
Impact:
|
|
277
|
+
|
|
278
|
+
- A decision, lesson, migration, mark-applied, or milestone can refresh the memory baseline when it records `source_commit`.
|
|
279
|
+
- Older memory stores without `indexes/updates.jsonl` keep working because milestone fallback is unchanged.
|
|
280
|
+
- A stale warning means "no durable memory update has been recorded for this project at or near HEAD"; it does not prove every individual memory file is stale.
|
|
281
|
+
|
|
282
|
+
### Concurrency
|
|
283
|
+
|
|
284
|
+
`fcntl.flock(LOCK_EX)` on `milestones.jsonl.lock` — same pattern as `memory_index.py`. Multi-writer safe.
|