@tyroneross/build-loop 0.36.1 → 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.
Files changed (270) hide show
  1. package/.agents/plugins/marketplace.json +2 -2
  2. package/.claude-plugin/marketplace.json +3 -3
  3. package/.claude-plugin/plugin.json +1 -1
  4. package/.codex-plugin/plugin.json +1 -1
  5. package/.cursor/rules/build-loop-surface.mdc +12 -11
  6. package/.cursor/rules/skill-index.mdc +33 -0
  7. package/AGENTS.md +213 -34
  8. package/README.md +99 -31
  9. package/agents/advisor.md +4 -4
  10. package/agents/alignment-checker.md +2 -2
  11. package/agents/architecture-scout.md +4 -4
  12. package/agents/build-orchestrator.md +38 -36
  13. package/agents/database-assessor.md +10 -4
  14. package/agents/design-contract-specialist.md +8 -8
  15. package/agents/fact-checker.md +13 -3
  16. package/agents/fix-critique.md +2 -2
  17. package/agents/independent-auditor.md +60 -7
  18. package/agents/leak-scanner.md +82 -0
  19. package/agents/overfitting-reviewer.md +2 -2
  20. package/agents/plan-critic.md +1 -1
  21. package/agents/promotion-reviewer.md +5 -5
  22. package/agents/retrospective-synthesizer.md +138 -35
  23. package/agents/scope-auditor.md +82 -11
  24. package/agents/security-reviewer.md +55 -1
  25. package/agents/self-improvement-architect.md +17 -3
  26. package/agents/transcript-pattern-miner.md +5 -5
  27. package/agents/ui-validator.md +1 -1
  28. package/bin/build-loop-debugger.js +143 -0
  29. package/bin/build-loop-install.js +1 -4
  30. package/bin/build-loop-load-probe.js +345 -0
  31. package/codex-skills/build-loop/SKILL.md +28 -6
  32. package/commands/feedback.md +37 -0
  33. package/dist/src/interactive-verifier.d.ts +1 -14
  34. package/dist/src/interactive-verifier.d.ts.map +1 -1
  35. package/dist/src/interactive-verifier.js +6 -113
  36. package/dist/src/interactive-verifier.js.map +1 -1
  37. package/dist/src/quality.d.ts +5 -0
  38. package/dist/src/quality.d.ts.map +1 -0
  39. package/dist/src/quality.js +81 -0
  40. package/dist/src/quality.js.map +1 -0
  41. package/dist/src/storage.d.ts.map +1 -1
  42. package/dist/src/storage.js +37 -3
  43. package/dist/src/storage.js.map +1 -1
  44. package/docs/agent-surface-policy.md +35 -31
  45. package/docs/memory-setup.md +19 -0
  46. package/hooks/git/pre-push +65 -4
  47. package/hooks/hooks.json +95 -38
  48. package/hooks/pre-commit +20 -1
  49. package/hooks/pre-edit-rally-point.sh +10 -3
  50. package/hooks/session-start-codex-hook-trust.sh +30 -0
  51. package/hooks/session-start-git-hooks.sh +3 -1
  52. package/hooks/session-start-rally-point.sh +52 -4
  53. package/hooks/session-start-worktree-gc.sh +47 -94
  54. package/hooks/stop-transcript-sweep.sh +173 -0
  55. package/hooks/test_closeout.sh +14 -2
  56. package/package.json +8 -7
  57. package/scripts/README.md +1 -1
  58. package/scripts/_paths.py +65 -0
  59. package/scripts/groundwork_exchange.py +1012 -0
  60. package/scripts/install_memory.py +33 -1
  61. package/scripts/lessons_index/ingest.py +13 -2
  62. package/scripts/lessons_index/query.py +36 -13
  63. package/scripts/memory_context/__init__.py +108 -14
  64. package/scripts/memory_graph/__init__.py +5 -1
  65. package/scripts/project_resolver.py +42 -36
  66. package/scripts/sync_plugin_cache.py +37 -2
  67. package/skills/agent-rally-point/SKILL.md +46 -0
  68. package/skills/api-registry-bridge/SKILL.md +1 -1
  69. package/skills/architecture/dead/SKILL.md +1 -1
  70. package/skills/architecture/impact/SKILL.md +1 -1
  71. package/skills/architecture/review/SKILL.md +1 -1
  72. package/skills/architecture/rules/SKILL.md +3 -3
  73. package/skills/architecture/scan/SKILL.md +1 -1
  74. package/skills/architecture/trace/SKILL.md +1 -1
  75. package/skills/attribution-standard/SKILL.md +6 -6
  76. package/skills/auto-decision-capture/SKILL.md +31 -2
  77. package/skills/auto-finding-capture/SKILL.md +28 -1
  78. package/skills/build-loop/SKILL.md +131 -23
  79. package/skills/build-loop/fallbacks.md +16 -21
  80. package/skills/build-loop/phases/ui-validation.md +2 -2
  81. package/skills/build-loop/references/advisor-dispatch-ladder.md +1 -1
  82. package/skills/build-loop/references/apple-native-planning.md +1 -1
  83. package/skills/build-loop/references/autonomous-and-per-commit-modes.md +11 -5
  84. package/skills/build-loop/references/autonomy-dashboard.md +115 -0
  85. package/skills/build-loop/references/capability-routing.md +24 -2
  86. package/skills/build-loop/references/coordination.md +24 -6
  87. package/skills/build-loop/references/experiment-results-template.md +15 -3
  88. package/skills/build-loop/references/leadership.md +1 -1
  89. package/skills/build-loop/references/memory.md +14 -3
  90. package/skills/build-loop/references/modular-systems-pack.md +8 -0
  91. package/skills/build-loop/references/output-style.md +86 -0
  92. package/skills/build-loop/references/phase-1-assess.md +102 -2
  93. package/skills/build-loop/references/phase-2-plan.md +9 -1
  94. package/skills/build-loop/references/phase-3-execute.md +5 -2
  95. package/skills/build-loop/references/phase-4-review.md +85 -8
  96. package/skills/build-loop/references/phase-5-iterate.md +76 -8
  97. package/skills/build-loop/references/phase-6-learn.md +10 -17
  98. package/skills/build-loop/references/privileged-request-broker.md +254 -0
  99. package/skills/build-loop/references/resource-aware-execution.md +183 -0
  100. package/skills/build-loop/references/self-recursive-dev.md +2 -2
  101. package/skills/build-loop/references/status-output-format.md +207 -0
  102. package/skills/build-loop/references/verify-dispatch.md +56 -2
  103. package/skills/building-with-deepagents/SKILL.md +1 -1
  104. package/skills/claim-scope/SKILL.md +185 -0
  105. package/skills/color-engine/SKILL.md +103 -0
  106. package/skills/color-engine/_core.py +464 -0
  107. package/skills/color-engine/color_engine.py +175 -0
  108. package/skills/cost-rca/SKILL.md +61 -0
  109. package/skills/data-plane-worktrees/SKILL.md +139 -0
  110. package/skills/data-plane-worktrees/agents/openai.yaml +4 -0
  111. package/skills/database-practice/SKILL.md +200 -0
  112. package/skills/database-practice/references/diagnostic-queries.sql +126 -0
  113. package/skills/database-practice/references/vector-and-graph-tuning.md +208 -0
  114. package/skills/database-practice/scripts/db_table_map.py +1244 -0
  115. package/skills/database-practice/scripts/test_db_table_map.py +514 -0
  116. package/skills/debug-loop/SKILL.md +36 -6
  117. package/skills/debugging-memory/SKILL.md +32 -430
  118. package/skills/debugging-memory/references/pattern-extraction.md +4 -4
  119. package/skills/debugging-memory/references/search.md +32 -120
  120. package/skills/debugging-memory/references/store.md +32 -126
  121. package/skills/debugging-memory/references/subagent-integration.md +1 -1
  122. package/skills/decision-queue/SKILL.md +251 -0
  123. package/skills/decision-queue/assets/template.html +1242 -0
  124. package/skills/decision-queue/references/example-large-queue-batching.md +164 -0
  125. package/skills/decision-queue/scripts/regen_template_constants.py +160 -0
  126. package/skills/defenseclaw-bridge/SKILL.md +2 -2
  127. package/skills/defenseclaw-bridge/references/dc-config-mapping.md +2 -9
  128. package/skills/drain-proposals/SKILL.md +53 -0
  129. package/skills/focused-loop-builder/SKILL.md +31 -0
  130. package/skills/focused-loop-builder/references/spec-format.md +27 -0
  131. package/skills/handoff/SKILL.md +169 -8
  132. package/skills/ibr-bridge/SKILL.md +4 -1
  133. package/skills/knowledge/SKILL.md +26 -14
  134. package/skills/knowledge/references/review-mode.md +2 -3
  135. package/skills/knowledge/templates/madr-minimal.md +1 -1
  136. package/skills/mcp-builder/SKILL.md +1 -1
  137. package/skills/model-bakeoff/SKILL.md +48 -10
  138. package/skills/model-tiering/SKILL.md +92 -31
  139. package/skills/native-ax-driver/SKILL.md +38 -5
  140. package/skills/native-ax-driver/scripts/native_driver.py +278 -22
  141. package/skills/native-ax-driver/scripts/test_native_driver.py +227 -0
  142. package/skills/optimize/SKILL.md +1 -1
  143. package/skills/plugin-builder/SKILL.md +48 -1
  144. package/skills/plugin-builder/references/build-loop-phase-guidance.md +3 -4
  145. package/skills/plugin-builder/references/distribution.md +13 -2
  146. package/skills/plugin-builder/references/plugin-hygiene-lessons.md +2 -2
  147. package/skills/plugin-tests/SKILL.md +2 -2
  148. package/skills/recursive-retrospective/SKILL.md +1 -1
  149. package/skills/repo-closeout/SKILL.md +17 -0
  150. package/skills/repo-closeout/agents/openai.yaml +4 -0
  151. package/skills/repo-maintenance/SKILL.md +179 -0
  152. package/skills/repo-maintenance/agents/openai.yaml +4 -0
  153. package/skills/repo-maintenance/references/pre-public-hygiene.md +134 -0
  154. package/skills/repo-maintenance/references/repository-taxonomy.md +161 -0
  155. package/skills/repo-maintenance/references/safety-protocol.md +106 -0
  156. package/skills/repo-maintenance/references/stack-profiles.md +138 -0
  157. package/skills/repo-maintenance/scripts/audit_repo_maintenance.py +1198 -0
  158. package/skills/repo-maintenance/scripts/test_audit_repo_maintenance.py +506 -0
  159. package/skills/repository-intelligence/SKILL.md +189 -0
  160. package/skills/repository-intelligence/agents/openai.yaml +4 -0
  161. package/skills/repository-intelligence/references/assessment-rubric.md +88 -0
  162. package/skills/repository-intelligence/scripts/repository_inventory.py +347 -0
  163. package/skills/research/SKILL.md +12 -2
  164. package/skills/root-cause-analysis/SKILL.md +1 -1
  165. package/skills/runtime-parity-verification/SKILL.md +36 -1
  166. package/skills/security-methodology/SKILL.md +22 -9
  167. package/skills/security-methodology/references/agentic-handoff-templates.md +220 -0
  168. package/skills/security-methodology/references/cross-source-matrix.md +1 -1
  169. package/skills/security-methodology/references/owasp-agentic-top-10.md +1 -1
  170. package/skills/security-scan/SKILL.md +55 -15
  171. package/skills/self-improve/SKILL.md +70 -50
  172. package/skills/silent-assumptions/SKILL.md +341 -0
  173. package/skills/silent-assumptions/references/elicitation-detectors.md +342 -0
  174. package/skills/spec-writing/SKILL.md +128 -24
  175. package/skills/spec-writing/scripts/check_checklist.py +114 -15
  176. package/skills/ui-design/SKILL.md +6 -4
  177. package/skills/ui-design/references/color-engine.md +132 -0
  178. package/skills/ui-design/references/design-preferences-from-owned-apps.md +8 -8
  179. package/skills/ui-design/references/ui-guidance-sources.md +1 -1
  180. package/skills/ui-design/references/universal-design-principles.alt.md +2 -2
  181. package/plugin-artifacts/codex/.codex-plugin/plugin.json +0 -41
  182. package/plugin-artifacts/codex/AGENTS.md +0 -560
  183. package/plugin-artifacts/codex/BUILD-ARTIFACT.md +0 -5
  184. package/plugin-artifacts/codex/LICENSE +0 -202
  185. package/plugin-artifacts/codex/README.md +0 -313
  186. package/plugin-artifacts/codex/assets/build-loop-plugin-icon.png +0 -0
  187. package/plugin-artifacts/codex/docs/agent-surface-policy.md +0 -63
  188. package/plugin-artifacts/codex/references/advisor-dispatch-ladder.md +0 -62
  189. package/plugin-artifacts/codex/references/agent-role-taxonomy.md +0 -135
  190. package/plugin-artifacts/codex/references/autonomous-and-per-commit-modes.md +0 -161
  191. package/plugin-artifacts/codex/references/autonomy-config.md +0 -231
  192. package/plugin-artifacts/codex/references/backlog-system.md +0 -285
  193. package/plugin-artifacts/codex/references/capability-routing.md +0 -231
  194. package/plugin-artifacts/codex/references/codex-subagents.md +0 -106
  195. package/plugin-artifacts/codex/references/coordination-file-template.md +0 -181
  196. package/plugin-artifacts/codex/references/coordination-rules.md +0 -552
  197. package/plugin-artifacts/codex/references/dogfood-reload-checkpoint.md +0 -112
  198. package/plugin-artifacts/codex/references/halt-and-ask-protocol.md +0 -102
  199. package/plugin-artifacts/codex/references/implementer-envelope-schema.md +0 -302
  200. package/plugin-artifacts/codex/references/intent-capability-pack.md +0 -257
  201. package/plugin-artifacts/codex/references/intent-exploration-prompts.md +0 -96
  202. package/plugin-artifacts/codex/references/leadership.md +0 -72
  203. package/plugin-artifacts/codex/references/memory-systems.md +0 -261
  204. package/plugin-artifacts/codex/references/memory.md +0 -313
  205. package/plugin-artifacts/codex/references/model-tier-mapping.md +0 -296
  206. package/plugin-artifacts/codex/references/modular-systems-pack.md +0 -96
  207. package/plugin-artifacts/codex/references/phase-1-assess.md +0 -249
  208. package/plugin-artifacts/codex/references/phase-2-plan.md +0 -86
  209. package/plugin-artifacts/codex/references/phase-3-execute.md +0 -49
  210. package/plugin-artifacts/codex/references/phase-4-review.md +0 -341
  211. package/plugin-artifacts/codex/references/phase-5-iterate.md +0 -72
  212. package/plugin-artifacts/codex/references/phase-6-learn.md +0 -58
  213. package/plugin-artifacts/codex/references/recent-design-structures.md +0 -274
  214. package/plugin-artifacts/codex/references/research-trigger-policy.md +0 -140
  215. package/plugin-artifacts/codex/references/runtime-smoke-triggers.md +0 -42
  216. package/plugin-artifacts/codex/references/self-review.md +0 -234
  217. package/plugin-artifacts/codex/references/single-writer-commit-protocol.md +0 -90
  218. package/plugin-artifacts/codex/references/task-capture-policy.md +0 -68
  219. package/plugin-artifacts/codex/references/ui-io-contract.md +0 -116
  220. package/plugin-artifacts/codex/references/ui-spotcheck-protocol.md +0 -65
  221. package/plugin-artifacts/codex/references/verify-dispatch.md +0 -85
  222. package/plugin-artifacts/codex/skills/build-loop/SKILL.md +0 -381
  223. package/plugin-artifacts/codex/skills/build-loop/detect-plugins.mjs +0 -82
  224. package/plugin-artifacts/codex/skills/build-loop/eval-guide.md +0 -65
  225. package/plugin-artifacts/codex/skills/build-loop/fallbacks.md +0 -549
  226. package/plugin-artifacts/codex/skills/build-loop/phases/fact-check.md +0 -42
  227. package/plugin-artifacts/codex/skills/build-loop/phases/ui-validation.md +0 -267
  228. package/plugin-artifacts/codex/skills/build-loop/references/advisor-dispatch-ladder.md +0 -62
  229. package/plugin-artifacts/codex/skills/build-loop/references/apple-native-planning.md +0 -439
  230. package/plugin-artifacts/codex/skills/build-loop/references/autonomous-and-per-commit-modes.md +0 -161
  231. package/plugin-artifacts/codex/skills/build-loop/references/capability-routing.md +0 -231
  232. package/plugin-artifacts/codex/skills/build-loop/references/codex-subagents.md +0 -106
  233. package/plugin-artifacts/codex/skills/build-loop/references/coordination.md +0 -161
  234. package/plugin-artifacts/codex/skills/build-loop/references/correction-aware-capture.md +0 -177
  235. package/plugin-artifacts/codex/skills/build-loop/references/experiment-results-template.md +0 -101
  236. package/plugin-artifacts/codex/skills/build-loop/references/independent-auditor.md +0 -72
  237. package/plugin-artifacts/codex/skills/build-loop/references/intent-capability-pack.md +0 -257
  238. package/plugin-artifacts/codex/skills/build-loop/references/intent-exploration-prompts.md +0 -96
  239. package/plugin-artifacts/codex/skills/build-loop/references/leadership.md +0 -72
  240. package/plugin-artifacts/codex/skills/build-loop/references/memory.md +0 -313
  241. package/plugin-artifacts/codex/skills/build-loop/references/modular-systems-pack.md +0 -96
  242. package/plugin-artifacts/codex/skills/build-loop/references/output-style.md +0 -222
  243. package/plugin-artifacts/codex/skills/build-loop/references/pay-it-forward-arch.md +0 -98
  244. package/plugin-artifacts/codex/skills/build-loop/references/phase-1-assess.md +0 -249
  245. package/plugin-artifacts/codex/skills/build-loop/references/phase-2-plan.md +0 -86
  246. package/plugin-artifacts/codex/skills/build-loop/references/phase-3-execute.md +0 -49
  247. package/plugin-artifacts/codex/skills/build-loop/references/phase-4-review.md +0 -341
  248. package/plugin-artifacts/codex/skills/build-loop/references/phase-5-iterate.md +0 -72
  249. package/plugin-artifacts/codex/skills/build-loop/references/phase-6-learn.md +0 -58
  250. package/plugin-artifacts/codex/skills/build-loop/references/recent-design-structures.md +0 -274
  251. package/plugin-artifacts/codex/skills/build-loop/references/refactor-history/ASSESSMENT.md +0 -85
  252. package/plugin-artifacts/codex/skills/build-loop/references/refactor-history/STANDALONE_TEST_RUN.md +0 -149
  253. package/plugin-artifacts/codex/skills/build-loop/references/refactor-history/scenarios/01-simple-bugfix.md +0 -32
  254. package/plugin-artifacts/codex/skills/build-loop/references/refactor-history/scenarios/02-ui-build-with-iteration.md +0 -48
  255. package/plugin-artifacts/codex/skills/build-loop/references/refactor-history/scenarios/03-multi-failure-escalation.md +0 -60
  256. package/plugin-artifacts/codex/skills/build-loop/references/refactor-history/scenarios/04-ui-build-ibr-absent.md +0 -51
  257. package/plugin-artifacts/codex/skills/build-loop/references/refactor-history/scenarios/05-refactor-navgator-absent.md +0 -71
  258. package/plugin-artifacts/codex/skills/build-loop/references/refactor-history/scenarios/06-recurring-bug-debugger-absent.md +0 -52
  259. package/plugin-artifacts/codex/skills/build-loop/references/refactor-history/trace-comparison.md +0 -202
  260. package/plugin-artifacts/codex/skills/build-loop/references/self-recursive-dev.md +0 -77
  261. package/plugin-artifacts/codex/skills/build-loop/references/self-review.md +0 -234
  262. package/plugin-artifacts/codex/skills/build-loop/references/ui-io-contract.md +0 -116
  263. package/plugin-artifacts/codex/skills/build-loop/references/verify-dispatch.md +0 -85
  264. package/plugin-artifacts/codex/skills/build-loop/scanners/audit-design-rules.mjs +0 -476
  265. package/plugin-artifacts/codex/skills/build-loop/scanners/require-visual-evidence.mjs +0 -239
  266. package/plugin-artifacts/codex/skills/build-loop/templates/backlog-item.md +0 -35
  267. package/plugin-artifacts/codex/skills/build-loop/templates/codex-worker-prompt.md +0 -100
  268. package/plugin-artifacts/codex/skills/build-loop/templates/ui-subagent-prompt.md +0 -179
  269. package/plugin-artifacts/codex/skills/build-loop/templates/ux-fix-plan.md +0 -40
  270. package/scripts/build_codex_plugin_artifact.py +0 -321
