Skip to content

feat(bstack): doctor + frontmatter + primitives.md + templates for P13#6

Merged
broomva merged 1 commit into
mainfrom
feat/p13-doctor
May 6, 2026
Merged

feat(bstack): doctor + frontmatter + primitives.md + templates for P13#6
broomva merged 1 commit into
mainfrom
feat/p13-doctor

Conversation

@broomva
Copy link
Copy Markdown
Owner

@broomva broomva commented May 6, 2026

Companion to broomva/workspace#45 (P13 governance). Extends doctor 12→13. Closes a doc gap where references/primitives.md was missing P12 entirely — now covers P12 + P13 with reflexive triggers + cohesion narrative + rule-of-three deferral note for morpheus. Smoke-tested 46/49 against post-merge target.

…3 (Dream Cycle Discipline)

Companion to broomva/workspace#45 (P13 governance). Closes the doc gap
where references/primitives.md and assets/templates/* hadn't been updated
since P11 — now covers P12 (Persistent Loop) AND the new P13 (Dream
Cycle).

scripts/doctor.sh:
  - EXPECTED_COUNT: 12 → 13
  - Count header regex: "Twelve/12" → "Thirteen/13"
  - Primitive row check loop: 1..12 → 1..13
  - P_NAMES[]: append "P13: Dream Cycle Discipline"
  - REFLEXIVE_PRIMS[]: P6 P7 P10 P11 P12 → + P13

SKILL.md:
  - Frontmatter: P1–P12 → P1–P13
  - "Twelve irreducible" → "Thirteen"
  - New P13 row in primitives quick-reference (closes shadow-dream
    corruption mode)
  - Reflexive primitives list now includes P13

references/primitives.md (closes a doc gap that was open since P11):
  - Added full P12 section (Persistent Loop Discipline) with reflexive
    trigger rule — was missing entirely
  - Added full P13 section (Dream Cycle Discipline) with 5-phase canonical
    shape table, implementation matrix, reflexive trigger rule,
    rule-of-three deferral note for the morpheus crate
  - Cohesion narrative updated: P11/P12/P13 are structural siblings at
    different scales — table comparing discipline / surface / evidence /
    scale for each
  - Closing autonomous-loop diagram updated with "IF long-horizon → P12"
    and "P13 dream cycle for any consolidation"
  - Table of contents updated (P12, P13 entries)

assets/templates/CLAUDE.md.template:
  - "Eleven irreducible" → "Thirteen"
  - New P12 + P13 rows in the primitives table

assets/templates/AGENTS.md.template:
  - New P12 section with reflexive trigger rule (was missing)
  - New P13 section with reflexive trigger rule
  - Closing diagram updated

Smoke test (per P11 trigger #3):
  Against post-PR-α worktree: 46/49 passes
  3 gaps are P6/P7/P12 skill-script paths (skills live at workspace
  root, not inside worktrees — expected, same pattern as prior doctor
  extensions)

After PR α merges + npx skills update propagates to a real installed
workspace, doctor reports full primitive contract compliance.

This is the four-PR series for P13:
  - workspace#45 (P13 governance) — open
  - this PR (bstack doctor + frontmatter + templates + primitives ref)
  - broomva/bookkeeping#1 (P6 with replay — already merged) was the
    first concrete dream instance that motivates P13's binding now

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@broomva broomva merged commit bb27ae4 into main May 6, 2026
@broomva broomva deleted the feat/p13-doctor branch May 6, 2026 16:36
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 6, 2026

Warning

Rate limit exceeded

@broomva has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 32 minutes and 9 seconds before requesting another review.

To continue reviewing without waiting, purchase usage credits in the billing tab.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 5a34d229-8012-48dc-bb0b-23a7ef0c19b8

📥 Commits

Reviewing files that changed from the base of the PR and between d517b44 and 97b847b.

📒 Files selected for processing (5)
  • SKILL.md
  • assets/templates/AGENTS.md.template
  • assets/templates/CLAUDE.md.template
  • references/primitives.md
  • scripts/doctor.sh
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/p13-doctor

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

broomva added a commit that referenced this pull request May 12, 2026
…l engine (#8)

Bstack now treats broomva.tech/prompts as a shared knowledge surface
across agents — not a private repository. Every bstack-driven workspace
gets two affordances from the surface:

1. Reusable directives (code review, deep research, harness bootstrap,
   platform redesign, etc.) — versioned, parameterized, ranked by usage.

2. An evaluation engine that writes a typed prompt_invocation row for
   every pull and every completion (source attribution, latency, tokens,
   cost, feedback). Mirrors the auto-tracing mandate from the
   broomva-cli skill SKILL.md so the bstack agent reading this file
   knows it owes a completion call after every pull.

Changes:

- NEW references/prompts-integration.md (201 lines) — canonical guide:
  when to reach for the library, discovery patterns, the 5-step mandate
  (set source → pull --json → use body → complete with model/tokens →
  optional feedback), source attribution table, env vars, composition
  with primitives P1/P4/P6/P11/P13, and common traps.

- SKILL.md — new "Prompts as a shared knowledge surface" section with
  the reflexive mandate inline (so an agent loading SKILL.md alone sees
  the contract) and a pointer to the full reference file. See-also list
  extended.

- references/skills-roster.md — refreshed row #6 description from the
  stale "Pull, push, update, delete via CLI" to the current Phase 1+2
  reality (eval engine, source attribution, Rust CLI, auto-tracing
  mandate).

- references/quickstart.md — Memory row of the layer table updated to
  reference the shared knowledge surface + eval engine, with a more
  natural trigger phrase ("use the code-review-agent prompt on this
  diff").

Co-authored-by: Test <test@test.com>
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
broomva pushed a commit that referenced this pull request May 22, 2026
…3 follow-up)

Promotes the LLM-as-index /kg load skill from workspace-local v1 (shipped in
0.12.0 at ~/.claude/skills/kg/) to a managed bstack companion skill. Closes
the "Future work" item explicitly anchored in the 0.12.0 CHANGELOG: promote
broomva/kg to its own GitHub repo + bstack skills-lock entry once usage
exceeds rule-of-three. Repo is live at https://github.com/broomva/kg
(MIT-licensed; SKILL.md SHA256 1cf125beaeb675580cc18ef3007ca92eff734db0dc16467978a6d896aa5657a7).

- CHANGED references/companion-skills.yaml — adds `kg` as a required,
  knowledge-category, P6 skill placed next to knowledge-graph-memory (its
  sibling in the P6 family: load-end vs capture-end of the bookkeeping loop).
  bin/bstack-skills install picks it up automatically via parse_roster() —
  no install-script changes needed.

- CHANGED scripts/doctor.sh §7 — /kg load check now accepts either a managed
  install (~/.claude/skills/kg/ OR ~/.agents/skills/kg/) or a legacy
  workspace-local v1 install. Gap message points at
  `npx skills add broomva/kg` (the new managed path).

- CHANGED references/skills-roster.md — adds row #6 in Memory &
  Consciousness, between knowledge-graph-memory and prompt-library; full
  table renumbered (continuous 1-28); header count 27 → 28.

- CHANGED VERSION — 0.13.0 → 0.14.0. Minor bump: additive but the required
  roster surface area changes (existing v0.13.0 installs will see kg as
  "missing*" in `bstack skills status` until `bstack skills install` runs).

Schema unchanged — new entry validates against companion-skills.v1.json.
tests/skills-roster.test.sh Test 1 GREEN with 32 skills (was 31).
bstack doctor post-change: 86/88 (identical to pre-change baseline; the
2 gaps are pre-existing P19 mechanism + P6 catalog hook concerns about
the worktree, unrelated to kg).

Why P6, not a new primitive: kg operationalizes P6 at the load end of
the loop (dual of knowledge-graph-memory which captures into the graph).
Same primitive, opposite arrow. No L3 stability-budget impact.

Refs: BRO-1223

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
broomva added a commit that referenced this pull request May 22, 2026
…1223 follow-up) (#44)

* feat(0.14.0): register broomva/kg as managed companion skill (BRO-1223 follow-up)

Promotes the LLM-as-index /kg load skill from workspace-local v1 (shipped in
0.12.0 at ~/.claude/skills/kg/) to a managed bstack companion skill. Closes
the "Future work" item explicitly anchored in the 0.12.0 CHANGELOG: promote
broomva/kg to its own GitHub repo + bstack skills-lock entry once usage
exceeds rule-of-three. Repo is live at https://github.com/broomva/kg
(MIT-licensed; SKILL.md SHA256 1cf125beaeb675580cc18ef3007ca92eff734db0dc16467978a6d896aa5657a7).

- CHANGED references/companion-skills.yaml — adds `kg` as a required,
  knowledge-category, P6 skill placed next to knowledge-graph-memory (its
  sibling in the P6 family: load-end vs capture-end of the bookkeeping loop).
  bin/bstack-skills install picks it up automatically via parse_roster() —
  no install-script changes needed.

- CHANGED scripts/doctor.sh §7 — /kg load check now accepts either a managed
  install (~/.claude/skills/kg/ OR ~/.agents/skills/kg/) or a legacy
  workspace-local v1 install. Gap message points at
  `npx skills add broomva/kg` (the new managed path).

- CHANGED references/skills-roster.md — adds row #6 in Memory &
  Consciousness, between knowledge-graph-memory and prompt-library; full
  table renumbered (continuous 1-28); header count 27 → 28.

- CHANGED VERSION — 0.13.0 → 0.14.0. Minor bump: additive but the required
  roster surface area changes (existing v0.13.0 installs will see kg as
  "missing*" in `bstack skills status` until `bstack skills install` runs).

Schema unchanged — new entry validates against companion-skills.v1.json.
tests/skills-roster.test.sh Test 1 GREEN with 32 skills (was 31).
bstack doctor post-change: 86/88 (identical to pre-change baseline; the
2 gaps are pre-existing P19 mechanism + P6 catalog hook concerns about
the worktree, unrelated to kg).

Why P6, not a new primitive: kg operationalizes P6 at the load end of
the loop (dual of knowledge-graph-memory which captures into the graph).
Same primitive, opposite arrow. No L3 stability-budget impact.

Refs: BRO-1223

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* feat(doctor): catalog stale threshold reads from .control/policy.yaml

§7 P6 catalog freshness check now sources its threshold from
.control/policy.yaml catalog.stale_doctor_hours, with a hardcoded 48h
fallback when:
- policy.yaml is missing
- python3 is unavailable
- PyYAML is missing (read fails)

This is part of the BRO-1223 follow-up to reconcile three different
"stale" thresholds previously hardcoded across:
  - ~/.claude/skills/kg/scripts/kg.py        (24h, now policy.stale_warn_hours)
  - ~/broomva/bstack/scripts/doctor.sh       (48h, now policy.stale_doctor_hours)
  - ~/broomva/scripts/knowledge-catalog-refresh-hook.sh (300s, now policy.refresh_cooldown_seconds)

After this PR + the paired broomva/workspace PR, policy.yaml is the
single source of truth. Doctor reports the active threshold in the OK
message so the user sees which threshold applied.

Pairs with broomva/workspace PR (adds the catalog: block to policy.yaml
and updates kg.py + hook to read from it).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* fix(doctor): P20 round-1 — argv passing + regex validation + honest CHANGELOG

Addresses cross-review verdict 6/10 FAIL:

- **C1 (critical)**: CHANGELOG 0.14.0 previously described only
  commit a261461 (kg registration). Now also describes commit
  8de2f1b's doctor.sh §7 policy.yaml threshold reader — which is
  the primary BRO-1223 I1 closure shipping in this PR. The
  CHANGELOG is the audience-facing projection of the diff; honesty
  about what shipped is non-negotiable.
- **C3 (critical)**: doctor.sh §7 `_stale_h` now regex-validates
  the python3 output (`[[ "$_raw" =~ ^[0-9]+$ ]]`). Empty stdout
  from a malformed policy.yaml previously corrupted the integer
  comparison and falsely flagged a stale catalog every run.
- **I1 (important)**: doctor.sh §7 python3 invocation now uses
  argv-passed args via sys.argv (avoids SyntaxError on
  single-quote-in-path edge case). Same hardening pattern as the
  paired workspace hook.

Pairs with the workspace PR (kg.py bounds check + bench KG_PY +
hook argv/regex hardening).

Refs BRO-1223 P20 round-1.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Carlos D. Escobar-Valbuena <devteam@getstimulus.ai>
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant