diff --git a/.changeset/tidy-lynx-run.md b/.changeset/tidy-lynx-run.md new file mode 100644 index 000000000..a9ee906fc --- /dev/null +++ b/.changeset/tidy-lynx-run.md @@ -0,0 +1,5 @@ +--- +type: Fixed +pr: 2982 +--- +**MemPalace capture no longer silently disables itself when `capture_artifacts` is unset** — the skill gate used `!== true` (treating absent as disabled), but the capability schema defaults to enabled. Fixed to `=== false` (disabled only on explicit false). (#2641) diff --git a/commands/gsd/mempalace-capture.md b/commands/gsd/mempalace-capture.md index 218d13aeb..eaa656b28 100644 --- a/commands/gsd/mempalace-capture.md +++ b/commands/gsd/mempalace-capture.md @@ -25,7 +25,7 @@ Then proceed to Step 1. Check whether the MemPalace capability is enabled by reading `.planning/config.json` directly with the Read tool. 1. Read `.planning/config.json` with the Read tool. -2. If the file does not exist, or `config.mempalace` is absent, or `config.mempalace.enabled !== true`, or `config.mempalace.capture_artifacts !== true`: display the disabled message and **STOP**. +2. If the file does not exist, or `config.mempalace` is absent, or `config.mempalace.enabled !== true`, or `config.mempalace.capture_artifacts === false`: display the disabled message and **STOP**. 3. Otherwise proceed to Step 2. **Disabled message:** diff --git a/skills/gsd-mempalace-capture/SKILL.md b/skills/gsd-mempalace-capture/SKILL.md index 37a3a7f10..f7e984b54 100644 --- a/skills/gsd-mempalace-capture/SKILL.md +++ b/skills/gsd-mempalace-capture/SKILL.md @@ -25,7 +25,7 @@ Then proceed to Step 1. Check whether the MemPalace capability is enabled by reading `.planning/config.json` directly with the Read tool. 1. Read `.planning/config.json` with the Read tool. -2. If the file does not exist, or `config.mempalace` is absent, or `config.mempalace.enabled !== true`, or `config.mempalace.capture_artifacts !== true`: display the disabled message and **STOP**. +2. If the file does not exist, or `config.mempalace` is absent, or `config.mempalace.enabled !== true`, or `config.mempalace.capture_artifacts === false`: display the disabled message and **STOP**. 3. Otherwise proceed to Step 2. **Disabled message:** diff --git a/tests/mempalace-capture-gate-default.test.cjs b/tests/mempalace-capture-gate-default.test.cjs new file mode 100644 index 000000000..9c581b250 --- /dev/null +++ b/tests/mempalace-capture-gate-default.test.cjs @@ -0,0 +1,42 @@ +// allow-test-rule: source-text-is-the-product (see #2641) +// The mempalace-capture skill gates on config.mempalace.capture_artifacts. +// The capability registry declares this key with default: true, so an absent +// key must be treated as enabled. The skill previously used `!== true` which +// treated absent (undefined) as disabled — inverted from the schema default. +// The fix changes it to `=== false` (disabled only on explicit false). + +'use strict'; + +const { describe, test } = require('node:test'); +const assert = require('node:assert/strict'); +const fs = require('node:fs'); +const path = require('node:path'); + +const SKILL = path.join(__dirname, '..', 'skills', 'gsd-mempalace-capture', 'SKILL.md'); +const COMMAND = path.join(__dirname, '..', 'commands', 'gsd', 'mempalace-capture.md'); + +describe('#2641 — mempalace-capture gate treats absent capture_artifacts as enabled', () => { + test('SKILL.md uses === false (disabled only on explicit false), not !== true', () => { + const text = fs.readFileSync(SKILL, 'utf8'); + assert.ok( + text.includes('capture_artifacts === false'), + 'SKILL.md must use capture_artifacts === false (defaults to enabled when absent, matching the schema) — not !== true (#2641)', + ); + assert.ok( + !text.includes('capture_artifacts !== true'), + 'SKILL.md must NOT use the inverted capture_artifacts !== true check (#2641)', + ); + }); + + test('commands/gsd/mempalace-capture.md uses === false, not !== true', () => { + const text = fs.readFileSync(COMMAND, 'utf8'); + assert.ok( + text.includes('capture_artifacts === false'), + 'commands/gsd/mempalace-capture.md must use capture_artifacts === false (#2641)', + ); + assert.ok( + !text.includes('capture_artifacts !== true'), + 'commands/gsd/mempalace-capture.md must NOT use the inverted check (#2641)', + ); + }); +});