Phase A reconciler — shares/users/groups, dry-run default (#57)#4
Merged
Merged
Conversation
… default (#57) The IaC vertical on top of the SSH-runner: typed tool wrappers + a desired-state reconciler that diffs against live state and emits only the needed actions, so the non-idempotent syno* CLIs become safe. - Tools/: SynoShareTool/SynoUserTool/SynoGroupTool — typed `--enum` reads + command builders that encode the positional argv once (DSM 7.1). Shared EnumOutput parser (names = non-colon lines after the "Listed:" header). - Provisioning/: Share/User/GroupSpec + SynologyDesiredState; SynologyReconciler (PlanAsync diffs, ApplyAsync runs) → SynologyPlan of create/delete/skip actions, each carrying its command + reason. Dry-run by default; never prunes unmanaged. Passwordless user-create is BLOCKED with a clear reason. - CLI: `plan <spec.json>` (read-only diff) + `apply <spec.json> [--confirm]` (dry-run unless --confirm). - Tests: 5 reconciler tests over a scripted ISshRunner (no NAS needed). Verified against the live NAS (2026-05-31): `plan` skipped the 3 existing resources, planned correct creates for 2 new ones, blocked the passwordless user — zero mutation (reads only). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
The IaC vertical on top of the SSH-runner (transport wedge, #3). Per the write-path plan, Phase A.
What
Tools/—SynoShareTool/SynoUserTool/SynoGroupTool: typed--enumreads + command builders that encode each tool's positional argv once (DSM 7.1). SharedEnumOutputparser (names = non-colon lines after theListed:header — verified live).Provisioning/—Share/User/GroupSpec+SynologyDesiredState;SynologyReconciler:PlanAsyncdiffs desired vs live,ApplyAsyncruns. Output is aSynologyPlanof create/delete/skip actions, each carrying its command + reason.Deploy-Shape.ps1) —ApplyAsync(apply:false)mutates nothing.present:false.synouser --addwithout a password).plan <spec.json>(read-only diff),apply <spec.json> [--confirm](dry-run unless--confirm).ISshRunner(no NAS needed).Verification (live NAS, 2026-05-31, zero mutation)
synosharp planagainst a mixed spec:Not in this PR
A real
apply --confirmagainst the live box (would create/delete) — deferred to an explicit reversible smoke test. Field-level drift (desc/ACLs) and NFS (synowebapi, on Virtual DSM) are later phases.🤖 Generated with Claude Code