feat(0.25.0): doctor advisory + repair backfill for Development Philosophy section (BRO-1409)#72
Conversation
…sophy section (BRO-1409) Closes the gap from 0.24.0: idempotent-never-overwrite means newly-templated *content* never reaches existing workspaces, so the Development Philosophy section only shipped to new installs. - doctor.sh §4b: informational advisory when AGENTS.md lacks the section. Not a GAP, never fails --strict (mirrors §12 Pillars / §13 dogfood). - repair.sh backfill_philosophy_section(): extracts the section verbatim from the template (files only, no shell interpolation of content) and inserts it before the target's '## Bstack Core Automation Primitives' anchor in both AGENTS.md + CLAUDE.md. Runs before the compliance early-exit (like the hook merge). Idempotent + insert-only; skips with a warning if anchor absent. - tests/philosophy-backfill.test.sh: 13 assertions (backfill, position, content integrity, idempotency, --dry-run, missing-anchor, doctor advisory). - new-workspace-flow.md documents §4b + backfill. Primitive count unchanged (20). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
Warning Review limit reached
More reviews will be available in 13 minutes and 27 seconds. Learn how PR review limits work. Your organization has run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the 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 include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (6)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
…ant match, verify-after-insert, pipefail SIGPIPE fix Cross-review (Codex, Strata A) BLOCKed 6/10. All four findings real: - extractor now guards the TEMPLATE anchor too (else awk runs heading→EOF). - probe/inserter predicate unified + CRLF/trailing-space tolerant; verify the section actually landed before reporting [fix] (no silent false success). - mktemp/awk/mv now status-checked + temp files cleaned on every failure path. - test now actually runs 'doctor --strict' and asserts the advisory changes neither the GAP total nor the strict exit code (differential with/without). - root-cause of the AGENTS-only failure during hardening: 'tr | grep -q' under 'set -o pipefail' fails spuriously (grep -q SIGPIPEs tr on large files); grep the file directly — [[:space:]]*$ already absorbs trailing CR. Test: 17/17 (adds CRLF + differential-strict cases). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Codex round-2 residual (finding 3): the tr|awk extraction was unchecked under set -o pipefail. Now wrapped in 'if ! ...; then skip+cleanup'. SIGPIPE-safe (awk drains all of tr); content checks still catch partial/empty writes. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
P20 Cross-Review verdict: ✅ PASS (9/10)Strata A — true cross-vendor (Codex
Hardening added: template-anchor guard, CRLF/trailing-space-tolerant matching, verify-after-insert (never report |
What
Closes the follow-up gap from #71 (0.24.0). The scaffold is idempotent-never-overwrite, so newly-templated content never reaches existing workspaces — the Development Philosophy section only shipped to new installs. This makes
bstack doctorsurface it andbstack repairbackfill it.Closes BRO-1409.
Changes
scripts/doctor.sh— §4b advisory: ifAGENTS.mdlacks## Development Philosophy, print an[info]nudge →bstack repair. Informational only — a pre-0.24.0 workspace legitimately lacks it; not a GAP, never fails--strict(mirrors §12 Pillars / §13 dogfood).scripts/repair.sh—backfill_philosophy_section(): extracts the section verbatim from the template (heading →## Bstack Core Automation Primitivesanchor, exclusive) via files only (no shell interpolation of content — backticks/quotes/pipes survive) and inserts it before the target's own anchor inAGENTS.md+CLAUDE.md. Runs before the "fully bstack-compliant" early-exit (same pattern as the existing hook merge, because the advisory is not a GAP). Idempotent + insert-only; skips with a warning if the anchor is absent (never guesses).tests/philosophy-backfill.test.sh— 13 assertions.references/new-workspace-flow.md— §4b + backfill documented.Dep-chain
assets/templates/{AGENTS,CLAUDE}.md.template(extraction source).--quietand no workflow runsdoctor --strict, so the advisory can't fail CI. Primitive count unchanged (20).Verification (P11)
--dry-runwrites nothing; missing-anchor skip; doctor advisory present/absent + not-a-GAP).repair-merge-hooks.test.sh5/5,template_lockstep.test.shpass.bash -nclean.Follow-up (this session)
After merge, run
bstack repairagainst~/broomvaitself to backfill the section there.🤖 Generated with Claude Code