fix(cli): survive ktx.yaml version skew and derive repo ownership from disk#293
Merged
Conversation
…m disk Loading ktx.yaml is now tolerant of keys this ktx version does not recognize: they are stripped from the in-memory config (the file on disk is never rewritten) and reported by ktx status as non-blocking warnings, while invalid values on recognized fields still fail hard. Repo ownership is derived from observed state (a .git directory plus a root ktx.yaml) instead of a ktx.managed git-config marker, so projects created by any past or future ktx classify identically. initKtxProject now runs an explicit foreign-repo pre-check and writes ktx.yaml before initializing git, so an interrupted init leaves only recoverable residue instead of a bare .git misread as foreign.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Loading
ktx.yamlis now tolerant of keys this ktx version does not recognize: they are stripped from the in-memory config without ever rewriting the file on disk, while invalid values on recognized fields still fail hard.ktx statusreports the ignored fields as non-blocking warnings (exit 0) via a new severity on config issues, in both plain and JSON output. Repo ownership is now derived from observed state — a.gitdirectory plus a rootktx.yaml— instead of thektx.managedgit-config marker, so projects created by any past or future ktx version classify identically.initKtxProjectruns an explicit foreign-repo pre-check and writesktx.yamlbefore initializing git, so an interrupted init leaves only recoverable residue instead of a bare.gitmisread as a foreign repo. Docs forktx.yamlvalidation andktx statusare updated to match.Test Plan
pnpm --filter @kaelio/ktx run type-checkpnpm run dead-code(Biome + Knip default and production)llm.modelsroles warn, mixed error+warning doctor rendering, legacy repo (history + untrackedktx.yaml) accepted, foreign repo rejected with no writes, half-init recovery