2026-09-26·by Sijie Wang#node#standmeet#architecture

structure

Pillar 7 · Structure & discipline (the foundation)

Parent: key-designs

The ground the other six pillars stand on. Code shape: Go packaged by domain (internal/<domain>/{entity,usecase,repo,db,ops,facade} — the by-layer domain → usecases → routes god-packages were dissolved 2026-07-27, see backend-domain-modules) with sqlc (a db/ per domain), a single canonical schema.sql whose migrations the backend applies itself at boot (bd45353f4, 2026-08-31, backend/internal/infra/pgstore/migrate.go), Next.js as a thin shell, apierr's one error envelope with log/client separation, bwrap sandboxes with no network, the builder (microsite vite runner, no docker.sock), PDF via gotenberg + printsess, and three test estates (e2e Playwright, eval-harness, mock-stack fake upstreams). Discipline: mechanical guardrails (boundary lints, check-no-mock) hold the α≈0 tier; the judgment audit holds what lint can't mechanize.

Status: stable.

Package dependencies (allowed and forbidden edges)

The two forbidden edges are the load-bearing ones: eval-harness and the sandboxed plugins (infra/plugins/*) may touch ONLY the public seams (agentcore, the MCP wire protocol) — re-exporting internal/ types counts as a dependency and is banned (agent-as-injectable-driver); check-no-mock keeps fixtures out of backend.

Children

about this entry

One of sijie's wiki entries. The AI on this site is grounded in the same corpus and answers in sijie's voice, with citations back to entries like this one — answering costs sijie money, so it waits behind a code: enter an access code →

structure — Sijie Wang