Skip to content

Ensamblador: ship + verify-loop + /api/forja/loop (candado: unificar motor de publicación) - #91

Open
turbillon50 wants to merge 2 commits into
mainfrom
claude/mindcontextia-vforge-chat-68jxcy
Open

Ensamblador: ship + verify-loop + /api/forja/loop (candado: unificar motor de publicación)#91
turbillon50 wants to merge 2 commits into
mainfrom
claude/mindcontextia-vforge-chat-68jxcy

Conversation

@turbillon50

Copy link
Copy Markdown
Owner

Módulo Ensamblador — trabajo de la rama claude/mindcontextia-vforge-chat-68jxcy hacia main.

Incluye:

  • lib/builder/ship.ts (motor de publicación GitHub+Vercel)
  • lib/forja/verify-loop.ts + browser.ts
  • /api/forja/loop
  • Retoques a VersionCard y builder

CANDADO antes de mergear (revisar):

  • Duplicación: lib/builder/ship.ts vs app/api/forja/ship/route.ts — debe quedar UN solo motor de publicación. Si ambos publican, consolidar en uno y que el otro lo importe.

Referencia visual del módulo: turbillon50/VFORGE-ENSAMBLADOR (misma rama). Los tokens vf-* (violeta #7c3aed → cyan #22d3ee, fondo #0a0a0f) se respetan, sin paleta nueva.

Merge lo confirma Luis.

claude added 2 commits July 2, 2026 19:22
…eploy a su Vercel

approve en /api/builder ya no deja el build en "ship-pending": ahora toma
los archivos de la versión aprobada y los publica en la cuenta del propio
usuario (repo nuevo o commit encima del existente vía Git Data API, más
deploy directo a Vercel). VersionCard refleja el resultado real: link al
sitio en vivo, link al repo, o el motivo si faltan conexiones.

Cierra el gap marcado explícitamente en el código ("el pipeline repo+vercel
llega después") — es el primer tramo del módulo ensamblador: chat -> código
real -> tu GitHub -> tu Vercel, sin quedarse en manos de VForge.
…Ojo (manos)

Hoy el navegador Vulcano (CDP/VNC en Hetzner) y el Ojo (cola de agentes
que escriben código) son dos sistemas que no se hablan. Este bridge cierra
un loop: navega a la URL publicada, lee lo que renderiza, detecta fallas
conocidas (excepción de cliente, 404, 500, hydration fail, página en
blanco) y si encuentra una, encola un fix en el Ojo con el texto
observado como contexto — el mismo patrón de "ver la pantalla y actuar"
que el plugin de Claude en Chrome.

Extrae la lógica de CDP compartida (relayExec/cdpControl/safeHttpUrl) de
app/api/navegador/control/route.ts a lib/forja/browser.ts para no
duplicarla.

Límite conocido: lee el DOM renderizado, no la consola — errores no
visuales necesitan que cdp_control.py en Hetzner exponga Log/Runtime de
CDP, fuera del alcance de este repo.
@vercel

vercel Bot commented Jul 3, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
vforge Ready Ready Preview Jul 3, 2026 2:17am

Request Review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 63b1caa36d

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread lib/builder/ship.ts
Comment on lines +84 to +87
const treeRes = await gh(`/repos/${owner}/${repo}/git/trees`, token, {
method: "POST",
body: JSON.stringify({ base_tree: baseTreeSha, tree: blobs }),
});

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Replace the published tree instead of overlaying it

When republishing an existing build after a file is renamed or removed, this base_tree call only overwrites paths present in files; omitted paths remain in the GitHub repo even though the comment says each build is a final snapshot. GitHub's tree API documents that base_tree entries are preserved unless overwritten or deleted with sha: null (https://docs.github.com/en/rest/git/trees), so later approvals can leave stale source files in the user's repo while Vercel receives only the new file list.

Useful? React with 👍 / 👎.

Comment thread lib/builder/ship.ts
Comment on lines +183 to +188
await saveUserApp(userId, {
name: build.project_name,
repo_url: repoUrl,
deploy_url: deploy.url,
template: "ensamblador",
});

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Upsert the shipped app instead of inserting every publish

When an already-shipped build is approved again, this path runs again with build.repo_full_name set, but saveUserApp is insert-only, so every republish of a new version creates another identical app entry instead of updating the existing deploy URL. In the workspace apps list this shows duplicate apps for the same repo after normal builder iterations.

Useful? React with 👍 / 👎.

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