ktx/packages/cli/test/context/memory
Andrey Avtomonov f446d207ba fix(git): refuse squash-merge into a dirty main working tree
The auto_commit:false path (stageSquashMergeIntoMain) leaves main staged, but the
shared squash helper assumed a clean target. A later ingest/memory run merging
into that dirty index would 'git commit' the prior run's staged files under the
new run's commit (contamination), and conflict cleanup's 'reset --hard HEAD'
would discard them (data loss).

Guard applySquashToIndex: if the target worktree has uncommitted tracked changes,
refuse before merging and return a 'dirty' result (untracked/gitignored files are
ignored — the squash never commits them). Callers surface it cleanly: the bundle
runner fails the run with an actionable message; the memory agent rolls back its
eager DB writes (like a conflict) so the DB never gets ahead of main. Main is
left untouched in every case.
2026-06-09 14:27:53 +02:00
..
local-memory.test.ts test: split cli tests from source tree (#216) 2026-05-26 08:49:05 +02:00
memory-agent.service.ingest.test.ts fix(git): refuse squash-merge into a dirty main working tree 2026-06-09 14:27:53 +02:00
memory-agent.service.test.ts fix(ingest): honor storage.git.auto_commit and memory.auto_commit 2026-06-09 12:44:58 +02:00
memory-runs.test.ts test: split cli tests from source tree (#216) 2026-05-26 08:49:05 +02:00
memory-runtime-assets.test.ts test: split cli tests from source tree (#216) 2026-05-26 08:49:05 +02:00