Skip to content

feat(cli): active-context model, use/context, header & logo (spec 30 phase 1) - #115

Merged
gustavobertoi merged 1 commit into
mainfrom
feat/active-context-and-branding
Jul 1, 2026
Merged

feat(cli): active-context model, use/context, header & logo (spec 30 phase 1)#115
gustavobertoi merged 1 commit into
mainfrom
feat/active-context-and-branding

Conversation

@gustavobertoi

Copy link
Copy Markdown
Contributor

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 generate pipeline or lock-first concurrency.

What's in

  • State — migration v4 adds active_context (one row per Docker context, FK/CASCADE like every ledger table) + CRUD SetActiveContext/ActiveContext/ClearActiveContext. Append-only/forward-only.
  • ResolutionresolveActiveProject: --projectDEVSTACK_PROJECT → persisted active (only when its workspace_root matches the discovered workspace) → single/first project. Wired into defaultProject and the messaging default seam, so all db/s3/queue/topic/stream/resource commands inherit it. No behavior change when nothing is set.
  • Commandsdevstack 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 --print emits an eval-able cd+export DEVSTACK_* script for the shell wrapper (Phase 2).
  • Console headerrenderContextHeader atop status, gated off under --json/--quiet (the update-notice precedent).
  • Brandinginternal/branding embeds an ASCII logo, shown at the top of root help via Long (fang v2.0.1 exposes no logo option — verified; SetHelpFunc is overridden by fang, so Long is the injection point).

Tests / gates

  • New: 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) and make determinism both green.

Scope / follow-ups (next phases of spec 30/31)

  • Phase 2: shell-init eval hook (zsh/fish), completions install, prompt segment, use fuzzy-picker TUI.
  • Phase 3+: project TUI, env/secrets TUI, JS/monorepo templates, devstack run task graph.

Open questions carried from the spec: [Q-CTX-SCOPE] (per-Docker-context vs global — implemented per-context).

🤖 Generated with Claude Code

…(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>
@gustavobertoi
gustavobertoi merged commit ef795da into main Jul 1, 2026
4 checks passed
@gustavobertoi
gustavobertoi deleted the feat/active-context-and-branding branch July 1, 2026 23:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant