Pushes every manifest entry's declared value onto the live system via kwriteconfig6, idempotently. Non-schema (shortcuts/freeform) entries are rejected as not-yet-supported, deferred to later tasks.
2.9 KiB
2.9 KiB
spec, blocked-by
| spec | blocked-by |
|---|---|
| dot-kde | 0001-kde-schema-backed-save |
What to build
Implement dot kde apply for schema-backed settings: read every entry in
the manifest and write its declared value onto the live system via
kwriteconfig6. Re-running it against an already-applied system must be a
no-op with no unintended side effects — this is the idempotence the
feature depends on for safe re-runs after a KDE update or on a freshly
built machine. Add dot kde apply help, following the project's
check-for-help-before-argparse convention.
Add a README row for dot kde apply.
Acceptance criteria
dot kde applypushes every manifest entry's declared value onto the live system viakwriteconfig6- Re-running
dot kde applyagainst a system already matching the manifest changes nothing (idempotent) dot kde apply helpprints usage without writing anything- Tests run against a scratch
$HOME, exercising apply over a manifest with schema-backed entries, verifying resulting rc-file contents and idempotence on a second run - README has a row for
dot kde apply
Implementation Notes
- File layout mirrors
save's:write_live_value(thekwriteconfig6counterpart toread_live_value) andapply_one(mirroringsave_one'sparse_identifier→resolve_mechanism→ schema-only gate) added tocommands/kde/kde.py;cmd_applymirrorscmd_save's help/argument/error-handling scaffold.kde.fishgained anapplydispatch case abovesave. applytakes no arguments (unlikesave, which supports an optional identifier) — the task only specifies pushing the whole manifest, and the parent spec'sapplyuser story has no per-identifier mode, sodot kde apply <extra-arg>is rejected as misuse rather than silently ignored.write_live_valuepasses the value positionally after a--separator (kwriteconfig6 --file ... --group ... --key ... -- <value>) rather than via a--valueflag, sincekwriteconfig6takes the value as a mandatory positional argument, not a flag;--guards against a value that itself looks like an option.- Non-schema (shortcuts/freeform) manifest entries are rejected with the same "not yet supported" error
save_onealready raises for those mechanisms, kept out of scope per this task's title ("...apply for schema-backed settings"); those mechanisms are added in later tasks (0004, 0005) without needing to restructurecmd_apply. /review-uncommittedflagged two baseline duplication smells (apply_one/cmd_applymirroringsave_one/cmd_save's shape) and one observation (a failing entry mid-manifest haltsapplyimmediately, leaving earlier writes already applied — a partial-apply state, untested either way). Left as-is: the duplication mirrors an already-established local convention from task 0001 rather than introducing a new one, and the partial-apply behavior is consistent withcmd_save's pre-existing control flow, not a new risk introduced by this task.