feat(studio): bring Mecatl Studio in-repo as a Node module - #548
feat(studio): bring Mecatl Studio in-repo as a Node module#548Derek2Tu wants to merge 6 commits into
Conversation
Studio is the local WEB client for the harness — chat with tool-call and approval cards, plus panels for the provider, MCP gateway, semantic model routing, skills, memory, and scheduled tasks. It lived in a private standalone repo, which cost it everything an in-repo client gets for free: no CI ran it, its test suite asserted invariants that had already gone stale against the code they described, it reached its harness through a hardcoded `../../mecatl`, and one developer-machine absolute path was compiled into the client bundle. It lands on the `website/` pattern: its own package.json + Taskfile under a `studio:` namespace, and a `studio` CI job running build + test + lint + typecheck. It is NOT a Go module — never in go.work, the layering DAG, the depguard allowlists, or the api-compat gate, and `task test` is unchanged. It is a CLIENT like mecatui: it consumes the public HTTP/SSE surface on loopback through a same-origin worker proxy and imports nothing from engine/ or internal/. Adapted in the move: - The workspace is RESOLVED, not hardcoded. The controller derives the repo root from its own location and reports it on /status; the client refuses to open a session until it knows one, rather than silently pointing mecated at the wrong tree. A clone anywhere now works unedited. - The starter-template residue the app was scaffolded from (D1/Drizzle wiring, the examples surface, the chatgpt-auth helper, the boilerplate README) is dropped rather than carried in. That also clears the two worker type errors it had been carrying, so typecheck is clean. - `task studio:dev` requires `bin/mecated`, and `task studio:stop` tears down the controller first so the supervisor stops the daemon it owns instead of orphaning it. ADR 0110 records the decision and its costs honestly — the repo now carries an npm tree and a Node install on every PR, and Studio's suite is a build-plus-source-invariant suite, not a browser test: it proves the app compiles, server-renders, and still holds its safety-critical shapes, NOT that a panel works against a live daemon. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
The module landed without the doc surfaces every other subsystem carries. Follows the file set the authn-module commit (0664f2c) established for a new top-level module, minus the Go-only ones (go.work, .golangci.yml, release.yml) that do not apply to a Node module: - docs/design/PRODUCTION-READINESS.md — the tracker is "one row per design record" and ADR 0110 had none. The row states the gaps as gaps: no live-daemon integration test, no npm dependency automation, no hosted deployment. - docs/architecture.md — Studio is the third first-party client and was absent from the living "how it works": a peer paragraph next to mecatui and mecatequi, plus a node in the big-picture diagram showing it entering through the HTTP/SSE handler and nowhere else. - README.md — a `studio/` row in the project layout table. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
First-pass review — deployment shape & architecture notes. Haven't been through the code line-by-line yet; this is the structural feedback from a first read of the shape (worker proxy, controller, spawn path) against how we want to deploy it. Assuming up front: the core deploy targets are (a) everything-on-localhost (single-user dev box) and (b) k8s, and in both we want to be able to split the tiers — UI local, mecated remote. Every note below serves making that split first-class. (Non-blocking nits excluded; these are the structural items.) 1. Provider credentials — don't build key-paste UI now; hard-fail to the auth file, and treat config/auth UI as its own follow-up. Proposal: drop the A proper config/auth UI (not editing JSON/YAML by hand, but also not a paste-a-key box) is worth doing — but as a separate, designed thing, not this PR. This PR shouldn't ship the stopgap. 2. Make the managed mecated lifecycle optional — the mecatui two-mode pattern (ADR 0087).
For external mode, the pre-configured-daemon route is right: the hosted mecated owns its provider creds at its own launch (auth file / env, the normal way); Studio just connects and the credential/config surface hides or disables. No 3. Auth on the 4. Don't hardcode mecated's port in managed mode — pick a random free port now; UDS or :0-and-report as follow-ups.
Until one of those lands, a controller-picked random free port is the right no-server-change behavior. 5. The Cloudflare Worker runtime is the wrong hosting shape for both targets. 6. Known gap (author-flagged): the Happy to turn any of these into a concrete patch sketch if useful. |
|
Second-pass review — multi-agent panel findings. A review panel (spec adherence, repo standards, and specialist domain reviewers — security, architecture, DevOps, library-reuse, duplication) went over the diff against Ship-blockers
Docs claim more than the diff delivers
Mechanical / smaller
Proposed CI job (matches house conventions — SHA-pinned,
|
Co-Authored-By: OpenAI Codex <noreply@openai.com>
Co-Authored-By: OpenAI Codex <noreply@openai.com>
Co-Authored-By: OpenAI Codex <noreply@openai.com>
|
@jbeda Thanks for both review passes. I addressed the ship/deployment blockers and rebased the branch onto current Addressed in this PR
Deliberately separate follow-ups
Verification
Open-PR overlapI re-audited every open PR after the final push. No other PR touches |
Co-Authored-By: OpenAI Codex <noreply@openai.com>
Review follow-up: changes made from both comment passesThis is the complete mapping from the PR feedback to the current branch. First-pass deployment and architecture feedback
Second-pass ship blockers
Documentation and residue findings
Mechanical and dependency feedback
Verification and overlap audit
|
|
#618 proposes replacing this PR's UI with the Atrium workspace while carrying this PR's infrastructure forward — the piece-by-piece mapping: Carried near-verbatim (same behavior, new paths under
Replaced: This PR's deferred follow-ups that remain open in #618's ADR: generated TS proto bindings, daemon-side listener work, a designed auth/config UI, the controller module split, and the real-daemon browser test layer. If #618 lands, this PR can close as superseded — leaving that call to its author. 🤖 |
Summary
mecated, or authenticated externalMECATL_BASE_URL.next dev/next start.Scope decisions
Included here: all deployment-shape, security, CI, dependency, protocol-runtime, residue-removal, and documentation blockers raised in both review passes.
Separate follow-up PRs:
:0HTTP bind-and-report inmecated;Verification
task linttask test(including race tests and standalone module builds)task buildtask docstask site:buildgo run ./cmd/mecademonpm testnpm run lintnpm run typechecknpm audit --audit-level=high(0 vulnerabilities)Open-PR overlap audit
studio/**or.github/workflows/studio.yml.llms.txtoutput.