Skip to content

feat(compose): template/skills library + compose (deploy slice 1) - #64

Open
brettchien wants to merge 1 commit into
mainfrom
feat/deploy-slice1-compose
Open

feat(compose): template/skills library + compose (deploy slice 1)#64
brettchien wants to merge 1 commit into
mainfrom
feat/deploy-slice1-compose

Conversation

@brettchien

Copy link
Copy Markdown
Contributor

Slice 1 of the accepted agent-deployment ADR (#63): the compose seam — author a template/overlay/skills library and preview the composed {path → bytes} agent bundle. Studio-local, zero AWS / zero upstream: everything here is verifiable with cargo test + tsc/vite/vitest, no bundle-macos needed to know it's right.

What's here

crates/studio-compose — a new pure, dependency-light crate (serde + sha2, no async/AWS/fs):

  • Template ⊕ Overlay + skills-by-reference → a deterministic Bundle ({path → Vec<u8>} + image tag).
  • Precedence is last-writer-wins per path: template files < skills (under .claude/skills/<name>/…) < overlay files; image tag is overlay overriding template.
  • Bundle::digest() — a length-prefixed sha256: content-address (the stable identity slice 2 / fleet-store ADR: Fleet Store & Control-Plane State Ownership #18 will key desired state on).
  • Library aggregate + compose_named for the app/driver to look up by name; Bundle::preview() for a text-oriented, serde-friendly view.
  • 17 unit tests covering precedence, skill resolution, error attribution (which layer referenced a missing skill), image-tag fallback, and digest stability / collision-resistance.

src-tauri — three commands (compose_library_get / compose_library_set / compose_preview) with compose.rs persisting the library as one JSON doc under the app config dir, mirroring config.rs (best-effort load, validated write).

console — a new Compose tab: edit the library as JSON, pick template + overlay, preview the composed bundle (image tag, digest, per-file content). Pure render helpers are unit-tested (compose.test.ts); the browser build disables the panel (no backend) like the Config tab.

Not here (later slices, per the ADR §3)

Verification

  • cargo test -p studio-compose → 17 passed
  • cargo check -p studio-compose clean. (The full cargo test --workspace OOM'd in my constrained build box while compiling oabctl's aws-sdk tree — an env limit, not a code issue; CI's build-test runner has the memory. src-tauri is its own workspace, compiled by bundle-macos.)
  • cd console && npm run typecheck && npm test && npm run build → tsc clean, 65 vitest passed, vite build OK

🤖 Generated with Claude Code

Slice 1 of the accepted agent-deployment ADR (#63): the compose seam.
Author a template/overlay/skills library and preview the composed
{path -> bytes} agent bundle. Studio-local, zero AWS/upstream.

- crates/studio-compose: pure compose core (template ⊕ overlay + skills
  by-reference -> deterministic Bundle + image tag), last-writer-wins
  (overlay > skills > template), sha256 bundle digest. 17 unit tests.
- src-tauri: compose_library_get/set + compose_preview commands;
  library persisted as one JSON doc under app config dir (like config.rs).
- console: Compose tab (JSON library editor + template/overlay picker +
  bundle preview). Pure render helpers unit-tested.

Verified: cargo test -p studio-compose (17), console tsc + 65 vitest +
vite build. src-tauri Rust compiles under bundle-macos CI (GTK dep).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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