From 4df6d884b3f660ce3cf6d1c36dfb5d2f34e951c7 Mon Sep 17 00:00:00 2001 From: Tom Boucher Date: Sat, 1 Aug 2026 15:23:58 -0400 Subject: [PATCH] fix(#2641): treat absent capture_artifacts as enabled (schema default) (#2982) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * test(#2641): add regression for mempalace-capture gate default inversion * fix(#2641): treat absent capture_artifacts as enabled (schema default) The gate used `capture_artifacts !== true` which treated absent (undefined) as disabled — inverted from the capability registry's declared default of true. Changed to `capture_artifacts === false` (disabled only on explicit false), matching the sibling gsd-mempalace-recall skill's correct pattern. * chore(#2641): add changeset fragment * chore(#2641): backfill changeset PR number 2982 --------- Co-authored-by: sim --- .changeset/tidy-lynx-run.md | 5 +++ commands/gsd/mempalace-capture.md | 2 +- skills/gsd-mempalace-capture/SKILL.md | 2 +- tests/mempalace-capture-gate-default.test.cjs | 42 +++++++++++++++++++ 4 files changed, 49 insertions(+), 2 deletions(-) create mode 100644 .changeset/tidy-lynx-run.md create mode 100644 tests/mempalace-capture-gate-default.test.cjs 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)', + ); + }); +});