* fix: plan-phase Nyquist validation when research is disabled (#980) plan-phase step 5.5 required Nyquist artifacts even when research was disabled, creating an impossible state: no RESEARCH.md to extract Validation Architecture from. Step 7.5 then told Claude to "disable Nyquist in config" without specifying the exact key, causing Claude to guess wrong keys that config-set silently accepted. Three fixes: - plan-phase step 5.5: skip when research_enabled is false - plan-phase step 7.5: specify exact config-set command for disabling - config-set: reject unknown keys with whitelist validation Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * test: update config-set tests for key whitelist validation Tests that used arbitrary keys (some_number, some_string, a.b.c) now use valid config keys to test the same coercion and nesting behavior. Adds new test asserting unknown keys are rejected with error. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -6,6 +6,16 @@ const fs = require('fs');
|
||||
const path = require('path');
|
||||
const { output, error } = require('./core.cjs');
|
||||
|
||||
const VALID_CONFIG_KEYS = new Set([
|
||||
'mode', 'granularity', 'parallelization', 'commit_docs', 'model_profile',
|
||||
'search_gitignored', 'brave_search',
|
||||
'workflow.research', 'workflow.plan_check', 'workflow.verifier',
|
||||
'workflow.nyquist_validation', 'workflow.ui_phase', 'workflow.ui_safety_gate',
|
||||
'workflow._auto_chain_active',
|
||||
'git.branching_strategy', 'git.phase_branch_template', 'git.milestone_branch_template',
|
||||
'planning.commit_docs', 'planning.search_gitignored',
|
||||
]);
|
||||
|
||||
function cmdConfigEnsureSection(cwd, raw) {
|
||||
const configPath = path.join(cwd, '.planning', 'config.json');
|
||||
const planningDir = path.join(cwd, '.planning');
|
||||
@@ -88,6 +98,10 @@ function cmdConfigSet(cwd, keyPath, value, raw) {
|
||||
error('Usage: config-set <key.path> <value>');
|
||||
}
|
||||
|
||||
if (!VALID_CONFIG_KEYS.has(keyPath)) {
|
||||
error(`Unknown config key: "${keyPath}". Valid keys: ${[...VALID_CONFIG_KEYS].sort().join(', ')}`);
|
||||
}
|
||||
|
||||
// Parse value (handle booleans and numbers)
|
||||
let parsedValue = value;
|
||||
if (value === 'true') parsedValue = true;
|
||||
|
||||
Reference in New Issue
Block a user