Files
get-shit-done/tests/config-schema-docs-parity.test.cjs
Tom Boucher c47a6a2164 fix: correct VALID_CONFIG_KEYS — remove internal state key, add missing public keys, migration hints (#2561)
* fix(#2530-2535): correct VALID_CONFIG_KEYS set — remove internal state key, add missing public keys, add migration hints

- Remove workflow._auto_chain_active from VALID_CONFIG_KEYS (internal runtime state, not user-settable) (#2530)
- Add hooks.workflow_guard to VALID_CONFIG_KEYS (read by gsd-workflow-guard.js hook, already documented) (#2531)
- Add workflow.ui_review to VALID_CONFIG_KEYS (read in autonomous.md via config-get) (#2532)
- Add workflow.max_discuss_passes to VALID_CONFIG_KEYS (read in discuss-phase.md via config-get) (#2533)
- Add CONFIG_KEY_SUGGESTIONS entries for sub_repos → planning.sub_repos and plan_checker → workflow.plan_check (#2535)
- Document workflow.ui_review and workflow.max_discuss_passes in docs/CONFIGURATION.md
- Clear INTERNAL_KEYS exemption in parity test (workflow._auto_chain_active removed from schema entirely)
- Add regression test file tests/bug-2530-valid-config-keys.test.cjs covering all 6 bugs

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* fix: align SDK VALID_CONFIG_KEYS with CJS — remove internal key, add missing public keys

- Remove workflow._auto_chain_active from SDK (internal runtime state, not user-settable)
- Add workflow.ui_review, workflow.max_discuss_passes, hooks.workflow_guard to SDK
- Add ui_review and max_discuss_passes to Full Schema example in CONFIGURATION.md

Resolves CodeRabbit review on #2561.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-22 11:28:25 -04:00

41 lines
1.5 KiB
JavaScript

'use strict';
/**
* Asserts every exact-match key in config-schema.cjs appears at least once
* in docs/CONFIGURATION.md. A key present in the validator but absent from
* the docs means users can set it but have no guidance. A key in the docs but
* absent from the validator means config-set silently rejects it.
*
* Dynamic patterns (agent_skills.*, review.models.*, features.*) are excluded
* from this check — they are documented by namespace in CONFIGURATION.md.
*/
const { test } = require('node:test');
const assert = require('node:assert/strict');
const fs = require('node:fs');
const path = require('node:path');
const ROOT = path.resolve(__dirname, '..');
const { VALID_CONFIG_KEYS } = require('../get-shit-done/bin/lib/config-schema.cjs');
const CONFIGURATION_MD = fs.readFileSync(path.join(ROOT, 'docs', 'CONFIGURATION.md'), 'utf8');
// Reserved for future internal keys; workflow._auto_chain_active removed from VALID_CONFIG_KEYS (#2530).
const INTERNAL_KEYS = new Set();
test('every key in VALID_CONFIG_KEYS is documented in docs/CONFIGURATION.md', () => {
const undocumented = [];
for (const key of VALID_CONFIG_KEYS) {
if (INTERNAL_KEYS.has(key)) continue;
if (!CONFIGURATION_MD.includes('`' + key + '`')) {
undocumented.push(key);
}
}
assert.deepStrictEqual(
undocumented,
[],
'Keys in VALID_CONFIG_KEYS with no mention in docs/CONFIGURATION.md:\n' +
undocumented.map((k) => ' ' + k).join('\n') +
'\nAdd a row in the appropriate section of docs/CONFIGURATION.md.',
);
});