@@ -0,0 +1,164 @@
1
+ <!-- SPDX-FileCopyrightText: 2025-2026 Tyrone Ross, Jr <46267523+tyroneross@users.noreply.github.com> | SPDX-License-Identifier: Apache-2.0 -->
2
+
3
+ # Worked example: batch-claim triage
4
+
5
+ Built 2026-08-26 against a personal knowledge-base planner backlog. The pattern
6
+ is reusable; nothing in it is specific to that source beyond the data it was
7
+ pointed at. Counts below are the real ones from that run.
8
+
9
+ ## The problem this variant solves
10
+
11
+ The base decision-queue pattern gives every decision its own card. That works
12
+ while the decisions are few and genuinely distinct. It fails when the queue is
13
+ large, because a page of 128 cards reproduces exactly the overwhelm that made
14
+ the user ask for a page in the first place.
15
+
16
+ The planner backlog was 128 open items past their date. Presenting 128 cards
17
+ would have been honest and useless.
18
+
19
+ ## The insight that made it tractable
20
+
21
+ **Most of a large backlog shares a few causes.** Classify first, and the work
22
+ collapses. Of the 128 items:
23
+
24
+ - 28 named a clock time on a day that had passed.
25
+ - 13 were example text typed while setting the tool up.
26
+ - 4 were prep for meetings that had a recording proving they happened.
27
+
28
+ That is 45 items and three decisions. The remaining 83 were the real backlog.
29
+ The user ruled all three batches in three clicks and confirmed every claim
30
+ without a single override.
31
+
32
+ ## The shape
33
+
34
+ Three levels, which is the same progressive disclosure the base pattern uses,
35
+ with a pyramid substituted for the flat card.
36
+
37
+ **Level 1 — the batch card.** One claim, then the evidence for it.
38
+
39
+ - `claim` — the governing thought. A falsifiable sentence stating what is
40
+ true of every member, with a real predicate. *"These 28 tasks can no longer
41
+ be done. Each one names an hour on a day that has already passed."*
42
+ - `because` — three peers that answer the one question the claim raises, each
43
+ an independent fact, each counted from the data rather than asserted.
44
+ *"23 name a clock time; the other 5 name a drop-off, a pickup, or a
45
+ departure."*
46
+ - Two actions: rule the whole batch the recommended way, or rule it the
47
+ opposite way.
48
+
49
+ **Level 2 — the drill-in.** A full-width panel listing every member of the
50
+ batch with its date and `file:line`, each keeping its own disposition
51
+ dropdown. Restates the claim at the top and offers two ways back.
52
+
53
+ **Level 3 — the residue.** Everything that did not classify, grouped by owning
54
+ scope, each row with a disposition and a note field.
55
+
56
+ ## Why the claim and the evidence are load-bearing, not decoration
57
+
58
+ A batch ruling asks someone to close 28 things on the strength of three
59
+ bullets. That is only safe when three conditions hold.
60
+
61
+ **The claim is falsifiable.** "These are old" cannot be disagreed with
62
+ usefully. "Each one names an hour on a day that has passed" can be checked
63
+ against any row.
64
+
65
+ **The evidence is counted, not impressionistic.** Every number in the key line
66
+ was computed from the data before it was written. A bullet that turned out to
67
+ be decorative would be doing real damage at 28x leverage.
68
+
69
+ **The classification rule is stated, so the user can reject the rule rather
70
+ than the outcome.** The footer names how each class was assigned. Disagreeing
71
+ with "a line is *pinned* when it names a clock time" is a more useful
72
+ conversation than disagreeing with 28 individual verdicts.
73
+
74
+ **The drill-in exists.** A batch ruling you cannot audit is a guess you are
75
+ forced to trust. Per-item override inside the drill-in is what makes the
76
+ batch action a proposal instead of a demand.
77
+
78
+ ## When to use this instead of the base pattern
79
+
80
+ | Signal | Base decision-queue | Batch-claim triage |
81
+ |---|---|---|
82
+ | Item count | Up to roughly 20 | 50+ |
83
+ | Item independence | Each needs its own judgment | Most share a cause |
84
+ | What blocks the user | Not knowing the tradeoffs | The volume itself |
85
+ | The page's job | Elicit N judgments | Collapse N into a few, then elicit the rest |
86
+
87
+ Use the base pattern when the items are peers with nothing in common. Use this
88
+ when you can honestly write one sentence that is true of thirty of them. If you
89
+ cannot write that sentence, you do not have a batch, and forcing one produces a
90
+ claim the evidence will not carry.
91
+
92
+ ## Landmines specific to this variant
93
+
94
+ **Do not classify by repetition count.** The first pass grouped items by how
95
+ many day notes they appeared in, on the theory that a repeatedly-copied task is
96
+ durable work. It conflated two different things: a camp drop-off appeared four
97
+ times because camp ran four days, not because it was carried forward four
98
+ times. Classify by whether the task is time-bound; repetition count is a
99
+ different signal and answers a different question.
100
+
101
+ **Native `<select>` paints its own bevel.** On macOS the platform control draws
102
+ a gradient and inner bevel underneath any border you set. Combined with a
103
+ colored border for a "set" state, it reads as a glow, which the user rejected
104
+ on sight. Set `appearance: none`, draw the chevron as a background image, and
105
+ indicate state with a flat left rule rather than a fill or a ring. Same for
106
+ textarea and search inputs: `appearance: none; box-shadow: none`.
107
+
108
+ **A colored wash on a decided row is the same mistake at lower intensity.** Use
109
+ `box-shadow: inset 3px 0 0 <accent>` instead of a background fill.
110
+
111
+ ## Variant on self-publish: single-source instead of two-copy
112
+
113
+ The base template keeps `HEAD_HTML` and `SAVE_BAR_HTML` as literal constants
114
+ that must be edited in two places whenever the markup changes, and SKILL.md
115
+ correctly warns about that hazard.
116
+
117
+ This page took a different route to the same safety. **CSS lives only as a JS
118
+ constant inside the app script and is injected into a `<style>` on boot**, so
119
+ the published document and the running document are styled from one source and
120
+ cannot drift. The script re-embeds itself with
121
+ `document.getElementById("app").textContent`, which is the same safe DOM read
122
+ the base template already relies on.
123
+
124
+ Both approaches avoid the real bug, which is capturing `document.head.innerHTML`
125
+ and sweeping up the viewer's injected bootstrap. Pick by which hazard you would
126
+ rather carry:
127
+
128
+ - **Two-copy constants:** first paint is immediate; every markup edit must land
129
+ in two places or the saved page silently diverges.
130
+ - **Single-source injection:** no possible drift; first paint waits one frame
131
+ for the style injection, which is invisible on a tool but would be wrong on a
132
+ marketing page.
133
+
134
+ For a working surface the user returns to, single-source is the better trade.
135
+
136
+ ## Verification that caught real defects
137
+
138
+ Run these before publishing; each one found something.
139
+
140
+ ```bash
141
+ node --check <extracted app script> # syntax
142
+
143
+ # 1. Render smoke test with a DOM stub: assert the item count, the number of
144
+ # disposition controls, and the number of note fields all match the data.
145
+ # 2. Drill-in test: for each batch class, set the open-batch state, re-render,
146
+ # and assert the panel emits exactly as many component rows as that class
147
+ # has members.
148
+ # 3. Save round-trip: call buildDocument(), then assert the output starts with
149
+ # <!doctype html>, that the app script re-extracts byte-identical to the
150
+ # original, that a mutated ruling survives the trip, and that no raw
151
+ # </script> escaped into the embedded source.
152
+ ```
153
+
154
+ The round-trip test is the one that matters. It is the difference between
155
+ "the save button probably works" and knowing the saved page is the same
156
+ program.
157
+
158
+ ## Reusability note
159
+
160
+ This was built against a personal knowledge-base planner backlog, but nothing in the
161
+ shape depends on that. It applies to any large, classifiable set the user must
162
+ dispose of: a stale-issue sweep, a dependency-upgrade queue, a dead-code
163
+ inventory, an inbox of unrouted records. Point it at a set, find the classes,
164
+ write one claim per class, and make every claim auditable.
@@ -0,0 +1,160 @@
1
+ #!/usr/bin/env python3
2
+ """Regenerate the decision-queue template's self-publish constants from its markup.
3
+
4
+ WHY THIS EXISTS
5
+ ---------------
6
+ `assets/template.html` carries its <head> CSS and its save-bar markup TWICE:
7
+
8
+ 1. as real markup the authored page renders, and
9
+ 2. as the `HEAD_HTML` / `SAVE_BAR_HTML` template-literal constants inside
10
+ `<script id="app-script">`, which `buildDocument()` splices into every
11
+ republished copy.
12
+
13
+ They must be byte-identical. They cannot be replaced with a runtime
14
+ `document.head.innerHTML` read: the claude.ai artifact viewer injects its own
15
+ bootstrap script into <head> before the page's script runs, so a DOM capture
16
+ bakes that injected script into the save. One reload later the viewer injects a
17
+ second copy on top of the stale one and the page's <style> stops applying —
18
+ a real, shipped, user-visible bug (2026-08-26).
19
+
20
+ SKILL.md told authors to keep the two copies in sync by hand and sketched this
21
+ script without shipping it. The predictable happened: `SAVE_BAR_HTML` was left
22
+ as an empty string while 285 characters of save-bar markup sat in the file, so
23
+ every republished page shipped with no Save button, no status line, and no
24
+ counter — the page could be saved exactly once, then broke.
25
+
26
+ Hand-syncing is the defect. Run this instead, and let
27
+ `tests/test_decision_queue_template.py` fail the build when the copies drift.
28
+
29
+ USAGE
30
+ python3 regen_template_constants.py # rewrite in place
31
+ python3 regen_template_constants.py --check # exit 1 if out of sync
32
+ """
33
+ from __future__ import annotations
34
+
35
+ import argparse
36
+ import pathlib
37
+ import re
38
+ import sys
39
+
40
+ TEMPLATE = pathlib.Path(__file__).resolve().parent.parent / "assets" / "template.html"
41
+
42
+ # The authored markup runs from <title> to the close of the page's own <style>,
43
+ # and the save bar from its shell div to just before the content-zone script.
44
+ HEAD_BLOCK_RE = re.compile(r"<title>.*?</style>", re.S)
45
+ SAVE_BAR_BLOCK_RE = re.compile(
46
+ r'<div class="save-bar-shell".*?</div>\s*\n</div>', re.S
47
+ )
48
+ HEAD_CONST_RE = re.compile(r"( var HEAD_HTML = `)(.*?)(`;)", re.S)
49
+ SAVE_BAR_CONST_RE = re.compile(r"( var SAVE_BAR_HTML = `)(.*?)(`;)", re.S)
50
+
51
+
52
+ class TemplateError(RuntimeError):
53
+ pass
54
+
55
+
56
+ def _authored_region(html: str) -> str:
57
+ """Everything before the plumbing script — the markup the page renders.
58
+
59
+ Bounding the search matters: `HEAD_HTML`'s own value also contains
60
+ `<title>...</style>`, so an unbounded regex would match the constant and
61
+ compare it against itself, which passes no matter how far it has drifted.
62
+ """
63
+ # Anchor to line start: the authoring comment at the top of the file names
64
+ # `<script id="app-script">` in prose, and a plain substring search finds
65
+ # that mention first, truncating the region to ~270 chars and hiding the
66
+ # real markup entirely.
67
+ m = re.search(r'^<script id="app-script">', html, re.M)
68
+ if not m:
69
+ raise TemplateError('no <script id="app-script"> tag in template')
70
+ return html[:m.start()]
71
+
72
+
73
+ def extract_blocks(html: str) -> tuple[str, str]:
74
+ authored = _authored_region(html)
75
+
76
+ head = HEAD_BLOCK_RE.search(authored)
77
+ if not head:
78
+ raise TemplateError("could not find the authored <title>...</style> block")
79
+
80
+ bar = SAVE_BAR_BLOCK_RE.search(authored)
81
+ if not bar:
82
+ raise TemplateError("could not find the authored save-bar-shell block")
83
+
84
+ head_txt, bar_txt = head.group(0), bar.group(0)
85
+ for name, block in (("head", head_txt), ("save bar", bar_txt)):
86
+ # These get spliced into JS template literals; a backtick or ${ would
87
+ # terminate the literal or interpolate, silently corrupting the constant.
88
+ if "`" in block:
89
+ raise TemplateError(f"{name} block contains a backtick; template literal would break")
90
+ if "${" in block:
91
+ raise TemplateError(f"{name} block contains ${{; template literal would interpolate")
92
+ return head_txt, bar_txt
93
+
94
+
95
+ def render(html: str) -> str:
96
+ """Return `html` with both constants rewritten from the authored markup."""
97
+ head_txt, bar_txt = extract_blocks(html)
98
+
99
+ for const_re, value, label in (
100
+ (HEAD_CONST_RE, head_txt, "HEAD_HTML"),
101
+ (SAVE_BAR_CONST_RE, bar_txt, "SAVE_BAR_HTML"),
102
+ ):
103
+ if not const_re.search(html):
104
+ raise TemplateError(f"could not find the {label} constant to rewrite")
105
+ # A lambda avoids re.sub's backslash-escape handling mangling CSS.
106
+ html = const_re.sub(lambda m, v=value: m.group(1) + v + m.group(3), html, count=1)
107
+ return html
108
+
109
+
110
+ def drift(html: str) -> list[str]:
111
+ """Names of constants that do not match the authored markup."""
112
+ head_txt, bar_txt = extract_blocks(html)
113
+ out = []
114
+ for const_re, value, label in (
115
+ (HEAD_CONST_RE, head_txt, "HEAD_HTML"),
116
+ (SAVE_BAR_CONST_RE, bar_txt, "SAVE_BAR_HTML"),
117
+ ):
118
+ m = const_re.search(html)
119
+ if not m:
120
+ out.append(f"{label} (constant missing)")
121
+ elif m.group(2) != value:
122
+ got, want = len(m.group(2)), len(value)
123
+ out.append(f"{label} (constant {got} chars, markup {want} chars)")
124
+ return out
125
+
126
+
127
+ def main() -> int:
128
+ ap = argparse.ArgumentParser(description=__doc__)
129
+ ap.add_argument("--check", action="store_true",
130
+ help="report drift and exit 1 instead of rewriting")
131
+ ap.add_argument("--path", type=pathlib.Path, default=TEMPLATE)
132
+ args = ap.parse_args()
133
+
134
+ html = args.path.read_text(encoding="utf-8")
135
+ try:
136
+ bad = drift(html)
137
+ except TemplateError as e:
138
+ print(f"error: {e}", file=sys.stderr)
139
+ return 2
140
+
141
+ if args.check:
142
+ if bad:
143
+ print("template constants are OUT OF SYNC with the authored markup:")
144
+ for b in bad:
145
+ print(f" - {b}")
146
+ print("\nfix: python3 skills/decision-queue/scripts/regen_template_constants.py")
147
+ return 1
148
+ print("template constants match the authored markup")
149
+ return 0
150
+
151
+ if not bad:
152
+ print("already in sync; nothing to do")
153
+ return 0
154
+ args.path.write_text(render(html), encoding="utf-8")
155
+ print("regenerated: " + ", ".join(b.split(" ")[0] for b in bad))
156
+ return 0
157
+
158
+
159
+ if __name__ == "__main__":
160
+ sys.exit(main())
@@ -151,6 +151,6 @@ defenseclaw-bridge: missing reference file <path>. Cannot generate DefenseClaw s
151
151
 
