Skip to content

Commit 322ba23

Browse files
broomvaCarlos D. Escobar-Valbuenaclaude
authored
feat(primitives): renumber so Wait=P9 — restore skill-name↔primitive-number alignment (#23)
The productive-wait primitive returns to P9, matching the `broomva/p9` skill repo name. Skill Freshness moves to P7, Branch+Worktree Janitor moves to P8. This closes the Name (Pn) recall-key failure mode the naming rule (PR #21) was designed to prevent: under the interim P7=Wait / P8=Freshness / P9=Janitor numbering, the `broomva/p9` skill name pointed at primitive P9 (Janitor), making `feedback_p9_reflexive.md` ambiguous — was it about the skill (Wait) or the primitive number (Janitor)? The 2026-05-16 renumber restores Wait = P9 = `broomva/p9` everywhere. Stacked on PR #21 (`feat/primitive-naming-reflex`) so this PR carries both the naming rule and the alignment fix it makes possible. Changes: - SKILL.md: description-block prose + primitive table P7/P8/P9 swap + Short-name index in the naming-convention section. Added prose explaining why Wait sits at P9 (skill repo name commitment). - references/primitives.md: TOC + section bodies P7/P8/P9 swap + Short-name index. Section bodies carry legacy-path callouts pointing at the OPPOSITE direction now (~/.config/broomva/p7/ canonical, p8/ legacy for freshness; p8-janitor/ canonical, p9-janitor/ legacy for janitor). The §P9 Skill name paragraph now explains the renumber rationale + the "numeric soup" failure mode it closes. - assets/templates/settings.json.snippet: skill-freshness-hook.sh's `_bstack_primitive` annotation flipped P8 → P7. - assets/templates/policy.yaml.template: two comment headers updated to mark the ci_watch + auto_merge blocks as P9 primitives. - assets/templates/{CLAUDE,AGENTS}.md.template: no changes — these were already in the target ordering (the templates have been ahead of the workspace this whole time, which is what made the renumber possible in one PR). - scripts/doctor.sh: - Section 1-8 comment block updated for new numbering. - P_NAMES array swap (P7=Skill Freshness, P8=Janitor, P9=Wait). - REFLEXIVE_PRIMS now includes P9 (Wait, reasoning-enforced) and excludes P7 (Freshness, hook-enforced). - HOOK_LABELS skill-freshness-hook.sh label flipped P8 → P7. - SCRIPT_PATHS reordered so SCRIPT_LABELS=(P1 P2 P6 P7 P8 P9 P12) matches the new path-to-primitive mapping. - NEW Section 9 — Naming convention propagation. Lints CLAUDE.md + AGENTS.md for (a) presence of the Name (Pn) naming rule in prose and (b) a Short-name index with exactly 20 entries. Closes the silent-drift failure mode where governance edits could leave the index mismatched with the primitive count. - tests/template_lockstep.test.sh: updated explanatory comment to reflect that templates and workspace canonical now agree. Kept in WARN mode for one release cycle to ease in-place upgrades from downstream workspaces still on legacy ordering. - VERSION: 0.1.0 → 0.2.0. - CHANGELOG.md: 0.2.0 entry covering the renumber rationale, the migration path (legacy env vars + config dirs still honored), the naming-rule propagation (PR #21 carry-forward), and the doctor Section 9 extension. Workspace PR-A (companion to this PR) will follow shortly with the runtime changes (CLAUDE.md + AGENTS.md + scripts/skill-freshness-hook.sh + scripts/branch-janitor.sh) so the workspace mechanisms match these declarative bstack changes. Until PR-A lands, doctor against the workspace reports a single P9-missing-reflexive-rule gap — that's the expected coordination signal. Validation: - tests/template_lockstep.test.sh: 15/15 (canonical count = 20) - scripts/doctor.sh: 78/79 — only gap is workspace AGENTS.md P9 missing reflexive rule, which PR-A fixes. Section 9 Name (Pn) lint passes for both CLAUDE.md + AGENTS.md. Co-authored-by: Carlos D. Escobar-Valbuena <devteam@getstimulus.ai> Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 7e45d59 commit 322ba23

8 files changed

Lines changed: 159 additions & 71 deletions

File tree

CHANGELOG.md

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,53 @@
11
# Changelog
22

3+
## 0.2.0 — 2026-05-16
4+
5+
### Primitive renumber: Wait moves back to P9 (skill-name↔primitive-number alignment)
6+
7+
The productive-wait primitive (`broomva/p9` skill) is now **P9 (Wait)** again,
8+
matching the skill repo name. Freshness moves to **P7**, Janitor moves to **P8**.
9+
10+
| Before | After |
11+
|---|---|
12+
| P7 = Wait (`broomva/p9` skill — historical name) | P7 = Skill Freshness |
13+
| P8 = Skill Freshness | P8 = Branch + Worktree Janitor |
14+
| P9 = Branch + Worktree Janitor | P9 = Wait (`broomva/p9` skill — name matches number) |
15+
16+
**Rationale**: the interim P8-Freshness / P9-Janitor numbering broke the Name (Pn)
17+
recall key for Wait — the `broomva/p9` skill name no longer matched any primitive
18+
number, producing the exact "numeric soup" failure mode the naming rule (added
19+
in 0.1.x) was designed to prevent. Memory feedback file `feedback_p9_reflexive.md`
20+
became ambiguous (was it about the *skill* or the *primitive number*?). The
21+
2026-05-16 renumber restores alignment so Wait = P9 = `broomva/p9` — primitive
22+
number, primitive name, and skill repo name all agree.
23+
24+
**Migration**: legacy paths kept working via fallback in `skill-freshness-hook.sh`
25+
(reads `~/.config/broomva/p7/` canonically, falls back to `~/.config/broomva/p8/`)
26+
and `branch-janitor.sh` (reads `~/.config/broomva/p8-janitor/` canonically, falls
27+
back to `~/.config/broomva/p9-janitor/`). Legacy env vars `BROOMVA_P8_HOME` and
28+
`BROOMVA_P9_JANITOR_HOME` still honored for in-place upgrades; canonical names
29+
are now `BROOMVA_P7_HOME` and `BROOMVA_P8_JANITOR_HOME`.
30+
31+
### Naming convention rule propagated to bstack-loaded surfaces
32+
33+
The "use `Name (Pn)` form in agent prose, never bare `Pn`" rule (already in
34+
workspace CLAUDE.md + AGENTS.md) is now restated in `SKILL.md` (naming-convention
35+
subsection after the primitives table) and `references/primitives.md` (top of
36+
file, before TOC). When `/bstack` fires and agents load these surfaces, the rule
37+
is visible at the entry point — closing the gap where agents reverted to bare
38+
`Pn` because the rule was buried only in workspace governance files.
39+
40+
### Doctor extensions
41+
42+
- **New Section 9 — Naming convention propagation**: `scripts/doctor.sh` now lints
43+
that CLAUDE.md + AGENTS.md contain (a) the `Name (Pn)` naming rule in prose,
44+
and (b) a **Short-name index** line with exactly 20 entries. Closes the
45+
silent-drift failure mode where governance edits could leave the index
46+
mismatched with the primitive count.
47+
- **Primitive-number checks updated**: Section 3 (AGENTS.md primitive sections),
48+
Section 4 (reflexive trigger rules), Section 6 (hook wiring labels), and
49+
Section 7 (script paths + labels) all reflect the new canonical ordering.
50+
351
## 0.1.0
452

553
- Initial versioned release with auto-update mechanism

SKILL.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@ description: |
77
the substrate. P1 captures every session as episodic memory. P2 gates
88
destructive operations. P3 tracks every work unit in Linear. P4 forces every
99
change through CI. P5 isolates parallel agents in worktrees. P6 keeps the
10-
knowledge graph quality-controlled. P7 is the productive-wait optimizer
11-
(`broomva/p9` skill — historical name) — drains a context-scoped queue
12-
while a blocking operation (PR CI, deploy, build, long index) runs;
13-
classifier + evaluator self-heal red CI is the reference implementation.
14-
P8 nudges when installed skills go stale. P9 cleans up squash-merged
15-
branches and dead worktrees. P10 binds every agent to
10+
knowledge graph quality-controlled. P7 nudges when installed skills go
11+
stale. P8 cleans up squash-merged branches and dead worktrees. P9 is the
12+
productive-wait optimizer (`broomva/p9` skill — name matches primitive
13+
number) — drains a context-scoped queue while a blocking operation (PR
14+
CI, deploy, build, long index) runs; classifier + evaluator self-heal
15+
red CI is the reference implementation. P10 binds every agent to
1616
clean-tree discipline through the PR lifecycle. P11 is the cohesion glue —
1717
bind every agent to validate by interacting with what they build, not just
1818
by reasoning + lint + CI exit codes. P12 is the long-horizon discipline —
@@ -26,7 +26,7 @@ description: |
2626
graph. P18 binds the format of every produced documentation artifact to
2727
its audience — markdown for LLM-loaded surfaces, HTML for human deliverables
2828
(specs, plans, reports, design exploration). P19 names the autonomous-
29-
continuation family (the 2×2 of /goal | P7 watcher | /loop | P12 persist)
29+
continuation family (the 2×2 of /goal | P9 watcher | /loop | P12 persist)
3030
and the selection discipline — pick the right mechanism for the work
3131
shape; compose dynamically; never return control mid-arc when a mechanism
3232
would keep it closed. P20 is the cross-model adversarial review gate —
@@ -91,9 +91,9 @@ The twenty primitives. Each closes one specific failure mode that drifts into en
9191
| **P4** | PR Pipeline | merging unreviewed code |
9292
| **P5** | Parallel Agents | sequential bottleneck |
9393
| **P6** | Knowledge Bookkeeping | knowledge graph rot |
94-
| **P7** | CI Watcher + Productive Wait (`broomva/p9` skill — historical name) | sleep-on-wait dead time (CI, deploys, builds — PR CI is the reference impl) |
95-
| **P8** | Skill Freshness Check | silent rot of `npx skills add` snapshots |
96-
| **P9** | Branch + Worktree Janitor | squash-merge accumulation |
94+
| **P7** | Skill Freshness Check | silent rot of `npx skills add` snapshots |
95+
| **P8** | Branch + Worktree Janitor | squash-merge accumulation |
96+
| **P9** | CI Watcher + Productive Wait (`broomva/p9` skill — name matches number) | sleep-on-wait dead time (CI, deploys, builds — PR CI is the reference impl) |
9797
| **P10** | Worktree Hygiene Discipline | dirty-tree drift across the PR lifecycle |
9898
| **P11** | Empirical Feedback Loop | shipping code that compiles but doesn't work |
9999
| **P12** | Persistent Loop Discipline (`broomva/persist` skill) | long-horizon work decaying as the context window rots |
@@ -112,9 +112,9 @@ Full reference: see [references/primitives.md](references/primitives.md).
112112

113113
Each primitive carries a **short name** for use in agent prose. When referencing a primitive in responses, PR bodies, commit messages, code comments, knowledge-graph entries, or any human-readable surface, use the **`Name (Pn)`** form — *"applying Snapshot (P15)"*, *"via Dep-Chain (P14)"*, *"running Bookkeeping (P6)"* — not bare `P15` / `P14` / `P6`. The number is the canonical identifier (stable across renames); the name is the human-readable handle. First mention in a response uses the full form; subsequent mentions in the same response may drop to bare `Name` ("Snapshot showed clean state") but never to bare `Pn`. Anchors, section IDs (`#p15-state-snapshot-before-action`), and primitive-count headers ("Twenty irreducible primitives") stay numeric — URL stability and arithmetic respectively. Failure mode: bare `Pn` makes responses read as numeric soup; cross-session readers can't decode the reference without a lookup. The Short-name index below is the recall key.
114114

115-
**Short-name index** (canonical numbering): Bridge (P1) · Gate (P2) · Tickets (P3) · Pipeline (P4) · Fanout (P5) · Bookkeeping (P6) · Wait (P7) · Freshness (P8) · Janitor (P9) · Hygiene (P10) · Empirical (P11) · Persist (P12) · Dream (P13) · Dep-Chain (P14) · Snapshot (P15) · Crystallize (P16) · Lens (P17) · Audience (P18) · Orchestrate (P19) · Cross-Review (P20).
115+
**Short-name index** (canonical numbering): Bridge (P1) · Gate (P2) · Tickets (P3) · Pipeline (P4) · Fanout (P5) · Bookkeeping (P6) · Freshness (P7) · Janitor (P8) · Wait (P9) · Hygiene (P10) · Empirical (P11) · Persist (P12) · Dream (P13) · Dep-Chain (P14) · Snapshot (P15) · Crystallize (P16) · Lens (P17) · Audience (P18) · Orchestrate (P19) · Cross-Review (P20).
116116

117-
**Canonical statement** lives in workspace `CLAUDE.md` §Bstack Core Automation Primitives and workspace `AGENTS.md` near line 93. This SKILL.md restates the rule so it's visible at the entry point where `/bstack` loads.
117+
**Canonical statement** lives in workspace `CLAUDE.md` §Bstack Core Automation Primitives and workspace `AGENTS.md` near line 93. This SKILL.md restates the rule so it's visible at the entry point where `/bstack` loads. **Note**: Wait sits at P9 to match the `broomva/p9` skill repo name — the primitive number and the skill name are intentionally aligned. Skill repos that don't carry a number (e.g., `broomva/bookkeeping` = P6, `broomva/persist` = P12) take their name from the function, not the number; carrying a numeric skill name is a commitment to keep that number stable.
118118

119119
**Canonical operating mode**: `broomva/autonomous` — when the user says "go" / "proceed" / "be autonomous" / "automerge" / any bare execution directive, `/autonomous` fires the 20-reflex pipeline that exercises every primitive above in the right sequence. Substrate without mode is dormant; mode without substrate is wishful. Compounded, they produce a self-operating workspace.
120120

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.1.0
1+
0.2.0

assets/templates/policy.yaml.template

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@ gates:
4444
rule: "Run smoke before commit"
4545
severity: warn
4646

47-
# === P7 CI Watcher + Productive-Wait Primitive ===
48-
# Required by skills/p9 (bstack P7 primitive). Fails closed if absent.
47+
# === P9 CI Watcher + Productive-Wait Primitive ===
48+
# Required by skills/p9 (bstack P9 primitive — name matches number). Fails closed if absent.
4949

5050
ci_watch:
5151
enabled: true
@@ -67,7 +67,7 @@ ci_heal:
6767
linear_label: ci-heal-escalation
6868
notify_hook: skills/p9/scripts/p9-escalate-notify.sh
6969

70-
# === P7 Auto-merge actuator ===
70+
# === P9 Auto-merge actuator ===
7171
# Closes the MERGE_READY → merged gap. Default-disabled; opt-in branch class.
7272

7373
auto_merge:

assets/templates/settings.json.snippet

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"type": "command",
99
"command": "${BROOMVA_WORKSPACE}/scripts/skill-freshness-hook.sh",
1010
"timeout": 5,
11-
"_bstack_primitive": "P8"
11+
"_bstack_primitive": "P7"
1212
},
1313
{
1414
"type": "command",

0 commit comments

Comments
 (0)