Agent First Breath: an interrupted init-sanctum leaves a half-built sanctum that wake.py and init-sanctum.py then deadlock on; CAPABILITIES.md table not escaped
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 58/100
Direzione di ricerca
Start with skills/bmad-agent-builder/assets/init-sanctum-template.py and wake-template.py, then inspect the sample agent scripts generated from them. Trace what happens when initialization fails after creating the sanctum directory and how wake detects an incomplete sanctum; compare recovery behavior with the expected repair flow. Also inspect generate_capabilities_md() and its frontmatter parsing for table cell escaping and folded or literal descriptions. Done means interrupted initialization can recover and generated capability rows preserve descriptions without corrupting the Markdown table.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Describe the bug
This affects the memory-agent scaffolding emitted by skills/bmad-agent-builder/assets/init-sanctum-template.py and wake-template.py, and every sample agent built from them.
1. Interrupted First Breath permanently bricks the agent. init-sanctum.py creates _bmad/memory/<skill>/ first, then copies references, scripts and templates, and writes CAPABILITIES.md. If anything fails after the mkdir, the sanctum is left half-built: a missing or unreadable reference, a decode error, a full disk, or a killed session. After that:
wake.pychecks forCREED.md+MEMORY.md. They're missing, so it printsMODE: FIRST_BREATH/NO SANCTUM at ..., even though the directory exists.first-breath.mdtells the agent to runinit-sanctum.py, which sees the directory and prints "This agent has already been born. Skipping First Breath scaffolding."
Every activation loops between the two. Only a manual rm -rf of the sanctum recovers it.
2. CAPABILITIES.md rows are not escaped. generate_capabilities_md() writes each capability's description raw into a markdown table. A | in a description adds a cell and corrupts the row. A folded description: > (the frontmatter parser is line-based) appears as >.
Steps to reproduce
cp -r samples/bmad-agent-sentinel /tmp/s/skill && mkdir -p /tmp/s/proj/_bmad && cd /tmp/s
# (1) simulate a failure after the sanctum dir is created
mv skill/references skill/refs_moved
python3 skill/scripts/init-sanctum.py proj skill # FileNotFoundError ... skill/references
mv skill/refs_moved skill/references # cause fixed
python3 skill/scripts/wake.py proj | head -2 # MODE: FIRST_BREATH / NO SANCTUM at ...
python3 skill/scripts/init-sanctum.py proj skill # "This agent has already been born. Skipping..."
ls proj/_bmad/memory/bmad-agent-sentinel # capabilities references sessions (no PERSONA/CREED/MEMORY/CAPABILITIES)
# (2) table escaping
rm -rf proj/_bmad/memory
sed -i 's/^description:.*/description: Scans risks | ranks them by impact/' skill/references/risk-radar.md
python3 skill/scripts/init-sanctum.py proj skill
grep risk-radar proj/_bmad/memory/*/CAPABILITIES.md
# | [RR] | risk-radar | Scans risks | ranks them by impact | `./references/risk-radar.md` | <- 5 cells
Expected behavior
- Build the sanctum in a temp sibling directory (
<skill>.tmp-<pid>) andos.replaceit into place only after everything is written, or write a completion marker last. Treat "dir exists but no marker / no CREED.md" as resume or repair, not already born. - Make
wake.py's message accurate ("incomplete sanctum at ...") and route to repair. - Escape
|(and newlines) in table cells, and parse capability frontmatter with a YAML parser so folded and literal descriptions work.
Environment
- Model(s) used: n/a (deterministic script)
- Agentic IDE used: n/a (scripts run directly)
- BMad version: bmad-builder
main@d4a921c(v2.2.2 + #118) - Project language: Python 3.13, Linux
- Lingua principale
- Python
- Stelle
- 220
- Fork
- 54
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di bmad-code-org/bmad-builder
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
bmad-code-org/bmad-builder#157 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
bmad-code-org/bmad-builder#153 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
bmad-code-org/bmad-builder#151 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 77/100
bmad-code-org/bmad-builder#127 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
bmad-code-org/bmad-builder#123 ·
Tutte le issue di bmad-code-org/bmad-builder
Issue simili
-
namespace
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 68/100
EclipseFdn/open-vsx.org#15604 ·
I maintainer di solito rispondono entro 1 giorno
-
app: scripts severity: low status: backlog type: bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
netbox-community/netbox-scripts#164 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
I maintainer di solito rispondono entro 5 giorni
-
Public function to read participants.tsvForse già presa @bruAristimunha l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 1-3 ore Idoneità per principianti 85/100
huggingface/tau#799 ·
I maintainer di solito rispondono entro 2 giorni