From d8af61be4428809ce7a63f710f8e1a105c707d10 Mon Sep 17 00:00:00 2001 From: Tom Boucher Date: Tue, 14 Jul 2026 14:52:24 -0400 Subject: [PATCH] fix(#2220): replace invalid mempalace mine --room with detect_room() staging (#2260) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * 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 --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 --- .changeset/tidy-elks-sing.md | 5 ++ .gitignore | 1 + .../mempalace/fragments/capture-problems.md | 2 +- commands/gsd/mempalace-capture.md | 28 ++++++- skills/gsd-mempalace-capture/SKILL.md | 28 ++++++- .../golden-install-parity/antigravity.json | 2 +- .../golden-install-parity/augment.json | 4 +- .../golden-install-parity/claude.json | 2 +- .../fixtures/golden-install-parity/cline.json | 2 +- .../golden-install-parity/codebuddy.json | 4 +- .../fixtures/golden-install-parity/codex.json | 2 +- .../golden-install-parity/copilot.json | 2 +- .../golden-install-parity/cursor.json | 4 +- .../golden-install-parity/hermes.json | 2 +- .../fixtures/golden-install-parity/kilo.json | 4 +- .../fixtures/golden-install-parity/kimi.json | 2 +- .../golden-install-parity/opencode.json | 4 +- .../fixtures/golden-install-parity/qwen.json | 2 +- .../fixtures/golden-install-parity/trae.json | 2 +- .../fixtures/golden-install-parity/zcode.json | 4 +- ...alace-capture-headless-invocation.test.cjs | 73 +++++++++++++++++++ 21 files changed, 155 insertions(+), 24 deletions(-) create mode 100644 .changeset/tidy-elks-sing.md create mode 100644 tests/mempalace-capture-headless-invocation.test.cjs diff --git a/.changeset/tidy-elks-sing.md b/.changeset/tidy-elks-sing.md new file mode 100644 index 000000000..3a5ca61c0 --- /dev/null +++ b/.changeset/tidy-elks-sing.md @@ -0,0 +1,5 @@ +--- +type: Fixed +pr: 2260 +--- +**Headless MemPalace capture no longer fails silently** — the headless invocation `mempalace mine --wing --room ` used a `--room` flag that does not exist on the `mine` subcommand (only `search` accepts `--room`), causing every headless/no-MCP capture run to fail with `unrecognized arguments: --room` and silently skip (onError: skip). The fix replaces the flag with MemPalace's documented room-assignment mechanism: stage the artifact under a room-named subfolder with a `mempalace.yaml` taxonomy so `detect_room()` assigns it via folder-path match. (#2220) diff --git a/.gitignore b/.gitignore index 0f399bcad..fdec0b734 100644 --- a/.gitignore +++ b/.gitignore @@ -239,6 +239,7 @@ tmp/ # MemPalace per-project files (issue #185) mempalace.yaml entities.json +.planning/.mempalace-stage/ # Local scratch + Claude-test artifacts .scratch/ diff --git a/capabilities/mempalace/fragments/capture-problems.md b/capabilities/mempalace/fragments/capture-problems.md index 122ee37d3..4a86a4071 100644 --- a/capabilities/mempalace/fragments/capture-problems.md +++ b/capabilities/mempalace/fragments/capture-problems.md @@ -13,7 +13,7 @@ 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: `mempalace mine` / `mempalace hook run`. Include provenance (`source_file`, phase id). +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](https://mempalaceofficial.com/reference/cli.html); room assignment is via `detect_room()` folder-path match per the [mining guide](https://mempalaceofficial.com/guide/mining.html); 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 `(, fixed_by, )` 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. diff --git a/commands/gsd/mempalace-capture.md b/commands/gsd/mempalace-capture.md index 6f106ef91..fdd61cc4a 100644 --- a/commands/gsd/mempalace-capture.md +++ b/commands/gsd/mempalace-capture.md @@ -55,7 +55,33 @@ This step is `onError: skip` at `discuss:post` / `plan:post` / `verify:post` -- On any error or timeout, stop and let the phase continue -- capture is best-effort. 1. **Dedup first.** Interactive: `mempalace_check_duplicate` on the artifact's deterministic drawer id. Headless: rely on `mempalace mine`'s content-hash idempotency. -2. **Add the drawer (verbatim).** File the exact artifact text into `room: ` of `wing: ` with provenance (`source_file`, phase id). Interactive: `mempalace_add_drawer`. Headless: `mempalace mine --wing --room `. +2. **Add the drawer (verbatim).** File the exact artifact text into `room: ` of `wing: ` with provenance (`source_file`, phase id). Interactive: `mempalace_add_drawer`. Headless: see below. + + **`mempalace mine` has no `--room` flag** — only `search` accepts `--room` ([CLI reference: https://mempalaceofficial.com/reference/cli.html](https://mempalaceofficial.com/reference/cli.html)). Room assignment is driven by `detect_room()` matching folder-path segments against the `rooms:` list in `mempalace.yaml` ([mining guide: https://mempalaceofficial.com/guide/mining.html](https://mempalaceofficial.com/guide/mining.html) — "Rooms are auto-detected from your folder structure"; [config reference: https://mempalaceofficial.com/guide/configuration.html](https://mempalaceofficial.com/guide/configuration.html)). Stage the artifact under a room-named folder so `detect_room()` assigns it correctly: + + ```bash + STAGE=".planning/.mempalace-stage" + # One-time: declare the GSD room taxonomy so detect_room() recognizes these folders + mkdir -p "$STAGE" + [ -f "$STAGE/mempalace.yaml" ] || cat > "$STAGE/mempalace.yaml" <<'YAML' + rooms: + - decisions + - planning + - milestones + - problems + - general + YAML + # Suppress MemPalace cache artifacts written into the scanned tree + [ -f "$STAGE/.gitignore" ] || echo "mempalace_embedder.json" > "$STAGE/.gitignore" + # Stage under // — stable path so mine's content-hash + # idempotency (file_already_mined keys on absolute source_file + mtime) deduplicates + # instead of creating duplicate drawers on re-runs. + ROOM_DIR="$STAGE//" + mkdir -p "$ROOM_DIR" + cp "" "$ROOM_DIR/" + # Mine with --wing only — no --room flag; detect_room() assigns from the folder path + mempalace mine "$STAGE" --wing + ``` 3. **Mirror KG facts** when `config.mempalace.mirror_kg` is true: extract decision/delivery facts and `mempalace_kg_add` them with `valid_from` = the phase date (e.g. `(, decided, )` from CONTEXT; `(, delivered, )` from SUMMARY). Under `augment` these are an *additive* mirror of GSD's native `.planning/graphs/`. Under `kg_backend`/`replace` the palace KG is the *authoritative* fact store — GSD still produces `.planning/graphs/` through its normal graphify, so an unreachable palace never loses a fact. 4. Re-running a phase MUST NOT create duplicate drawers (deterministic ids + `check_duplicate`). diff --git a/skills/gsd-mempalace-capture/SKILL.md b/skills/gsd-mempalace-capture/SKILL.md index 9baa41e6c..68db3da6e 100644 --- a/skills/gsd-mempalace-capture/SKILL.md +++ b/skills/gsd-mempalace-capture/SKILL.md @@ -55,7 +55,33 @@ This step is `onError: skip` at `discuss:post` / `plan:post` / `verify:post` -- On any error or timeout, stop and let the phase continue -- capture is best-effort. 1. **Dedup first.** Interactive: `mempalace_check_duplicate` on the artifact's deterministic drawer id. Headless: rely on `mempalace mine`'s content-hash idempotency. -2. **Add the drawer (verbatim).** File the exact artifact text into `room: ` of `wing: ` with provenance (`source_file`, phase id). Interactive: `mempalace_add_drawer`. Headless: `mempalace mine --wing --room `. +2. **Add the drawer (verbatim).** File the exact artifact text into `room: ` of `wing: ` with provenance (`source_file`, phase id). Interactive: `mempalace_add_drawer`. Headless: see below. + + **`mempalace mine` has no `--room` flag** — only `search` accepts `--room` ([CLI reference: https://mempalaceofficial.com/reference/cli.html](https://mempalaceofficial.com/reference/cli.html)). Room assignment is driven by `detect_room()` matching folder-path segments against the `rooms:` list in `mempalace.yaml` ([mining guide: https://mempalaceofficial.com/guide/mining.html](https://mempalaceofficial.com/guide/mining.html) — "Rooms are auto-detected from your folder structure"; [config reference: https://mempalaceofficial.com/guide/configuration.html](https://mempalaceofficial.com/guide/configuration.html)). Stage the artifact under a room-named folder so `detect_room()` assigns it correctly: + + ```bash + STAGE=".planning/.mempalace-stage" + # One-time: declare the GSD room taxonomy so detect_room() recognizes these folders + mkdir -p "$STAGE" + [ -f "$STAGE/mempalace.yaml" ] || cat > "$STAGE/mempalace.yaml" <<'YAML' + rooms: + - decisions + - planning + - milestones + - problems + - general + YAML + # Suppress MemPalace cache artifacts written into the scanned tree + [ -f "$STAGE/.gitignore" ] || echo "mempalace_embedder.json" > "$STAGE/.gitignore" + # Stage under // — stable path so mine's content-hash + # idempotency (file_already_mined keys on absolute source_file + mtime) deduplicates + # instead of creating duplicate drawers on re-runs. + ROOM_DIR="$STAGE//" + mkdir -p "$ROOM_DIR" + cp "" "$ROOM_DIR/" + # Mine with --wing only — no --room flag; detect_room() assigns from the folder path + mempalace mine "$STAGE" --wing + ``` 3. **Mirror KG facts** when `config.mempalace.mirror_kg` is true: extract decision/delivery facts and `mempalace_kg_add` them with `valid_from` = the phase date (e.g. `(, decided, )` from CONTEXT; `(, delivered, )` from SUMMARY). Under `augment` these are an *additive* mirror of GSD's native `.planning/graphs/`. Under `kg_backend`/`replace` the palace KG is the *authoritative* fact store — GSD still produces `.planning/graphs/` through its normal graphify, so an unreachable palace never loses a fact. 4. Re-running a phase MUST NOT create duplicate drawers (deterministic ids + `check_duplicate`). diff --git a/tests/fixtures/golden-install-parity/antigravity.json b/tests/fixtures/golden-install-parity/antigravity.json index 4f7bdba20..054f7cca5 100644 --- a/tests/fixtures/golden-install-parity/antigravity.json +++ b/tests/fixtures/golden-install-parity/antigravity.json @@ -381,7 +381,7 @@ "skills/gsd-ingest-docs/SKILL.md": "f4e43968af317ed8", "skills/gsd-manager/SKILL.md": "6e51785860784d8c", "skills/gsd-map-codebase/SKILL.md": "552f914f43b2181c", - "skills/gsd-mempalace-capture/SKILL.md": "588ddf4fbf3ebe65", + "skills/gsd-mempalace-capture/SKILL.md": "ece243a29d87cfca", "skills/gsd-mempalace-recall/SKILL.md": "2d95e385fee26dee", "skills/gsd-milestone-summary/SKILL.md": "2955ab3e3a444ca3", "skills/gsd-mvp-phase/SKILL.md": "1cf7622d655840ac", diff --git a/tests/fixtures/golden-install-parity/augment.json b/tests/fixtures/golden-install-parity/augment.json index 5cef0a97c..a73f5fbfc 100644 --- a/tests/fixtures/golden-install-parity/augment.json +++ b/tests/fixtures/golden-install-parity/augment.json @@ -63,7 +63,7 @@ "commands/gsd-ingest-docs.md": "6718b04c597a5428", "commands/gsd-manager.md": "8f4ae79774902293", "commands/gsd-map-codebase.md": "e4e170d4ef2d46c6", - "commands/gsd-mempalace-capture.md": "2e610f3ebe2eb5b4", + "commands/gsd-mempalace-capture.md": "d57b339a2743f5a4", "commands/gsd-mempalace-recall.md": "38716c0983a3ef9c", "commands/gsd-milestone-summary.md": "ff5e11e6b33d4b5e", "commands/gsd-mvp-phase.md": "ffc5905aed8f450a", @@ -428,7 +428,7 @@ "skills/gsd-ns-context/skills/extract-learnings/SKILL.md": "48846bf26ccaf0e7", "skills/gsd-ns-context/skills/graphify/SKILL.md": "3d6341614add6ccd", "skills/gsd-ns-context/skills/map-codebase/SKILL.md": "2017007dcd69d153", - "skills/gsd-ns-context/skills/mempalace-capture/SKILL.md": "a7261b5ead71cc58", + "skills/gsd-ns-context/skills/mempalace-capture/SKILL.md": "b3c600b306f179eb", "skills/gsd-ns-context/skills/mempalace-recall/SKILL.md": "646e59e76acd548f", "skills/gsd-ns-ideate/SKILL.md": "d70360a5f7e8ac90", "skills/gsd-ns-ideate/skills/capture/SKILL.md": "74651f6959cfbbd3", diff --git a/tests/fixtures/golden-install-parity/claude.json b/tests/fixtures/golden-install-parity/claude.json index fa01eae3f..d61af7aa4 100644 --- a/tests/fixtures/golden-install-parity/claude.json +++ b/tests/fixtures/golden-install-parity/claude.json @@ -379,7 +379,7 @@ "skills/gsd-ingest-docs/SKILL.md": "eb85e654917a503a", "skills/gsd-manager/SKILL.md": "1370d93741e47828", "skills/gsd-map-codebase/SKILL.md": "cf65e61890448285", - "skills/gsd-mempalace-capture/SKILL.md": "40a31ad049374297", + "skills/gsd-mempalace-capture/SKILL.md": "fa47f3e3fb1264eb", "skills/gsd-mempalace-recall/SKILL.md": "c3f412d5a64f3921", "skills/gsd-milestone-summary/SKILL.md": "33d51a325d314f3a", "skills/gsd-mvp-phase/SKILL.md": "f9a1348c6c297579", diff --git a/tests/fixtures/golden-install-parity/cline.json b/tests/fixtures/golden-install-parity/cline.json index 83776639e..cae8723d4 100644 --- a/tests/fixtures/golden-install-parity/cline.json +++ b/tests/fixtures/golden-install-parity/cline.json @@ -332,7 +332,7 @@ "skills/gsd-ns-context/skills/extract-learnings/SKILL.md": "d39269bea995fabc", "skills/gsd-ns-context/skills/graphify/SKILL.md": "030050fcd08d129d", "skills/gsd-ns-context/skills/map-codebase/SKILL.md": "fa6a37402430af7d", - "skills/gsd-ns-context/skills/mempalace-capture/SKILL.md": "588ddf4fbf3ebe65", + "skills/gsd-ns-context/skills/mempalace-capture/SKILL.md": "ece243a29d87cfca", "skills/gsd-ns-context/skills/mempalace-recall/SKILL.md": "2d95e385fee26dee", "skills/gsd-ns-ideate/SKILL.md": "c10342345c01c91f", "skills/gsd-ns-ideate/skills/capture/SKILL.md": "fb53053848bb6695", diff --git a/tests/fixtures/golden-install-parity/codebuddy.json b/tests/fixtures/golden-install-parity/codebuddy.json index 67cea98b8..f6a696439 100644 --- a/tests/fixtures/golden-install-parity/codebuddy.json +++ b/tests/fixtures/golden-install-parity/codebuddy.json @@ -63,7 +63,7 @@ "commands/gsd-ingest-docs.md": "ab3e58239c23d61d", "commands/gsd-manager.md": "bfe9e261fa918876", "commands/gsd-map-codebase.md": "5093093d42240325", - "commands/gsd-mempalace-capture.md": "e9e00b0602e1d8b8", + "commands/gsd-mempalace-capture.md": "c687b6d88b50f45c", "commands/gsd-mempalace-recall.md": "6efef238d8c62569", "commands/gsd-milestone-summary.md": "e3a36fbd695a1833", "commands/gsd-mvp-phase.md": "671791ba61c4654a", @@ -451,7 +451,7 @@ "skills/gsd-ingest-docs/SKILL.md": "2df55e0ec95d57d9", "skills/gsd-manager/SKILL.md": "816db4d4ed618537", "skills/gsd-map-codebase/SKILL.md": "b304ec25e9a95c93", - "skills/gsd-mempalace-capture/SKILL.md": "5f10d368835e062c", + "skills/gsd-mempalace-capture/SKILL.md": "cb6238896332cedf", "skills/gsd-mempalace-recall/SKILL.md": "70c8491f53f4161b", "skills/gsd-milestone-summary/SKILL.md": "9eb030a1ac307fa1", "skills/gsd-mvp-phase/SKILL.md": "236fcdd69f47d101", diff --git a/tests/fixtures/golden-install-parity/codex.json b/tests/fixtures/golden-install-parity/codex.json index d74671302..7c39208b0 100644 --- a/tests/fixtures/golden-install-parity/codex.json +++ b/tests/fixtures/golden-install-parity/codex.json @@ -27,7 +27,7 @@ ".agents/skills/gsd-ingest-docs/SKILL.md": "5bd2838bf0b6dc1b", ".agents/skills/gsd-manager/SKILL.md": "cb1cf56f5d3f66d6", ".agents/skills/gsd-map-codebase/SKILL.md": "cd27dc028718426b", - ".agents/skills/gsd-mempalace-capture/SKILL.md": "1a7fac4d53f607ab", + ".agents/skills/gsd-mempalace-capture/SKILL.md": "361675ada00a54b6", ".agents/skills/gsd-mempalace-recall/SKILL.md": "7205b02250e89f25", ".agents/skills/gsd-milestone-summary/SKILL.md": "af84ecb400f23556", ".agents/skills/gsd-mvp-phase/SKILL.md": "72b65ae927b280fe", diff --git a/tests/fixtures/golden-install-parity/copilot.json b/tests/fixtures/golden-install-parity/copilot.json index 786aa3692..a55bcc385 100644 --- a/tests/fixtures/golden-install-parity/copilot.json +++ b/tests/fixtures/golden-install-parity/copilot.json @@ -354,7 +354,7 @@ "skills/gsd-ingest-docs/SKILL.md": "10500de29525f6cf", "skills/gsd-manager/SKILL.md": "9946975bec15e737", "skills/gsd-map-codebase/SKILL.md": "39e7fd6bcc561f9d", - "skills/gsd-mempalace-capture/SKILL.md": "f4511f69c14befb7", + "skills/gsd-mempalace-capture/SKILL.md": "a9f9dd7fb904d09f", "skills/gsd-mempalace-recall/SKILL.md": "89523db66f834b2f", "skills/gsd-milestone-summary/SKILL.md": "5ca1dabfe0cd85f0", "skills/gsd-mvp-phase/SKILL.md": "60ac3c3fa6a6a19b", diff --git a/tests/fixtures/golden-install-parity/cursor.json b/tests/fixtures/golden-install-parity/cursor.json index a84a6b74d..9ad875e85 100644 --- a/tests/fixtures/golden-install-parity/cursor.json +++ b/tests/fixtures/golden-install-parity/cursor.json @@ -63,7 +63,7 @@ "commands/gsd-ingest-docs.md": "9e7f8757b9408c01", "commands/gsd-manager.md": "f300b708a5487c76", "commands/gsd-map-codebase.md": "12f705917eb202fb", - "commands/gsd-mempalace-capture.md": "b30bce634ac3136c", + "commands/gsd-mempalace-capture.md": "06323113ec60df3e", "commands/gsd-mempalace-recall.md": "08c910285469a394", "commands/gsd-milestone-summary.md": "adfad2cf43fc5aad", "commands/gsd-mvp-phase.md": "e8debeee627a0bf2", @@ -429,7 +429,7 @@ "skills/gsd-ingest-docs/SKILL.md": "01ed9183a00252ee", "skills/gsd-manager/SKILL.md": "62cd9f671a39e8a4", "skills/gsd-map-codebase/SKILL.md": "383559aca64201e8", - "skills/gsd-mempalace-capture/SKILL.md": "b308823dee547c65", + "skills/gsd-mempalace-capture/SKILL.md": "f14977d3f78291c6", "skills/gsd-mempalace-recall/SKILL.md": "56f3037091a8bd9a", "skills/gsd-milestone-summary/SKILL.md": "c5dbbc8edb97a7f7", "skills/gsd-mvp-phase/SKILL.md": "9d8e2999fa9f7830", diff --git a/tests/fixtures/golden-install-parity/hermes.json b/tests/fixtures/golden-install-parity/hermes.json index 39b171e49..870bd22c9 100644 --- a/tests/fixtures/golden-install-parity/hermes.json +++ b/tests/fixtures/golden-install-parity/hermes.json @@ -358,7 +358,7 @@ "skills/gsd/gsd-ns-context/skills/extract-learnings/SKILL.md": "36e59d6e514dcaf0", "skills/gsd/gsd-ns-context/skills/graphify/SKILL.md": "169eefd42c444cde", "skills/gsd/gsd-ns-context/skills/map-codebase/SKILL.md": "9d36eee52586bb34", - "skills/gsd/gsd-ns-context/skills/mempalace-capture/SKILL.md": "3fa619f73834c436", + "skills/gsd/gsd-ns-context/skills/mempalace-capture/SKILL.md": "4a2733dd32cdf737", "skills/gsd/gsd-ns-context/skills/mempalace-recall/SKILL.md": "5d06922e0d7ab7d9", "skills/gsd/gsd-ns-ideate/SKILL.md": "b36bb4700ed6723a", "skills/gsd/gsd-ns-ideate/skills/capture/SKILL.md": "76fc7c1200124ece", diff --git a/tests/fixtures/golden-install-parity/kilo.json b/tests/fixtures/golden-install-parity/kilo.json index c882325a9..15a9fab0b 100644 --- a/tests/fixtures/golden-install-parity/kilo.json +++ b/tests/fixtures/golden-install-parity/kilo.json @@ -63,7 +63,7 @@ "command/gsd-ingest-docs.md": "e655ecf1d4433ba9", "command/gsd-manager.md": "1cdc133079833552", "command/gsd-map-codebase.md": "704cb63214f51523", - "command/gsd-mempalace-capture.md": "a94ca275cbe7134c", + "command/gsd-mempalace-capture.md": "8b6bc24d7baf1e9b", "command/gsd-mempalace-recall.md": "d358cdd89c935877", "command/gsd-milestone-summary.md": "4ab29b777f62f0bb", "command/gsd-mvp-phase.md": "273a1c26ca13274b", @@ -425,7 +425,7 @@ "skills/gsd-ingest-docs/SKILL.md": "f049f06a6ec7da43", "skills/gsd-manager/SKILL.md": "a37ecdbe32952262", "skills/gsd-map-codebase/SKILL.md": "e06d6ac1b7632cbe", - "skills/gsd-mempalace-capture/SKILL.md": "f960b7b1a8fdf89b", + "skills/gsd-mempalace-capture/SKILL.md": "80ffe0ee9b833502", "skills/gsd-mempalace-recall/SKILL.md": "2091c48e6e986e28", "skills/gsd-milestone-summary/SKILL.md": "da645171ca2299d8", "skills/gsd-mvp-phase/SKILL.md": "eeb0ac0f88647475", diff --git a/tests/fixtures/golden-install-parity/kimi.json b/tests/fixtures/golden-install-parity/kimi.json index 5ae55a77b..741af9b8d 100644 --- a/tests/fixtures/golden-install-parity/kimi.json +++ b/tests/fixtures/golden-install-parity/kimi.json @@ -416,7 +416,7 @@ "skills/gsd-ingest-docs/SKILL.md": "6366644e623ae9e4", "skills/gsd-manager/SKILL.md": "8a11a1beb8e35a9c", "skills/gsd-map-codebase/SKILL.md": "73ab0afb2398de2c", - "skills/gsd-mempalace-capture/SKILL.md": "64a2ec493092d26e", + "skills/gsd-mempalace-capture/SKILL.md": "5ed5ae9c018c89df", "skills/gsd-mempalace-recall/SKILL.md": "c6e0195e55cd934c", "skills/gsd-milestone-summary/SKILL.md": "3ea93ccaa0d4d967", "skills/gsd-mvp-phase/SKILL.md": "d2f98f1e955797b6", diff --git a/tests/fixtures/golden-install-parity/opencode.json b/tests/fixtures/golden-install-parity/opencode.json index 954ead1cb..9a1a8f402 100644 --- a/tests/fixtures/golden-install-parity/opencode.json +++ b/tests/fixtures/golden-install-parity/opencode.json @@ -63,7 +63,7 @@ "command/gsd-ingest-docs.md": "b47c812c247e58a4", "command/gsd-manager.md": "86ece154b34b6d1b", "command/gsd-map-codebase.md": "9aba6b4eed565912", - "command/gsd-mempalace-capture.md": "a94ca275cbe7134c", + "command/gsd-mempalace-capture.md": "8b6bc24d7baf1e9b", "command/gsd-mempalace-recall.md": "d358cdd89c935877", "command/gsd-milestone-summary.md": "86a827271bc647c5", "command/gsd-mvp-phase.md": "d45fd76cb9cff3ef", @@ -453,7 +453,7 @@ "skills/gsd-ingest-docs/SKILL.md": "8f294b4894f782a5", "skills/gsd-manager/SKILL.md": "cf40f237b4f20aa7", "skills/gsd-map-codebase/SKILL.md": "73f714297815f74c", - "skills/gsd-mempalace-capture/SKILL.md": "f960b7b1a8fdf89b", + "skills/gsd-mempalace-capture/SKILL.md": "80ffe0ee9b833502", "skills/gsd-mempalace-recall/SKILL.md": "2091c48e6e986e28", "skills/gsd-milestone-summary/SKILL.md": "175366bb500b5e64", "skills/gsd-mvp-phase/SKILL.md": "0531d0e907af41ce", diff --git a/tests/fixtures/golden-install-parity/qwen.json b/tests/fixtures/golden-install-parity/qwen.json index 02d2472c4..71e08f236 100644 --- a/tests/fixtures/golden-install-parity/qwen.json +++ b/tests/fixtures/golden-install-parity/qwen.json @@ -357,7 +357,7 @@ "skills/gsd-ns-context/skills/extract-learnings/SKILL.md": "8d38e55e5f8b774b", "skills/gsd-ns-context/skills/graphify/SKILL.md": "ac3661e6e576188b", "skills/gsd-ns-context/skills/map-codebase/SKILL.md": "cf65e61890448285", - "skills/gsd-ns-context/skills/mempalace-capture/SKILL.md": "40a31ad049374297", + "skills/gsd-ns-context/skills/mempalace-capture/SKILL.md": "fa47f3e3fb1264eb", "skills/gsd-ns-context/skills/mempalace-recall/SKILL.md": "c3f412d5a64f3921", "skills/gsd-ns-ideate/SKILL.md": "4a0d2691054b23e5", "skills/gsd-ns-ideate/skills/capture/SKILL.md": "05fa421c95fbad2d", diff --git a/tests/fixtures/golden-install-parity/trae.json b/tests/fixtures/golden-install-parity/trae.json index 60287415a..23a691ab9 100644 --- a/tests/fixtures/golden-install-parity/trae.json +++ b/tests/fixtures/golden-install-parity/trae.json @@ -329,7 +329,7 @@ "skills/gsd-ns-context/skills/extract-learnings/SKILL.md": "1fc6ba92fc18eb86", "skills/gsd-ns-context/skills/graphify/SKILL.md": "371ce22f2fe319bc", "skills/gsd-ns-context/skills/map-codebase/SKILL.md": "cfc5310b903d594a", - "skills/gsd-ns-context/skills/mempalace-capture/SKILL.md": "8524838c851ee44f", + "skills/gsd-ns-context/skills/mempalace-capture/SKILL.md": "211b03370a105fae", "skills/gsd-ns-context/skills/mempalace-recall/SKILL.md": "73b0b7a6301cb214", "skills/gsd-ns-ideate/SKILL.md": "aa399385b735c7c1", "skills/gsd-ns-ideate/skills/capture/SKILL.md": "3b7fc696b2107bcf", diff --git a/tests/fixtures/golden-install-parity/zcode.json b/tests/fixtures/golden-install-parity/zcode.json index 2447b7cd8..cfe6a1852 100644 --- a/tests/fixtures/golden-install-parity/zcode.json +++ b/tests/fixtures/golden-install-parity/zcode.json @@ -63,7 +63,7 @@ "commands/gsd-ingest-docs.md": "7a3c21ae5d5d133a", "commands/gsd-manager.md": "9f54653a7c589b00", "commands/gsd-map-codebase.md": "709e9572953accc6", - "commands/gsd-mempalace-capture.md": "5d4556e444acbb90", + "commands/gsd-mempalace-capture.md": "be4316828baebe52", "commands/gsd-mempalace-recall.md": "5ac67fa4b7f2b03b", "commands/gsd-milestone-summary.md": "f8fa9c357c08b74b", "commands/gsd-mvp-phase.md": "cba67bcb55250e5f", @@ -400,7 +400,7 @@ "skills/gsd-ns-context/skills/extract-learnings/SKILL.md": "6de7eeaaf4939e5d", "skills/gsd-ns-context/skills/graphify/SKILL.md": "d54c2b44e8059299", "skills/gsd-ns-context/skills/map-codebase/SKILL.md": "f48d48b43e2cc4bd", - "skills/gsd-ns-context/skills/mempalace-capture/SKILL.md": "40a31ad049374297", + "skills/gsd-ns-context/skills/mempalace-capture/SKILL.md": "fa47f3e3fb1264eb", "skills/gsd-ns-context/skills/mempalace-recall/SKILL.md": "c3f412d5a64f3921", "skills/gsd-ns-ideate/SKILL.md": "4a0d2691054b23e5", "skills/gsd-ns-ideate/skills/capture/SKILL.md": "c848255c134a860f", diff --git a/tests/mempalace-capture-headless-invocation.test.cjs b/tests/mempalace-capture-headless-invocation.test.cjs new file mode 100644 index 000000000..6ece5f5e6 --- /dev/null +++ b/tests/mempalace-capture-headless-invocation.test.cjs @@ -0,0 +1,73 @@ +'use strict'; + +// Regression test for #2220: headless mempalace-capture instructed +// `mempalace mine --wing --room `, but `mine` has no +// --room flag (only `search` does). The fix replaced the flag with a +// detect_room()-based staging approach. +// +// Docs sources: +// CLI reference: https://mempalaceofficial.com/reference/cli.html +// Mining guide: https://mempalaceofficial.com/guide/mining.html +// Config guide: https://mempalaceofficial.com/guide/configuration.html + +const { describe, test } = require('node:test'); +const assert = require('node:assert/strict'); +const fs = require('fs'); +const path = require('path'); + +const ROOT = path.resolve(__dirname, '..'); + +const SKILL_FILES = [ + 'skills/gsd-mempalace-capture/SKILL.md', + 'commands/gsd/mempalace-capture.md', +]; + +// Matches actual shell command lines that invoke `mempalace mine` +// (line starts with optional whitespace + "mempalace mine"). Excludes +// prose/instruction text that merely mentions the command. +const MINE_CMD_RE = /^\s*mempalace\s+mine\b/; + +describe('#2220 — headless mempalace mine has no --room flag', () => { + for (const rel of SKILL_FILES) { + test(`${rel}: no "mine ... --room" command line`, () => { + const content = fs.readFileSync(path.join(ROOT, rel), 'utf8'); + const mineCmdLines = content + .split(/\r?\n/) + .filter((l) => MINE_CMD_RE.test(l)); + for (const line of mineCmdLines) { + assert.doesNotMatch( + line, + /--room/, + `${rel}: "mempalace mine" command must not include --room (mine has no such flag per CLI reference). Offending line: ${line.trim()}`, + ); + } + }); + + test(`${rel}: staging instructions present (mempalace.yaml + detect_room)`, () => { + const content = fs.readFileSync(path.join(ROOT, rel), 'utf8'); + assert.ok(content.includes('mempalace.yaml'), `${rel}: must reference mempalace.yaml for room taxonomy`); + assert.ok(content.includes('detect_room'), `${rel}: must reference detect_room() as the room-assignment mechanism`); + assert.ok(content.includes('.mempalace-stage'), `${rel}: must use the .mempalace-stage staging directory`); + }); + } + + test('capture-problems.md: references detect_room staging, not mine --room', () => { + const rel = 'capabilities/mempalace/fragments/capture-problems.md'; + const content = fs.readFileSync(path.join(ROOT, rel), 'utf8'); + const mineCmdLines = content + .split(/\r?\n/) + .filter((l) => MINE_CMD_RE.test(l)); + for (const line of mineCmdLines) { + assert.doesNotMatch( + line, + /--room/, + `${rel}: "mempalace mine" command must not include --room. Offending line: ${line.trim()}`, + ); + } + }); + + test('.gitignore: .mempalace-stage/ is excluded', () => { + const content = fs.readFileSync(path.join(ROOT, '.gitignore'), 'utf8'); + assert.ok(content.includes('.mempalace-stage/'), '.gitignore must exclude .planning/.mempalace-stage/'); + }); +});