feat(init): add configuration drift detection and corruption reporting#56
Open
c-ferrier wants to merge 1 commit into
Open
feat(init): add configuration drift detection and corruption reporting#56c-ferrier wants to merge 1 commit into
c-ferrier wants to merge 1 commit into
Conversation
Enhanced 'lore init' to proactively manage configuration evolution. The command now detects when an existing '.lore/config.toml' is missing new protocol options and distinguishes between projects using default values (suggesting a Safe Reset) and those with customizations (advising a Manual Merge). Additionally, it detects and reports TOML syntax corruption with specific recovery hints, using standardized error handling to ensure consistent CLI behavior. Lore-id: 093537c0 Constraint: Must not destructively overwrite existing configurations Constraint: Must use standardized LoreError for fatal parsing failures Constraint: Must distinguish customizations from defaults to minimize user friction Rejected: Surgical interleaving | High complexity, requires loss-less TOML parser to preserve comments Rejected: Automated overwriting | Destructive to user-written notes and formatting Tested: [Vitest] 6 unit tests verify fresh init, gaps, safe reset, manual merge, and corruption scenarios Tested: Manual verification of recovery hints for corrupted TOML (exit code 1 verified) Tested: Verified runtime fallback to defaults for missing keys via ConfigLoader Tested: npm run typecheck and npm run build pass Confidence: high Scope-risk: narrow Reversibility: clean Assisted-by: Gemini:CLI [lore-protocol]
f96b398 to
3f0fcfa
Compare
Contributor
Author
|
Ready for Review. |
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.
Description
This PR enhances the
lore initcommand to be more helpful when re-run on an existing project. It introduces "gap detection" to identify missing configurationoptions, "customization detection" to differentiate between default and user-modified settings, and "corruption reporting" for invalid TOML syntax.
Key Changes
.lore/config.tomlagainstDEFAULT_CONFIGand lists missing sections/keys.mv ... .corrupted && lore init).tests/unit/commands/init.test.ts.Strategic Questions for the Maintainer
that interleaves missing options while preserving user comments?
lore doctor:lore doctoralready checks for TOML corruption. Does it make sense to duplicate this check ininitfor better user guidance atthe moment of initialization, or should we centralize this logic into a shared service?