152
152
  ## Related references
153
153
 
154
- - `~/dev/research/topics/product-dev/product-dev.agentic-systems-security-references.md` — the security canon citing DefenseClaw as a T1 reference implementation, plus the three-pillar Govern / Inspect / Prove model.
155
- - `~/dev/research/topics/product-dev/product-dev.agentic-systems-original-synthesis.md` — recommends adding DefenseClaw to the agent-builder catalog as the security-governance reference architecture.
154
+ - "Agentic Systems — Security References" (private research note substance summarized here) — the security canon citing DefenseClaw as a T1 reference implementation, plus the three-pillar Govern / Inspect / Prove model.
155
+ - "Agentic Systems — Original Synthesis" (private research note substance summarized here) — recommends adding DefenseClaw to the agent-builder catalog as the security-governance reference architecture.
156
156
  - `https://github.com/cisco-ai-defense/defenseclaw` — DefenseClaw repo. Apache 2.0. Cisco-backed.
@@ -4,16 +4,9 @@
4
4
 
5
5
  Field-by-field mapping from each agent-builder template to the DefenseClaw config row(s) it produces. The bridge skill (`SKILL.md`) walks this mapping when generating `<project>/.defenseclaw/generated/`.
6
6
 
7
- **Canonical agent-builder template paths** (when the plugin is installed locally):
7
+ **Canonical agent-builder templates** (when the `agent-builder` plugin is installed locally): six files under that plugin's `plugin/references/templates/agentic-handoff/` directory — `tool-contract.md`, `agent-manifest.md`, `guardrail.md`, `system-boundary.md`, `flow-topology.md`, `role-card.md`. Locate the plugin's install root the same way any installed plugin is located (`${CLAUDE_PLUGIN_ROOT}` when this bridge is invoked from within it, or the plugin cache/marketplace path otherwise) rather than assuming a fixed absolute path — the plugin is private and not shipped with build-loop.
8
8
 
9
- - `~/dev/git-folder/agent-builder/plugin/references/templates/agentic-handoff/tool-contract.md`
10
- - `~/dev/git-folder/agent-builder/plugin/references/templates/agentic-handoff/agent-manifest.md`
11
- - `~/dev/git-folder/agent-builder/plugin/references/templates/agentic-handoff/guardrail.md`
12
- - `~/dev/git-folder/agent-builder/plugin/references/templates/agentic-handoff/system-boundary.md`
13
- - `~/dev/git-folder/agent-builder/plugin/references/templates/agentic-handoff/flow-topology.md`
14
- - `~/dev/git-folder/agent-builder/plugin/references/templates/agentic-handoff/role-card.md`
15
-
16
- When the plugin is not installed locally, the project's own copies of these templates (filled in for the build) are the input. Filename match drives the bridge; plugin presence is not required.
9
+ When the plugin is not installed locally, the project's own copies of these templates (filled in for the build) are the input. Filename match drives the bridge; plugin presence is not required. `skills/security-methodology/references/agentic-handoff-templates.md` also carries the vendored substance of `role-card`, `tool-contract`, `guardrail`, `system-boundary`, and `flow-topology` (schemas + the T0–T5 / A0–A4 tables) for repos that don't have `agent-builder` installed at all.
17
10
 
