Files
msd-core/capabilities/mempalace/fragments/capture-problems.md
Tom Boucher d8af61be44 fix(#2220): replace invalid mempalace mine --room with detect_room() staging (#2260)
* fix(#2220): replace invalid 'mine --room' with detect_room() staging approach

mempalace mine has no --room flag (only search does) — verified against
MemPalace 3.5.0 official docs (mempalaceofficial.com/reference/cli.html).
The headless capture path used --room, causing every headless/no-MCP run
to fail with 'unrecognized arguments: --room' and silently skip capture.

Fix: replace the flag with a staging-based approach that uses detect_room()'s
documented folder-path match — stage the artifact under a room-named subfolder
with a mempalace.yaml room taxonomy, then run 'mempalace mine <stage> --wing'.

Docs sources cited in-file:
- CLI reference:  https://mempalaceofficial.com/reference/cli.html
- Mining guide:   https://mempalaceofficial.com/guide/mining.html
- Config guide:   https://mempalaceofficial.com/guide/configuration.html

Changes:
- skills/gsd-mempalace-capture/SKILL.md: headless staging instructions
- commands/gsd/mempalace-capture.md: same
- capabilities/mempalace/fragments/capture-problems.md: reference staging
- .gitignore: exclude .planning/.mempalace-stage/
- tests/mempalace-capture-headless-invocation.test.cjs: regression test
- Golden install parity fixtures + workflow-size baseline regenerated

* docs: backfill changeset PR number (#2260)

* fix: regenerate golden fixtures after next merge
2026-07-14 14:52:24 -04:00

2.4 KiB

Capture problems → fixes (MemPalace)

Gate first. Read .planning/config.json. If mempalace.enabled is not true, or mempalace.capture_artifacts is false, skip this entire section and let the wave complete unchanged. (This contribution is only injected when the capability is enabled; the capture_artifacts check lets you turn capture off without disabling the rest of the capability.)

Otherwise — after verifying this wave, persist any confirmed problem→fix pairs into the palace so they are recalled in future phases. This is best-effort; if MemPalace is unreachable, skip silently — capture never fails a wave.

For each confirmed bug/issue resolved in this wave:

  1. Resolve the wing (mempalace.wing, else project_code, else project dir) and target room: problems.
  2. Dedupe first. Call mempalace_check_duplicate (interactive) before filing so re-runs don't create duplicate drawers.
  3. File the drawer verbatim. Store the problem statement and its fix as a drawer in room: problems — interactive: mempalace_add_drawer; headless: stage the artifact under the problems/ folder and run mempalace mine (no --room flag — see CLI reference; room assignment is via detect_room() folder-path match per the mining guide; use the same staging pattern documented in gsd-mempalace-capture Step 3). Include provenance (source_file, phase id).
  4. Mirror the KG fact when mempalace.mirror_kg is on: add (<bug>, fixed_by, <fix>) with valid_from = the phase date via mempalace_kg_add.
  5. Mode awareness (mempalace.memory_mode). Under augment the fact is an additive mirror alongside .planning/graphs/. Under kg_backend/replace the palace is the authoritative store for the fact; GSD still writes .planning/graphs/ through its normal graphify, so an unreachable palace never loses it.

Captures are idempotent: deterministic drawer IDs + check_duplicate mean re-running the wave re-files the same content without duplication. On any error, skip and let the wave complete normally.