Skip to content

docs(editor): frontend contract for Lovable (Steps 6-7) - #69

Merged
WayforthOfficial merged 1 commit into
mainfrom
docs/agent-editor-frontend-contract
Jun 27, 2026
Merged

docs(editor): frontend contract for Lovable (Steps 6-7)#69
WayforthOfficial merged 1 commit into
mainfrom
docs/agent-editor-frontend-contract

Conversation

@WayforthOfficial

Copy link
Copy Markdown
Owner

The editor frontend-contract doc — same as the params contract (#58) — so Lovable builds against the exact API, not an approximation. Docs only, for review; then you hand it to Lovable.

docs/agent-editor-frontend-contract.md specifies, precisely:

  1. EndpointsPOST /cloud/agents/{id}/deploy (multi-file {files, requirements}), POST /cloud/agents/{id}/rollback, GET /cloud/agents/{id}/versions — exact request/response bodies + status codes.
  2. The requirements picker / allowlist — answers your question: it's a static server-side lockfile, no GET today. The doc specifies GET /cloud/deps/allowlist (name → installable versions, hashes omitted) and flags it NOT YET IMPLEMENTED — a trivial read-only endpoint to add (called out prominently so it isn't discovered mid-build). The picker can't render without it.
  3. Version objectid, version_no, status (building|active|superseded|failed), image_ref, created_at, + active flag (id === active_version_id). Notes the optional dep_flagged badge for revoked-package surfacing.
  4. Error shapes — by stage (redeploy_files|params|requirements|build) and per-field codes (not_allowed, version_not_allowed, unpinned, revoked, …) so the editor renders failures inline (PARAMS errors on the entrypoint, requirement errors on the offending line).
  5. Template picker — reuses the existing GET /templates / GET /templates/{id} registry (no new endpoints).

Plus a flag-gating table up top: GET /versions + GET /templates are testable now; POST /deploy + POST /rollback return 409 versioning_disabled until the Step-4b flip — so Lovable knows what to build live vs. against spec.

One thing needing your call

The contract depends on GET /cloud/deps/allowlist, which doesn't exist yet (the allowlist is the static agent_deps_lock.json). It's a one-liner (serve the lockfile minus hashes). Flagged in §2 — greenlight it and I'll add it as a tiny PR before/alongside the frontend.

🤖 Generated with Claude Code

Exact API contract for the code editor + version UI, so Lovable builds against the
real shapes (companion to docs/agent-params-frontend-contract.md). Docs only.

Specifies: (1) POST /deploy (multi-file), POST /rollback, GET /versions — exact
request/response; (2) the requirements-picker allowlist source — answers 'static
lockfile, no GET' and specifies GET /cloud/deps/allowlist to ADD (flagged NOT YET
IMPLEMENTED, trivial); (3) the version object shape (version_no/status/created_at/
active flag); (4) error shapes by stage/code for inline rendering; (5) template
picker via the existing GET /templates registry. Marks which endpoints are
flag-gated (deploy/rollback) vs live now (versions/templates).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@railway-app
railway-app Bot temporarily deployed to wayforth / wayforth-pr-69 June 27, 2026 20:53 Destroyed
@WayforthOfficial
WayforthOfficial merged commit 0decfe0 into main Jun 27, 2026
2 of 3 checks passed
@WayforthOfficial
WayforthOfficial deleted the docs/agent-editor-frontend-contract branch June 27, 2026 20:56
WayforthOfficial added a commit that referenced this pull request Jun 27, 2026
Serves the curated allowlist as name -> sorted versions for Lovable's requirements
picker. Hashes are a build-time integrity detail and are NEVER sent to the client —
the payload is only package names + installable versions (all the picker needs).

- Reuses services.agent_deps.load_lockfile(); transform extracted to _allowlist_payload()
  so the no-hashes guarantee is unit-tested on the exact code the endpoint serves.
- Authenticated cloud_agents tier, like the rest of /cloud/*. Not flag-gated (read-only
  reference) — testable now.
- 3 unit tests incl. the load-bearing 'no sha256 reaches the client'. Suite 626 passed.
- Updates the editor contract doc (#69): §2 + the flag-table now mark the endpoint live.

Co-authored-by: MytelligentPRV <assulindor@gmail.com>
Co-authored-by: Claude Opus 4.8 (1M context) <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.

2 participants