18
11
  ## Mapping reference (DefenseClaw schema)
19
12
 
@@ -0,0 +1,53 @@
1
+ ---
2
+ name: drain-proposals
3
+ description: Walk the cross-repo proposal backlog interactively, deciding apply/reject/defer on each item; never auto-applies. Use when the user says "drain proposals" or "review the proposal backlog".
4
+ user-invocable: false
5
+ argument-hint: "[--all] [--scan-only]"
6
+ ---
7
+
8
+ <!-- SPDX-FileCopyrightText: 2025-2026 Tyrone Ross, Jr <46267523+tyroneross@users.noreply.github.com> | SPDX-License-Identifier: Apache-2.0 -->
9
+
10
+ You are walking the proposal-drain digest with the user. The drain script is
11
+ `scripts/drain_proposals.py` (cross-repo aggregator; state persists so decided
12
+ items never re-surface). NEVER apply, edit, or delete a proposal without the
13
+ user's explicit decision on that specific item.
14
+
15
+ A decision is keyed to the finding's CONTENT, scoped to its repo — not to its
16
+ filename. Producers re-emit the same finding under a fresh datestamped filename
17
+ and the daily `drain_self_review_proposals.py` pass archives the superseded copy,
18
+ so a decision recorded here holds across that cycle. The same finding in two
19
+ repos stays two separate decisions, because each repo needs its own fix.
20
+
21
+ ## Procedure
22
+
23
+ 1. Refresh the digest:
24
+ ```
25
+ python3 "${CLAUDE_PLUGIN_ROOT:-.}/scripts/drain_proposals.py" scan --json
26
+ ```
27
+ Report the headline: `N new / T total` and the per-repo breakdown.
28
+
29
+ 2. If `--scan-only` was passed (`{{ARGUMENTS}}`), stop here — print the digest
30
+ path and the `new` count, do not walk items.
31
+
32
+ 3. Otherwise walk the `new` items (or all items if `--all` was passed), in the
33
+ order returned (new first, oldest first). For EACH item present the one-line,
34
+ repo, id, and age, then ask the user for a decision using AskUserQuestion with
35
+ options: **Apply**, **Reject**, **Defer**, **Skip** (leave as new), **Stop**.
36
+ - Batch related items from the same repo into one question when they share a
37
+ theme, but record each item's decision separately.
38
+ - **Apply** means: open the proposal, do the work it specifies (or dispatch a
39
+ build-loop run for it), THEN record `set --status apply`. Applying is real
40
+ work, not just a state flip — do not mark applied unless the change landed.
41
+ - **Reject** / **Defer**: record immediately with an optional `--note`.
42
+
43
+ 4. Record every decision:
44
+ ```
45
+ python3 "${CLAUDE_PLUGIN_ROOT:-.}/scripts/drain_proposals.py" set --key <KEY> --status apply|reject|defer --note "<why>"
46
+ ```
47
+
48
+ 5. When the user says Stop or the list is exhausted, re-run `scan` and report the
49
+ remaining `new` count so the user sees progress.
50
+
51
+ ## Non-negotiable
52
+ - No auto-apply. A proposal is only `applied` after its change actually lands.
53
+ - Decisions are per-item and come from the user, never inferred.
@@ -52,6 +52,37 @@ Keep the runner generic and the loop domain-specific. Do not create a new orches
52
52
  python3 .build-loop/loops/<loop-id>/validators/validate_loop.py
