Skip to content

feat(studio): X05 deploy builds the published version - #1122

Merged
LinuxDevil merged 6 commits into
mainfrom
fb-x05-deploy-published
Nov 14, 2026
Merged

LinuxDevil merged 6 commits into
mainfrom
fb-x05-deploy-published

Conversation

@LinuxDevil

Copy link
Copy Markdown
Owner

Summary

  • deployRunner.ts: publishedSpecPath (.lousho/agents/<id>/published.yaml, inside the sidecar so AgentRepo.list() never scans it), writePublishedSpec (atomic write, returns path), runDeploy now takes published: { version, specPath }, spawns lousho build --agent=<published.yaml>, injects spawn via deps, and returns version on DeployResult.
  • POST /agents/:id/deploy: 404 unknown agent, 409 LOUSHO_NOT_PUBLISHED when nothing is pinned (nothing spawns), else writes the snapshot and builds it. 200/422 as before.
  • publishAgent rewrites published.yaml on every pointer move, best effort (logs, never fails the publish) — so lousho mcp .lousho/agents/<id>/published.yaml sees the same snapshot deploy does.
  • SettingsPanel Deploy card: button disabled + title="Publish a version first" + helper copy while publishedVersion === null; label Deploy v<n>; result headline Deployed v<n> to <adapter> / Build of v<n> failed (exit <code>); a 409 race surfaces as an error toast.

Deviation from the ticket, deliberate: the ticket says writePublishedSpec should yaml.stringify the v2 snapshot as-is. Both consumers of published.yaml — lousho build --agent= and lousho mcp — still load spec files through the v1 loadSpec, which rejects version: 2 documents outright (verified: src/spec/loadSpec.ts validates agentSpecSchema only). Writing v2 would make every deploy and lousho mcp invocation fail. The file therefore holds the same toLegacySpec v1 projection the deploy path already used — only its source changed (published snapshot instead of working copy), which is the ticket's actual goal. Secret refs stay refs; nothing is resolved.

Test plan

  • deployPublished.test.ts (4): 409+no-spawn, 404/400, --agent= = published.yaml containing the published instructions while the working copy drifted, version in result, publish-v1-after-v2 rewrites the file
  • deployRunner.test.ts rewritten for the new signatures (path/write/spawn-args/version/failure)
  • publish.test.ts: published.yaml written on publish and rewritten on repin
  • SettingsPanel.test.tsx: disabled+title+helper, Deploy v2 label, result copy, error toast
  • typecheck (client+server), eslint clean on touched files, fallow dead-code/dupes clean, LF endings

Generated with Devin

LinuxDevil and others added 2 commits November 14, 2026 13:53
POST /agents/:id/deploy now reads the pinned version through
readPublishedSpec, writes its snapshot to
.lousho/agents/<id>/published.yaml and passes that file to
`lousho build --agent=` - the working copy is never what gets built.
Unpublished agents answer 409 LOUSHO_NOT_PUBLISHED before anything
spawns; DeployResult carries the built `version`.

publishAgent rewrites published.yaml whenever the pointer moves (best
effort - a write failure logs, never fails the publish), so
`lousho mcp .lousho/agents/<id>/published.yaml` sees the same snapshot
deploy does. The file holds the spec's v1 projection (toLegacySpec):
both `lousho build` and `lousho mcp` still load spec files through the
v1 loadSpec, which rejects version: 2 documents.

SettingsPanel's Deploy card disables the button with
"Publish a version first" while unpublished, labels it
`Deploy v<n>` when published, headlines the result with the version,
and toasts the server message on a 409 race.

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
X05 made deploy build the published snapshot, so the route now answers
409 LOUSHO_NOT_PUBLISHED for an unpublished agent; the test PUT the spec
but never published.

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@LinuxDevil
LinuxDevil force-pushed the fb-x05-deploy-published branch from 192f3f8 to 27962ce Compare November 14, 2026 10:56
LinuxDevil and others added 4 commits November 14, 2026 15:02
Main's Toast module gained a ToastProvider export the X05 mock did not
provide, breaking the forge suite's vi.mock contract.

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@LinuxDevil
LinuxDevil merged commit 0ec116e into main Nov 14, 2026
6 checks passed
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