Repository navigation
fix(config): preserve raw declarations when saving a patch - #415
Merged
Merged
Conversation
Fixes #364 what changed: saveConfig patches a raw JSON object or its usable last-good snapshot, retaining unpatched role and posture values for diagnostics. A broken config with no usable snapshot refuses an unrelated save with CONFIG-UNREADABLE; an explicit valid role declaration can repair it. install-hooks names this refusal with exit 2, and the panel key endpoint returns 409 without echoing the key. Existing retired-key migration remains. why: Saving an unrelated setting persisted resolved role unknown and restrictive posture values, destroying the operator's original typo and misrepresenting fallback state as a declaration (#364). A broken unsnapshotted file could be replaced while the CLI or panel reported success. Preserve declarations and refuse a save that has no usable raw state; no alternative design was set aside. what it touched: machine config saving, install-hooks error handling, panel key handling, four machine regressions and one panel regression, the machine/panel/CLI architecture descriptions, changelog and README test inventory (1843 on main 2d80715). No new configuration option or format. what you verified: verified - baseline machine/panel had 46 passing, five expected regression failures and two unsupported symlink cases. After the fix, machine/panel/doctor/architecture-map ran 138 passing checks, zero failures and two unsupported symlink checks in85.8s on Windows Node24.20.0. The direct runner exited1 because unsupported capabilities were unwaived, not because a test failed; its structured result and log are retained. The normal commit gate's existing local unsupported-capability waiver applies to its full suite, while CI blocks unsupported results. Syntax checks and diff checks clean. Handoff OK, preflight PASS (28 passing, one existing warning), doctor READY collector/firecrawl-cli with existing deployment/edit-registration warnings. After refresh onto merged main 82a02cb, the focused machine/panel/doctor/architecture-map run passed 147 checks with zero failures and two unsupported symlink cases in 93.9 seconds. Its documented local allowance produced exit 0 while retaining those unsupported results; CI blocks unsupported cases. The patch was advanced to main 2d80715 after PR412 landed; staged code/test blobs match the focused-tested source and the shared documentation carries the 1,843-test inventory. The normal full gate and GitHub CI follow before merge. what you got wrong and fixed: mistake - a documentation conflict helper assumed the panel addition survived selecting the main conflict block; where - refreshing docs/ARCHITECTURE.md onto merged main; impact - its preservation guard refused before writing a resolved map, with no published result affected; cause - the conflict block included the neighboring panel row too; fix - explicitly retained both new config-saving and panel-refusal descriptions alongside the current map; verified - no unmerged paths, clean staged whitespace and syntax checks. Current-base focused verification passed 147 checks with zero failures and two unsupported symlink cases; the full normal gate follows.
what changed: Carry the merged workflow PNG and asset guide into PR415 before its final current-base CI check. why: PR414 landed while the already accepted config-fix commit was being published; GitHub's strict checks require the current base. what it touched: Only docs/assets/README.md and docs/assets/research-kit-workflow.png are added to the locally accepted a6d6328 tree. The issue #364 implementation remains in its original task commit. what you verified: verified - #364's normal full commit gate accepted a6d6328; all seven PR414 CI jobs passed in run38562865947 before its expected-head merge to main3d34bfbd. The staged delta is guarded to exactly the two documentation assets, and all other tracked file blobs are compared before commit. The normal documentation commit gate and final PR415 CI follow. what you got wrong and fixed: nothing to report.
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.
Saving an unrelated setting previously replaced an operator's raw role or posture typo with a resolved fallback, losing the declaration needed for diagnostics. Config saves now patch the usable raw state; a broken file without a usable last-good snapshot refuses an unrelated save.
Fixes #364
what changed: Preserve unpatched raw role/posture values and structurally usable last-good snapshots. Refuse an unrelated save with CONFIG-UNREADABLE if no usable raw state exists; an explicit valid role declaration can repair it. install-hooks reports the refusal with exit 2, and the panel key endpoint returns 409 without echoing the key. Existing retired-key migration remains.
why: Persisting fallback state misrepresented it as an operator declaration and could report success after replacing a broken unsnapshotted config.
what it touched: machine config saving, install-hooks and panel error handling, four machine regressions and one panel regression, architecture descriptions, changelog and README test inventory (1,843).
what you verified: Verified five expected failures before the fix. After refreshing onto merged main, machine/panel/doctor/architecture-map passed 147 focused checks with zero failures and two unsupported symlink cases in 93.9 seconds. The documented local capability allowance produced exit 0 while retaining those unsupported results; CI blocks unsupported cases. The normal full-suite commit gate accepted a6d6328 on base 2d80715 at 12:17 UTC. Handoff OK, preflight PASS and doctor READY with existing warnings. The initial published head passed all seven GitHub CI jobs in run38562979762. Synced merged main3d34bfbd through the normal documentation gate in c1ab427; its only delta from the accepted source commit is the two workflow assets. Final current-base CI follows before merge.
what you got wrong and fixed: A documentation conflict helper assumed the panel addition survived selecting the main block. Its preservation guard refused before writing or publication. Explicitly retained both config-saving and panel-refusal descriptions alongside the current architecture map; verified clean staged scope, syntax, focused checks and acceptance by the normal full gate.