53
53
  ```
54
54
 
55
+ ## Deterministic vs AI Step Rubric
56
+
57
+ For every step in a generated loop, decide whether it is a hardcoded SCRIPT (deterministic) or an AI/LLM step. **Default to code; earn the LLM call.** A probabilistic step placed on a deterministic problem costs money, latency, and audit-failures on *every* run; a deterministic step on a genuinely ambiguous problem fails *visibly* on the long tail. The costs are asymmetric, so when in doubt, choose deterministic.
58
+
59
+ **DETERMINISTIC (script / rule)** — pick this when the step has any of:
60
+
61
+ - Enumerable / bounded inputs.
62
+ - Machine-checkable output against a fixed contract.
63
+ - Commits an irreversible or system-of-record action (write, publish, send, migrate).
64
+ - A safety, compliance, or financial threshold.
65
+ - High call-frequency or cost-sensitivity.
66
+ - Must-not-vary-run-to-run output (determinism is part of the contract).
67
+ - Structure the shell / AST / schema already encodes (parse it, don't ask a model to guess it).
68
+
69
+ **AI / PROBABILISTIC (LLM)** — pick this only when the step genuinely needs:
70
+
71
+ - Natural-language understanding of intent, tone, or semantics.
72
+ - Open-ended generation, summarization, or insight-extraction.
73
+ - Long-tail inputs no finite rule covers.
74
+ - Judgment or ambiguity as the *actual work*, not incidental to it.
75
+
76
+ **HYBRID is the default shape:** deterministic scaffold → a narrow LLM step only where a rule can't reach → a deterministic verify/gate on the LLM output. Every generated LLM step must carry (a) an output schema/type and (b) a deterministic post-check. **If you can't write the post-check, the step's boundary is wrong** — narrow the LLM's job until its output is checkable.
77
+
78
+ **Tie-breaker:** default to deterministic.
79
+
80
+ This rubric is the loop-authoring twin of build-loop's Item-18 `dispatch_tier` `script` eligibility test (`skills/spec-writing/SKILL.md` §Item 18 — machine-checkable output, fully enumerable inputs, tool exists or is ≤~50 LOC + colocated test) and the repo's deterministic-first posture (`skills/build-loop/references/deterministic-checks.md` where present). Assign the same way here: a loop step earns an LLM tier only when a script cannot reach the work.
81
+
82
+ Provenance for the rubric (cite when adapting): Anthropic, "Building Effective Agents" (start with the simplest thing that works; prefer composable *workflows* with deterministic code paths + gates over open-ended agents); OpenAI, "A Practical Guide to Building Agents" (validate you actually NEED an agent before building one; rate each tool/action by write-access, reversibility, and financial impact, and gate high-risk actions deterministically). Both land on the same posture build-loop already runs: deterministic by default, LLM where judgment is the work, a check on every probabilistic output. See `build-loop-memory/research/2026-07-06-ai-coding-fundamentals-and-harness-claims.md` (Claim 5).
83
+
84
+ > **Loop-spec encoding.** Declare each step's assignment with the optional `step_type` (`script | ai | hybrid`) and `post_check` fields per phase — see `references/spec-format.md` §"Deterministic vs AI Steps". These are advisory today (no generator lint yet — see the note in that section); write them so the rubric is auditable by a reviewer and enforceable later.
85
+
55
86
  ## Skill Chaining Guidance
56
87
 
57
88
  Use skill chaining when the loop has stable phase boundaries and at least one phase is better handled by an existing specialized skill.
@@ -46,6 +46,33 @@ skill_chain:
46
46
  handoff_artifact: "source_inventory.md"
47
47
  ```
