Skip to content
This repository was archived by the owner on Nov 25, 2026. It is now read-only.
This repository was archived by the owner on Nov 25, 2026. It is now read-only.

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

Open

Description

@CloneOfAlex

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 fix: exempt agent-builder operational files from scan false positives #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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions