diff --git a/bin/gstack-config b/bin/gstack-config index 6782b97f4..5d02c9feb 100755 --- a/bin/gstack-config +++ b/bin/gstack-config @@ -167,7 +167,11 @@ lookup_default() { question_tuning) echo "false" ;; team_mode) echo "false" ;; transcript_ingest_mode) echo "off" ;; - repo_mode) echo "unknown" ;; + # repo_mode: EMPTY is load-bearing — gstack-repo-mode treats any non-empty + # answer as a user override and skips its own classification entirely, so + # a synthesized "unknown" default turns the classifier into dead code. + # Empty + exit 0 = "no override set, go classify". + repo_mode) echo "" ;; # Unknown key: exit non-zero instead of printing "". The fallback pattern # the preambles use, # VAR=$(gstack-config get 2>/dev/null || echo "") diff --git a/test/gstack-config-defaults.test.ts b/test/gstack-config-defaults.test.ts index 10d9f68df..cb8febadd 100644 --- a/test/gstack-config-defaults.test.ts +++ b/test/gstack-config-defaults.test.ts @@ -123,15 +123,18 @@ describe('gstack-config defaults (gate, free)', () => { }); test('a known key whose default is intentionally empty still exits 0', () => { - for (const key of ['cross_project_learnings', 'salience_allowlist', 'redact_repo_visibility']) { + // repo_mode is in this class BY CONTRACT: gstack-repo-mode treats any + // non-empty answer as a user override and skips classification, so a + // synthesized "unknown" default would turn the classifier into dead code + // (caught live by test/gstack-repo-mode.test.ts during the wave). + for (const key of ['cross_project_learnings', 'salience_allowlist', 'redact_repo_visibility', 'repo_mode']) { expect({ key, ...get(key) }).toEqual({ key, out: '', code: 0 }); } }); - test('the four keys that regressed resolve to the values their callers assume', () => { + test('the regressed keys resolve to the values their callers assume', () => { expect(get('question_tuning').out).toBe('false'); expect(get('team_mode').out).toBe('false'); expect(get('transcript_ingest_mode').out).toBe('off'); - expect(get('repo_mode').out).toBe('unknown'); }); });