48
48
 
49
+ ## Deterministic vs AI Steps
50
+
51
+ Each step in a loop is either a hardcoded SCRIPT (deterministic) or an AI/LLM step. **Default to code; earn the LLM call.** The cost of a wrong assignment is asymmetric — a probabilistic step on a deterministic problem burns money/latency/audit-failures every run, while a deterministic step on a genuinely ambiguous problem fails visibly on the long tail — so break ties toward deterministic. The full rubric (DETERMINISTIC / AI / HYBRID triggers, provenance) lives in `SKILL.md` §"Deterministic vs AI Step Rubric".
52
+
53
+ Phases may declare the assignment with two optional fields:
54
+
55
+ | Field | Purpose |
56
+ |---|---|
57
+ | `step_type` | `script` \| `ai` \| `hybrid`. Which executor the step uses. Default `hybrid` for any phase that involves generation or judgment. |
58
+ | `post_check` | The deterministic verify/gate applied to an `ai`/`hybrid` step's output. Names the validator id (from `validators`) or an inline pass/fail rule. Required whenever `step_type` is `ai` or `hybrid`. |
59
+
60
+ Rule: **every `ai`/`hybrid` step must carry (a) an output schema/type and (b) a `post_check`.** If you cannot write the `post_check`, the step's boundary is wrong — narrow the LLM's job until its output is machine-checkable, then re-declare the deterministic parts as `script`.
61
+
62
+ ```yaml
63
+ phases:
64
+ extract_claims:
65
+ step_type: hybrid # deterministic scaffold -> narrow LLM -> deterministic gate
66
+ summary: "Pull material claims from source text with cited spans."
67
+ output_schema: "list[{claim: str, source_span: str, assumption: bool}]"
68
+ post_check: source_trace # validator id: every claim cites a span or is marked assumption
69
+ emit_report:
70
+ step_type: script # bounded inputs, fixed template -> no model needed
71
+ summary: "Render the report from the validated claim list."
72
+ ```
73
+
74
+ > **Advisory-only today.** `loop_builder.py` does not yet lint `step_type`/`post_check` — the generator builds packs from presets, and no preset declares per-step types, so there is no field to check at generation time. Adding a linter now would guard a schema nothing emits (a mechanism ahead of its observed need). These fields are defined here so the rubric is auditable by a reviewer and enforceable once presets/specs start declaring them. Aligns with build-loop's Item-18 `dispatch_tier` advisory checks (`tier-sanity-*`), which likewise WARN rather than block.
75
+
49
76
  ## Gate Rules
50
77
 
51
78
  Keep common gates centralized. Loop specs should name examples, not redefine policy.