@tyroneross/build-loop 0.30.3 → 0.34.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 +4 -4
- package/.claude-plugin/plugin.json +1 -1
- package/.codex-plugin/plugin.json +1 -1
- package/AGENTS.md +9 -0
- package/README.md +8 -7
- package/agents/advisor.md +111 -0
- package/agents/alignment-checker.md +11 -0
- package/agents/assessment-orchestrator.md +1 -1
- package/agents/build-orchestrator.md +28 -33
- package/agents/fact-checker.md +1 -1
- package/agents/fix-critique.md +1 -1
- package/agents/independent-auditor.md +1 -1
- package/agents/overfitting-reviewer.md +1 -1
- package/agents/plan-critic.md +5 -4
- package/agents/promotion-reviewer.md +1 -1
- package/agents/retrospective-synthesizer.md +20 -3
- package/agents/scope-auditor.md +1 -1
- package/agents/security-reviewer.md +1 -1
- package/agents/self-improvement-architect.md +1 -1
- package/commands/{handoff.md → compose-handoff.md} +4 -4
- package/commands/{optimize.md → optimize-run.md} +1 -1
- package/commands/{agent-rally-point.md → rally-point.md} +3 -3
- package/commands/{research.md → research-run.md} +1 -1
- package/commands/setup-memory.md +32 -0
- package/commands/{plan-verify.md → verify-plan.md} +1 -1
- package/docs/agent-surface-policy.md +38 -20
- package/docs/memory-setup.md +19 -14
- package/hooks/_resolve_python.sh +28 -0
- package/hooks/closeout.sh +58 -0
- package/hooks/git/pre-push +69 -6
- package/hooks/hooks.json +34 -13
- package/hooks/post-push-closeout.sh +73 -0
- package/hooks/session-start-closeout.sh +69 -0
- package/hooks/session-start-memory.sh +27 -0
- package/hooks/session-start-plugin-heal.sh +33 -0
- package/hooks/test_closeout.sh +124 -0
- package/package.json +7 -4
- package/plugin-artifacts/codex/.codex-plugin/plugin.json +41 -0
- package/plugin-artifacts/codex/AGENTS.md +499 -0
- package/plugin-artifacts/codex/BUILD-ARTIFACT.md +5 -0
- package/plugin-artifacts/codex/LICENSE +202 -0
- package/plugin-artifacts/codex/README.md +404 -0
- package/plugin-artifacts/codex/docs/agent-surface-policy.md +63 -0
- package/plugin-artifacts/codex/references/advisor-dispatch-ladder.md +62 -0
- package/plugin-artifacts/codex/references/agent-role-taxonomy.md +101 -0
- package/plugin-artifacts/codex/references/autonomous-and-per-commit-modes.md +161 -0
- package/plugin-artifacts/codex/references/autonomy-config.md +231 -0
- package/plugin-artifacts/codex/references/capability-routing.md +182 -0
- package/plugin-artifacts/codex/references/codex-subagents.md +106 -0
- package/plugin-artifacts/codex/references/coordination-file-template.md +181 -0
- package/plugin-artifacts/codex/references/coordination-rules.md +283 -0
- package/plugin-artifacts/codex/references/dogfood-reload-checkpoint.md +112 -0
- package/plugin-artifacts/codex/references/halt-and-ask-protocol.md +102 -0
- package/plugin-artifacts/codex/references/implementer-envelope-schema.md +302 -0
- package/plugin-artifacts/codex/references/intent-capability-pack.md +257 -0
- package/plugin-artifacts/codex/references/intent-exploration-prompts.md +96 -0
- package/plugin-artifacts/codex/references/leadership.md +72 -0
- package/plugin-artifacts/codex/references/memory-systems.md +238 -0
- package/plugin-artifacts/codex/references/memory.md +297 -0
- package/plugin-artifacts/codex/references/model-tier-mapping.md +257 -0
- package/plugin-artifacts/codex/references/modular-systems-pack.md +96 -0
- package/plugin-artifacts/codex/references/phase-1-assess.md +231 -0
- package/plugin-artifacts/codex/references/phase-2-plan.md +77 -0
- package/plugin-artifacts/codex/references/phase-3-execute.md +47 -0
- package/plugin-artifacts/codex/references/phase-4-review.md +320 -0
- package/plugin-artifacts/codex/references/phase-5-iterate.md +71 -0
- package/plugin-artifacts/codex/references/phase-6-learn.md +56 -0
- package/plugin-artifacts/codex/references/recent-design-structures.md +274 -0
- package/plugin-artifacts/codex/references/research-trigger-policy.md +140 -0
- package/plugin-artifacts/codex/references/runtime-smoke-triggers.md +42 -0
- package/plugin-artifacts/codex/references/self-review.md +234 -0
- package/plugin-artifacts/codex/references/single-writer-commit-protocol.md +90 -0
- package/plugin-artifacts/codex/references/task-capture-policy.md +68 -0
- package/plugin-artifacts/codex/references/ui-io-contract.md +116 -0
- package/plugin-artifacts/codex/references/ui-spotcheck-protocol.md +65 -0
- package/plugin-artifacts/codex/skills/build-loop/SKILL.md +372 -0
- package/plugin-artifacts/codex/skills/build-loop/detect-plugins.mjs +82 -0
- package/plugin-artifacts/codex/skills/build-loop/eval-guide.md +65 -0
- package/plugin-artifacts/codex/skills/build-loop/fallbacks.md +549 -0
- package/plugin-artifacts/codex/skills/build-loop/phases/fact-check.md +42 -0
- package/plugin-artifacts/codex/skills/build-loop/phases/ui-validation.md +267 -0
- package/plugin-artifacts/codex/skills/build-loop/references/advisor-dispatch-ladder.md +62 -0
- package/plugin-artifacts/codex/skills/build-loop/references/apple-native-planning.md +439 -0
- package/plugin-artifacts/codex/skills/build-loop/references/autonomous-and-per-commit-modes.md +161 -0
- package/plugin-artifacts/codex/skills/build-loop/references/capability-routing.md +182 -0
- package/plugin-artifacts/codex/skills/build-loop/references/codex-subagents.md +106 -0
- package/plugin-artifacts/codex/skills/build-loop/references/coordination.md +161 -0
- package/plugin-artifacts/codex/skills/build-loop/references/correction-aware-capture.md +177 -0
- package/plugin-artifacts/codex/skills/build-loop/references/independent-auditor.md +72 -0
- package/plugin-artifacts/codex/skills/build-loop/references/intent-capability-pack.md +257 -0
- package/plugin-artifacts/codex/skills/build-loop/references/intent-exploration-prompts.md +96 -0
- package/plugin-artifacts/codex/skills/build-loop/references/leadership.md +72 -0
- package/plugin-artifacts/codex/skills/build-loop/references/memory.md +297 -0
- package/plugin-artifacts/codex/skills/build-loop/references/modular-systems-pack.md +96 -0
- package/plugin-artifacts/codex/skills/build-loop/references/output-style.md +129 -0
- package/plugin-artifacts/codex/skills/build-loop/references/pay-it-forward-arch.md +98 -0
- package/plugin-artifacts/codex/skills/build-loop/references/phase-1-assess.md +231 -0
- package/plugin-artifacts/codex/skills/build-loop/references/phase-2-plan.md +77 -0
- package/plugin-artifacts/codex/skills/build-loop/references/phase-3-execute.md +47 -0
- package/plugin-artifacts/codex/skills/build-loop/references/phase-4-review.md +320 -0
- package/plugin-artifacts/codex/skills/build-loop/references/phase-5-iterate.md +71 -0
- package/plugin-artifacts/codex/skills/build-loop/references/phase-6-learn.md +56 -0
- package/plugin-artifacts/codex/skills/build-loop/references/recent-design-structures.md +274 -0
- package/plugin-artifacts/codex/skills/build-loop/references/refactor-history/ASSESSMENT.md +85 -0
- package/plugin-artifacts/codex/skills/build-loop/references/refactor-history/STANDALONE_TEST_RUN.md +149 -0
- package/plugin-artifacts/codex/skills/build-loop/references/refactor-history/scenarios/01-simple-bugfix.md +32 -0
- package/plugin-artifacts/codex/skills/build-loop/references/refactor-history/scenarios/02-ui-build-with-iteration.md +48 -0
- package/plugin-artifacts/codex/skills/build-loop/references/refactor-history/scenarios/03-multi-failure-escalation.md +60 -0
- package/plugin-artifacts/codex/skills/build-loop/references/refactor-history/scenarios/04-ui-build-ibr-absent.md +51 -0
- package/plugin-artifacts/codex/skills/build-loop/references/refactor-history/scenarios/05-refactor-navgator-absent.md +71 -0
- package/plugin-artifacts/codex/skills/build-loop/references/refactor-history/scenarios/06-recurring-bug-debugger-absent.md +52 -0
- package/plugin-artifacts/codex/skills/build-loop/references/refactor-history/trace-comparison.md +202 -0
- package/plugin-artifacts/codex/skills/build-loop/references/self-recursive-dev.md +77 -0
- package/plugin-artifacts/codex/skills/build-loop/references/self-review.md +234 -0
- package/plugin-artifacts/codex/skills/build-loop/references/ui-io-contract.md +116 -0
- package/plugin-artifacts/codex/skills/build-loop/scanners/audit-design-rules.mjs +476 -0
- package/plugin-artifacts/codex/skills/build-loop/scanners/require-visual-evidence.mjs +239 -0
- package/plugin-artifacts/codex/skills/build-loop/templates/backlog-item.md +35 -0
- package/plugin-artifacts/codex/skills/build-loop/templates/codex-worker-prompt.md +96 -0
- package/plugin-artifacts/codex/skills/build-loop/templates/ui-subagent-prompt.md +179 -0
- package/plugin-artifacts/codex/skills/build-loop/templates/ux-fix-plan.md +40 -0
- package/scripts/_paths.py +59 -13
- package/scripts/build_codex_plugin_artifact.py +314 -0
- package/scripts/check_cache_sync.py +1 -1
- package/scripts/install_memory.py +11 -3
- package/scripts/prune_plugin_cache.py +225 -11
- package/scripts/sync_navgator_lessons.py +25 -0
- package/scripts/sync_plugin_cache.py +66 -36
- package/skills/agent-rally-point/SKILL.md +1 -1
- package/skills/agent-rally-watcher/SKILL.md +1 -1
- package/skills/build-loop/SKILL.md +11 -155
- package/skills/build-loop/references/advisor-dispatch-ladder.md +62 -0
- package/skills/build-loop/references/autonomous-and-per-commit-modes.md +161 -0
- package/skills/build-loop/references/capability-routing.md +4 -3
- package/skills/build-loop/references/codex-subagents.md +8 -0
- package/skills/build-loop/references/coordination.md +1 -1
- package/skills/build-loop/references/intent-capability-pack.md +88 -1
- package/skills/build-loop/references/memory.md +17 -2
- package/skills/build-loop/references/phase-1-assess.md +13 -0
- package/skills/build-loop/references/phase-2-plan.md +1 -1
- package/skills/build-loop/references/phase-4-review.md +12 -0
- package/skills/build-loop/references/phase-6-learn.md +1 -1
- package/skills/build-loop/references/self-review.md +4 -2
- package/skills/build-loop/templates/codex-worker-prompt.md +41 -34
- package/skills/handoff/SKILL.md +3 -3
- package/skills/loop-builder/SKILL.md +98 -0
- package/skills/loop-builder/presets/active-project-evidence.yaml +97 -0
- package/skills/loop-builder/presets/generic-artifact-loop.yaml +95 -0
- package/skills/loop-builder/presets/presentation-audit.yaml +96 -0
- package/skills/loop-builder/presets/research-synthesis.yaml +96 -0
- package/skills/loop-builder/presets/source-ingestion-raw-data-audit.yaml +96 -0
- package/skills/loop-builder/references/spec-format.md +80 -0
- package/skills/loop-builder/scripts/loop_builder.py +346 -0
- package/skills/model-tiering/SKILL.md +65 -40
- package/skills/optimize/SKILL.md +2 -2
- package/skills/plan-verify/SKILL.md +1 -1
- package/skills/plugin-builder/references/distribution.md +8 -0
- package/skills/research/SKILL.md +33 -6
- package/skills/runtime-parity-verification/SKILL.md +51 -0
- package/skills/spec-writing/SKILL.md +19 -0
- package/templates/memory/README.md +65 -0
- package/templates/memory/charter.md.template +46 -0
- package/templates/memory/manifest.json +24 -4
- package/codex-skills/debug-loop/SKILL.md +0 -18
- package/codex-skills/handoff/SKILL.md +0 -22
- package/codex-skills/knowledge/SKILL.md +0 -21
- package/codex-skills/optimize/SKILL.md +0 -18
- package/codex-skills/research/SKILL.md +0 -18
- /package/commands/{knowledge-review.md → review-knowledge.md} +0 -0
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
<!-- SPDX-FileCopyrightText: 2025-2026 Tyrone Ross, Jr <46267523+tyroneross@users.noreply.github.com> -->
|
|
2
|
+
<!-- SPDX-License-Identifier: Apache-2.0 -->
|
|
3
|
+
|
|
4
|
+
# Independent Commit Auditor
|
|
5
|
+
|
|
6
|
+
Single source of truth for build-loop commit/build-scope adversarial review. **Consolidated 2026-05-23** — replaces both the retired `commit-auditor` agent (chunk + build scope) and the earlier retired `sonnet-critic`. Operates on two surfaces sharing one context-gathering procedure and one verdict taxonomy:
|
|
7
|
+
|
|
8
|
+
1. **Boundary-gated hook (every commit).** A PreToolUse Bash hook in `hooks/hooks.json` invokes `scripts/audit_before_commit.py` whenever the Bash tool runs a command matching `git commit`. The orchestrator cannot skip it. Manual user commits, Codex commits, IDE commits, and build-loop commits all pass through it.
|
|
9
|
+
2. **Self-contextualizing.** The script gathers its own context from on-disk `.build-loop/intent.md`, `.build-loop/goal.md`, repo `CLAUDE.md` + `README.md`, the first PRD found (`docs/PRD.md` -> `docs/prd.md` -> `docs/prd/*.md` -> `.build-loop/prd.md`), canonical build-loop-memory constitution context, and the last 5 commit subjects. No upstream packet needed.
|
|
10
|
+
3. **LLM-grade dispatched agent.** The `independent-auditor` agent (`agents/independent-auditor.md`) is dispatched at Phase 3 chunk-close (chunk advisory) and Phase 4 Review-A (build scope). Same context procedure as the hook, plus diff range — emits a structured JSON envelope. Verdict rendered in conversation by the running Claude session.
|
|
11
|
+
|
|
12
|
+
## Four-verdict taxonomy
|
|
13
|
+
|
|
14
|
+
- **yay (approve)** — packet aligns with intent + constitution; ship.
|
|
15
|
+
- **nay (reject)** — packet contradicts intent or trips a constitution rule; do not land.
|
|
16
|
+
- **suggest correction** — partial alignment; name file:line edits the implementer should make before re-committing.
|
|
17
|
+
- **look again** — context insufficient to judge; name the missing artifact (PRD section, prior decision, test result) and gather it.
|
|
18
|
+
|
|
19
|
+
## When the hook fires
|
|
20
|
+
|
|
21
|
+
Every Bash tool invocation whose command matches `\bgit\s+commit\b`. The hook timeout is 5000ms; the script is fast (no LLM call, no network). It runs at the Bash boundary, so it fires before the commit lands — the running session can short-circuit by not actually committing if the packet shows a contradiction.
|
|
22
|
+
|
|
23
|
+
## Exit codes
|
|
24
|
+
|
|
25
|
+
| Code | Meaning | Caller behavior |
|
|
26
|
+
|---|---|---|
|
|
27
|
+
| 0 | Packet emitted, no deterministic block | Commit proceeds; running session renders a verdict in chat |
|
|
28
|
+
| 2 | Deterministic block (secrets file staged, merge-conflict markers in diff) | Caller / hook framework signals the commit should not proceed |
|
|
29
|
+
| 1 | Reserved | — |
|
|
30
|
+
|
|
31
|
+
Deterministic blocks are zero-judgment hard fails (filenames matching `*.pem` / `id_rsa*` / `id_ed25519*`, `.env*` files with credential-shaped content, or `<<<<<<< HEAD` / `=======` / `>>>>>>>` markers in the staged diff).
|
|
32
|
+
|
|
33
|
+
## Bypass
|
|
34
|
+
|
|
35
|
+
Emergency commits can bypass the audit by setting `BUILDLOOP_AUDIT_BYPASS=1` in the environment:
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
BUILDLOOP_AUDIT_BYPASS=1 git commit -m "emergency hotfix"
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
Each bypass is logged to `~/.build-loop/audit-bypass.log` with timestamp + cwd + reason. Bypasses are valid but visible — Phase 6 Learn can mine the log for chronic-bypass patterns.
|
|
42
|
+
|
|
43
|
+
## Dispatched-agent surface
|
|
44
|
+
|
|
45
|
+
For LLM-grade judgment on a specific commit or commit range, dispatch `Agent(subagent_type="build-loop:independent-auditor", ...)`. The agent uses the same context-gathering procedure as the script and renders a structured JSON envelope (with explicit `context_seen` flags and `missing_artifacts[]`). The agent is Sonnet-tier; use it for per-chunk advisory, cross-chunk reviews, and Phase 4 Review-A build-scope critique.
|
|
46
|
+
|
|
47
|
+
## Dispatch ladder & `auditor_status` — the LLM auditor is never silently skipped (GAP-1)
|
|
48
|
+
|
|
49
|
+
`Agent(subagent_type=...)` only works from a context that HAS the Agent tool. When the build-loop **orchestrator itself runs as a nested subagent** (dispatched via the Agent tool as `build-loop:build-orchestrator`, or running per-commit mode), the harness blocks sub-subagents — so that orchestrator **cannot** dispatch this agent. The historical defect (2026-06-06 IBR retro): the nested orchestrator silently fell back to inline self-reasoning and reported "independent-auditor ran inline", which rubber-stamped a HIGH cookie-leak + 2 MEDIUM findings that a real dispatch later caught. **Inline self-audit is not the independent auditor.**
|
|
50
|
+
|
|
51
|
+
There are exactly **three honest ways a real auditor verdict enters `judge_decisions[]`**, and one honest "didn't run" signal:
|
|
52
|
+
|
|
53
|
+
| `auditor_status` | How the verdict was produced | `judge_id` written |
|
|
54
|
+
|---|---|---|
|
|
55
|
+
| `ran:dispatched-agent` | `Agent(subagent_type="build-loop:independent-auditor")` — Agent tool present (top-level / Mode A) | `independent-auditor` |
|
|
56
|
+
| `ran:peer-host(<host>)` | Auditor run as a peer process (rally channel / `codex exec`) — used when the orchestrator is nested but a peer host is reachable (Bash survives nesting) | `independent-auditor` |
|
|
57
|
+
| (hook) | The PreToolUse boundary hook `scripts/audit_before_commit.py` | `independent-auditor-hook` |
|
|
58
|
+
| `not-run:parent-must-dispatch` / `cross-vendor-deferred` | No Agent tool AND no peer host could execute. **No `independent-auditor`-labeled verdict is written.** | — |
|
|
59
|
+
|
|
60
|
+
**Never-masquerade rule:** do not write a `judge_id` containing `independent-auditor` for inline orchestrator reasoning. If neither a dispatched agent, a peer-host process, nor the hook produced a verdict, the only honest record is `auditor_status: not-run:parent-must-dispatch` in the orchestrator's return envelope — never a fabricated verdict. A `not-run` run is **not review-complete**: the dispatching parent (which has the Agent tool) owes the audit before Report. Full ladder + parent-dispatch contract in `phase-4-review.md` §"Sub-step A"; the structural backstop is `scripts/write_run_entry` (`review_completeness_error` → exit 3 on a `scope=build` code-touching `pass` that lacks a real auditor verdict).
|
|
61
|
+
|
|
62
|
+
## How the running session should interpret a packet
|
|
63
|
+
|
|
64
|
+
When a Bash `git commit` returns with the packet appended to stderr:
|
|
65
|
+
|
|
66
|
+
1. **Read the packet sections** (Intent, Goal, PRD reference, Trajectory, etc.).
|
|
67
|
+
2. **Pick a verdict** explicitly in your next assistant message — the user (and any audit-trail tooling) needs to see the verdict named, not implied.
|
|
68
|
+
3. **If `yay`**, no further action — the commit is in.
|
|
69
|
+
4. **If `nay` or `suggest correction`**, do not push. State which finding triggered the verdict and either revert (`git reset HEAD~1`) or make the suggested edits and amend.
|
|
70
|
+
5. **If `look again`**, gather the missing artifact (read the PRD section, dispatch the escalation agent, etc.) and re-render the verdict.
|
|
71
|
+
|
|
72
|
+
The verdict belongs in the running session's transcript so future readers (and Phase 6 Learn) can see what the auditor saw and what the operator did with it.
|
|
@@ -0,0 +1,257 @@
|
|
|
1
|
+
<!-- SPDX-FileCopyrightText: 2025-2026 Tyrone Ross, Jr <46267523+tyroneross@users.noreply.github.com> | SPDX-License-Identifier: Apache-2.0 -->
|
|
2
|
+
|
|
3
|
+
# Intent Capability Pack
|
|
4
|
+
|
|
5
|
+
Use this pack on every build. It keeps decentralized subagent work aligned to the app's purpose, the user's actual job, and the update's intent.
|
|
6
|
+
|
|
7
|
+
## North Star
|
|
8
|
+
|
|
9
|
+
Every build starts by capturing:
|
|
10
|
+
|
|
11
|
+
- **App/repo purpose**: what this product is for and who it serves.
|
|
12
|
+
- **Primary users**: the people or roles affected by this change.
|
|
13
|
+
- **Core jobs**: the tasks users perform most often or rely on most.
|
|
14
|
+
- **Update intent**: why this change matters now.
|
|
15
|
+
- **User value**: how the change makes the product faster, clearer, more accurate, more trustworthy, more useful, or easier to navigate.
|
|
16
|
+
- **Non-goals**: what this build should not add, expose, or complicate.
|
|
17
|
+
|
|
18
|
+
Write the result to `.build-loop/intent.md` and mirror the compact version into `.build-loop/state.json.intent`.
|
|
19
|
+
|
|
20
|
+
### Commander's-intent posture (WP-F, all OPTIONAL — LLM-inferred, confirm-on-ambiguity)
|
|
21
|
+
|
|
22
|
+
North Star captures who/what; **posture** captures the tradeoff stance that drives
|
|
23
|
+
autonomous forks when the agent loses comms (the Marine-Corps commander's-intent
|
|
24
|
+
analog: purpose + key tasks + end state, so a subordinate who can't ask still
|
|
25
|
+
chooses correctly). A walkie-talkie app for generals-on-ops, for kids, and for
|
|
26
|
+
traders share North Star *fields* but differ entirely in *what to optimize when
|
|
27
|
+
forced to choose*. All fields are OPTIONAL and LLM-inferred from the ask; confirm
|
|
28
|
+
only on genuine ambiguity (reuse the restatement protocol — never `AskUserQuestion`,
|
|
29
|
+
never a gate). Mirror into `state.json.intent.posture`.
|
|
30
|
+
|
|
31
|
+
- **audience** + **stakes** — one line each (who the change serves; what a failure
|
|
32
|
+
costs). `stakes` ∈ {low, medium, high}.
|
|
33
|
+
- **priority_order** — the ranked tie-breaker the agent applies when two viable
|
|
34
|
+
paths conflict. FIXED VOCAB (ordered subset of
|
|
35
|
+
`security / reliability / speed / cost / simplicity / polish`) plus a free-text
|
|
36
|
+
`notes` escape for expressiveness. The fixed vocab aids weak-LLM recall; `notes`
|
|
37
|
+
carries anything the vocab can't.
|
|
38
|
+
- **acceptable_tradeoffs** — what is OK to cut under pressure.
|
|
39
|
+
- **non_goals** — what is never cut. At `stakes: high`, a `non_goals` entry that
|
|
40
|
+
names a REAL risk is a candidate to **graduate to a constitution invariant** — but
|
|
41
|
+
only once it is **promoted into the project constitution** (`projects/<slug>/constitution.md`),
|
|
42
|
+
where the LLM enforces it as a hard line. Until promoted, it stays advisory like the
|
|
43
|
+
rest of the posture. There is no separate deterministic gate that reads `non_goals`
|
|
44
|
+
directly (`grep non_goals scripts/` is intentionally empty); enforcement rides the
|
|
45
|
+
constitution, not a parallel mechanism. See the tiered charter below.
|
|
46
|
+
|
|
47
|
+
`priority_order` wires into the `alignment-checker` as the Phase-2-fork and
|
|
48
|
+
Phase-5-queue-drain tie-breaker: not just "matches intent?" but "which viable path
|
|
49
|
+
does THIS user's priority order prefer?" — advisory data the LLM weighs, never a gate.
|
|
50
|
+
|
|
51
|
+
### Tiered intent — `stakes` is the depth dial (WP-F/F2)
|
|
52
|
+
|
|
53
|
+
- **Per-run intent** (ephemeral, `.build-loop/intent.md`): restated ask + this
|
|
54
|
+
change's posture. Unchanged lifecycle.
|
|
55
|
+
- **Project charter** (persistent): stable North Star + posture + invariants + key
|
|
56
|
+
architecture decisions. ACCRETES via promotion — a fact promotes to durable when
|
|
57
|
+
user-confirmed OR stable/unchallenged across N runs; stays `inferred` until then;
|
|
58
|
+
carries the falsifier that would unseat it (doctrine rule 8). Storage + sync:
|
|
59
|
+
`scripts/charter.py` (canonical `build-loop-memory/projects/<slug>/charter.md`;
|
|
60
|
+
repo mirror `.build-loop/charter.md` with a `canonical:` pointer + content hash;
|
|
61
|
+
one writer = the run, from canonical; user hand-edit of the mirror promotes to
|
|
62
|
+
canonical `authored_by: user` on next run via hash-mismatch detection).
|
|
63
|
+
- **Depth scales by `stakes`**: low → intent line only (skills/agents/toys — do NOT
|
|
64
|
+
force a charter, that's the anti-pattern); medium → thin charter (web/mobile);
|
|
65
|
+
high → full charter, and risk-naming `non_goals` become candidates to promote into
|
|
66
|
+
the constitution as invariants (where the LLM enforces them). The promotion is the
|
|
67
|
+
enforcement; no `non_goals`-specific gate exists outside the constitution.
|
|
68
|
+
- **PRD stance**: opt-in upfront via `start-prd`; accretion is the default; never
|
|
69
|
+
required. A PRD, when present, PREFILLS the charter richer — input, not a gate.
|
|
70
|
+
|
|
71
|
+
Enforcement philosophy (binding): all advisory. The one stronger-than-advisory path
|
|
72
|
+
is **constitution promotion** — a risk-naming `non_goals` at `stakes: high` graduates
|
|
73
|
+
to a hard invariant only when it is written into `projects/<slug>/constitution.md`,
|
|
74
|
+
which the LLM treats as a binding line. Per `feedback_deterministic_only_for_known_risks` —
|
|
75
|
+
posture/charter depth is the dial; the LLM weighs, never a gate. The constitution, not
|
|
76
|
+
a `non_goals`-specific script, carries any graduated invariant (no dormant determinism
|
|
77
|
+
claim — there is no `non_goals` enforcement code to wire up).
|
|
78
|
+
|
|
79
|
+
## Intent restatement protocol (always-on)
|
|
80
|
+
|
|
81
|
+
Run this protocol on every build, judged by the orchestrator LLM — never a regex, never a detector script, never a binary gate. Depth scales with ambiguity, not a threshold. The behavior is intrinsic to Phase 1; no separate skill, script, or routing step gates it.
|
|
82
|
+
|
|
83
|
+
### Step A — One-line concrete restatement (always)
|
|
84
|
+
|
|
85
|
+
Read the user's goal text and the surrounding context. Write a single sentence restating the most likely concrete interpretation to `.build-loop/intent.md` under a `## Restated intent` heading. For a concrete unambiguous goal, this is the entire protocol — write the line and move on. No options, no assumption-tagging, no exploration detour. The auto-execute fast path is unaffected.
|
|
86
|
+
|
|
87
|
+
Heuristics the LLM uses (judgment, not a checklist):
|
|
88
|
+
|
|
89
|
+
- Does the goal name a file path, function, schema field, route, command, or other concrete deliverable? → restate once and proceed.
|
|
90
|
+
- Could two reasonable readers infer materially different work? → continue to Step B.
|
|
91
|
+
- Does the goal use investigative or hedging language ("explore", "look into", "something like", "brainstorm", "design from scratch") without a concrete target? → continue to Step B.
|
|
92
|
+
|
|
93
|
+
The judgment is one pass, fast, and does not block. When in doubt about whether ambiguity is "real," do the lighter version (Step A only) and tag assumptions inline so downstream work can correct.
|
|
94
|
+
|
|
95
|
+
### Step B — Options + tradeoffs when ambiguity is genuine
|
|
96
|
+
|
|
97
|
+
When the LLM judges genuine ambiguity (Step A heuristics fail), extend `.build-loop/intent.md` with:
|
|
98
|
+
|
|
99
|
+
```md
|
|
100
|
+
## Approach options
|
|
101
|
+
1. **<short label>** — <≤2 sentences on what + tradeoff>
|
|
102
|
+
2. **<short label>** — <≤2 sentences on what + tradeoff>
|
|
103
|
+
3. **<short label>** — (optional third — stop at 3)
|
|
104
|
+
|
|
105
|
+
## Recommended path
|
|
106
|
+
<one sentence naming option 1/2/3 and the reason>
|
|
107
|
+
|
|
108
|
+
## Scope cuts considered
|
|
109
|
+
- <thing the orchestrator believes can be cut without losing user value>
|
|
110
|
+
- <second if present>
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
Lead with the recommended option. Avoid speculative "we could also" lists. Keep to 1–3 options — the goal is to narrow, not to enumerate.
|
|
114
|
+
|
|
115
|
+
The reference file `skills/build-loop/references/intent-exploration-prompts.md` carries four template patterns (vague-verb, branching-or, creative-open, hedge-phrase) the LLM can consult when shaping options for common ambiguity shapes. Load on demand only when the goal matches one of those shapes.
|
|
116
|
+
|
|
117
|
+
### Step C — Tagged assumptions (always when Step B fires; optional in Step A)
|
|
118
|
+
|
|
119
|
+
For every leap the restatement made that isn't grounded in the repo or the user's prompt, append a `TAG:ASSUMED` line under a `## Open assumptions (TAG:ASSUMED)` heading naming the assumption + the evidence that would close it. Examples:
|
|
120
|
+
|
|
121
|
+
- `TAG:ASSUMED — user wants the smallest concrete restatement; would close by user pinning a specific deliverable.`
|
|
122
|
+
- `TAG:ASSUMED — "explore" means "survey + recommend"; would close by repo showing prior similar work pattern.`
|
|
123
|
+
|
|
124
|
+
Tagged assumptions are the audit trail. The user reads them in the run report and can override on the next dispatch.
|
|
125
|
+
|
|
126
|
+
### Step D — Mirror compact summary to state.json
|
|
127
|
+
|
|
128
|
+
Mirror the result to `.build-loop/state.json.intent`:
|
|
129
|
+
|
|
130
|
+
```json
|
|
131
|
+
{
|
|
132
|
+
"restated_intent": "<one sentence>",
|
|
133
|
+
"approach_options": ["<label>", "<label>"], // optional; empty when Step A alone fired
|
|
134
|
+
"assumptions": ["<line>", "<line>"], // optional; empty when no leaps were made
|
|
135
|
+
"confidence": "high" | "medium" | "low", // LLM judgment, not a script
|
|
136
|
+
"run_id": "<current run_id>" // Step E: the run this intent was written for
|
|
137
|
+
}
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
### Step E — Run-id freshness stamp (per-run staleness guard)
|
|
141
|
+
|
|
142
|
+
`intent.md` lives in `.build-loop/` and survives across runs in the same workdir, so a
|
|
143
|
+
resumed or back-to-back run finds the PRIOR run's intent on disk. The "auto-execute fast
|
|
144
|
+
path" (Step A: "write the line and move on" for a concrete goal) can be misread as
|
|
145
|
+
"the present file already satisfies the protocol", so the rewrite gets skipped and the
|
|
146
|
+
stale intent describes prior work — the exact bl-intent-refresh-per-run failure (the
|
|
147
|
+
A–H consolidation run listed as a non-goal what WP-A shipped).
|
|
148
|
+
|
|
149
|
+
Two cheap, deterministic moves close it:
|
|
150
|
+
|
|
151
|
+
1. **Stamp on write.** Whenever Phase 1 (re)writes `intent.md`, embed the current
|
|
152
|
+
`run_id` as an HTML comment so the prose never has to carry it:
|
|
153
|
+
`<!-- intent_run_id: <run_id> -->` (helper: `intent_freshness.stamp_marker(run_id)`).
|
|
154
|
+
Mirror `run_id` into `state.json.intent.run_id`.
|
|
155
|
+
2. **Check at Phase 1 start.** Run
|
|
156
|
+
`python3 ${CLAUDE_PLUGIN_ROOT}/scripts/intent_freshness.py --workdir "$PWD" --json`.
|
|
157
|
+
A `stale` (stamp ≠ current run) or `unstamped` verdict means the on-disk intent is
|
|
158
|
+
from a prior run — re-run Steps A–D and re-stamp. The check is **advisory** and exit-0
|
|
159
|
+
always: a run-id *mismatch* is an objective structural fact (equality, not a content
|
|
160
|
+
judgment), so detecting it respects "never a content gate" — only the refresh (the LLM
|
|
161
|
+
rewriting the prose) is judgment. Surface the verdict line in the run report; never
|
|
162
|
+
`AskUserQuestion`, never `## Held`, never block.
|
|
163
|
+
|
|
164
|
+
This is detection-by-structure + refresh-by-LLM: it does not re-introduce the retired
|
|
165
|
+
regex that judged intent *content*; it only answers "does this file belong to this run?".
|
|
166
|
+
|
|
167
|
+
### Hard guarantees (non-negotiable)
|
|
168
|
+
|
|
169
|
+
- **Never `AskUserQuestion`.** Intent capture is autonomous. The user reads the restatement + assumptions in the run report and can correct on the next dispatch.
|
|
170
|
+
- **Never `## Held`.** Advisory output only. Phase 2 Plan proceeds with whatever Step A or A+B produced.
|
|
171
|
+
- **Never blocks Phase 1.** A goal that is too ambiguous to restate concretely still gets restated as the best-effort interpretation + assumptions tagged. The flow proceeds.
|
|
172
|
+
- **Fail-safe.** Any error in this protocol (file write fails, intent.md missing) is logged as one line and the build continues. No exit-non-zero path exists here.
|
|
173
|
+
- **Auto-execute fast path preserved.** A concrete unambiguous goal produces the one-line restatement only. Zero added cost for Step B/C. No skill dispatch, no script call, no detection layer.
|
|
174
|
+
- **Fork-on-uncertainty consumes the output.** When Step B fired AND `confidence == "medium"|"low"` AND Phase 2 surfaces 2+ viable approaches differing only on implementation tradeoffs, the orchestrator's existing fork-on-uncertainty rule fans out worktrees per approach. The protocol provides the options; the existing rule consumes them.
|
|
175
|
+
|
|
176
|
+
### Why intrinsic, not gated
|
|
177
|
+
|
|
178
|
+
The prior shape used a regex script to decide whether to run an exploration skill. That regex false-fired on ordinary prose ("auth fails or times out", "returns 200 or 404") and forced exploration detours on concrete goals — violating the no-friction fast-path contract. The LLM judges ambiguity better than a regex can. This protocol is the application of the "host agent is the LLM" principle to intent capture.
|
|
179
|
+
|
|
180
|
+
## Intent Packet
|
|
181
|
+
|
|
182
|
+
Every subagent prompt must include this packet:
|
|
183
|
+
|
|
184
|
+
```md
|
|
185
|
+
North star: <one sentence>
|
|
186
|
+
Update intent: <one sentence>
|
|
187
|
+
Primary user/workflow: <who does what>
|
|
188
|
+
This task fits by: <how this subtask advances the build>
|
|
189
|
+
User-value rule: <speed | accuracy | trust | navigation | scalability | reduced choice burden | other>
|
|
190
|
+
Decision constraints:
|
|
191
|
+
- No fake data or mock responses in production/user decision paths.
|
|
192
|
+
- No dead controls, dead navigation, decorative options, or UI promises without working behavior.
|
|
193
|
+
- Prefer the simplest approach that preserves user value and long-term scalability.
|
|
194
|
+
- Use a more complex approach only when the simpler approach harms user experience, correctness, extensibility, or performance.
|
|
195
|
+
Evidence required: <tests, build, visual check, data trace, performance check, etc.>
|
|
196
|
+
```
|
|
197
|
+
|
|
198
|
+
## Decision Rules
|
|
199
|
+
|
|
200
|
+
- **Real value beats apparent progress**. A UI that looks complete but hides mock data is worse than an honest incomplete state.
|
|
201
|
+
- **Basics must be excellent**. Core flows, data accuracy, loading, empty states, error states, navigation, and primary actions matter more than secondary features.
|
|
202
|
+
- **Every visible element needs intent**. Each button, label, option, nav item, chart, and message must help the user act, understand, decide, or recover.
|
|
203
|
+
- **One clear primary action by default**. Multiple hero or primary buttons need a strong reason. If choices create confusion, reduce them.
|
|
204
|
+
- **No non-working promises**. Do not ship listed options, nav items, filters, actions, charts, or integrations that do nothing or return placeholders.
|
|
205
|
+
- **Simplicity is not shortcutting**. Prefer the smallest durable solution. Choose additional complexity only when it materially improves user value, reliability, scalability, or future optionality.
|
|
206
|
+
- **End-to-end data integrity matters**. If users make decisions from search, charts, metrics, recommendations, or summaries, trace those outputs to real sources.
|
|
207
|
+
|
|
208
|
+
## UI Standard: Beauty in the Basics
|
|
209
|
+
|
|
210
|
+
For UI work, the baseline is intentional, useful, and polished:
|
|
211
|
+
|
|
212
|
+
- **Hierarchy**: the screen makes the next best action obvious.
|
|
213
|
+
- **Copy**: text is specific, truthful, and necessary. Remove generic filler.
|
|
214
|
+
- **Controls**: controls have working behavior, appropriate affordance, and accessible labels.
|
|
215
|
+
- **Navigation**: navigation reflects real destinations and common workflows.
|
|
216
|
+
- **Choices**: option count is constrained to what users can meaningfully use.
|
|
217
|
+
- **States**: loading, empty, error, success, disabled, and permission states are designed, not incidental.
|
|
218
|
+
- **Data displays**: charts, tables, search results, and metrics show real data or a clear unavailable state.
|
|
219
|
+
- **Performance**: avoid visual or data-flow choices that make common tasks slower without clear value.
|
|
220
|
+
- **Scalability**: layouts and data models should tolerate realistic growth without immediate redesign.
|
|
221
|
+
|
|
222
|
+
## User-Impact Issue Rule
|
|
223
|
+
|
|
224
|
+
When build-loop discovers a bug or issue while working:
|
|
225
|
+
|
|
226
|
+
1. Ask whether it impacts users by checking:
|
|
227
|
+
- Does it make the app slower or faster?
|
|
228
|
+
- Does it make information less or more accurate?
|
|
229
|
+
- Does it affect trust, data integrity, security, or recovery from failure?
|
|
230
|
+
- Does it make core workflows easier or harder to navigate?
|
|
231
|
+
- Does it add unnecessary choices or remove useful optionality?
|
|
232
|
+
- Does it create short-term code that blocks scalable future work?
|
|
233
|
+
2. If yes and the fix is local to the current build, add it to the plan and fix it automatically.
|
|
234
|
+
3. If yes but the fix is too large or risky, log it to `.build-loop/issues/` with user impact, proposed fix, and why it was deferred.
|
|
235
|
+
4. If no, log only when it is likely to affect future maintenance.
|
|
236
|
+
|
|
237
|
+
## Review Gates
|
|
238
|
+
|
|
239
|
+
Review must check:
|
|
240
|
+
|
|
241
|
+
- **Intent fidelity**: the implementation advances the north star and update intent.
|
|
242
|
+
- **User value**: the result improves at least one declared user-value rule.
|
|
243
|
+
- **UI intentionality**: visible elements are meaningful, working, and not excessive.
|
|
244
|
+
- **Data integrity**: production/user decision paths do not use fake, random, or placeholder data.
|
|
245
|
+
- **Simplicity and scalability**: the solution is the simplest durable approach that protects user experience.
|
|
246
|
+
|
|
247
|
+
## Source Basis
|
|
248
|
+
|
|
249
|
+
This pack operationalizes human-centered design and usability principles from:
|
|
250
|
+
|
|
251
|
+
- [ISO 9241-210:2019](https://www.iso.org/standard/77520.html): human-centered design across the interactive-system life cycle.
|
|
252
|
+
- [NIST summary of ISO human-centered design](https://www.nist.gov/itl/iad/visualization-and-usability-group/human-factors-human-centered-design): explicit users/tasks/environments, iterative evaluation, whole user experience, and multidisciplinary perspective.
|
|
253
|
+
- [GOV.UK Service Manual: understand users and their needs](https://www.gov.uk/service-manual/service-standard/point-1-understand-user-needs): understand full context, validate assumptions, and avoid building the wrong thing.
|
|
254
|
+
- [GOV.UK Service Manual: learning about users and their needs](https://www.gov.uk/service-manual/user-centred-design/user-needs): design around real user needs and keep needs traceable to user stories.
|
|
255
|
+
- [W3C WCAG 2.2 Understanding](https://www.w3.org/WAI/WCAG22/understanding/): accessible interfaces should be perceivable, operable, understandable, and robust.
|
|
256
|
+
- [Apple Human Interface Guidelines](https://developer.apple.com/design/human-interface-guidelines/): hierarchy, harmony, consistency, accessibility, platform patterns, and common components.
|
|
257
|
+
- [Nielsen Norman Group usability heuristics](https://www.nngroup.com/articles/ten-usability-heuristics/): visibility, match to real world, user control, consistency, error prevention, recognition, flexibility, minimalist design, recovery, and help.
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
<!-- SPDX-FileCopyrightText: 2025-2026 Tyrone Ross, Jr <46267523+tyroneross@users.noreply.github.com> | SPDX-License-Identifier: Apache-2.0 -->
|
|
2
|
+
|
|
3
|
+
# Intent exploration prompt templates
|
|
4
|
+
|
|
5
|
+
Loaded ON DEMAND by the orchestrator when its LLM judges intent genuinely ambiguous during Phase 1 Step B (`skills/build-loop/references/intent-capability-pack.md` § Intent restatement protocol). Never auto-fires on regex detection. Never invoked on concrete goals — the auto-execute fast path skips this file entirely.
|
|
6
|
+
|
|
7
|
+
Each template covers one common ambiguity shape and produces the structure required by Step B of the protocol. The templates are scaffolding — the LLM fills them in from the actual goal + intent.md + repo context. Each section header in the output is fixed; the body is adaptive.
|
|
8
|
+
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
## Pattern 1 — vague-verb ("explore", "figure out", "see if", "look into", "play with", "think about")
|
|
12
|
+
|
|
13
|
+
The goal uses an investigative verb without a concrete target. Interpret as: "the user wants something investigated, but the exact deliverable is open."
|
|
14
|
+
|
|
15
|
+
Restate as one of:
|
|
16
|
+
|
|
17
|
+
- "Survey X and produce a one-page summary of <observed state, recommended action>"
|
|
18
|
+
- "Run a non-destructive scan of X and write findings to `.build-loop/research/`"
|
|
19
|
+
- "Read X and answer the implicit question: <one-sentence inferred question>"
|
|
20
|
+
|
|
21
|
+
**Approach options to consider:**
|
|
22
|
+
|
|
23
|
+
1. **Inventory pass** — list what exists, no judgments. Fastest. Tradeoff: user still has to decide.
|
|
24
|
+
2. **Inventory + recommendation** — list + opinion on best path. More work. Tradeoff: opinion may not match user's constraints.
|
|
25
|
+
3. **Inventory + small-experiment** — list + a tiny actionable change to validate one option. Most useful when the cost of the experiment is low.
|
|
26
|
+
|
|
27
|
+
**Default**: option 2 unless the repo shows zero prior similar work (then option 1).
|
|
28
|
+
|
|
29
|
+
---
|
|
30
|
+
|
|
31
|
+
## Pattern 2 — branching-or ("X or Y" as competing paths)
|
|
32
|
+
|
|
33
|
+
The goal names two candidate paths. Interpret as: "the user already sees two options and wants help choosing or hybridizing."
|
|
34
|
+
|
|
35
|
+
**Important judgment**: most "or" phrases in goal text are NOT this pattern. "Verify the endpoint returns 200 or 404" is enumeration, not branching. "Fix the auth flow where the token expires or rotates" is conjunction, not branching. Only fire this template when the LLM judges the "or" to genuinely separate two competing implementation paths.
|
|
36
|
+
|
|
37
|
+
Restate as: "Recommend X or Y for <restated underlying goal>, with the evidence that drove the choice."
|
|
38
|
+
|
|
39
|
+
**Approach options:**
|
|
40
|
+
|
|
41
|
+
1. **Adopt the cheaper option** — explicitly. Tradeoff: locked-in if requirements grow.
|
|
42
|
+
2. **Adopt the more general option** — explicitly. Tradeoff: more work now.
|
|
43
|
+
3. **Hybrid** — name the smallest combination that gets the user-value of both. Often the right answer when the user already named two options.
|
|
44
|
+
|
|
45
|
+
**Default**: option 3 if the two options aren't mutually exclusive; otherwise the one with fewer foreclosed future capabilities (per `pay-it-forward-arch.md`).
|
|
46
|
+
|
|
47
|
+
---
|
|
48
|
+
|
|
49
|
+
## Pattern 3 — creative-open ("brainstorm", "design from scratch", "greenfield", "open-ended")
|
|
50
|
+
|
|
51
|
+
The goal explicitly invites generative work. Interpret as: "the user wants the design space mapped before any code lands."
|
|
52
|
+
|
|
53
|
+
Restate as: "Map the design space for <target>, recommend a starting point, name the cuts."
|
|
54
|
+
|
|
55
|
+
**Approach options:**
|
|
56
|
+
|
|
57
|
+
1. **Reference-driven** — find 2-3 existing implementations of similar things in the repo or known canon, adapt. Lowest risk.
|
|
58
|
+
2. **Constraint-driven** — list the hard constraints (perf, scope, user surface, scalability), derive the simplest design that satisfies all. Best when constraints are sharp.
|
|
59
|
+
3. **Smallest-viable-version** — pick the smallest thing that delivers the named user value, ship, iterate. Default for creative-open scope without sharp constraints.
|
|
60
|
+
|
|
61
|
+
**Default**: option 3 unless the repo has 2+ obvious reference patterns (then option 1).
|
|
62
|
+
|
|
63
|
+
---
|
|
64
|
+
|
|
65
|
+
## Pattern 4 — hedge-phrase ("something like", "kind of", "sort of", "maybe", "not sure")
|
|
66
|
+
|
|
67
|
+
The goal uses hedging language. Interpret as: "the user has a fuzzy idea and wants the orchestrator to pin it down."
|
|
68
|
+
|
|
69
|
+
Restate as: "The fuzzy idea is most likely <concrete restatement>; restated for clarity."
|
|
70
|
+
|
|
71
|
+
**Approach options:**
|
|
72
|
+
|
|
73
|
+
1. **Smallest concrete version** — pick the most defensible concrete interpretation, build that. Tradeoff: may not be what the user actually pictured.
|
|
74
|
+
2. **2-option preview** — name two interpretations, build the smaller as a probe. Tradeoff: more setup, more learning.
|
|
75
|
+
3. **Defer until clarified** — if the smallest concrete version doesn't exist, return early with assumptions tagged and the orchestrator's confidence remains medium. The user reads the run report and re-dispatches with a sharpened goal.
|
|
76
|
+
|
|
77
|
+
**Default**: option 1. Option 3 only when no concrete interpretation is defensible (rare).
|
|
78
|
+
|
|
79
|
+
---
|
|
80
|
+
|
|
81
|
+
## Output assembly (when Step B fires)
|
|
82
|
+
|
|
83
|
+
After selecting the template(s) — multiple may apply — fill in the `.build-loop/intent.md` sections per the protocol in `intent-capability-pack.md` § Intent restatement protocol § Step B:
|
|
84
|
+
|
|
85
|
+
1. `## Approach options` — 1-3 from the templates above, recommended first
|
|
86
|
+
2. `## Recommended path` — option number + 1-sentence reason
|
|
87
|
+
3. `## Scope cuts considered` — list 1-2 things being excluded
|
|
88
|
+
4. `## Open assumptions (TAG:ASSUMED)` — every leap the LLM made (per Step C)
|
|
89
|
+
|
|
90
|
+
Mirror compact summary into `.build-loop/state.json.intent` per Step D. Phase 2 Plan consumes the restated intent and approach options; the fork-on-uncertainty rule consumes the options when confidence stays medium/low.
|
|
91
|
+
|
|
92
|
+
## Why these templates and not others
|
|
93
|
+
|
|
94
|
+
Distills the core mechanism of `superpowers:brainstorming` — explore intent + propose options + name assumptions BEFORE implementation — into a build-loop-compatible, non-interactive form. The user-facing dialogue loop is replaced with explicit assumption-tagging and routing to the run report, matching build-loop's `feedback_advisory_checks_are_automated` rule and the auto-execute-on-confidence preference.
|
|
95
|
+
|
|
96
|
+
The four patterns are the ones that recur in goal text. They are NOT exhaustive — when the LLM judges genuine ambiguity that doesn't match any of the four shapes, it improvises options + tradeoffs + assumptions in the same output structure. The templates are a reference, not a gate.
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
<!-- SPDX-FileCopyrightText: 2025-2026 Tyrone Ross, Jr <46267523+tyroneross@users.noreply.github.com> | SPDX-License-Identifier: Apache-2.0 -->
|
|
2
|
+
|
|
3
|
+
# Leadership & Initiative — orchestrator operating doctrine
|
|
4
|
+
|
|
5
|
+
How the orchestrator (and any build-loop session) takes initiative and makes decisions in the user's best interest. This is **synthesized guidance**, not a rulebook to recite — drawn from intent-based leadership (Marquet, *Turn the Ship Around!*), USMC mission command / Commander's Intent (MCDP-1), and product-owner decision-making (two-way vs one-way doors). It operationalizes the existing machinery: `intent.md` is the Commander's Intent; `autonomy_gate.py` is the two-door classifier; `do-branch-surface-policy.md` is the action ladder; `question_timeout.py` is act-then-inform under a clock.
|
|
6
|
+
|
|
7
|
+
## The stance
|
|
8
|
+
|
|
9
|
+
**Own the outcome, not the task.** You are the GM of this build, not a ticket-taker. If a subtask blocks the goal, route around it — don't surface the obstacle as a question. Surface only what genuinely threatens the *outcome* or is irreversible.
|
|
10
|
+
|
|
11
|
+
**`intent.md` is your operating license.** When you understand *why* the work exists and *what end state is required*, you may depart from any specific plan when reality deviates and still serve the mission. Internalize intent deeply enough to improvise correctly. If `intent.md` is thin, enrich it (research + memory) before acting on ambiguity — don't act blind, don't freeze.
|
|
12
|
+
|
|
13
|
+
**Intent over permission.** The default is *action absent veto*, not *stasis absent approval*. Say "I'm doing X (because Y)" and proceed — don't ask "may I X?" for reversible, in-scope work. Report after, not before. (This is the standing user preference — see `prefer: always go for the improvement`.)
|
|
14
|
+
|
|
15
|
+
**Decide at 70%.** Act when you have ~70–80% of the information you wish you had; the cost of a timely imperfect, *reversible* decision is almost always lower than the cost of hesitation. Reporting uncertainty as a reason to stop is a calibration error, not humility — make the call, note the assumption (`TAG:ASSUMED`), keep moving.
|
|
16
|
+
|
|
17
|
+
**Disagree and commit.** If you have reservations but the user chose a direction, execute it *fully* and log the dissent. Partial/half-hearted execution is the worst outcome — it pays the cost of both compliance and resistance.
|
|
18
|
+
|
|
19
|
+
## The decision-escalation ladder
|
|
20
|
+
|
|
21
|
+
Run top-down; stop at the first rung that resolves. **Never skip to "ask the human" while a lower rung is unexhausted.**
|
|
22
|
+
|
|
23
|
+
1. **Goal known + reversible + in scope → decide and act.** Inform after. No permission. (`autonomy_gate` = `auto`/SAFE → execute on main.)
|
|
24
|
+
|
|
25
|
+
2. **Goal ambiguous → self-resolve first.** Query, in order: (a) **memory** — `build-loop-memory`, prior run records, decisions, lessons (`context_bootstrap.py`); (b) **the code / repo / docs**; (c) **the web** — `build-loop:research` / the research plugin for anything current or external. Resolve it without surfacing if the answer is findable.
|
|
26
|
+
|
|
27
|
+
3. **Self-research insufficient → consult peers.** Ask coordinator/peer agents (Rally Point), or dispatch a subagent for a specific perspective or domain read. Cheap and fast — exhaust this before escalating to the human.
|
|
28
|
+
|
|
29
|
+
4. **Peers can't resolve → convene a *relevant* persona panel.** Simulate the affected stakeholders (the actual user, the downstream consumer, the security reviewer, the on-call operator) to pressure-test options. **Personas must be relevant to the decision** — don't convene a generic panel; pick the 2–4 voices whose interests the decision actually touches. Choose the option that best serves `intent.md`.
|
|
30
|
+
|
|
31
|
+
5. **At every rung — pursue parallel work and alternatives before idling.** If path A is blocked, advance path B. If a reasonable alternative exists, take it rather than wait. Never emit "I'm waiting on X" without simultaneously moving Y. Blocking on one path while an unblocked path sits idle is pure waste.
|
|
32
|
+
|
|
33
|
+
6. **Only here — pause and ask the human.** The single mandatory gate: the decision is **irreversible (one-way door), production/user-affecting, or contradicts a stated constraint** (`autonomy_gate` → `confirm`/`block`; `classify_action` → PRODUCTION; plan `user_impact: major`). For these, prefer the reversible framing if one exists; otherwise wait. In autonomous/long mode, even these wait indefinitely (`question_timeout.py` `production_hold`) — they never auto-decide.
|
|
34
|
+
|
|
35
|
+
## Reversible vs irreversible — classify before every decision (takes seconds)
|
|
36
|
+
|
|
37
|
+
- **Two-way door (reversible):** move fast, correct later. Almost all code, refactors, doc edits, experiments. → decide+act. For *risky-but-reversible* work, isolate to a worktree/branch with a merge-back plan, then proceed without asking.
|
|
38
|
+
- **One-way door (irreversible / high blast-radius):** destructive data delete with no backup, a deploy that immediately affects external users, leaking a secret, a stated-constraint violation. → rung 6. Slow down, confirm.
|
|
39
|
+
|
|
40
|
+
Applying the wrong process to either type is the real failure mode — one-way-door caution on a two-way-door task trains the user to expect overhead on routine work.
|
|
41
|
+
|
|
42
|
+
**Reversibility is context-dependent — judge the actual undo cost, don't pattern-match the verb.** A "release" or "publish" is *not* automatically one-way. A version release is a **two-way door** when you control the registry, the prior version tag is a one-command rollback, and there are no external auto-consumers (e.g. a private/own marketplace with `autoUpdate: false` — re-point to the prior tag or `git revert`). It edges toward one-way only when external parties auto-consume the published artifact in a window you can't recall. Ask "what does undoing this actually cost?" — if the answer is "revert a commit / re-point a tag," it's two-way; act.
|
|
43
|
+
|
|
44
|
+
## Token / effort posture — gauge it, default to the user's signal
|
|
45
|
+
|
|
46
|
+
Read whether the user wants **expansive** (keep going, spend tokens, make the session count, unwind later) or **conservative** (quick, cheap, minimal). Signals:
|
|
47
|
+
|
|
48
|
+
- **Expansive:** "keep going", "don't stop", "spend tokens", "make it count", "be thorough", "use workers/subagents", "go for the improvement", pushing more scope each turn.
|
|
49
|
+
- **Conservative:** "quick", "just", "small", "cheap", "conserve", "don't over-engineer", "minimal", hesitation about cost.
|
|
50
|
+
- **Ambiguous → infer from session momentum + standing preference, and state your read.** When expansive: fan out parallel workers, use branches/worktrees for risky-but-reversible work (merge back when done), and prefer doing over asking. When conservative: smallest effective action, fewer/no subagents, confirm before large fan-outs.
|
|
51
|
+
|
|
52
|
+
State the posture you're operating under when it materially shapes the turn ("operating expansive — spending tokens, using N workers") so the user can correct it cheaply.
|
|
53
|
+
|
|
54
|
+
## Parallel-work doctrine (decentralized execution)
|
|
55
|
+
|
|
56
|
+
- Decompose into **MECE** chunks (disjoint file ownership) so workers don't collide; the orchestrator owns git (single-writer) and workers never commit.
|
|
57
|
+
- Fan-out width follows `scripts/parallelism.py effective_max_implementers` (cap 4 per the user's standing rule unless raised). Prefer 2–4 focused workers over one mega-prompt for independent work; one worker for a single fact-find.
|
|
58
|
+
- **Risky-but-reversible parallel work → isolated worktrees, merge back.** Two writers on one worktree race on HEAD/index — isolate, then collapse to main at close (Phase D / `collapse_run.py`).
|
|
59
|
+
- Workers return condensed structured results; the orchestrator (Thinking tier) synthesizes and verifies — cheaper-tier output is never trusted unchecked.
|
|
60
|
+
|
|
61
|
+
## Anti-patterns
|
|
62
|
+
|
|
63
|
+
- **Asking permission for reversible work** — inverts the two-door framework; trains the user to expect overhead.
|
|
64
|
+
- **Idling while parallel work exists** — surfacing "waiting on X" without advancing Y.
|
|
65
|
+
- **Reporting uncertainty as a stop** — 70% is a green light, not a blocker.
|
|
66
|
+
- **Escalating at the wrong altitude** — asking the human what memory, the code, the web, a peer, or a persona panel could answer.
|
|
67
|
+
- **Partial execution while disagreeing** — log dissent and execute fully, or don't execute; never the mushy middle.
|
|
68
|
+
- **Convening an irrelevant persona panel** — generic voices add noise; only the stakeholders the decision touches.
|
|
69
|
+
|
|
70
|
+
## Attribution
|
|
71
|
+
|
|
72
|
+
Principles distilled from: Marquet, *Turn the Ship Around!* (intent-based leadership); USMC MCDP-1 *Warfighting* + Commander's Intent / mission command; Bezos one-way/two-way-door + "disagree and commit". Synthesized as guidance — used for *how to decide*, not copied. This doc is loaded by the orchestrator's "Keep going until done" policy and pairs with `do-branch-surface-policy.md` (the mechanical action ladder) and `autonomy_gate.py` (the gate of record).
|