@tyroneross/build-loop 0.36.0 → 0.43.0
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 +2 -2
- package/.claude-plugin/marketplace.json +3 -3
- package/.claude-plugin/plugin.json +1 -1
- package/.codex-plugin/plugin.json +1 -1
- package/.cursor/rules/build-loop-surface.mdc +12 -11
- package/.cursor/rules/skill-index.mdc +33 -0
- package/AGENTS.md +213 -34
- package/README.md +99 -31
- package/agents/advisor.md +4 -4
- package/agents/alignment-checker.md +2 -2
- package/agents/architecture-scout.md +4 -4
- package/agents/build-orchestrator.md +38 -36
- package/agents/database-assessor.md +11 -5
- package/agents/design-contract-specialist.md +8 -8
- package/agents/fact-checker.md +13 -3
- package/agents/fix-critique.md +2 -2
- package/agents/independent-auditor.md +60 -7
- package/agents/leak-scanner.md +82 -0
- package/agents/overfitting-reviewer.md +2 -2
- package/agents/plan-critic.md +1 -1
- package/agents/promotion-reviewer.md +5 -5
- package/agents/retrospective-synthesizer.md +138 -35
- package/agents/scope-auditor.md +82 -11
- package/agents/security-reviewer.md +56 -2
- package/agents/self-improvement-architect.md +17 -3
- package/agents/transcript-pattern-miner.md +5 -5
- package/agents/ui-validator.md +1 -1
- package/bin/build-loop-debugger.js +143 -0
- package/bin/build-loop-install.js +1 -4
- package/bin/build-loop-load-probe.js +345 -0
- package/codex-skills/build-loop/SKILL.md +28 -6
- package/commands/feedback.md +37 -0
- package/dist/src/interactive-verifier.d.ts +1 -14
- package/dist/src/interactive-verifier.d.ts.map +1 -1
- package/dist/src/interactive-verifier.js +6 -113
- package/dist/src/interactive-verifier.js.map +1 -1
- package/dist/src/quality.d.ts +5 -0
- package/dist/src/quality.d.ts.map +1 -0
- package/dist/src/quality.js +81 -0
- package/dist/src/quality.js.map +1 -0
- package/dist/src/storage.d.ts.map +1 -1
- package/dist/src/storage.js +37 -3
- package/dist/src/storage.js.map +1 -1
- package/docs/agent-surface-policy.md +35 -31
- package/docs/memory-setup.md +19 -0
- package/hooks/git/pre-push +65 -4
- package/hooks/hooks.json +95 -38
- package/hooks/pre-commit +20 -1
- package/hooks/pre-edit-rally-point.sh +10 -3
- package/hooks/session-start-codex-hook-trust.sh +30 -0
- package/hooks/session-start-git-hooks.sh +3 -1
- package/hooks/session-start-rally-point.sh +52 -4
- package/hooks/session-start-worktree-gc.sh +47 -94
- package/hooks/stop-transcript-sweep.sh +173 -0
- package/hooks/test_closeout.sh +14 -2
- package/package.json +8 -7
- package/scripts/README.md +1 -1
- package/scripts/_paths.py +65 -0
- package/scripts/groundwork_exchange.py +1012 -0
- package/scripts/install_memory.py +33 -1
- package/scripts/lessons_index/ingest.py +13 -2
- package/scripts/lessons_index/query.py +36 -13
- package/scripts/memory_context/__init__.py +108 -14
- package/scripts/memory_graph/__init__.py +5 -1
- package/scripts/project_resolver.py +42 -36
- package/scripts/sync_plugin_cache.py +37 -2
- package/skills/agent-rally-point/SKILL.md +46 -0
- package/skills/api-registry-bridge/SKILL.md +1 -1
- package/skills/architecture/dead/SKILL.md +1 -1
- package/skills/architecture/impact/SKILL.md +1 -1
- package/skills/architecture/review/SKILL.md +1 -1
- package/skills/architecture/rules/SKILL.md +3 -3
- package/skills/architecture/scan/SKILL.md +1 -1
- package/skills/architecture/trace/SKILL.md +1 -1
- package/skills/attribution-standard/SKILL.md +6 -6
- package/skills/auto-decision-capture/SKILL.md +31 -2
- package/skills/auto-finding-capture/SKILL.md +28 -1
- package/skills/build-loop/SKILL.md +131 -23
- package/skills/build-loop/fallbacks.md +16 -21
- package/skills/build-loop/phases/ui-validation.md +2 -2
- package/skills/build-loop/references/advisor-dispatch-ladder.md +1 -1
- package/skills/build-loop/references/apple-native-planning.md +1 -1
- package/skills/build-loop/references/autonomous-and-per-commit-modes.md +11 -5
- package/skills/build-loop/references/autonomy-dashboard.md +115 -0
- package/skills/build-loop/references/capability-routing.md +24 -2
- package/skills/build-loop/references/coordination.md +24 -6
- package/skills/build-loop/references/experiment-results-template.md +15 -3
- package/skills/build-loop/references/leadership.md +1 -1
- package/skills/build-loop/references/memory.md +14 -3
- package/skills/build-loop/references/modular-systems-pack.md +8 -0
- package/skills/build-loop/references/output-style.md +86 -0
- package/skills/build-loop/references/phase-1-assess.md +102 -2
- package/skills/build-loop/references/phase-2-plan.md +9 -1
- package/skills/build-loop/references/phase-3-execute.md +5 -2
- package/skills/build-loop/references/phase-4-review.md +85 -8
- package/skills/build-loop/references/phase-5-iterate.md +76 -8
- package/skills/build-loop/references/phase-6-learn.md +10 -17
- package/skills/build-loop/references/privileged-request-broker.md +254 -0
- package/skills/build-loop/references/resource-aware-execution.md +183 -0
- package/skills/build-loop/references/self-recursive-dev.md +2 -2
- package/skills/build-loop/references/status-output-format.md +207 -0
- package/skills/build-loop/references/verify-dispatch.md +56 -2
- package/skills/building-with-deepagents/SKILL.md +1 -1
- package/skills/claim-scope/SKILL.md +185 -0
- package/skills/color-engine/SKILL.md +103 -0
- package/skills/color-engine/_core.py +464 -0
- package/skills/color-engine/color_engine.py +175 -0
- package/skills/cost-rca/SKILL.md +61 -0
- package/skills/data-plane-worktrees/SKILL.md +139 -0
- package/skills/data-plane-worktrees/agents/openai.yaml +4 -0
- package/skills/database-practice/SKILL.md +200 -0
- package/skills/database-practice/references/diagnostic-queries.sql +126 -0
- package/skills/database-practice/references/vector-and-graph-tuning.md +208 -0
- package/skills/database-practice/scripts/db_table_map.py +1244 -0
- package/skills/database-practice/scripts/test_db_table_map.py +514 -0
- package/skills/debug-loop/SKILL.md +36 -6
- package/skills/debugging-memory/SKILL.md +32 -430
- package/skills/debugging-memory/references/pattern-extraction.md +4 -4
- package/skills/debugging-memory/references/search.md +32 -120
- package/skills/debugging-memory/references/store.md +32 -126
- package/skills/debugging-memory/references/subagent-integration.md +1 -1
- package/skills/decision-queue/SKILL.md +251 -0
- package/skills/decision-queue/assets/template.html +1242 -0
- package/skills/decision-queue/references/example-large-queue-batching.md +164 -0
- package/skills/decision-queue/scripts/regen_template_constants.py +160 -0
- package/skills/defenseclaw-bridge/SKILL.md +2 -2
- package/skills/defenseclaw-bridge/references/dc-config-mapping.md +2 -9
- package/skills/drain-proposals/SKILL.md +53 -0
- package/skills/focused-loop-builder/SKILL.md +31 -0
- package/skills/focused-loop-builder/references/spec-format.md +27 -0
- package/skills/handoff/SKILL.md +169 -8
- package/skills/ibr-bridge/SKILL.md +4 -1
- package/skills/knowledge/SKILL.md +26 -14
- package/skills/knowledge/references/review-mode.md +2 -3
- package/skills/knowledge/templates/madr-minimal.md +1 -1
- package/skills/mcp-builder/SKILL.md +1 -1
- package/skills/model-bakeoff/SKILL.md +48 -10
- package/skills/model-tiering/SKILL.md +92 -31
- package/skills/native-ax-driver/SKILL.md +38 -5
- package/skills/native-ax-driver/scripts/native_driver.py +278 -22
- package/skills/native-ax-driver/scripts/test_native_driver.py +227 -0
- package/skills/optimize/SKILL.md +1 -1
- package/skills/plugin-builder/SKILL.md +48 -1
- package/skills/plugin-builder/references/build-loop-phase-guidance.md +3 -4
- package/skills/plugin-builder/references/distribution.md +13 -2
- package/skills/plugin-builder/references/plugin-hygiene-lessons.md +2 -2
- package/skills/plugin-tests/SKILL.md +2 -2
- package/skills/recursive-retrospective/SKILL.md +1 -1
- package/skills/repo-closeout/SKILL.md +17 -0
- package/skills/repo-closeout/agents/openai.yaml +4 -0
- package/skills/repo-maintenance/SKILL.md +179 -0
- package/skills/repo-maintenance/agents/openai.yaml +4 -0
- package/skills/repo-maintenance/references/pre-public-hygiene.md +134 -0
- package/skills/repo-maintenance/references/repository-taxonomy.md +161 -0
- package/skills/repo-maintenance/references/safety-protocol.md +106 -0
- package/skills/repo-maintenance/references/stack-profiles.md +138 -0
- package/skills/repo-maintenance/scripts/audit_repo_maintenance.py +1198 -0
- package/skills/repo-maintenance/scripts/test_audit_repo_maintenance.py +506 -0
- package/skills/repository-intelligence/SKILL.md +189 -0
- package/skills/repository-intelligence/agents/openai.yaml +4 -0
- package/skills/repository-intelligence/references/assessment-rubric.md +88 -0
- package/skills/repository-intelligence/scripts/repository_inventory.py +347 -0
- package/skills/research/SKILL.md +12 -2
- package/skills/root-cause-analysis/SKILL.md +1 -1
- package/skills/runtime-parity-verification/SKILL.md +36 -1
- package/skills/security-methodology/SKILL.md +23 -10
- package/skills/security-methodology/references/agentic-handoff-templates.md +220 -0
- package/skills/security-methodology/references/cross-source-matrix.md +1 -1
- package/skills/security-methodology/references/owasp-agentic-top-10.md +1 -1
- package/skills/security-scan/SKILL.md +55 -15
- package/skills/self-improve/SKILL.md +70 -50
- package/skills/silent-assumptions/SKILL.md +341 -0
- package/skills/silent-assumptions/references/elicitation-detectors.md +342 -0
- package/skills/spec-writing/SKILL.md +128 -24
- package/skills/spec-writing/scripts/check_checklist.py +114 -15
- package/skills/ui-design/SKILL.md +6 -4
- package/skills/ui-design/references/color-engine.md +132 -0
- package/skills/ui-design/references/design-preferences-from-owned-apps.md +8 -8
- package/skills/ui-design/references/ui-guidance-sources.md +1 -1
- package/skills/ui-design/references/universal-design-principles.alt.md +2 -2
- package/plugin-artifacts/codex/.codex-plugin/plugin.json +0 -41
- package/plugin-artifacts/codex/AGENTS.md +0 -560
- package/plugin-artifacts/codex/BUILD-ARTIFACT.md +0 -5
- package/plugin-artifacts/codex/LICENSE +0 -202
- package/plugin-artifacts/codex/README.md +0 -313
- package/plugin-artifacts/codex/assets/build-loop-plugin-icon.png +0 -0
- package/plugin-artifacts/codex/docs/agent-surface-policy.md +0 -63
- package/plugin-artifacts/codex/references/advisor-dispatch-ladder.md +0 -62
- package/plugin-artifacts/codex/references/agent-role-taxonomy.md +0 -135
- package/plugin-artifacts/codex/references/autonomous-and-per-commit-modes.md +0 -161
- package/plugin-artifacts/codex/references/autonomy-config.md +0 -231
- package/plugin-artifacts/codex/references/backlog-system.md +0 -285
- package/plugin-artifacts/codex/references/capability-routing.md +0 -231
- package/plugin-artifacts/codex/references/codex-subagents.md +0 -106
- package/plugin-artifacts/codex/references/coordination-file-template.md +0 -181
- package/plugin-artifacts/codex/references/coordination-rules.md +0 -552
- package/plugin-artifacts/codex/references/dogfood-reload-checkpoint.md +0 -112
- package/plugin-artifacts/codex/references/halt-and-ask-protocol.md +0 -102
- package/plugin-artifacts/codex/references/implementer-envelope-schema.md +0 -302
- package/plugin-artifacts/codex/references/intent-capability-pack.md +0 -257
- package/plugin-artifacts/codex/references/intent-exploration-prompts.md +0 -96
- package/plugin-artifacts/codex/references/leadership.md +0 -72
- package/plugin-artifacts/codex/references/memory-systems.md +0 -261
- package/plugin-artifacts/codex/references/memory.md +0 -313
- package/plugin-artifacts/codex/references/model-tier-mapping.md +0 -296
- package/plugin-artifacts/codex/references/modular-systems-pack.md +0 -96
- package/plugin-artifacts/codex/references/phase-1-assess.md +0 -249
- package/plugin-artifacts/codex/references/phase-2-plan.md +0 -86
- package/plugin-artifacts/codex/references/phase-3-execute.md +0 -49
- package/plugin-artifacts/codex/references/phase-4-review.md +0 -341
- package/plugin-artifacts/codex/references/phase-5-iterate.md +0 -72
- package/plugin-artifacts/codex/references/phase-6-learn.md +0 -58
- package/plugin-artifacts/codex/references/recent-design-structures.md +0 -274
- package/plugin-artifacts/codex/references/research-trigger-policy.md +0 -140
- package/plugin-artifacts/codex/references/runtime-smoke-triggers.md +0 -42
- package/plugin-artifacts/codex/references/self-review.md +0 -234
- package/plugin-artifacts/codex/references/single-writer-commit-protocol.md +0 -90
- package/plugin-artifacts/codex/references/task-capture-policy.md +0 -68
- package/plugin-artifacts/codex/references/ui-io-contract.md +0 -116
- package/plugin-artifacts/codex/references/ui-spotcheck-protocol.md +0 -65
- package/plugin-artifacts/codex/references/verify-dispatch.md +0 -85
- package/plugin-artifacts/codex/skills/build-loop/SKILL.md +0 -381
- package/plugin-artifacts/codex/skills/build-loop/detect-plugins.mjs +0 -82
- package/plugin-artifacts/codex/skills/build-loop/eval-guide.md +0 -65
- package/plugin-artifacts/codex/skills/build-loop/fallbacks.md +0 -549
- package/plugin-artifacts/codex/skills/build-loop/phases/fact-check.md +0 -42
- package/plugin-artifacts/codex/skills/build-loop/phases/ui-validation.md +0 -267
- package/plugin-artifacts/codex/skills/build-loop/references/advisor-dispatch-ladder.md +0 -62
- package/plugin-artifacts/codex/skills/build-loop/references/apple-native-planning.md +0 -439
- package/plugin-artifacts/codex/skills/build-loop/references/autonomous-and-per-commit-modes.md +0 -161
- package/plugin-artifacts/codex/skills/build-loop/references/capability-routing.md +0 -231
- package/plugin-artifacts/codex/skills/build-loop/references/codex-subagents.md +0 -106
- package/plugin-artifacts/codex/skills/build-loop/references/coordination.md +0 -161
- package/plugin-artifacts/codex/skills/build-loop/references/correction-aware-capture.md +0 -177
- package/plugin-artifacts/codex/skills/build-loop/references/experiment-results-template.md +0 -101
- package/plugin-artifacts/codex/skills/build-loop/references/independent-auditor.md +0 -72
- package/plugin-artifacts/codex/skills/build-loop/references/intent-capability-pack.md +0 -257
- package/plugin-artifacts/codex/skills/build-loop/references/intent-exploration-prompts.md +0 -96
- package/plugin-artifacts/codex/skills/build-loop/references/leadership.md +0 -72
- package/plugin-artifacts/codex/skills/build-loop/references/memory.md +0 -313
- package/plugin-artifacts/codex/skills/build-loop/references/modular-systems-pack.md +0 -96
- package/plugin-artifacts/codex/skills/build-loop/references/output-style.md +0 -222
- package/plugin-artifacts/codex/skills/build-loop/references/pay-it-forward-arch.md +0 -98
- package/plugin-artifacts/codex/skills/build-loop/references/phase-1-assess.md +0 -249
- package/plugin-artifacts/codex/skills/build-loop/references/phase-2-plan.md +0 -86
- package/plugin-artifacts/codex/skills/build-loop/references/phase-3-execute.md +0 -49
- package/plugin-artifacts/codex/skills/build-loop/references/phase-4-review.md +0 -341
- package/plugin-artifacts/codex/skills/build-loop/references/phase-5-iterate.md +0 -72
- package/plugin-artifacts/codex/skills/build-loop/references/phase-6-learn.md +0 -58
- package/plugin-artifacts/codex/skills/build-loop/references/recent-design-structures.md +0 -274
- package/plugin-artifacts/codex/skills/build-loop/references/refactor-history/ASSESSMENT.md +0 -85
- package/plugin-artifacts/codex/skills/build-loop/references/refactor-history/STANDALONE_TEST_RUN.md +0 -149
- package/plugin-artifacts/codex/skills/build-loop/references/refactor-history/scenarios/01-simple-bugfix.md +0 -32
- package/plugin-artifacts/codex/skills/build-loop/references/refactor-history/scenarios/02-ui-build-with-iteration.md +0 -48
- package/plugin-artifacts/codex/skills/build-loop/references/refactor-history/scenarios/03-multi-failure-escalation.md +0 -60
- package/plugin-artifacts/codex/skills/build-loop/references/refactor-history/scenarios/04-ui-build-ibr-absent.md +0 -51
- package/plugin-artifacts/codex/skills/build-loop/references/refactor-history/scenarios/05-refactor-navgator-absent.md +0 -71
- package/plugin-artifacts/codex/skills/build-loop/references/refactor-history/scenarios/06-recurring-bug-debugger-absent.md +0 -52
- package/plugin-artifacts/codex/skills/build-loop/references/refactor-history/trace-comparison.md +0 -202
- package/plugin-artifacts/codex/skills/build-loop/references/self-recursive-dev.md +0 -77
- package/plugin-artifacts/codex/skills/build-loop/references/self-review.md +0 -234
- package/plugin-artifacts/codex/skills/build-loop/references/ui-io-contract.md +0 -116
- package/plugin-artifacts/codex/skills/build-loop/references/verify-dispatch.md +0 -85
- package/plugin-artifacts/codex/skills/build-loop/scanners/audit-design-rules.mjs +0 -476
- package/plugin-artifacts/codex/skills/build-loop/scanners/require-visual-evidence.mjs +0 -239
- package/plugin-artifacts/codex/skills/build-loop/templates/backlog-item.md +0 -35
- package/plugin-artifacts/codex/skills/build-loop/templates/codex-worker-prompt.md +0 -100
- package/plugin-artifacts/codex/skills/build-loop/templates/ui-subagent-prompt.md +0 -179
- package/plugin-artifacts/codex/skills/build-loop/templates/ux-fix-plan.md +0 -40
- package/scripts/build_codex_plugin_artifact.py +0 -321
|
@@ -1,140 +1,52 @@
|
|
|
1
|
-
<!-- PROVENANCE: op=search reference for
|
|
1
|
+
<!-- PROVENANCE: op=search reference for build-loop:debugging-memory. Native core refreshed from @tyroneross/claude-code-debugger v1.9.0 at 74cc2cc96ce7c212a81d41b85143dc1fc9094bc3 on 2026-08-25. -->
|
|
2
2
|
|
|
3
3
|
<!-- SPDX-FileCopyrightText: 2025-2026 Tyrone Ross, Jr <46267523+tyroneross@users.noreply.github.com> | SPDX-License-Identifier: Apache-2.0 -->
|
|
4
4
|
|
|
5
|
-
# Debugging Memory
|
|
5
|
+
# Native Debugging Memory Search
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
Build Loop owns this debugger. It does not require the standalone Coding Debugger package or MCP server. Search and store both use the project's structured `.claude/memory/` root.
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
## Invoke
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
Before investigating a bug, run:
|
|
12
12
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
```bash
|
|
14
|
+
node "${CLAUDE_PLUGIN_ROOT}/bin/build-loop-debugger.js" search "<symptom>" \
|
|
15
|
+
--threshold 0.6 --workdir "$PWD"
|
|
16
|
+
```
|
|
16
17
|
|
|
17
|
-
|
|
18
|
+
The command returns JSON with `memory_root`, `debugger_core_version`, and a verdict:
|
|
18
19
|
|
|
19
|
-
|
|
20
|
+
- `KNOWN_FIX`: direct-apply only if the strict gate passes.
|
|
21
|
+
- `LIKELY_MATCH`: use the incident as a hypothesis and run the normal fix loop.
|
|
22
|
+
- `WEAK_SIGNAL`: consider the result, but investigate fresh.
|
|
23
|
+
- `NO_MATCH`: investigate fresh and store the verified result afterward.
|
|
20
24
|
|
|
21
|
-
|
|
25
|
+
## Strict direct-apply gate
|
|
22
26
|
|
|
23
|
-
|
|
27
|
+
All three checks must pass:
|
|
24
28
|
|
|
25
|
-
1.
|
|
26
|
-
2.
|
|
27
|
-
3.
|
|
28
|
-
4. **NO_MATCH**: Proceed with standard debugging via `build-loop:debug-loop`, then document the solution after
|
|
29
|
+
1. At least one recorded file exists at the same relative path.
|
|
30
|
+
2. Recorded dependency versions match the current project within minor version. Missing version evidence fails this check.
|
|
31
|
+
3. A second signal matches: error class, callsite, or a corroborating log entry.
|
|
29
32
|
|
|
30
|
-
|
|
33
|
+
React-hook, performance, and "increase a limit" fixes never direct-apply because they are context-sensitive.
|
|
31
34
|
|
|
32
|
-
|
|
35
|
+
## Retrieval depth
|
|
33
36
|
|
|
34
|
-
|
|
35
|
-
2. **version_match**: dependency versions in the prior incident match current within minor (semver). If the prior incident's `tags` include a version, compare it to current `package.json`/`requirements.txt`/etc.
|
|
36
|
-
3. **second_signal**: at least one secondary signal — same error class, same callsite line range, or same component layer
|
|
37
|
+
The initial search returns compact matches. Load a full incident only when needed:
|
|
37
38
|
|
|
38
|
-
|
|
39
|
+
```bash
|
|
40
|
+
node "${CLAUDE_PLUGIN_ROOT}/bin/build-loop-debugger.js" detail <INC_ID> --workdir "$PWD"
|
|
41
|
+
```
|
|
39
42
|
|
|
40
|
-
|
|
43
|
+
Announce the search and report whether it found a match. Store the verified outcome through the same native command described in `store.md`.
|
|
41
44
|
|
|
42
|
-
|
|
43
|
-
2. **Drill down**: read the local issue file or, for Coding Debugger matches, use `detail` with the ID
|
|
44
|
-
3. **Outcome tracking**: for Coding Debugger matches, use `outcome` to record whether the fix worked
|
|
45
|
+
## Lifecycle
|
|
45
46
|
|
|
46
|
-
|
|
47
|
+
- Phase 1 Assess: search for relevant project incidents.
|
|
48
|
+
- Review-B failure: search the exact current error before changing code.
|
|
49
|
+
- Each Iterate attempt: search again if the symptom changes.
|
|
50
|
+
- Review-F: store every newly resolved, verified incident.
|
|
47
51
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
1. **Before searching**: "Checking debugging memory for similar issues..."
|
|
51
|
-
2. **After search**: "Found X matching incident(s) from past debugging sessions" or "No matching incidents — starting fresh investigation"
|
|
52
|
-
|
|
53
|
-
## Deep Investigation Mode
|
|
54
|
-
|
|
55
|
-
For non-trivial issues, escalate to the `build-loop:debug-loop` skill. Trigger is the **verdict category**, not a numeric confidence score:
|
|
56
|
-
|
|
57
|
-
- **`KNOWN_FIX`** → apply directly, skip the loop
|
|
58
|
-
- **`LIKELY_MATCH`** → enter debug loop (past incidents need verification against current context)
|
|
59
|
-
- **`WEAK_SIGNAL`** → enter debug loop (loosely related, fresh investigation needed)
|
|
60
|
-
- **`NO_MATCH`** → enter debug loop (no prior knowledge)
|
|
61
|
-
|
|
62
|
-
Also enter the debug loop when:
|
|
63
|
-
- Initial diagnosis feels superficial
|
|
64
|
-
- Previous fix didn't hold
|
|
65
|
-
- User explicitly asks for root-cause analysis
|
|
66
|
-
- Multiple symptoms suggest a shared cause
|
|
67
|
-
|
|
68
|
-
## Basic Steps (simple, clear-cut issues)
|
|
69
|
-
|
|
70
|
-
1. **Reproduce** — exact steps, environmental factors, minimal repro
|
|
71
|
-
2. **Isolate** — binary search recent changes, disable components, check logs
|
|
72
|
-
3. **Diagnose** — trace execution, examine state, identify offending code
|
|
73
|
-
4. **Fix** — minimal, targeted, no side effects
|
|
74
|
-
5. **Verify** — original repro, related tests, regression check
|
|
75
|
-
|
|
76
|
-
## Incident Documentation
|
|
77
|
-
|
|
78
|
-
After fixing a bug, store via `build-loop:debugging-memory` `{op:"store"}`. Required fields: `symptom`, `root_cause`, `fix`. Optional: `category`, `tags`, `files_changed`, `file`.
|
|
79
|
-
|
|
80
|
-
## Quality Indicators
|
|
81
|
-
|
|
82
|
-
The memory system scores incidents on:
|
|
83
|
-
- Root cause analysis depth (30%)
|
|
84
|
-
- Fix documentation completeness (30%)
|
|
85
|
-
- Verification status (20%)
|
|
86
|
-
- Tags and metadata (20%)
|
|
87
|
-
|
|
88
|
-
Target 75%+ quality score for effective future retrieval.
|
|
89
|
-
|
|
90
|
-
## Tagging Strategy
|
|
91
|
-
|
|
92
|
-
- Technology: `react`, `typescript`, `api`, `database`
|
|
93
|
-
- Category: `logic`, `config`, `dependency`, `performance`
|
|
94
|
-
- Symptom type: `crash`, `render`, `timeout`, `validation`
|
|
95
|
-
|
|
96
|
-
## Pattern Recognition
|
|
97
|
-
|
|
98
|
-
The memory system extracts patterns when 3+ similar incidents exist. Patterns have higher reliability than individual incidents. When a pattern matches, trust the solution template (90%+ confidence), apply the recommended approach, note caveats.
|
|
99
|
-
|
|
100
|
-
## Optional Coding Debugger Tools
|
|
101
|
-
|
|
102
|
-
| Tool | Purpose |
|
|
103
|
-
|------|---------|
|
|
104
|
-
| `search` | Search memory for similar bugs (returns verdict) |
|
|
105
|
-
| `store` | Store a new debugging incident |
|
|
106
|
-
| `detail` | Get full incident or pattern details |
|
|
107
|
-
| `status` | Show memory statistics |
|
|
108
|
-
| `list` | List recent incidents |
|
|
109
|
-
| `patterns` | List known fix patterns |
|
|
110
|
-
| `outcome` | Record whether a fix worked |
|
|
111
|
-
|
|
112
|
-
Use these only when standalone Coding Debugger is installed. Build-loop does not register these MCP tools itself.
|
|
113
|
-
|
|
114
|
-
## Review-F Outcome Feedback
|
|
115
|
-
|
|
116
|
-
Closes the memory-first gate's feedback loop. Both required:
|
|
117
|
-
|
|
118
|
-
- For each newly resolved Review-B/Iterate failure: invoke `build-loop:debugging-memory` `{op:"store"}` with `{symptom, root_cause, fix, tags: ["build-loop", project, layer], files}`
|
|
119
|
-
- For each Review-B memory gate where standalone Coding Debugger supplied a prior `KNOWN_FIX` or `LIKELY_MATCH`: invoke its `outcome` tool with `{incident_id, result: "worked"|"failed"|"modified", notes}` — this trains the optional verdict classifier
|
|
120
|
-
|
|
121
|
-
Skipping `outcome` means the optional verdict classifier never improves.
|
|
122
|
-
|
|
123
|
-
## Subagent Integration
|
|
124
|
-
|
|
125
|
-
When debugging involves subagents:
|
|
126
|
-
|
|
127
|
-
1. **Pre-query memory once** through `build-loop:debugging-memory` before spawning agents
|
|
128
|
-
2. **Distribute context** — each agent gets relevant subset
|
|
129
|
-
3. **Aggregate findings** — collect insights from all agents
|
|
130
|
-
4. **Store unified incident** — single `build-loop:debugging-memory` `{op:"store"}` call to document combined diagnosis
|
|
131
|
-
|
|
132
|
-
Subagents do not inherit Skill or MCP access — pre-load context into their prompt.
|
|
133
|
-
|
|
134
|
-
## Sibling Skills
|
|
135
|
-
|
|
136
|
-
- `build-loop:debugging-memory` `{op:"store"}` — write incident after fix
|
|
137
|
-
- `build-loop:debugging-memory` `{op:"assess"}` — parallel domain assessment for multi-domain symptoms
|
|
138
|
-
- `build-loop:debug-loop` — iterative root-cause analysis with causal-tree investigation
|
|
139
|
-
|
|
140
|
-
*Source: adapted from the debugger workflow lineage and maintained as a build-loop-native skill. Drift-checked by `build-loop:sync-skills`.*
|
|
52
|
+
`.build-loop/issues/` remains the executable/open-issue lane. Do not write resolved debugger history there.
|
|
@@ -1,145 +1,51 @@
|
|
|
1
|
-
<!-- PROVENANCE: op=store reference for
|
|
1
|
+
<!-- PROVENANCE: op=store reference for build-loop:debugging-memory. Native core refreshed from @tyroneross/claude-code-debugger v1.9.0 at 74cc2cc96ce7c212a81d41b85143dc1fc9094bc3 on 2026-08-25. -->
|
|
2
2
|
|
|
3
3
|
<!-- SPDX-FileCopyrightText: 2025-2026 Tyrone Ross, Jr <46267523+tyroneross@users.noreply.github.com> | SPDX-License-Identifier: Apache-2.0 -->
|
|
4
4
|
|
|
5
|
-
# Debugging Incident Storage
|
|
5
|
+
# Native Debugging Incident Storage
|
|
6
6
|
|
|
7
|
-
Persist
|
|
7
|
+
Persist verified fixes to the same `.claude/memory/` store searched by Build Loop's native debugger.
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
## Required payload
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
Create a temporary JSON file with:
|
|
12
12
|
|
|
13
|
-
- Phase 4 Review-F Report: for each Review-B/Iterate failure newly resolved this build, store the incident
|
|
14
|
-
- After any `build-loop:debug-loop` run that produced a verified fix
|
|
15
|
-
- User asks "save this fix", "remember this bug"
|
|
16
|
-
|
|
17
|
-
## Native Path — Build-Loop Incident Note
|
|
18
|
-
|
|
19
|
-
Write one incident note per resolved failure:
|
|
20
|
-
|
|
21
|
-
```bash
|
|
22
|
-
mkdir -p .build-loop/issues
|
|
23
|
-
```
|
|
24
|
-
|
|
25
|
-
Path:
|
|
26
|
-
|
|
27
|
-
```text
|
|
28
|
-
.build-loop/issues/YYYY-MM-DD-<short-slug>.md
|
|
29
|
-
```
|
|
30
|
-
|
|
31
|
-
Template:
|
|
32
|
-
|
|
33
|
-
```markdown
|
|
34
|
-
# <one-line symptom>
|
|
35
|
-
|
|
36
|
-
**Symptom**: <error string, failing command, or observed behavior>
|
|
37
|
-
**Root cause**: <technical cause plus first controllable system cause>
|
|
38
|
-
**Fix**: <what changed and why>
|
|
39
|
-
**Verification**: <commands, tests, or observed proof>
|
|
40
|
-
**Files**: <paths touched>
|
|
41
|
-
**Tags**: build-loop, <project>, <layer>, <framework>, <symptom-type>
|
|
42
|
-
**RCA framework**: <5 Whys | causal tree | fishbone | Kepner-Tregoe | differential diagnosis | falsification>
|
|
43
|
-
```
|
|
44
|
-
|
|
45
|
-
**Required**: `symptom`, `root_cause`, `fix`, `verification`. Everything else improves future retrieval.
|
|
46
|
-
|
|
47
|
-
## Optional Mirror — Coding Debugger MCP
|
|
48
|
-
|
|
49
|
-
If standalone Coding Debugger is installed and available, mirror the same incident:
|
|
50
|
-
|
|
51
|
-
```
|
|
52
|
-
mcp__plugin_coding_debugger__store({
|
|
53
|
-
symptom: "user-facing description (≤200 chars, preserves error type/file/key phrase)",
|
|
54
|
-
root_cause: "technical explanation of why",
|
|
55
|
-
fix: "what was changed",
|
|
56
|
-
category: "logic|config|dependency|performance|react-hooks",
|
|
57
|
-
tags: ["build-loop", "<project>", "<layer>", "<framework>", "<symptom-type>"],
|
|
58
|
-
files_changed: ["path/to/file1.ts", "path/to/file2.ts"],
|
|
59
|
-
file: "path/to/primary/problematic/file.ts"
|
|
60
|
-
})
|
|
61
|
-
```
|
|
62
|
-
|
|
63
|
-
Mirror failure is not a build failure. Report it as "local incident stored; Coding Debugger mirror unavailable."
|
|
64
|
-
|
|
65
|
-
## Tag Discipline
|
|
66
|
-
|
|
67
|
-
Always include:
|
|
68
|
-
- `"build-loop"` — distinguishes build-orchestrator origins from manual `/build-loop:debug` runs
|
|
69
|
-
- Project name (lowercase, slugified)
|
|
70
|
-
- Layer (`frontend`, `backend`, `database`, `infra`, `external`)
|
|
71
|
-
|
|
72
|
-
Add as relevant:
|
|
73
|
-
- Technology: `react`, `typescript`, `python`, `api`, `prisma`
|
|
74
|
-
- Category: `logic`, `config`, `dependency`, `performance`
|
|
75
|
-
- Symptom type: `crash`, `render`, `timeout`, `validation`
|
|
76
|
-
|
|
77
|
-
## Quality Score Targets
|
|
78
|
-
|
|
79
|
-
The memory system scores stored incidents:
|
|
80
|
-
- Root cause depth (30%)
|
|
81
|
-
- Fix documentation completeness (30%)
|
|
82
|
-
- Verification status (20%)
|
|
83
|
-
- Tags and metadata (20%)
|
|
84
|
-
|
|
85
|
-
Target 75%+. Score below 75% means future searches won't surface this incident reliably — pad the description and tags before storing.
|
|
86
|
-
|
|
87
|
-
## JSON Compatibility Fallback
|
|
88
|
-
|
|
89
|
-
If a downstream process requires JSON, write a compatibility copy after the native note:
|
|
90
|
-
|
|
91
|
-
**Step 1: Generate incident ID**
|
|
92
|
-
```
|
|
93
|
-
INC_<CATEGORY>_YYYYMMDD_HHMMSS_xxxx
|
|
94
|
-
```
|
|
95
|
-
where `xxxx` is 4 random alphanumeric characters. Example: `INC_API_20260403_143052_a7b2`.
|
|
96
|
-
|
|
97
|
-
**Step 2: Ensure directory exists**
|
|
98
|
-
```bash
|
|
99
|
-
mkdir -p .build-loop/debugging/incidents
|
|
100
|
-
```
|
|
101
|
-
|
|
102
|
-
**Step 3: Write the JSON**
|
|
103
13
|
```json
|
|
104
14
|
{
|
|
105
|
-
"
|
|
106
|
-
"timestamp": 1735654252000,
|
|
107
|
-
"symptom": "User-facing description of the bug",
|
|
15
|
+
"symptom": "Exact user-visible failure or error",
|
|
108
16
|
"root_cause": {
|
|
109
|
-
"description": "Technical
|
|
110
|
-
"
|
|
111
|
-
"
|
|
112
|
-
"confidence": 0.85
|
|
113
|
-
},
|
|
114
|
-
"fix": {
|
|
115
|
-
"approach": "What was done",
|
|
116
|
-
"changes": [
|
|
117
|
-
{ "file": "path/to/file.ts", "lines_changed": 10, "change_type": "modify|add|delete", "summary": "..." }
|
|
118
|
-
]
|
|
17
|
+
"description": "Technical cause and first controllable cause",
|
|
18
|
+
"category": "logic",
|
|
19
|
+
"confidence": 0.95
|
|
119
20
|
},
|
|
120
|
-
"
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
},
|
|
125
|
-
"tags": ["build-loop", "project-name", "layer", "category"],
|
|
126
|
-
"files_changed": ["list/of/all/files.ts"],
|
|
127
|
-
"quality_score": 0.75
|
|
21
|
+
"fix": "What changed and why",
|
|
22
|
+
"verification": "verified",
|
|
23
|
+
"tags": ["build-loop", "project", "backend", "typescript"],
|
|
24
|
+
"files_changed": ["path/to/file.ts"]
|
|
128
25
|
}
|
|
129
26
|
```
|
|
130
27
|
|
|
131
|
-
|
|
28
|
+
Then run:
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
node "${CLAUDE_PLUGIN_ROOT}/bin/build-loop-debugger.js" store \
|
|
32
|
+
--input /path/to/incident.json --workdir "$PWD"
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
The command validates and writes `.claude/memory/incidents/<incident-id>.json`, then updates the JSONL and keyword indexes in the same memory root. Delete the temporary input after a successful store.
|
|
132
36
|
|
|
133
|
-
##
|
|
37
|
+
## Quality requirements
|
|
134
38
|
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
39
|
+
- Preserve the exact symptom and error class.
|
|
40
|
+
- Explain the root cause, not only the failing line.
|
|
41
|
+
- Record the implemented fix and changed files.
|
|
42
|
+
- Use `verified` only when the reproduction and relevant regression tests pass.
|
|
43
|
+
- Include `build-loop`, project, layer, technology, and symptom tags when applicable.
|
|
138
44
|
|
|
139
|
-
|
|
45
|
+
Target a quality score of at least 75%. Do not store speculative diagnoses as verified incidents.
|
|
140
46
|
|
|
141
|
-
|
|
142
|
-
- `build-loop:debugging-memory` `{op:"assess"}` (references/assess.md) — parallel domain assessment
|
|
143
|
-
- `build-loop:debug-loop` — full iterative debugging that produces the incident this op stores
|
|
47
|
+
## After storing
|
|
144
48
|
|
|
145
|
-
|
|
49
|
+
1. Confirm `file_path` exists in the JSON response.
|
|
50
|
+
2. Search the symptom again and confirm the new incident is discoverable.
|
|
51
|
+
3. Keep `.build-loop/issues/` for unresolved/executable work; resolved history belongs only in the structured debugger store.
|
|
@@ -64,7 +64,7 @@ Skill("build-loop:debugging-memory") with input { op: "search", symptom: "<sympt
|
|
|
64
64
|
- Low/no match (<40%): Investigate fresh, document afterward
|
|
65
65
|
|
|
66
66
|
**After fixing a bug:**
|
|
67
|
-
|
|
67
|
+
Return the verified incident fields to the parent. The parent invokes `build-loop:debugging-memory` with `{ op: "store", ... }`, which writes `.claude/memory/incidents/<incident-id>.json`.
|
|
68
68
|
|
|
69
69
|
This ensures fixes are remembered for future similar issues.
|
|
70
70
|
```
|
|
@@ -0,0 +1,251 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: decision-queue
|
|
3
|
+
description: "Turn pending decisions — Operations Center tasks with status needs_input, a backlog of open questions, anything blocked on the user's judgment — into one interactive page the user answers inline and Claude reads back later. Not for a one-off static report with no response capture; use a plain Artifact instead. Each decision gets a card carrying the choice, why it needs the user, its impact, the options, and a recommendation. Triggers: 'show me the decisions waiting on me', 'what needs my input', 'make a decision queue', 'launch a ui for these open questions'. Not for a judgement call you already made and applied while work continued — that never blocks and belongs in `silent-assumptions`."
|
|
4
|
+
user-invocable: false
|
|
5
|
+
companion_assets:
|
|
6
|
+
- assets/template.html — tested, working page (styling, save/response plumbing, self-publish logic). Copy and adapt; never regenerate from scratch.
|
|
7
|
+
- scripts/regen_template_constants.py — regenerates the HEAD_HTML / SAVE_BAR_HTML self-publish constants from the authored markup. Run it after ANY CSS or save-bar edit; never hand-sync the two copies.
|
|
8
|
+
- references/example-large-queue-batching.md — second worked example (2026-08-26, PersonalLLMWiki planner backlog): the large-queue variant, where items are classified into a few claims and ruled as batches instead of one card per item. Read it before building for a queue of 50+ items.
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
<!-- SPDX-FileCopyrightText: 2025-2026 Tyrone Ross, Jr <46267523+tyroneross@users.noreply.github.com> | SPDX-License-Identifier: Apache-2.0 -->
|
|
12
|
+
|
|
13
|
+
# Decision Queue
|
|
14
|
+
|
|
15
|
+
Build an interactive Artifact that lists every pending decision as a card —
|
|
16
|
+
decision, why it needs the user, impact, options, recommendation, a response
|
|
17
|
+
control, and a save button — so the user can answer at their own pace and
|
|
18
|
+
Claude can read the answers back on request. Built once (2026-08-25) for
|
|
19
|
+
Operations Center's `needs_input` queue; the pattern generalizes to any set
|
|
20
|
+
of open questions the user names.
|
|
21
|
+
|
|
22
|
+
## When to use
|
|
23
|
+
|
|
24
|
+
- User asks what's waiting on their input, across Operations Center, a
|
|
25
|
+
backlog, or any other queue of blocked decisions.
|
|
26
|
+
- User wants to *answer* those decisions somewhere durable, not just read
|
|
27
|
+
a report — the defining feature over a plain summary is the save/respond
|
|
28
|
+
loop.
|
|
29
|
+
- Do not use this for a single decision (just ask) or for content with no
|
|
30
|
+
response to capture (use a plain Artifact via `artifact-design`).
|
|
31
|
+
|
|
32
|
+
## Two shapes, chosen by queue size
|
|
33
|
+
|
|
34
|
+
**One card per decision** is the default and everything below describes it. It
|
|
35
|
+
works while the decisions are few and genuinely distinct.
|
|
36
|
+
|
|
37
|
+
**Batch-claim triage** is the variant for a large queue. Above roughly fifty
|
|
38
|
+
items, a page of one card per item reproduces the overwhelm that made the user
|
|
39
|
+
ask for a page. Classify the items into a few classes instead, give each class
|
|
40
|
+
one falsifiable claim plus the counted evidence for it, and let one ruling
|
|
41
|
+
close the whole class with a drill-in for auditing and per-item override.
|
|
42
|
+
|
|
43
|
+
The test between them is one question: **can you write a single sentence that
|
|
44
|
+
is true of thirty of these items?** If yes, build the batch variant and read
|
|
45
|
+
`references/example-large-queue-batching.md` first — it carries the pyramid
|
|
46
|
+
structure the claims need, the classification trap that cost a rebuild, the
|
|
47
|
+
flat-control CSS the user requires, and a save round-trip test worth copying.
|
|
48
|
+
If no, you do not have batches; build one card per decision.
|
|
49
|
+
|
|
50
|
+
## Workflow
|
|
51
|
+
|
|
52
|
+
1. **Gather the decisions.** For Operations Center: `mcp__operations-center__list_tasks`
|
|
53
|
+
filtered to `status: needs_input`. The result is often too large for the
|
|
54
|
+
tool response and gets saved to a file — read it with Python/jq, don't
|
|
55
|
+
try to fit it inline. **Landmine:** `get_task` takes the FULL task id;
|
|
56
|
+
the short 8-char ids shown in the Operations Center startup-hook digest
|
|
57
|
+
are prefixes and `get_task` returns `null` for them. Use `list_tasks`
|
|
58
|
+
and filter by prefix match instead.
|
|
59
|
+
|
|
60
|
+
2. **Synthesize each item**, one card's worth of fields:
|
|
61
|
+
|
|
62
|
+
| Field | What it answers | Note |
|
|
63
|
+
|---|---|---|
|
|
64
|
+
| `decision` | What action is on the table | Full sentence, not a summary of the situation |
|
|
65
|
+
| `why` | Why THIS needs the user, not an agent | If the source record has no explicit reason, infer from spec/classification and set `whyInferred: true` — the template renders an "inferred" disclaimer, so the honesty marker is never lost |
|
|
66
|
+
| `impact` | What actually changes — app, user, team | Concrete; cite real numbers from the source record when they exist |
|
|
67
|
+
| `options` | 2–4 real choices, lettered A/B/C… | Include the honest cost of "defer"/"reject", not a straw man |
|
|
68
|
+
| `recommendation` | Which option and why | Name the actual tradeoff, don't just restate the option |
|
|
69
|
+
|
|
70
|
+
Write in full sentences with clear predicates — this is a decision
|
|
71
|
+
record the user acts on, not a bullet fragment.
|
|
72
|
+
|
|
73
|
+
3. **Load `artifact-design`** (required — even though the template supplies
|
|
74
|
+
a working visual treatment, the design-pass discipline still governs
|
|
75
|
+
copy calibration: eyebrow/title/lede text, card language, and whether
|
|
76
|
+
this dataset actually warrants the dashboard treatment over something
|
|
77
|
+
lighter).
|
|
78
|
+
|
|
79
|
+
4. **Copy `assets/template.html`** to the scratchpad — never hand-roll the
|
|
80
|
+
self-publish plumbing from scratch; see "The one rule that matters"
|
|
81
|
+
below for why that's expensive to get right. Strip the leading `<!-- -->`
|
|
82
|
+
authoring comment block (it must not ship). Edit only the CONTENT ZONE:
|
|
83
|
+
|
|
84
|
+
```js
|
|
85
|
+
window.__META__ = { eyebrow, title, lede, summaryCells, footer };
|
|
86
|
+
window.__ITEMS__ = [ { id, num, opened, touched, repo, classChip,
|
|
87
|
+
typeLabel, priority, title, decision, why, whyInferred, impact,
|
|
88
|
+
options, recommendation, selected: null, comment: "", respondedAt: null }, ... ];
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
Leave everything inside `<script id="app-script">` untouched.
|
|
92
|
+
|
|
93
|
+
5. **Verify before publishing** — cheap and catches real bugs:
|
|
94
|
+
|
|
95
|
+
```bash
|
|
96
|
+
node --check <extracted app-data + app-script> # syntax
|
|
97
|
+
# render META + ITEMS through the real cardHtml/renderBody functions
|
|
98
|
+
# (see git history of this skill's authoring session for the exact
|
|
99
|
+
# extraction snippet) and confirm it returns non-empty HTML with no
|
|
100
|
+
# thrown exception
|
|
101
|
+
grep -n "document.head.innerHTML\|getElementById(\"save-bar-shell\").outerHTML" *.html
|
|
102
|
+
# any match OUTSIDE an explanatory comment is the landmine below — fix it
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
6. **Publish** with `Artifact({ file_path, capabilities: {artifact: {}}, title, description, favicon })`.
|
|
106
|
+
The `artifact` capability is what lets the page save its own responses —
|
|
107
|
+
without it the save button has nothing to call. Load `artifact-capabilities`
|
|
108
|
+
if this is a fresh session that hasn't already loaded it.
|
|
109
|
+
|
|
110
|
+
7. **Read answers back** on request: `Artifact({ action: "read", url })`.
|
|
111
|
+
The saved HTML contains the string `window.__ITEMS__` **twice** — once
|
|
112
|
+
as the real, live `<script id="app-data">` content, and once more as a
|
|
113
|
+
JS string literal inside `buildDocument()`'s own source (which the
|
|
114
|
+
self-publish logic captures verbatim so the republished page stays
|
|
115
|
+
functional). Parse the **first** occurrence, at the top of the file,
|
|
116
|
+
not whichever regex match comes back first if your extraction spans
|
|
117
|
+
the whole document carelessly.
|
|
118
|
+
|
|
119
|
+
## The one rule that matters: never capture the live DOM for self-publish
|
|
120
|
+
|
|
121
|
+
The template's `HEAD_HTML` and `SAVE_BAR_HTML` are **hardcoded JS string
|
|
122
|
+
constants**, not `document.head.innerHTML` or `.outerHTML` reads. This is
|
|
123
|
+
not a style preference — it was a real, shipped, user-visible bug
|
|
124
|
+
(2026-08-26): the claude.ai artifact viewer injects its own bootstrap
|
|
125
|
+
script into `<head>` before the page's own script runs. Capturing
|
|
126
|
+
`document.head.innerHTML` at load time sweeps that injected script up
|
|
127
|
+
alongside the page's own `<title>`/`<link>`/`<style>` and bakes it into
|
|
128
|
+
whatever gets saved. On the next load the viewer injects a **second**,
|
|
129
|
+
fresh copy of its own bootstrap on top of the stale one — two competing
|
|
130
|
+
runtime copies collide, and the page's `<style>` tag stops taking effect
|
|
131
|
+
at all (confirmed: totally unstyled, unreadable page after one save/reload
|
|
132
|
+
cycle).
|
|
133
|
+
|
|
134
|
+
The fix that held: write `HEAD_HTML` and `SAVE_BAR_HTML` as literal
|
|
135
|
+
template-literal strings in the script, generated once from the actual
|
|
136
|
+
authored markup and never read from the DOM again. The **only** DOM read
|
|
137
|
+
that is safe in `buildDocument()` is
|
|
138
|
+
`document.getElementById("app-script").outerHTML` — capturing the script's
|
|
139
|
+
own tag, which the platform never modifies, so the running script can
|
|
140
|
+
re-embed itself verbatim in the next version (the "quine" trick that keeps
|
|
141
|
+
the page functional after every save without duplicating the render logic
|
|
142
|
+
as a second string).
|
|
143
|
+
|
|
144
|
+
If you edit the template's CSS or the save-bar markup, the change must land in
|
|
145
|
+
**two** places — the literal markup, and the `HEAD_HTML`/`SAVE_BAR_HTML`
|
|
146
|
+
constants inside `app-script`. **Do not sync them by hand. Run:**
|
|
147
|
+
|
|
148
|
+
```bash
|
|
149
|
+
python3 skills/decision-queue/scripts/regen_template_constants.py # rewrite
|
|
150
|
+
python3 skills/decision-queue/scripts/regen_template_constants.py --check # CI mode
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
This section used to say "regenerate with a small script" and ship no script.
|
|
154
|
+
What followed was predictable: `SAVE_BAR_HTML` sat as an empty string against
|
|
155
|
+
382 characters of real markup, so `buildDocument()` emitted a page with no Save
|
|
156
|
+
button, no status line and no counter — savable exactly once, then broken. Four
|
|
157
|
+
static checks passed the whole time, because none of them ran `buildDocument()`
|
|
158
|
+
and looked at the output. Found and fixed 2026-08-30.
|
|
159
|
+
|
|
160
|
+
`tests/test_decision_queue_template.py` now fails on any drift, and
|
|
161
|
+
`tests/test_decision_queue_render.py` runs the real script under Node and
|
|
162
|
+
asserts on what it renders.
|
|
163
|
+
|
|
164
|
+
## Every interpolation is escaped — keep it that way
|
|
165
|
+
|
|
166
|
+
The card and header markup is built with the `h` tagged template. It escapes every
|
|
167
|
+
`${...}` it interpolates. To insert markup you built yourself, wrap it: `${raw(cells)}`.
|
|
168
|
+
|
|
169
|
+
```js
|
|
170
|
+
h`<h2 class="card-title">${item.title}</h2>` // escaped — the default
|
|
171
|
+
h`<div class="queue">${raw(items.map(cardHtml).join(""))}</div>` // deliberate HTML
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
This is not style. Item fields come from Operations Center tasks, backlog items, and
|
|
175
|
+
peer-authored rally records — text an agent wrote, not text you wrote. Before
|
|
176
|
+
2026-08-30 the template called `escapeHtml()` at 5 of ~23 interpolation sites, so every
|
|
177
|
+
field added after the first few defaulted to unescaped: `item.title`, `item.decision`,
|
|
178
|
+
`item.why`, `item.impact`, `item.recommendation`, `meta.lede`, and `meta.footer` all
|
|
179
|
+
reached `innerHTML` raw. Rendering one crafted title through that version produced 14
|
|
180
|
+
live `<img onerror>` elements in the reader's page.
|
|
181
|
+
|
|
182
|
+
`h` inverts the default so the unsafe path is the one you have to type on purpose.
|
|
183
|
+
When you add a field to a card, interpolate it and stop — do not reach for `raw()`
|
|
184
|
+
unless the value really is markup you constructed.
|
|
185
|
+
|
|
186
|
+
The same rule covers the data element: `buildDocument()` embeds items through
|
|
187
|
+
`safeJsonForScript()`, not bare `JSON.stringify()`, because `JSON.stringify` does not
|
|
188
|
+
escape `<` — an item containing `</script>` would close the data element early and the
|
|
189
|
+
rest of the document would parse as markup.
|
|
190
|
+
|
|
191
|
+
`scripts/test_decision_queue_template_escaping.py` renders a hostile item through the
|
|
192
|
+
real file and fails if anything executes. It runs in CI. If you restructure the
|
|
193
|
+
`<script id="app-script">` block, update that test's extraction with it.
|
|
194
|
+
|
|
195
|
+
## Other things the template already handles (don't re-solve these)
|
|
196
|
+
|
|
197
|
+
- **Batched save, not per-keystroke.** Radio/textarea changes update an
|
|
198
|
+
in-memory `items` array; nothing publishes until the Save button fires.
|
|
199
|
+
One `publish()` call per Save click, covering every card at once.
|
|
200
|
+
- **Conflict handling.** A `conflict` rejection means someone else (another
|
|
201
|
+
tab, the user themself) already published — the view reloads to the
|
|
202
|
+
winner automatically. No retry, no merge logic needed.
|
|
203
|
+
- **Read-only detection.** `not_writer` / `not_granted` / `not_declared` /
|
|
204
|
+
`capability_disabled` all collapse to one read-only state: the Save
|
|
205
|
+
button disables itself and says why, rather than pretending to save.
|
|
206
|
+
- **A standing "no longer relevant" response.** `optionsFor()` appends a `×`
|
|
207
|
+
option to every card automatically. Do not author your own — the point is that
|
|
208
|
+
a decision which stopped being a question can be closed without pretending one
|
|
209
|
+
of the real options was chosen.
|
|
210
|
+
- **Staleness chip.** A card whose `touched` date is 14+ days old renders an
|
|
211
|
+
"Untouched N days" chip. This requires `opened`/`touched` to be **ISO dates**
|
|
212
|
+
(`2026-08-30`), not prose like "3 weeks ago" — a non-date is ignored, never
|
|
213
|
+
guessed at.
|
|
214
|
+
- **Draft persistence.** Selections and comments mirror to `localStorage` on
|
|
215
|
+
every change and clear on a successful publish, so closing the tab mid-queue
|
|
216
|
+
no longer loses typed work. A restored draft never overwrites an answer that
|
|
217
|
+
already round-tripped through publish, and the status line says how many cards
|
|
218
|
+
were restored. Every storage access sits in try/catch — the viewer can throw
|
|
219
|
+
on storage during thumbnail capture or with site data blocked.
|
|
220
|
+
- **Filter to unanswered.** A save-bar checkbox hides answered cards through a
|
|
221
|
+
body class. View-only; it never mutates an item.
|
|
222
|
+
- **Radio-group semantics.** Options sit in a `fieldset` with a `legend` naming
|
|
223
|
+
the decision, so a screen reader announces each choice with its question
|
|
224
|
+
attached. `#save-status` carries `role="status" aria-live="polite"`.
|
|
225
|
+
|
|
226
|
+
## The decision-surface family — one core, several variants
|
|
227
|
+
|
|
228
|
+
Four skills share one job: put a set of calls in front of the user and capture a
|
|
229
|
+
ruling. They differ only in the KIND of call, so they share a core rather than
|
|
230
|
+
forking one — the variant registry (`scripts/decision_surface.py`), the
|
|
231
|
+
interactive page and its save/self-publish plumbing
|
|
232
|
+
(`skills/decision-queue/assets/template.html`), and the durable writer
|
|
233
|
+
(`scripts/write_decision/__main__.py`). **Adding a variant is a registry entry,
|
|
234
|
+
never a fork of the core.**
|
|
235
|
+
|
|
236
|
+
**Choose by the question the user is actually asking, never by name.** An agent
|
|
237
|
+
that picks on name alone reaches for the one it already knows and rebuilds
|
|
238
|
+
something that exists.
|
|
239
|
+
|
|
240
|
+
| Member | Answers | Layer | Does work stop? |
|
|
241
|
+
|---|---|---|---|
|
|
242
|
+
| [`silent-assumptions`](../silent-assumptions/SKILL.md) | "What did you decide without me?" | surface | No — work continued under your default |
|
|
243
|
+
| [`decision-queue`](../decision-queue/SKILL.md) | "What is waiting on me?" | surface | Yes — work has stopped |
|
|
244
|
+
| [`auto-decision-capture`](../auto-decision-capture/SKILL.md) | "What did we already settle, and where is it written down?" | capture | No — fires passively |
|
|
245
|
+
| [`auto-finding-capture`](../auto-finding-capture/SKILL.md) | "What concrete issues has anyone surfaced?" | capture | No — fires passively |
|
|
246
|
+
|
|
247
|
+
`python3 scripts/decision_surface.py` prints this table (`--json` for machines).
|
|
248
|
+
The registry is the one place a member is declared; this table is its prose
|
|
249
|
+
mirror and must match it.
|
|
250
|
+
|
|
251
|
+
**You are here: `decision-queue`.** Reach for `silent-assumptions` instead when the call was ALREADY MADE and applied and work never stopped — that surface exists to reverse a default after the fact, and it must never block.
|