@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,297 @@
|
|
|
1
|
+
<!-- SPDX-FileCopyrightText: 2025-2026 Tyrone Ross, Jr <46267523+tyroneross@users.noreply.github.com> | SPDX-License-Identifier: Apache-2.0 -->
|
|
2
|
+
|
|
3
|
+
# Memory — Global and Project-Scoped (full protocol)
|
|
4
|
+
|
|
5
|
+
> Loaded from `skills/build-loop/SKILL.md` summary. Contains the full memory system: global vs project stores, routing rules, and read/write policies.
|
|
6
|
+
|
|
7
|
+
## Memory — Global and Project-Scoped
|
|
8
|
+
|
|
9
|
+
Build-loop maintains one canonical long-term memory store at `~/dev/git-folder/build-loop-memory/`. Every build reads canonical indexes/folders; writes go to exactly one lane based on scope.
|
|
10
|
+
|
|
11
|
+
### Recall-optimized memory discipline
|
|
12
|
+
|
|
13
|
+
Canonical reference: `build-loop-memory/references/2026-06-11-memory-discipline-prompt.md` (`version: 2026-06-11.1`). Apply it to every non-trivial memory-relevant read or write.
|
|
14
|
+
|
|
15
|
+
Operational contract:
|
|
16
|
+
|
|
17
|
+
- Recall first for significant repo work, debugging, planning, and any memory write. Read the store-root `INDEX.md` first, then project context such as `projects/<slug>/context/CONTEXT.md` and generated `CURRENT.*`, plus `constitution.md` / `MEMORY.md` where present. Search `indexes/INDEX.jsonl`, scan `chronology.jsonl`, read the matching lane, and verify any remembered file/flag/API/script still exists before relying on it.
|
|
18
|
+
- Write only durable facts that aid future recall: decisions + rationale, lessons, reusable references, gotchas, experiment results, product opportunities, and durable operational patterns. Do not write restated code, git-derivable facts, transient status, or handoff-only state.
|
|
19
|
+
- Before writing, search `indexes/INDEX.jsonl` for an existing slug/title, update instead of duplicating, then check `indexes/duplicates.jsonl` after indexing. Use title and `description` as the recall hooks.
|
|
20
|
+
- Do not hand-write project decisions. Use `scripts/write_decision/__main__.py`; it writes the decision lane and updates that lane's `INDEX.md` / update ledger. Generated master-index reachability is still incomplete for new `projects/<slug>/decisions/` files, so verify decisions through `memory_facade` or the decision lane until the scanner/map split is reconciled.
|
|
21
|
+
- Current reference gap: `memory_writer.py` has `research` as a project sublane but not `references`; `reference_capture` writes to `projects/<slug>/research/`, while `build-loop-memory/scripts/rebuild_memory_indexes.py` scans `references/` and not `research/`. For generated-index recall today, write `type: reference` content under `projects/<slug>/lessons/references/`, or update both writer and indexer to agree on `references` or `research`.
|
|
22
|
+
- After any memory write, run the relevant host index/check step when mutation is in scope and verify the entry is reachable from the proper recall surface: `INDEX.jsonl` for generated-index lanes, decision lane/index or `memory_facade` for decisions, or the host system's equivalent.
|
|
23
|
+
|
|
24
|
+
**Cross-project memory**: `build-loop-memory/lessons/` plus the sibling top-level lanes `design/`, `debugging/`, and `product/`
|
|
25
|
+
|
|
26
|
+
- Applies across every project this user builds.
|
|
27
|
+
- Examples: "Deployment to Vercel uses `vercel deploy --prebuilt` when `ENABLE_AUTH=true`"; "Neon is the default Postgres for Next.js 16 projects"; "TestFlight upload uses ASC API key from `~/.appstoreconnect/private_keys/`"; "User prefers zero-dep scripts over package additions".
|
|
28
|
+
- Structure: one file per fact/lesson/tool-discovery. Generated recall indexes live in `build-loop-memory/indexes/`.
|
|
29
|
+
- Types: `tool`, `deployment`, `library-choice`, `user-preference`, `pattern`.
|
|
30
|
+
|
|
31
|
+
**Project memory**: `build-loop-memory/projects/<slug>/` (slug derived via `scripts/_paths.derive_slug_from_cwd`)
|
|
32
|
+
|
|
33
|
+
- Applies only to the current project.
|
|
34
|
+
- Examples: "This app's design system lives in `src/styles/tokens.css`, not Tailwind"; "Routes under `/admin/` require `requireAdmin()` guard"; "The `custom_themes` table has a user_id VarChar bug from 2026-04-13 — see migration note".
|
|
35
|
+
- Same lane structure as top level: `decisions/`, `lessons/`, `debugging/`, `design/`, `product/`, and related domain folders.
|
|
36
|
+
- Types: `design`, `convention`, `gotcha`, `decision`, `contract`.
|
|
37
|
+
|
|
38
|
+
### Routing rule (always ask this question)
|
|
39
|
+
|
|
40
|
+
**"Would this apply to a different project?"**
|
|
41
|
+
|
|
42
|
+
- **Yes** → top-level canonical lane (`build-loop-memory/lessons/`, `design/`, `debugging/`, or `product/`). Deployment tools, library choices, general user preferences, reusable patterns.
|
|
43
|
+
- **No** → project canonical lane (`build-loop-memory/projects/<slug>/...`). Design tokens, internal APIs, project-specific gotchas, per-repo conventions.
|
|
44
|
+
- **Ambiguous** → ask the user once, then save. Don't guess.
|
|
45
|
+
|
|
46
|
+
### Artifact lanes & segmentation (issues / backlog / lessons)
|
|
47
|
+
|
|
48
|
+
Three work/knowledge artifact types, each with a clear WRITE → READ → TRACK lane. **Every lane is repo-segmented; the segmentation is mechanical, not discretionary** — so work on repo X never reads or writes repo Y's items.
|
|
49
|
+
|
|
50
|
+
| Artifact | Write (where) | Read / Track | Lifetime |
|
|
51
|
+
|---|---|---|---|
|
|
52
|
+
| **issues** | `<repo>/.build-loop/issues/<id>.md` — current-run bugs | Phase 5 Iterate drains them; repo-local so inherently scoped | short-lived (resolve → delete) |
|
|
53
|
+
| **backlog** | durable: `build-loop-memory/projects/<slug>/backlog.md` (slug folder = repo scope); active: `<repo>/.build-loop/backlog/<id>.md` | read before planning self-work; Phase 5 drains active items | long-lived |
|
|
54
|
+
| **backlog-archive** | `build-loop-memory/projects/<slug>/backlog-archive.md` | closed/moved/superseded items land here **with rationale + ref** — never deleted silently | durable |
|
|
55
|
+
| **lessons** | `projects/<slug>/lessons/` (project) OR top-level `lessons/` (cross-project, stored `_unscoped`) — via `memory_writer.py` | `context_bootstrap` recall scopes to `(slug OR _unscoped)` — never other projects | durable |
|
|
56
|
+
|
|
57
|
+
**Segmentation contract (binding):**
|
|
58
|
+
- The **slug folder** (`projects/<slug>/`) is the repo key; the **`repo` + `branch` frontmatter** on each issue/backlog item is the explicit scope tag (template: `templates/backlog-item.md`). Both must agree.
|
|
59
|
+
- When working repo X on branch B, **read and write only** items where `repo == X` (and `branch == B` or unscoped). A cross-repo item discovered mid-work is recorded in **its** repo's scope, **never** the current repo's tracker.
|
|
60
|
+
- **No shared/freeform cross-repo trackers.** (The retired `OPEN-ITEMS.md` was exactly this anti-pattern — one file that accreted rows from unrelated app repos into build-loop's scope. Replaced by the slug-segmented `projects/<slug>/backlog.md`.)
|
|
61
|
+
- Reads are already enforced: `context_bootstrap` queue reads are repo-local `.build-loop/`, and lessons recall passes the resolved `project` so the query scopes to `(project OR _unscoped)` — `project=None` (all-projects) is never used for current-work context.
|
|
62
|
+
|
|
63
|
+
### When to write memory
|
|
64
|
+
|
|
65
|
+
- User states a preference or convention: save immediately.
|
|
66
|
+
- A build surfaces a new tool/library/deployment pattern worth reusing: save after Review-F.
|
|
67
|
+
- A project-specific gotcha or decision emerges: save during Review-F Report.
|
|
68
|
+
- Do NOT save: ephemeral task details, things already derivable from code or git log, state that changes per build.
|
|
69
|
+
|
|
70
|
+
### When to read memory
|
|
71
|
+
|
|
72
|
+
- Always during Phase 1 ASSESS.
|
|
73
|
+
- Before deploying: check global deployment memory.
|
|
74
|
+
- Before UI work: check project design memory.
|
|
75
|
+
- Before adopting a new library: check global library-choice memory.
|
|
76
|
+
|
|
77
|
+
## Cross-session memory propagation + provenance schema (multi-process / multi-host)
|
|
78
|
+
|
|
79
|
+
Multiple build-loop sessions can run concurrently. Two scripts own the cross-session model end-to-end:
|
|
80
|
+
|
|
81
|
+
- `scripts/memory_writer.py` — canonical WRITER. Adds provenance frontmatter and appends to the index in one atomic operation.
|
|
82
|
+
- `scripts/memory_index.py` — append-only discovery log in the selected canonical lane.
|
|
83
|
+
- `scripts/memory_update_ledger.py` — global append-only audit/freshness log for the whole configured memory root.
|
|
84
|
+
|
|
85
|
+
### Provenance frontmatter (every memory file)
|
|
86
|
+
|
|
87
|
+
```yaml
|
|
88
|
+
---
|
|
89
|
+
name: <slug>
|
|
90
|
+
description: <one-line summary>
|
|
91
|
+
type: tool | deployment | library-choice | user-preference | pattern | feedback | reference | design | convention | gotcha | decision | contract
|
|
92
|
+
source_repo: "<git remote url or null>"
|
|
93
|
+
source_workdir: "<abs path>"
|
|
94
|
+
source_run_id: "run_<UTC>_<hash>"
|
|
95
|
+
source_host: "claude_code | codex | gemini | other"
|
|
96
|
+
cross_repo_validated: false # flips to true once a DIFFERENT repo applies it
|
|
97
|
+
applied_in_repos: [] # appended entries: {repo, workdir, run_id, applied_at}
|
|
98
|
+
created_at: "ISO8601 UTC"
|
|
99
|
+
last_updated_at: "ISO8601 UTC"
|
|
100
|
+
---
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
### Writer side — use the canonical writer for normal memory writes
|
|
104
|
+
|
|
105
|
+
**Top-level (cross-project) write** — `--scope top-level` routes to `build-loop-memory/lessons/` (or a sibling lane when `--file <lane>/x.md` is used):
|
|
106
|
+
|
|
107
|
+
```
|
|
108
|
+
python3 ${CLAUDE_PLUGIN_ROOT}/scripts/memory_writer.py \
|
|
109
|
+
--scope top-level \
|
|
110
|
+
write \
|
|
111
|
+
--file "<rel-path>" \
|
|
112
|
+
--name "<slug>" \
|
|
113
|
+
--description "<one-line>" \
|
|
114
|
+
--type feedback \
|
|
115
|
+
--run-id "$RUN_ID" \
|
|
116
|
+
--workdir "$PWD" \
|
|
117
|
+
--host claude_code \
|
|
118
|
+
--body-file /tmp/memory-body.md
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
**Project-scoped write** — `--scope project --project <slug>` routes to `build-loop-memory/projects/<slug>/lessons/` (or a sublane when `--file <sublane>/x.md` is used):
|
|
122
|
+
|
|
123
|
+
```
|
|
124
|
+
python3 ${CLAUDE_PLUGIN_ROOT}/scripts/memory_writer.py \
|
|
125
|
+
--scope project --project "$PROJECT_SLUG" \
|
|
126
|
+
write \
|
|
127
|
+
--file "<rel-path>" \
|
|
128
|
+
--name "<slug>" \
|
|
129
|
+
--description "<one-line>" \
|
|
130
|
+
--type gotcha \
|
|
131
|
+
--run-id "$RUN_ID" \
|
|
132
|
+
--workdir "$PWD" \
|
|
133
|
+
--host claude_code \
|
|
134
|
+
--body-file /tmp/memory-body.md
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
The writer auto-detects `source_repo` from the workdir's git remote, appends a row to the lane-local `INDEX.jsonl`, appends a row to the global update ledger at `indexes/updates.jsonl`, and (on update) preserves `created_at` + `applied_in_repos` so cross-repo validation history survives edits. Direct writes are repair/fallback work only: use them only when no canonical writer exists or the current task is explicitly a memory-system repair, then run the host index/check step and verify reachability.
|
|
138
|
+
|
|
139
|
+
### Reader side — surface peer writes via INDEX.jsonl
|
|
140
|
+
|
|
141
|
+
Between phases (or at every M2 heartbeat), tail since your last check:
|
|
142
|
+
|
|
143
|
+
```
|
|
144
|
+
python3 ${CLAUDE_PLUGIN_ROOT}/scripts/memory_index.py tail \
|
|
145
|
+
--since "$LAST_INDEX_CHECK_TS" \
|
|
146
|
+
--exclude-run-id "$RUN_ID" \
|
|
147
|
+
--json
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
For each row:
|
|
151
|
+
1. Read the underlying memory file.
|
|
152
|
+
2. If `source_workdir` ≠ this `$PWD` AND `source_repo` ≠ this repo's git remote — tag `[CROSS-REPO — requires scrutiny]` in the phase brief.
|
|
153
|
+
3. Surface to the user with the memory's `description` field as the hook.
|
|
154
|
+
|
|
155
|
+
### Store side — global update ledger
|
|
156
|
+
|
|
157
|
+
Every canonical memory mutation should also append one JSONL row to:
|
|
158
|
+
|
|
159
|
+
```
|
|
160
|
+
<memory-root>/indexes/updates.jsonl
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
This is the store-wide ledger. It is not a replacement for lane-local `INDEX.jsonl`; the two logs have different jobs:
|
|
164
|
+
|
|
165
|
+
| Log | Scope | Primary job |
|
|
166
|
+
|---|---|---|
|
|
167
|
+
| `<lane>/INDEX.jsonl` | One memory lane | Peer discovery inside that lane |
|
|
168
|
+
| `indexes/updates.jsonl` | Whole memory root | Audit trail, freshness baseline, repair inventory |
|
|
169
|
+
|
|
170
|
+
Row schema:
|
|
171
|
+
|
|
172
|
+
```json
|
|
173
|
+
{
|
|
174
|
+
"ts": "2026-06-01T12:00:00Z",
|
|
175
|
+
"schema_version": 1,
|
|
176
|
+
"event_id": "<sha256-prefix>",
|
|
177
|
+
"project": "build-loop",
|
|
178
|
+
"lane": "decisions",
|
|
179
|
+
"action": "write",
|
|
180
|
+
"path": "projects/build-loop/decisions/0001-example.md",
|
|
181
|
+
"writer": "write_decision.py",
|
|
182
|
+
"run_id": "run_...",
|
|
183
|
+
"source_repo": "<git remote or omitted>",
|
|
184
|
+
"source_workdir": "<absolute workdir or omitted>",
|
|
185
|
+
"source_commit": "<repo HEAD represented by this memory update>",
|
|
186
|
+
"source_host": "codex",
|
|
187
|
+
"memory_id": "0001",
|
|
188
|
+
"summary": "Short human hook",
|
|
189
|
+
"sha256": "<content hash when available>",
|
|
190
|
+
"metadata": {}
|
|
191
|
+
}
|
|
192
|
+
```
|
|
193
|
+
|
|
194
|
+
`memory_writer.py`, `write_decision.py`, and `append_milestone.py` emit this ledger row automatically. Direct writes to memory files should be treated as legacy or repair work because they bypass provenance, discovery, and freshness.
|
|
195
|
+
|
|
196
|
+
CLI:
|
|
197
|
+
|
|
198
|
+
```
|
|
199
|
+
python3 ${CLAUDE_PLUGIN_ROOT}/scripts/memory_update_ledger.py tail \
|
|
200
|
+
--project "$PROJECT_SLUG" \
|
|
201
|
+
--limit 20 \
|
|
202
|
+
--json
|
|
203
|
+
```
|
|
204
|
+
|
|
205
|
+
### Trust gradient — mark-applied flow
|
|
206
|
+
|
|
207
|
+
When a memory written elsewhere is successfully applied in the current repo, record it:
|
|
208
|
+
|
|
209
|
+
```
|
|
210
|
+
python3 ${CLAUDE_PLUGIN_ROOT}/scripts/memory_writer.py mark-applied \
|
|
211
|
+
--file "<rel-path>" \
|
|
212
|
+
--applying-repo "$THIS_REPO_REMOTE" \
|
|
213
|
+
--applying-workdir "$PWD" \
|
|
214
|
+
--applying-run-id "$RUN_ID"
|
|
215
|
+
```
|
|
216
|
+
|
|
217
|
+
Appends to `applied_in_repos[]` (deduped by `(repo, workdir)`) and flips `cross_repo_validated` to `true` once at least one applying repo differs from the source. Memories with `cross_repo_validated: true` AND `len(applied_in_repos) >= 2` have earned higher trust — independently verified to hold across distinct repos. Surface that distinction in Phase 1 Assess briefs as `[VALIDATED — applied in N repos]`.
|
|
218
|
+
|
|
219
|
+
### Migration — existing memory files
|
|
220
|
+
|
|
221
|
+
`memory_writer.py migrate` is an idempotent backfill that adds provenance frontmatter to existing memory files. Safe to re-run; skips any file that already has all required provenance keys.
|
|
222
|
+
|
|
223
|
+
```
|
|
224
|
+
python3 ${CLAUDE_PLUGIN_ROOT}/scripts/memory_writer.py migrate \
|
|
225
|
+
--run-id "$RUN_ID" \
|
|
226
|
+
--workdir "$PWD" \
|
|
227
|
+
--host claude_code \
|
|
228
|
+
--dry-run # inspect first; remove the flag to apply
|
|
229
|
+
```
|
|
230
|
+
|
|
231
|
+
Run once after this version of build-loop is installed; the migration completes immediately for memory dirs of ordinary size (the user's global memory at ~80 files migrates in well under a second).
|
|
232
|
+
|
|
233
|
+
### Concurrency
|
|
234
|
+
|
|
235
|
+
- `memory_writer.py write` — atomic tmpfile + os.replace; the memory file IS the lock.
|
|
236
|
+
- `memory_index.py append` — `fcntl.flock(LOCK_EX)` on `INDEX.jsonl.lock`; multi-writer safe across hosts.
|
|
237
|
+
- `memory_update_ledger.py append` — `fcntl.flock(LOCK_EX)` on `updates.jsonl.lock`; append-only and multi-writer safe.
|
|
238
|
+
|
|
239
|
+
## Append-only milestones (anti-rewrite-drift)
|
|
240
|
+
|
|
241
|
+
### The problem this solves
|
|
242
|
+
|
|
243
|
+
"Current state" files that are rewritten in place rot: the writer overwrites without fully reading, summaries drift from reality, and no one can tell which run produced a given snapshot. The fix is append-only by construction — a log that can only grow forward.
|
|
244
|
+
|
|
245
|
+
### What gets appended and when
|
|
246
|
+
|
|
247
|
+
Every build-loop run appends a single milestone record at **Review-G** via `scripts/append_milestone.py`. Each record captures what shipped and the repo HEAD sha at write time.
|
|
248
|
+
|
|
249
|
+
JSONL contract (frozen — sibling staleness-check reads this):
|
|
250
|
+
|
|
251
|
+
```
|
|
252
|
+
<memory-root>/projects/<slug>/milestones.jsonl
|
|
253
|
+
```
|
|
254
|
+
|
|
255
|
+
Each line:
|
|
256
|
+
|
|
257
|
+
```json
|
|
258
|
+
{"ts": "2026-05-30T12:00:00Z", "commit": "<sha>", "repo": "<dir-name>", "summary": "<what shipped>", "run_id": "<id|null>"}
|
|
259
|
+
```
|
|
260
|
+
|
|
261
|
+
### How to append
|
|
262
|
+
|
|
263
|
+
```
|
|
264
|
+
python3 ${CLAUDE_PLUGIN_ROOT}/scripts/append_milestone.py \
|
|
265
|
+
--workdir "$PWD" \
|
|
266
|
+
--summary "feat: shipped auth + dashboard" \
|
|
267
|
+
--run-id "$RUN_ID" \
|
|
268
|
+
--json
|
|
269
|
+
```
|
|
270
|
+
|
|
271
|
+
`--commit` and `--project` override the defaults (git HEAD and slug derived from `--workdir`). `--memory-root` overrides the default `~/dev/git-folder/build-loop-memory`.
|
|
272
|
+
|
|
273
|
+
Output: `{"appended": true, "path": "...", "line": "..."}` on success; `{"appended": false, "reason": "..."}` on fail-soft (non-git workdir, unwritable root). Exit 0 in both cases.
|
|
274
|
+
|
|
275
|
+
Idempotency: if the last line already has the same `commit` AND `summary`, the call is a no-op. Safe to re-run on retry.
|
|
276
|
+
|
|
277
|
+
### The core principle: pointer not duplicate
|
|
278
|
+
|
|
279
|
+
The milestone log is the **durable, never-rewritten** record of project progress. Other memory files (`lessons/`, `decisions/`, etc.) remain the authoritative content store. The milestone is a pointer — "at this commit, this run shipped this" — not a duplicated copy of their content.
|
|
280
|
+
|
|
281
|
+
> The rewrite-in-place pattern is what rots. Append-only logs + pointers resist drift by construction: you can always `tail` to see the latest state, `grep` to find when something shipped, and the sibling staleness-check can compare the latest milestone commit against the current HEAD to detect stale memory instantly.
|
|
282
|
+
|
|
283
|
+
Decisions use the existing `decisions/` lane (also append-only files, one file per decision). The milestone log adds the run-level "what shipped" layer that `decisions/` doesn't track.
|
|
284
|
+
|
|
285
|
+
### Staleness detection
|
|
286
|
+
|
|
287
|
+
`memory_staleness_check.py` now prefers the latest `source_commit` in `indexes/updates.jsonl` for the current project, then falls back to the latest milestone's `commit` field. It compares that baseline against `git rev-parse HEAD` in the project workdir. If HEAD has moved past the last memory update by the configured commit threshold, the project's memory is potentially stale and Phase 1 Assess should flag it.
|
|
288
|
+
|
|
289
|
+
Impact:
|
|
290
|
+
|
|
291
|
+
- A decision, lesson, migration, mark-applied, or milestone can refresh the memory baseline when it records `source_commit`.
|
|
292
|
+
- Older memory stores without `indexes/updates.jsonl` keep working because milestone fallback is unchanged.
|
|
293
|
+
- A stale warning means "no durable memory update has been recorded for this project at or near HEAD"; it does not prove every individual memory file is stale.
|
|
294
|
+
|
|
295
|
+
### Concurrency
|
|
296
|
+
|
|
297
|
+
`fcntl.flock(LOCK_EX)` on `milestones.jsonl.lock` — same pattern as `memory_index.py`. Multi-writer safe.
|
|
@@ -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
|
+
# Modular Systems Pack
|
|
4
|
+
|
|
5
|
+
Use this pack on every non-trivial build. It makes modular, scalable structure the default while allowing a simpler or more integrated approach when that better serves the use case.
|
|
6
|
+
|
|
7
|
+
## Default
|
|
8
|
+
|
|
9
|
+
Build-loop should prefer systems that are:
|
|
10
|
+
|
|
11
|
+
- **Modular**: each module hides one important design decision behind a stable interface.
|
|
12
|
+
- **Scalable**: the design can grow in data volume, user volume, feature count, or team ownership without immediate redesign.
|
|
13
|
+
- **MECE**: task groups, file ownership, and agent scopes are mutually exclusive and collectively exhaustive.
|
|
14
|
+
- **Pyramid-structured**: plans, handoffs, reports, and repo organization lead with the governing thought, then supporting groups, then details.
|
|
15
|
+
|
|
16
|
+
This is a default, not dogma. The goal is durable user value, not extra architecture.
|
|
17
|
+
|
|
18
|
+
## Exception Rule
|
|
19
|
+
|
|
20
|
+
Do not add modularity for its own sake. Choose a simpler or more integrated approach when:
|
|
21
|
+
|
|
22
|
+
- The change is a one-off script, short-lived migration, or isolated fix.
|
|
23
|
+
- A new boundary would add indirection without reducing real complexity.
|
|
24
|
+
- A performance hot path needs a tightly integrated implementation.
|
|
25
|
+
- The repo is small and the added module structure would obscure the core workflow.
|
|
26
|
+
- The product need is intentionally limited and extra optionality would confuse users.
|
|
27
|
+
|
|
28
|
+
When taking an exception, record:
|
|
29
|
+
|
|
30
|
+
```text
|
|
31
|
+
MODULARITY EXCEPTION: <why simpler/integrated is better for this use case>
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
## MECE File And Agent Partition
|
|
35
|
+
|
|
36
|
+
Phase 2 Plan must partition work so every changed file has exactly one owner and every required responsibility has an owner.
|
|
37
|
+
|
|
38
|
+
For each task group, use this packet:
|
|
39
|
+
|
|
40
|
+
```md
|
|
41
|
+
Group: <name>
|
|
42
|
+
Dimension: <domain | layer | workflow | bounded context | adapter | test surface>
|
|
43
|
+
Owns files: <paths>
|
|
44
|
+
Does not own: <paths handled elsewhere>
|
|
45
|
+
Interface contract: <exports/events/API/schema it may change>
|
|
46
|
+
Integration checkpoint: <command or review step>
|
|
47
|
+
Intent link: <north-star or user-value rule this group supports>
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
MECE checks:
|
|
51
|
+
|
|
52
|
+
- No overlap: a file or interface is not owned by two agents unless the plan defines a handoff point.
|
|
53
|
+
- No gaps: every required behavior, state, migration, test, and user-facing surface has an owner.
|
|
54
|
+
- One dimension per level: avoid mixing domains, layers, and workflows in the same grouping level.
|
|
55
|
+
- Stable interfaces: agents can change internals, but cross-group contracts are explicit.
|
|
56
|
+
- Integration checkpoint: every boundary has a test, build, visual check, schema check, or reviewer step.
|
|
57
|
+
|
|
58
|
+
## Modular Design Heuristics
|
|
59
|
+
|
|
60
|
+
- Hide volatile decisions behind small interfaces: data shape, provider choice, algorithm, storage, rendering strategy, or external API.
|
|
61
|
+
- Prefer high cohesion: code that changes for the same reason lives together.
|
|
62
|
+
- Prefer loose coupling: callers depend on published interfaces, not internal data structures or side effects.
|
|
63
|
+
- Design around business/domain capabilities when the system is large enough for domains to matter.
|
|
64
|
+
- Keep boundaries small enough to understand and large enough to own a useful capability.
|
|
65
|
+
- Separate deploy/runtime config from code when values vary by environment.
|
|
66
|
+
- Preserve directness when extra layers make the core workflow harder to read, test, or operate.
|
|
67
|
+
|
|
68
|
+
## Pyramid Structure
|
|
69
|
+
|
|
70
|
+
Use pyramid structure for plans, reports, repo notes, and agent handoffs:
|
|
71
|
+
|
|
72
|
+
1. Governing thought: the one decision, result, or recommendation.
|
|
73
|
+
2. MECE key lines: 3-5 non-overlapping supporting claims or work groups.
|
|
74
|
+
3. Evidence/details: commands, files, risks, interfaces, and validation.
|
|
75
|
+
|
|
76
|
+
For repo structure, this means names should communicate purpose, folders should group by one clear dimension, and cross-cutting utilities should stay genuinely shared rather than becoming a junk drawer.
|
|
77
|
+
|
|
78
|
+
## Review Gates
|
|
79
|
+
|
|
80
|
+
Critic and final review should flag:
|
|
81
|
+
|
|
82
|
+
- Avoidable tight coupling or weak cohesion.
|
|
83
|
+
- Hidden cross-file ownership overlap between agents.
|
|
84
|
+
- Missing owner for a required behavior, state, migration, test, or user-facing surface.
|
|
85
|
+
- Abstraction added without user, scalability, testability, security, or maintainability benefit.
|
|
86
|
+
- Simplification that collapses a boundary needed for accuracy, security, scale, testability, or future optionality.
|
|
87
|
+
- Missing `MODULARITY EXCEPTION` when the plan intentionally chooses an integrated shortcut.
|
|
88
|
+
|
|
89
|
+
## Source Basis
|
|
90
|
+
|
|
91
|
+
- Parnas, "On the Criteria to Be Used in Decomposing Systems into Modules" (CACM, 1972): https://cacm.acm.org/research/on-the-criteria-to-be-used-in-decomposing-systems-into-modules/
|
|
92
|
+
- AWS Well-Architected REL04-BP02, "Implement loosely coupled dependencies": https://docs.aws.amazon.com/wellarchitected/2024-06-27/framework/rel_prevent_interaction_failure_loosely_coupled_system.html
|
|
93
|
+
- Microsoft Azure Architecture Center, domain analysis for microservices: https://learn.microsoft.com/en-us/azure/architecture/microservices/model/domain-analysis
|
|
94
|
+
- Microsoft Azure Architecture Center, design principles for Azure applications: https://learn.microsoft.com/en-gb/azure/architecture/guide/design-principles/
|
|
95
|
+
- Twelve-Factor App config guidance: https://12factor.net/config
|
|
96
|
+
- MECE framework overview: https://www.casestar.io/guides/mece
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
# Output Style Contract — User-Facing Terminal Output
|
|
2
|
+
|
|
3
|
+
Final user-facing output (Phase 4 Review-G report, phase status lines printed to the operator's terminal) must be **clear, direct, concise, and free of internal jargon**. This contract is enforced — `scripts/report_lint.py` runs on the draft before the user sees it, and Review-G auto-revises on findings (warn-and-self-heal, never a hard halt).
|
|
4
|
+
|
|
5
|
+
It extends — does not duplicate — the existing guidance:
|
|
6
|
+
|
|
7
|
+
- `CLAUDE.md` § "Concise output" — say only what the user needs to decide or act
|
|
8
|
+
- `~/.claude/CLAUDE.md` § "Intentional word choice" — every line must transmit information the reader does not already have
|
|
9
|
+
- `~/.claude/CLAUDE.md` § "Reporting Work" — pyramid-principle headline + verification line + impact-by-size
|
|
10
|
+
|
|
11
|
+
Scope: **user-facing output only.** Internal agent-to-agent envelopes (subagent return JSON, judge-decisions, run records, MECE briefs) are structured data and stay as-is — they exist for machines, not the human.
|
|
12
|
+
|
|
13
|
+
## The five rules
|
|
14
|
+
|
|
15
|
+
1. **Headline = one plain full sentence** stating what changed. First non-blank line. Not a noun phrase, not a telegraph fragment, not a heading.
|
|
16
|
+
2. **Bulleted concrete artifacts.** Below the headline: commit hashes, file paths, issue paths. Concrete things the user can grep, open, or `git show`.
|
|
17
|
+
3. **Substance bullets.** What the change captures or does, in plain language. Optional when the artifacts alone are self-explanatory.
|
|
18
|
+
4. **Validation line, explicit.** Name the exact command, method, or observer that verified the work, with a status marker:
|
|
19
|
+
- `✅ Verified by <method>` — ran the script, passing test, curl response, IBR scan, demo
|
|
20
|
+
- `⚠️ Untested — <what couldn't be verified and why>`
|
|
21
|
+
- `❓ Uncertain — <what's assumed and what would close it>`
|
|
22
|
+
5. **Plain language.** No jargon (see blocklist below). No contrastive pivot (`not X — it's Y`, `isn't X, it's Y`, `not just X but Y`) — state the point directly.
|
|
23
|
+
|
|
24
|
+
## Jargon blocklist (user-facing only)
|
|
25
|
+
|
|
26
|
+
These tokens are fine in internal envelopes; they must be translated to plain language in user-facing output:
|
|
27
|
+
|
|
28
|
+
| Internal token | Plain-language translation |
|
|
29
|
+
|---|---|
|
|
30
|
+
| `GAP-1`, `GAP-N` | Name the actual gap (e.g. "missing auditor dispatch") |
|
|
31
|
+
| `auditor_status: not-run:parent-must-dispatch` | "Auditor not run — parent owes it" |
|
|
32
|
+
| `auditor_status: ran:dispatched-agent` | "Auditor ran" or omit if obvious |
|
|
33
|
+
| `sub-step G`, `sub-step F` | "Final report step", "Auto-resolve step", or omit |
|
|
34
|
+
| `MECE` | "ownership split", "one owner per file" |
|
|
35
|
+
| `envelope` | "return data", "result" |
|
|
36
|
+
| `scope=build` | "full build review" or omit |
|
|
37
|
+
| `suggest_correction` / `yay` / `nay` / `look_again` | "approve", "reject", "needs change", "needs another look" |
|
|
38
|
+
| `Phase 4G` / `Phase 5` | "final review", "iterate step" |
|
|
39
|
+
| `state.json.runs[]` | "run record" |
|
|
40
|
+
| Internal phase codenames (C-HEAL, C-RCA, C-FLOW…) | Describe the behavior, not the code |
|
|
41
|
+
|
|
42
|
+
## Good — the exemplar (Codex output, captured 2026-06-04)
|
|
43
|
+
|
|
44
|
+
```
|
|
45
|
+
- ad1ac79a memory(build-loop): capture native ax ui follow-up
|
|
46
|
+
- Issue: dev/git-folder/build-loop-memory/projects/build-loop/issues/bl-native-ax-light-ui-gap-check.md
|
|
47
|
+
- Backlog row added to .../backlog.md
|
|
48
|
+
|
|
49
|
+
It captures:
|
|
50
|
+
- skills/native-ax-driver/ as the home.
|
|
51
|
+
- IBR as the primary/full verifier, native AX as the lighter gap/fill layer.
|
|
52
|
+
- Blockers: clean main/fresh worktree and recovered AX/screencapture.
|
|
53
|
+
|
|
54
|
+
Validation passed: python3 scripts/validate_memory_store.py --strict.
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
Why this is good: plain-sentence headline implied by the commit subject, bulleted concrete artifacts with paths and a commit hash, an "It captures:" substance block, and an explicit validation line naming the exact command. Scannable, direct, no jargon.
|
|
58
|
+
|
|
59
|
+
## Good — exemplar B (scoped-edit narration, captured 2026-06-06)
|
|
60
|
+
|
|
61
|
+
```
|
|
62
|
+
Claim is recorded. I'm keeping the edit scoped: selector scoring plus one regression
|
|
63
|
+
test that reproduces "old handoff masks newer targeted inbox/review request."
|
|
64
|
+
[visible actions: git switch -c …, Explored: read/search …]
|
|
65
|
+
The edit is small: add a typed helper for requires_ack evidence, score direct targeted
|
|
66
|
+
artifacts as inbox-doorbell work, and cover it with a regression where a stale handoff
|
|
67
|
+
used to hide the newer message.
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
Why it's good: declarative state → scope stated plainly with the bug in plain words → the change in one informed sentence.
|
|
71
|
+
|
|
72
|
+
## Good — exemplar C (closeout note, captured 2026-06-06)
|
|
73
|
+
|
|
74
|
+
```
|
|
75
|
+
Commit 4392166 is created on fix/actionable-inbox-next. I'm posting the closeout to
|
|
76
|
+
Rally and releasing the two file claims now.
|
|
77
|
+
[visible actions: rally say release …, rally say artifact …]
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
Why it's good: states the landed artifact (commit + branch) → then the action-in-progress in one plain line.
|
|
81
|
+
|
|
82
|
+
## Bad — verbose + jargon (rewritten Good)
|
|
83
|
+
|
|
84
|
+
**Bad (jargon + filler):**
|
|
85
|
+
|
|
86
|
+
```
|
|
87
|
+
Phase 4G Sub-step G completed for the auditor dispatch ladder. The auditor_status
|
|
88
|
+
field was changed to ran:dispatched-agent based on the GAP-1 contract; the build
|
|
89
|
+
scope=build review-completeness gate passed. We've now wired the MECE envelope
|
|
90
|
+
through the build-orchestrator so it propagates to the runs[] entry. Suggested
|
|
91
|
+
correction verdict from independent-auditor: yay. Want me to push?
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
**Good (rewrite):**
|
|
95
|
+
|
|
96
|
+
```
|
|
97
|
+
Auditor now runs on every build commit; the gap where nested orchestrators
|
|
98
|
+
skipped it is closed.
|
|
99
|
+
|
|
100
|
+
- Commit: 7e54621 fix(audit): close nested-orchestrator audit gap
|
|
101
|
+
- Files: agents/build-orchestrator.md, scripts/audit_before_commit.py
|
|
102
|
+
- Run record: .build-loop/state.json runs[] entry build-2026-06-07-...
|
|
103
|
+
|
|
104
|
+
It captures:
|
|
105
|
+
- Nested orchestrators now hand the audit back to the dispatching parent.
|
|
106
|
+
- Auditor's approve verdict recorded in .build-loop/judge-decisions.json.
|
|
107
|
+
|
|
108
|
+
✅ Verified by python3 scripts/test_audit_before_commit.py — 14 passed.
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
## What stays internal (do not lint)
|
|
112
|
+
|
|
113
|
+
These are structured data for machines, not user-facing prose:
|
|
114
|
+
|
|
115
|
+
- Subagent return envelopes (JSON return values, `status: blocked | partial`, etc.)
|
|
116
|
+
- `state.json` writes
|
|
117
|
+
- `.build-loop/judge-decisions.json` entries
|
|
118
|
+
- MECE brief packets between orchestrator and implementers
|
|
119
|
+
- Rally Point post bodies on internal channels (peer-to-peer coordination)
|
|
120
|
+
- `auditor_status` and other machine fields embedded in run records
|
|
121
|
+
|
|
122
|
+
The lint targets ONLY the final user-facing report markdown + phase status lines printed to the operator's terminal. Inline backtick spans are NOT exempted — if an internal token appears in prose (even quoted), translate it; use a full fenced block only for verbatim code/trace the user should see literally.
|
|
123
|
+
|
|
124
|
+
## Enforcement summary
|
|
125
|
+
|
|
126
|
+
- `scripts/report_lint.py <draft.md> --json` runs on every Phase 4G draft
|
|
127
|
+
- Findings are WARN (advisory): the orchestrator self-heals by revising the draft once, then emits it
|
|
128
|
+
- Never hard-blocks a run — worst case is one revision pass
|
|
129
|
+
- The structural lint (`scripts/build_report_lint.py`) keeps running in parallel; it is orthogonal (parallel_batch / merge_plan / evidence triplet shape)
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
<!-- SPDX-FileCopyrightText: 2025-2026 Tyrone Ross, Jr <46267523+tyroneross@users.noreply.github.com> | SPDX-License-Identifier: Apache-2.0 -->
|
|
2
|
+
|
|
3
|
+
# Pay-it-Forward Architectural Posture (full protocol)
|
|
4
|
+
|
|
5
|
+
> Loaded from `skills/build-loop/SKILL.md` summary. Encodes the user's preference that scalability and product-roadmap unlocks matter more than short-term build velocity when costs aren't prohibitive.
|
|
6
|
+
|
|
7
|
+
## The rule (verbatim, user-stated 2026-05-11)
|
|
8
|
+
|
|
9
|
+
> *"I'd rather do a slightly harder thing now to avoid a more painful change in the future if not prohibited by costs or other concerns."*
|
|
10
|
+
|
|
11
|
+
When a chunk has two viable implementations:
|
|
12
|
+
|
|
13
|
+
- **Path A** — minimum-viable, working v1, easy to ship now.
|
|
14
|
+
- **Path B** — same user-visible behavior, but extends the typed / structural contract so future surfaces can reuse it.
|
|
15
|
+
|
|
16
|
+
**Default to Path B** unless one of the explicit gates below blocks.
|
|
17
|
+
|
|
18
|
+
## Gates (Path B blocked when ANY is true)
|
|
19
|
+
|
|
20
|
+
| Gate | Condition | Recommendation |
|
|
21
|
+
|---|---|---|
|
|
22
|
+
| **Time-budget gate** | Path B blows the immediate time budget by more than 2× (e.g. requires a schema migration when none was needed for Path A). | Fall back to Path A. |
|
|
23
|
+
| **Missing dep / infra** | Path B requires a dependency or infrastructure not yet in the project. | Fall back to Path A. Note the dep as a roadmap item. |
|
|
24
|
+
| **Missing design decision** | Path B requires a product/architecture decision the user has not yet made (multi-tenant boundary, auth model, etc.). | Fall back to Path A. Surface the decision in the plan's Open Questions section. |
|
|
25
|
+
| **Empty foreclosed-future-capability list** | Path B's "what does this unlock?" list is empty — no named future capability needs the typed contract. | Fall back to Path A. The "flexibility" is speculative. |
|
|
26
|
+
|
|
27
|
+
## Anti-pattern explicitly excluded
|
|
28
|
+
|
|
29
|
+
Path B that's flexibility-for-its-own-sake is **NOT** what this rule means. Excluded shapes:
|
|
30
|
+
|
|
31
|
+
- Plugin/extension systems with no named future plugin.
|
|
32
|
+
- Abstract factories / hook architectures for a single current consumer.
|
|
33
|
+
- Generic event buses for a single producer / single consumer pair.
|
|
34
|
+
- Parameterized configs whose only caller hardcodes one value.
|
|
35
|
+
|
|
36
|
+
Path B must be tied to a **NAMED** future capability that's in the roadmap, PRD, intent.md, or stated user goal. "Future flexibility" is not a named capability.
|
|
37
|
+
|
|
38
|
+
## When this fires
|
|
39
|
+
|
|
40
|
+
Phase 2 Plan must trigger a Path A / Path B comparison for any chunk that touches:
|
|
41
|
+
|
|
42
|
+
1. **A typed protocol or interface boundary** — engine types, API contracts, DB schemas, message schemas, envelope shapes, MCP tool input/output schemas, agent return contracts.
|
|
43
|
+
2. **User-facing behavior servable by multiple surfaces** — a feature that could theoretically be exposed via chat + voice + native + email + CLI. Even if today only one surface uses it.
|
|
44
|
+
3. **A consumer where the path of least resistance inlines the contract** — prompt templates that embed business logic, route handlers that JSON-shape ad-hoc, single components that own a state machine.
|
|
45
|
+
4. **A schema change** — any addition/modification to a typed boundary (Prisma schema, Pydantic model, TypeScript interface, JSON Schema, Protobuf message).
|
|
46
|
+
|
|
47
|
+
If the chunk fits NONE of these signals, skip the comparison and proceed.
|
|
48
|
+
|
|
49
|
+
## How to apply (Phase 2 Plan output)
|
|
50
|
+
|
|
51
|
+
For each chunk that fires the signal above, the plan must include:
|
|
52
|
+
|
|
53
|
+
```markdown
|
|
54
|
+
### Path A vs Path B — <chunk name>
|
|
55
|
+
|
|
56
|
+
**Path A (minimum-viable):**
|
|
57
|
+
- <one paragraph: what gets shipped, where the contract lives>
|
|
58
|
+
- Time estimate: <derived from t-shirt size>
|
|
59
|
+
- Limitation: <what future capability is foreclosed if we go this way>
|
|
60
|
+
|
|
61
|
+
**Path B (typed-contract extension):**
|
|
62
|
+
- <one paragraph: what gets shipped, where the contract lives>
|
|
63
|
+
- Time delta vs A: <e.g. "+30 min — adds 1 type definition + 1 module boundary">
|
|
64
|
+
- Unlocks (named future capabilities, NOT generic flexibility):
|
|
65
|
+
- <capability 1, with citation to roadmap/PRD/intent.md>
|
|
66
|
+
- <capability 2, with citation>
|
|
67
|
+
|
|
68
|
+
**Gates check:**
|
|
69
|
+
- Time-budget (>2× A)? <yes/no>
|
|
70
|
+
- Missing dep / infra? <yes — name it / no>
|
|
71
|
+
- Missing design decision? <yes — name it / no>
|
|
72
|
+
- Foreclosed-future list empty? <yes — explain / no — list above>
|
|
73
|
+
|
|
74
|
+
**Recommendation:** **Path B** (default) / **Path A** (because <named gate>).
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
The orchestrator's default recommendation is **Path B**. User may override to A on plan acceptance.
|
|
78
|
+
|
|
79
|
+
## Examples (from user's prior decisions)
|
|
80
|
+
|
|
81
|
+
- **Clarifier flow**: prompt-layer (A) vs engine-typed (B) — Decision Doctor C6b. Path B chosen because typed engine output unlocked voice + native surfaces named in the PRD.
|
|
82
|
+
- **Auth checks**: per-route gate (A) vs middleware abstraction (B). Path B chosen when 3+ routes need the check; Path A when only one route.
|
|
83
|
+
- **Theme**: hardcoded primary color (A) vs CSS-var token scaffold (B). Path B chosen when alt-theme is on the roadmap; A otherwise.
|
|
84
|
+
- **Search results**: route-shape JSON (A) vs typed result schema in `lib/` (B). Path B chosen when a second consumer (chat tool, RSS export) is already planned.
|
|
85
|
+
|
|
86
|
+
## Phase 4 Review-A Critic check
|
|
87
|
+
|
|
88
|
+
When reviewing a commit that landed on Path A, the critic asks: did the plan's Path A/B section name a gate that justified A? If the plan lacked the section entirely AND the chunk fits the signals above, flag as a strong checkpoint: **"missing Path-A-vs-B analysis on a typed-boundary commit."**
|
|
89
|
+
|
|
90
|
+
This is a process check, not a re-implementation request — the commit can still ship on A, but the synthesis decision should be on the record.
|
|
91
|
+
|
|
92
|
+
## Relationship to existing packs
|
|
93
|
+
|
|
94
|
+
- **Intent Capability Pack** (`references/intent-capability-pack.md`) — captures user value + non-goals. Provides the named-future-capability list this pack draws on.
|
|
95
|
+
- **UI Input/Output Contract** (`references/ui-io-contract.md`) — names every user input/output. Surfaces the "could be served by multiple surfaces" signal.
|
|
96
|
+
- **Modular Systems Pack** (`references/modular-systems-pack.md`) — MECE/cohesion/coupling defaults. Path B usually advances modularity; Path A often inlines responsibilities.
|
|
97
|
+
|
|
98
|
+
The three packs together establish *what* the build is for and *how* it should be structured. The pay-it-forward pack establishes *which version* to ship when there's a choice.
|