Skip to content

refactor(console): narrow console surface to chat and observability - #935

Merged
devlikebear merged 5 commits into
mainfrom
refactor/console-narrow-surface
Aug 24, 2026
Merged

refactor(console): narrow console surface to chat and observability#935
devlikebear merged 5 commits into
mainfrom
refactor/console-narrow-surface

Conversation

@devlikebear

Copy link
Copy Markdown
Owner

Summary

  • Write down the console purpose in DESIGN.md: conversation + session/cwd control + observability, plus targeted control (onboarding, credentials, approvals, cron CRUD, extensions, channels). Config is file-first — the console inspects and validates.
  • Audit all 165 schema fields in Config.svelte; classification table recorded in DESIGN.md. Onboarding and credential flows unchanged.
  • Narrow Config.svelte 3200 → 1393 LOC (−56%): Quick Start stays interactive; Fields tab becomes read-only inspection with YAML-key pointers and wizard deep links; YAML tab becomes a read view; 4 modal editors removed.
  • Split 1825-line lib/api.ts into 14 domain modules behind a barrel re-export (lib/api/index.ts) — zero API surface change, old imports keep working; 27 test files repointed to owning modules.
  • CLI review (analysis only): 5 command groups marked as deprecation candidates (approve, cron list/runs, auth passwd, remote, skill/plugin/mcp management) with replacements documented. Nothing removed.
  • Orphan-route check: PUT /v1/admin/config and GET /v1/providers no longer called by the console but retained server-side; flagged as follow-up.

Refs #931 · Part of #919 (LP-012) — first cut; issue stays open for form-primitive extraction and Playwright/manual validation.

Test plan

  • cd frontend/console && npm run check (0 errors, 0 warnings)
  • cd frontend/console && npm run test:ci (45/45) and full npm test (302/302), incl. rewritten tests locking the narrowed surface
  • make console-build
  • make test (Go side, 66 pkgs ok)
  • Playwright suite + manual dev-serve walkthrough of onboarding and remaining routes (post-merge follow-up)

…olicy

Part of #919. Refs #931. Step 1 of the console-narrowing first cut:
normative purpose statement (conversation / observability / targeted
control), route inventory mapped to pillars, and the config policy
(file-first, inspection-not-editing) recorded in DESIGN.md before any
visual or route change.
Part of #919. Refs #931. Step 2: classification of all 165 schema
fields into (a) keep-UI (onboarding/credentials/session control),
(b) read-only inspection candidates, and (c) YAML-first removals,
including where each removed editor's capability lands.
…pection

Part of #919. Refs #931. Step 3: replace the long-tail field editors
with a validated read-only inspection view (value, env-override
effective value, default/restart/secret badges, documented YAML key).
Remove the generic JSON / LLM tier / LLM provider / embodiment preset
modal editors; provider and tier editing deep links to the onboarding
wizard reentry which already preserves masked keys via alias-replace.
YAML tab becomes a read view — file-first per DESIGN.md. Onboarding,
credential entry, restart, danger zone, pending-changes diff, and LLM
connection test unchanged.

Config.svelte 3200 -> 1393 lines.
Part of #919. Refs #931. Step 4: api.ts (1825 lines) becomes
src/lib/api/{client,normalize,system,config,chat,sessions,tasks,git,
memory,ops,extensions,channels,agentruntime,workspace}.ts with an
index.ts barrel re-exporting the full surface — all existing
'../lib/api' imports keep working. Runtime relative imports carry
explicit .ts extensions so node --experimental-strip-types can load
modules directly; tsconfig gains allowImportingTsExtensions. Tests
that asserted on api.ts source now read the owning module.

No endpoint, function, or type removed.
… findings

Part of #919. Refs #931. Steps 5-7: shared-form-primitive extraction
documented as follow-up; five CLI command groups marked as deprecation
candidates (analysis only, nothing removed); PUT /v1/admin/config and
GET /v1/providers noted as console-orphaned but retained API routes.
@sonarqubecloud

Copy link
Copy Markdown

@devlikebear
devlikebear merged commit dbcc34f into main Aug 24, 2026
11 checks passed
devlikebear added a commit that referenced this pull request Aug 24, 2026
Review follow-up to #935 (#931). Two bugs the config narrowing made
reachable, plus the DESIGN.md contradictions it left behind.

- buildConfigPayload merged llm_providers with what is on disk but rebuilt
  llm_tiers from heavy/standard/light alone and returned it wholesale. The
  alias-keyed PATCH replaces the on-disk set with whatever the patch sends —
  the same reason the provider merge exists — so a user with a custom tier
  (schema.go documents "heavy/standard/light or custom tiers") lost it by
  changing one model in the wizard. #935 routed Config.svelte's llm_tiers
  editing to that wizard deep link, which opened the path to normal users.
- Inspect rendered uncommitted edits. shouldShowFieldActions hides
  Save/Discard outside Quick Start, but getDisplayValue preferred dirtyFields
  regardless, so a pane banner-labelled "Read-only inspection" showed an
  unsaved value as though the server had loaded it.
- DESIGN.md claimed the 13 Quick Start gates "stay interactive" while the
  consequence table three bullets later made embodiment_providers_json
  read-only, and promised masked entry for 7 credential fields when only 2
  still have an input. Both now describe what the code does, including that
  token rotation needs host filesystem access.
- Recorded configStructured.ts's draft builders and the saveConfig /
  getProviders wrappers as retained-but-unreferenced, kept for the
  embodiment-preset follow-up DESIGN.md already names. Left in place rather
  than deleted because #931 is still open; the note is the delete inventory
  if that follow-up is declined.

Verified: npm run check 529 files 0 errors, npm test 303/303 (the new tier
test fails against the old code), go test ./internal/tarsserver/.
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