feat(cli): active-context model, use/context, header & logo (spec 30 phase 1) - #115
Merged
Merged
Conversation
…(spec 30 phase 1) The first slice of the interactive-DX lane (spec 30 / D18): an active "current workspace + project" and the branding/console polish around it. - state: migration v4 `active_context` (one row per Docker context) + CRUD (SetActiveContext/ActiveContext/ClearActiveContext), the persisted default. - resolution: resolveActiveProject — --project → DEVSTACK_PROJECT → persisted active (only when its workspace_root matches) → single/first project. Wired into defaultProject and the messaging default seam. - `devstack context` — print the resolved workspace/project/role/docker/version (+ --json). `devstack use [name]` — persist the active project (or switch to a registered workspace) under the flock; `--print` emits an eval-able cd+export script for the shell wrapper landing in phase 2. - console: renderContextHeader atop `status`, gated off under --json/--quiet. - branding: internal/branding ASCII logo, shown at the top of root help via Long (fang v2 exposes no logo option, verified). make ci (fmt/vet/build/test-race) + make determinism green. 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.
Summary
First implementation slice of the interactive-DX lane (spec 30 / D18). Introduces an active "current workspace + project" and the console/branding polish around it. No changes to the deterministic
generatepipeline or lock-first concurrency.What's in
v4addsactive_context(one row per Docker context, FK/CASCADE like every ledger table) + CRUDSetActiveContext/ActiveContext/ClearActiveContext. Append-only/forward-only.resolveActiveProject:--project→DEVSTACK_PROJECT→ persisted active (only when itsworkspace_rootmatches the discovered workspace) → single/first project. Wired intodefaultProjectand the messaging default seam, so all db/s3/queue/topic/stream/resource commands inherit it. No behavior change when nothing is set.devstack context(+--json) prints the resolved workspace/project/role/docker-context/backend/version;devstack use [name]persists the active project (or switches to a registered workspace) under the flock, and--printemits an eval-ablecd+export DEVSTACK_*script for the shell wrapper (Phase 2).renderContextHeaderatopstatus, gated off under--json/--quiet(the update-notice precedent).internal/brandingembeds an ASCII logo, shown at the top of root help viaLong(fang v2.0.1 exposes no logo option — verified;SetHelpFuncis overridden by fang, soLongis the injection point).Tests / gates
internal/state/active_test.go(CRUD + Docker-context isolation),internal/cli/context_test.go(registration + resolution precedence incl. stale-root and env cases).make ci(fmt-check + vet + build + test-race) andmake determinismboth green.Scope / follow-ups (next phases of spec 30/31)
shell-initeval hook (zsh/fish), completions install, prompt segment,usefuzzy-picker TUI.devstack runtask graph.Open questions carried from the spec:
[Q-CTX-SCOPE](per-Docker-context vs global — implemented per-context).🤖 Generated with Claude Code