Skip to content

fix(ci): build svalinn binary from the real entrypoint (MVP gateway)#54

Merged
hyperpolymath merged 2 commits into
mainfrom
claude/dazzling-noether-hkgAV
Jun 27, 2026
Merged

fix(ci): build svalinn binary from the real entrypoint (MVP gateway)#54
hyperpolymath merged 2 commits into
mainfrom
claude/dazzling-noether-hkgAV

Conversation

@hyperpolymath

Copy link
Copy Markdown
Owner

What & why

The Build Binaries CI job has been failing on every run with:

Check main.ts
TS2307 [ERROR]: Cannot find module '.../src/main.ts'.

Root cause: after the .res → .affine migration, src/ holds AffineScript — src/main.ts and src/compose/cli.ts were never created. The typecheck job was already fixed to check the real entrypoint (tools/mvp/svalinn_gateway.ts), but the build job and the src/deno.json tasks were missed and still pointed at the non-existent files. This is the pre-existing red I flagged when reconciling #52.

The fix (root cause, single source of truth)

  • src/deno.json — point build/dev/start at ../tools/mvp/svalinn_gateway.ts (the only Deno-compilable entrypoint, and the same file typecheck checks). Drop the dead build:compose / compose tasks — there is no compose CLI. The build task is now the single definition of the entrypoint.
  • .github/workflows/ci.yml — the Build Binaries job runs deno task build instead of duplicating a stale raw command, so CI and local builds can never drift from deno.json again. When the AffineScript/Ephapax app gains a compilable entrypoint, updating the one task updates both.

deno.lock is intentionally left untouched — the test jobs resolve imports the gateway doesn't (@std/yaml, @std/cli, …), so the full graph must stay.

Verification (local, deno 2.9.0)

Run against the actual tree, not eyeballed:

Command Result
deno task build (the exact CI command) ✅ exit 0 — produces dist/svalinn
run ./dist/svalinn ✅ boots the HTTP gateway, listens on :8000
deno fmt --check (incl. edited deno.json) ✅ exit 0
deno lint ✅ exit 0
deno task check ✅ exit 0

(deno compile fetches its denort base from dl.deno.land, which is blocked in my sandbox; I verified by pointing DENORT_BIN at the denort asset from GitHub Releases. CI has normal network, so the job needs no such workaround.)

Out of scope (flagged, not fixed)

README.adoc / EXPLAINME.adoc / TOPOLOGY.md still describe the old src/main.ts gateway and a svalinn-compose CLI. That's stale documentation from the pre-migration architecture — a separate doc-accuracy pass, not part of getting CI green.

🤖 Generated with Claude Code


Generated by Claude Code

The "Build Binaries" job — and the src/deno.json build/dev/start/compose
tasks — still pointed at src/main.ts and src/compose/cli.ts, which were never
created after the .res->.affine migration. So the job failed on every run with
"Cannot find module .../src/main.ts", keeping main red. (The typecheck job was
already fixed to check the real entrypoint; the build job and deno tasks were
missed.)

The only Deno-compilable entrypoint today is the MVP gateway,
tools/mvp/svalinn_gateway.ts — the same file the typecheck job checks.

- src/deno.json: point build/dev/start at ../tools/mvp/svalinn_gateway.ts and
  drop the dead build:compose and compose tasks (no compose CLI exists). The
  build task is now the single source of truth for the entrypoint.
- ci.yml: the Build Binaries job runs `deno task build` instead of duplicating a
  stale command, so CI and local builds can never drift from deno.json again.

Verified with deno 2.9.0: `deno task build` produces a working dist/svalinn that
boots the HTTP gateway (listens on :8000); `deno fmt --check`, `deno lint`, and
`deno task check` all pass. deno.lock is left untouched on purpose — the test
jobs resolve imports the gateway doesn't, so it must keep the full graph.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011z2t8zAxfcCNLJzU7YdpBQ
@hyperpolymath
hyperpolymath marked this pull request as ready for review June 27, 2026 09:21
@hyperpolymath
hyperpolymath enabled auto-merge (squash) June 27, 2026 09:21
@hyperpolymath
hyperpolymath disabled auto-merge June 27, 2026 09:22
@hyperpolymath
hyperpolymath enabled auto-merge (squash) June 27, 2026 09:22
@hyperpolymath
hyperpolymath disabled auto-merge June 27, 2026 09:24
@hyperpolymath
hyperpolymath enabled auto-merge (squash) June 27, 2026 09:24
…ob conflict

#55 (inline deno compile) merged to main while this branch (#54) refactors the
same Build Binaries job to 'deno task build'. Resolved by keeping #54's
single-source-of-truth design AND #55's correctness:

- ci.yml: build job runs 'deno task build' (working-directory: src); upload
  path corrected to src/dist/ (where that task emits the binary).
- src/deno.json: dev/start/build tasks now bake the gateway's full runtime
  permissions (net/read/write/env/run) — the --allow-write/--allow-run that
  #55 established are no longer dropped.

Lockfiles left untouched (test jobs need the full graph). Verified with
deno 2.9.0: 'deno task build' produces src/dist/svalinn (rc=0); deno fmt
--check and YAML parse clean.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XhuUim2UaLDziQRrFgtBTJ
@hyperpolymath
hyperpolymath disabled auto-merge June 27, 2026 10:04
@hyperpolymath
hyperpolymath merged commit 7cbdc7b into main Jun 27, 2026
24 of 25 checks passed
@hyperpolymath
hyperpolymath deleted the claude/dazzling-noether-hkgAV branch June 27, 2026 10:04
@sonarqubecloud

Copy link
Copy Markdown

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