ktx/packages/cli
Andrey Avtomonov f165506585 fix(cli): preserve project artifacts when ktx setup steps fail
ktx setup wiped ktx.yaml, .ktx/setup/state.json, wiki/, semantic-layer/,
raw-sources/, and .git/ — or removed the entire project dir — whenever any
single source in the context-build step failed, destroying hours of ingest
work and the persisted resume state. The cleanup hint was designed for an
"early abort, leave no trace" semantic but was applied indiscriminately to
every later step failure, in direct conflict with the .ktx/setup/state.json
resume mechanism.

Drop the cleanup mechanism entirely (KtxSetupCreatedProjectCleanup,
cleanupForFolderState, createProjectWithCleanup, cleanupCreatedProjectScaffold,
and the createdProjectCleanup plumbing through KtxSetupProjectResult). Step
failures now return non-zero without touching the filesystem, so re-running
ktx setup continues from completed steps and only re-attempts failed sources.

Rewrites the two tests that documented the wipe behavior to assert
preservation, and adds a regression test that simulates partial context-build
artifacts (state.json, wiki/, semantic-layer/) and verifies all survive a
failed context step.

Refs KLO-719
2026-05-28 15:16:08 +02:00
..
assets/demo/orbit Polish documentation copy (#98) 2026-05-14 12:43:14 -04:00
scripts chore(workspace): gate dead-code with knip production mode (#196) 2026-05-21 15:28:58 +02:00
src fix(cli): preserve project artifacts when ktx setup steps fail 2026-05-28 15:16:08 +02:00
test fix(cli): preserve project artifacts when ktx setup steps fail 2026-05-28 15:16:08 +02:00
package.json chore(release): 0.6.0 [skip ci] 2026-05-26 21:19:07 +00:00
tsconfig.json chore(workspace): gate dead-code with knip production mode (#196) 2026-05-21 15:28:58 +02:00
tsconfig.test.json test: split cli tests from source tree (#216) 2026-05-26 08:49:05 +02:00
vitest.config.ts test: split cli tests from source tree (#216) 2026-05-26 08:49:05 +02:00