Low priority: prepass-prompt-metrics counts .memlog.md as a prompt file; dream-weaver recall_metrics crashes on one malformed entry

Aperta
#154 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
66/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
python
Ambito
tooling

Direzione di ricerca

Start with skills/bmad-workflow-builder/scripts/prepass-prompt-metrics.py and samples/bmad-agent-dream-weaver/scripts/recall_metrics.py; the issue includes reproduction commands for both failures. Check the existing agent-builder prepass behavior referenced in #114 and #115 for context. Done means dotfiles and non-prompt root files are excluded from the inventory, malformed journal fields are handled without a crash, and skipped entries are reported.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Describe the bug

Two small defects, grouped.

1. prepass-prompt-metrics.py counts .memlog.md (and any root .md) as a prompt file. scan() iterates every root-level *.md except SKILL.md, including the root .memlog.md that bmad-workflow-builder/SKILL.md requires. Its tokens go into the per-file metrics the budget lenses compare against. In a small demo, .memlog.md was 2,635 tokens against SKILL.md at 826. This is the workflow-builder sibling of #115 item 4, which covers only the agent-builder prepass.py.

uv run skills/bmad-workflow-builder/scripts/init_skill.py --name memtest --dest /tmp
uv run skills/bmad-eval-runner/scripts/memlog.py init --path /tmp/memtest/.memlog.md
for i in $(seq 1 200); do echo "- (note) entry $i" >> /tmp/memtest/.memlog.md; done
uv run skills/bmad-workflow-builder/scripts/prepass-prompt-metrics.py /tmp/memtest | jq '.files[] | {file, tokens}'
# {"file":"SKILL.md","tokens":826} {"file":".memlog.md","tokens":2635}

2. samples/bmad-agent-dream-weaver/scripts/recall_metrics.py crashes on a single malformed journal entry. A timestamped date (date: 2026-11-11 07:30:00, which YAML parses as datetime) mixed with plain dates makes sorted() raise TypeError: '<' not supported between instances of 'datetime.datetime' and 'datetime.date'. A non-numeric vividness (vividness: 4/5) raises TypeError: unsupported operand type(s) for +: 'int' and 'str'. One bad entry kills the whole metrics run.

mkdir -p j
printf -- '---\ndate: 2026-11-10\nvividness: 4\n---\nflying\n' > j/a.md
printf -- '---\ndate: 2026-11-11 07:30:00\nvividness: 3\n---\nfalling\n' > j/b.md
python3 samples/bmad-agent-dream-weaver/scripts/recall_metrics.py --journal-path j   # TypeError

Expected behavior

  1. Skip dotfiles (at least .memlog.md) and non-prompt root files in the prompt-file inventory, consistent with the #114 fix in agent-builder.
  2. Normalise datetime to .date(), coerce or skip non-numeric vividness, and report skipped entries in the output instead of crashing.

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

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di bmad-code-org/bmad-builder

Tutte le issue di bmad-code-org/bmad-builder

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.