fix(cli): remove inert auto commit config

This commit is contained in:
Andrey Avtomonov 2026-06-09 22:59:47 +02:00
parent c2607de9b2
commit 450bfa1dfa
4 changed files with 39 additions and 23 deletions

View file

@ -230,14 +230,13 @@ const setupSchema = z
const storageGitSchema = z
.strictObject({
auto_commit: z.boolean().default(true).describe('When true, KTX automatically commits state changes to the local Git-backed store.'),
author: z
.string()
.min(1)
.default('ktx <ktx@example.com>')
.describe('Git author identity used for auto-commits, in standard "Name <email>" form.'),
.describe('Git author identity used for commits, in standard "Name <email>" form.'),
})
.describe('Git-backed storage commit policy.');
.describe('Git-backed storage author policy.');
const storageSchema = z
.strictObject({
@ -276,12 +275,6 @@ const agentSchema = z
})
.describe('Agent feature configuration.');
const memorySchema = z
.strictObject({
auto_commit: z.boolean().default(true).describe('When true, KTX automatically commits memory updates to the Git-backed store.'),
})
.describe('Memory subsystem configuration.');
const ktxProjectConfigSchema = z
.strictObject({
setup: setupSchema.optional().describe('Setup-wizard state. Written by `ktx setup`; may be omitted.'),
@ -293,7 +286,6 @@ const ktxProjectConfigSchema = z
llm: llmSchema.prefault({}).describe('LLM provider, per-role model overrides, and prompt-caching tunables.'),
ingest: ingestSchema.prefault({}).describe('Ingest pipeline configuration.'),
agent: agentSchema.prefault({}).describe('Agent feature configuration.'),
memory: memorySchema.prefault({}).describe('Memory subsystem configuration.'),
scan: scanSchema.prefault({}).describe('Schema-scan configuration: enrichment and relationship discovery.'),
})
.describe('Configuration schema for KTX project files (ktx.yaml).');

View file

@ -78,7 +78,6 @@ interface PipelineStatus {
interface StorageStatus {
state: string;
search: string;
gitAutoCommit: boolean;
gitAuthor: string;
}
@ -160,7 +159,6 @@ export interface ProjectStatus {
nextActions: string[];
promptCaching?: { enabled: boolean; systemTtl?: string; toolsTtl?: string; historyTtl?: string };
workUnits?: { stepBudget: number; maxConcurrency: number; failureMode: string };
memoryAutoCommit: boolean;
relationshipsDetail?: {
acceptThreshold: number;
reviewThreshold: number;
@ -579,7 +577,6 @@ function buildStorageStatus(config: KtxProjectConfig): StorageStatus {
return {
state: config.storage.state,
search: config.storage.search,
gitAutoCommit: config.storage.git.auto_commit,
gitAuthor: config.storage.git.author,
};
}
@ -986,7 +983,6 @@ export async function buildProjectStatus(project: KtxLocalProject, options: Buil
maxConcurrency: config.ingest.workUnits.maxConcurrency,
failureMode: config.ingest.workUnits.failureMode,
},
memoryAutoCommit: config.memory.auto_commit,
relationshipsDetail: {
acceptThreshold: config.scan.relationships.acceptThreshold,
reviewThreshold: config.scan.relationships.reviewThreshold,
@ -1272,10 +1268,7 @@ export function renderProjectStatus(status: ProjectStatus, options: RenderProjec
lines.push(
` ${bold('Agent')} ${dim(`max_iterations=${status.pipeline.agentMaxIterations}, tools=${status.pipeline.agentTools.join(', ') || '(none)'}`)}`,
);
lines.push(` ${bold('Memory')} ${dim(`auto_commit=${status.memoryAutoCommit}`)}`);
lines.push(
` ${bold('Git')} ${dim(`auto_commit=${status.storage.gitAutoCommit}, author=${status.storage.gitAuthor}`)}`,
);
lines.push(` ${bold('Git')} ${dim(`author=${status.storage.gitAuthor}`)}`);
lines.push('');
}

View file

@ -29,7 +29,6 @@ connections:
state: 'sqlite',
search: 'sqlite-fts5',
git: {
auto_commit: true,
author: 'ktx <ktx@example.com>',
},
},
@ -70,9 +69,6 @@ connections:
default_toolset: ['sl_query', 'wiki_search', 'sl_read_source'],
},
},
memory: {
auto_commit: true,
},
scan: {
enrichment: {
mode: 'none',
@ -93,6 +89,28 @@ connections:
});
});
it('rejects removed auto-commit config keys', () => {
expect(() =>
parseKtxProjectConfig(`
storage:
git:
auto_commit: false
`),
).toThrow(/storage\.git\.auto_commit/);
expect(() =>
parseKtxProjectConfig(`
memory:
auto_commit: false
`),
).toThrow(/memory/);
expect(validateKtxProjectConfig('storage:\n git:\n auto_commit: false\n')).toMatchObject({
ok: false,
issues: [expect.objectContaining({ path: 'storage.git.auto_commit' })],
});
});
it('round-trips through YAML with stable defaults', () => {
const serialized = serializeKtxProjectConfig(buildDefaultKtxProjectConfig());
const parsed = parseKtxProjectConfig(serialized);
@ -595,7 +613,7 @@ describe('generateKtxProjectConfigJsonSchema', () => {
it('exposes every top-level ktx.yaml section under properties', () => {
const properties = schema.properties as Record<string, unknown>;
expect(Object.keys(properties).sort()).toEqual(['agent', 'connections', 'ingest', 'llm', 'memory', 'scan', 'setup', 'storage'].sort());
expect(Object.keys(properties).sort()).toEqual(['agent', 'connections', 'ingest', 'llm', 'scan', 'setup', 'storage'].sort());
});
it('does not require any top-level fields', () => {

View file

@ -402,6 +402,19 @@ describe('buildProjectStatus --fast', () => {
});
});
describe('renderProjectStatus config cleanup', () => {
it('does not render removed auto_commit status fields in verbose output', async () => {
const project = projectWithConfig(baseProjectConfig());
const status = await buildProjectStatus(project, {
claudeCodeAuthProbe: stubClaudeCodeAuthProbe,
});
const rendered = renderProjectStatus(status, { verbose: true, useColor: false });
expect(rendered).not.toContain('auto_commit');
expect(rendered).toContain('author=ktx <ktx@example.com>');
});
});
describe('buildProjectStatus codex', () => {
it('reports authenticated local Codex session', async () => {
const project = projectWithConfig(withCodexLlm(buildDefaultKtxProjectConfig()));