Replace ucode setup with a ucode configure-centered workflow - #433
Open
david-siqi-liu wants to merge 1 commit into
Open
Replace ucode setup with a ucode configure-centered workflow#433david-siqi-liu wants to merge 1 commit into
ucode setup with a ucode configure-centered workflow#433david-siqi-liu wants to merge 1 commit into
Conversation
david-siqi-liu
force-pushed
the
david/configure-managed-flow
branch
from
September 1, 2026 18:02
7628c68 to
4bd0eeb
Compare
david-siqi-liu
changed the base branch from
main
to
david/personal-mcp-skills
September 1, 2026 18:03
This was referenced Sep 1, 2026
david-siqi-liu
force-pushed
the
david/configure-managed-flow
branch
2 times, most recently
from
September 1, 2026 19:50
c28f508 to
3f60924
Compare
david-siqi-liu
force-pushed
the
david/personal-mcp-skills
branch
from
September 1, 2026 23:28
ba90328 to
82c09bb
Compare
david-siqi-liu
force-pushed
the
david/configure-managed-flow
branch
from
September 1, 2026 23:28
f95af9c to
f6d295b
Compare
david-siqi-liu
force-pushed
the
david/personal-mcp-skills
branch
from
September 2, 2026 00:39
82c09bb to
223b263
Compare
david-siqi-liu
force-pushed
the
david/configure-managed-flow
branch
from
September 2, 2026 00:39
f6d295b to
3709e5b
Compare
david-siqi-liu
force-pushed
the
david/personal-mcp-skills
branch
from
September 2, 2026 23:32
223b263 to
591ad29
Compare
david-siqi-liu
force-pushed
the
david/configure-managed-flow
branch
2 times, most recently
from
September 3, 2026 01:05
3f70031 to
e27f8d9
Compare
david-siqi-liu
force-pushed
the
david/personal-mcp-skills
branch
from
September 3, 2026 02:32
b2e5ea5 to
3ceeae9
Compare
Managed config had its own command tree: `ucode setup` to author, `ucode setup show`, `ucode setup help`, `ucode setup spend-tiers`, `ucode setup --from-file`. An admin had to know that `ucode configure` set up their own machine while `ucode setup` authored everyone else's, and a developer running `ucode configure` against a workspace that publishes a config was walked through prompts whose answers the managed config was about to override. `ucode configure` is now the single entry point. It fetches the workspace's published config once, applies it to this machine when there is one (showing the drift inline rather than asking per setting), and only then offers authoring, to admins. `ucode setup` and its subcommands are gone; `spend-tiers` and `--from-file` move onto `configure`. Authoring has to be locally testable before it reaches anyone else, so it writes a draft that the admin's own machine runs from and nothing else reads. `~/.ucode/managed-state.json` could not express that: it held one config per workspace, written both by `refresh_managed_config` (the copy fetched on every launch) and by the authoring wizard. The two clobbered each other, so a launch wiped an in-progress draft, and a launch could apply an unpublished draft as if it were published policy. It now holds a versioned per-workspace map with separate `draft` and `published` slots. Authoring and `ucode export` read and write the draft only, so nothing reaches the workspace until `ucode publish`; a launch refreshes `published` and never touches the draft. Keeping a map rather than one slot means refreshing one workspace cannot clobber another workspace's draft. A v1 file migrates on read into `published`, with its original bytes kept once at `managed-state.json.pre-v2.bak`, because a legacy value's provenance cannot be recovered. The map is written through a sibling temp file and renamed into place: it now holds the draft, which nothing can refetch, so a torn write would lose it outright. A workspace whose managed-config backend is unavailable still configures the machine and simply does not offer to publish. Co-authored-by: Isaac <no-reply@databricks.com>
david-siqi-liu
force-pushed
the
david/configure-managed-flow
branch
from
September 3, 2026 02:33
e27f8d9 to
ae085ca
Compare
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.
🥞 Stack (AIGTWY-4342 ucode configure)
ucode setupwith aucode configure-centered workflow #433 ⬅ this PRucode configurepath end to end #440Superseded: #437 (folded into #433, so the draft slot arrives together with its first writer).
What did you change, and why?
Authoring a managed config (
ucode setup) and applying one (bareucode) were separate entry pointswith overlapping behavior, and neither told the user which side of that line they were on.
ucode configurebecomes the single entry point: it works out whether you are a workspace admin, theneither offers to author a draft or applies the workspace's published config. Authoring has to be
locally testable on the admin's own machine before it reaches anyone else, so the same change splits
~/.ucode/managed-state.jsoninto a draft slot and a published slot.ucode setupand its sub-app are gone.ucode configurecarries authoring, anducode publishpromotes the draft to published.
{published, draft}. Authoring anducode exportread and writedraftonly; a launch refreshespublishedand never touchesdraft. Before this, both wrote the one slot, sorefresh_managed_configon the next launchclobbered whatever the admin had just authored, and the admin had no way to run their own draft
without publishing it first.
workspace. A v1 file migrates into
published(a v1 config's provenance is unrecoverable, andpublished is the safe reading), the legacy file is copied to
managed-state.json.pre-v2.bakoncebefore the first v2 write, and every write goes through a temp file plus rename.
src/ucode/cli.py(an inconclusive check mustnot strand a non-admin in the authoring path), the phase ordering in
src/ucode/managed_wizard.py,and the slot read precedence, which is draft-then-published on every authoring surface and
published alone on the apply path.
How do you know it works?
tests/test_cli.pyandtests/test_managed_wizard.pywere rebuilt aroundconfigure, covering theadmin and non-admin branches, the dry run, authoring from a file, and publish;
tests/test_managed_config.pycovers the v1 to v2 migration and the slot boundary. #440 then drivesthe whole flow end to end against a fake workspace. Full unit suite green locally at this layer
(2165 passed, 38 skipped).