Skip to content

Armonia as default workspace — sidebar tree, session cwd, cleanup #326

Description

@jeonghun-jj-lee

Armonia as default workspace — sidebar tree, session cwd, cleanup

Important

Problem: Amicode's UI has no awareness of the canonical ~/armonia/ workspace layout. The sidebar's Armonia panel is a placeholder stub, the agent session runs in whatever VS Code folder the user opened, and stale vault-setup machinery exists for a flow that bootstrap-armonia.sh now owns.

Approach: Introduce an ArmoniaService that owns workspace discovery and layout model, a structured ArmoniaTreeProvider that replaces both the placeholder and the catalog panel, override the session cwd to always resolve against armonia, and clean up superseded vault code.

Scope: Extension-only (packages/extension/ + opencode fork app). Does NOT touch the agent's tool permissions (the agent can still reach outside armonia). Does NOT add a user-facing setting to change the working directory (separate issue). Does NOT touch files-changed (separate plans).

Assumptions: PR #308 (bootstrap-armonia.sh) merges first — this issue gates on it. The canonical layout (repos/{packages,demos}, data/{env,problems,runs,vaults}) is stable.

Acceptance Criteria

  • ArmoniaService resolves the armonia root from hidden amicode.armoniaRoot setting (default ~/armonia/), exposes bootstrap state, and watches the filesystem for changes
  • ArmoniaTreeProvider renders six semantic buckets (Packages, Demos, Problems, Runs, Vaults, Environments) expanding into full filesystem subtrees; replaces both PlaceholderTree and SessionCatalogTree
  • When ~/armonia/ does not exist, the tree shows a "Set up Armonia" action that opens a tier quick-picker (--minimal / --standard / --full) and runs bootstrap-armonia.sh in the integrated terminal
  • Contextual actions on tree items: Runs → Open in Run Inspector / View result.toml; pulse.jld2 → Load pulse; Vault notes → Open preview; Packages → Run tests; Problems → Resume session / Open solve.jl; Demos → Run script
  • Agent session cwd is ArmoniaService.root (falls back to workspace folder if not bootstrapped)
  • open-file bridge resolves relative paths against armonia root; absolute paths pass through unrestricted
  • The breadcrumb bar (project selector + workspace selector + git status) is hidden when running as Amicode
  • amicode.catalog view removed from package.json; SessionCatalogTree deleted
  • amicode.setupVault command removed; ensureDefaultPersonalVault() removed; vault_setup.ts deleted
  • mount_store.ts resolves vaults from armoniaRoot/data/vaults/ (with amicode.vaultDir as hidden dev override)
  • Dead resolvePersonalVault removed from vault_store.ts
  • CONTEXT.md updated: Project definition reflects armonia as default; Armonia definition updated to reflect dual role (workspace + knowledge stack)

Key Decisions

Decision Rationale
ArmoniaService as a class, not inline in tree provider Reusable across extension (cwd, open-file, future features); testable in isolation; already referenced in trees.ts comments
Semantic buckets skip repos/ and data/ intermediary Users think in terms of "my packages" / "my runs", not filesystem hierarchy; the Explorer shows raw paths for power users
Session cwd override with workspace-folder fallback Graceful degradation before bootstrap; no broken state
Gate on #308, don't inline bootstrap Single source of truth for workspace setup; bootstrap tiers (clone logic) are too complex to duplicate
Hidden amicode.armoniaRoot setting Forward-compatible with "let users change working directory" issue; testable with non-standard paths during dev
Catalog panel removed rather than kept Scope unclear; the Runs bucket + Run Inspector cover the primary use case; can return with clear scope later

Constraints & Invariants

  • The agent is NOT jailed to armonia — tools can reach any absolute path. Armonia is the cwd (relative path resolution), not a sandbox.
  • open-file must continue to work with absolute paths outside armonia (existing behavior preserved).
  • The amicode.vaultDir setting survives as a hidden dev escape hatch — vault resolution can be forced independently of the armonia root.
  • Bootstrap detection is structural (checks for expected subdirectories), not marker-file-based — a manually created ~/armonia/ with the right shape is valid.

Prior Art

Source

Brainstorming session 2026-08-10. Grilled with grill-with-docs against CONTEXT.md.

Notes

  • The "let users change working directory" feature is a separate issue — this ships the armonia-is-always-the-root default.
  • files-changed scoping is out of scope — separate plans.
  • Bug report flow (gh CLI) is intentionally preserved.
  • The Catalog panel may return in a future issue once its scope is defined.

Metadata

Metadata

Labels

hitlNeeds human decision or review

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions