3.3 KiB
3.3 KiB
Task: Review Go backend for missing modules
Identity
- Task ID: 20260814-architecture-gap-review-3c8d51ae
- Mode: Feature
- Branch: main
- Worktree: /Users/brother7/Documents/AI/NianAIGC
- Base commit:
eacb4c67de - Owner: dsh
- Status: Ready for Integration
Scope
- Read-only completeness review of the merged Go backend against ADR-003 and the current Next.js implementation: HTTP route surface, deep modules, provider engines, account lifecycle, ops scripts, and deployment artifacts.
Intent And Constraints
- No application, database, test, or deployment file was changed.
- Facts were verified against the checked-in route-surface contract, source inventories, and binary strings; no claims based on task-record prose alone.
Outcome
- Route surface: complete parity. The checked-in contract has 66 method/path entries; Next.js exports 64 route handlers plus the two static file roots (
/uploads,/generated-results), and the Goroute_surface.goregisters all 66. Zero routes missing in Go, zero unexpected extras. - Deep modules: all ADR-003 modules exist in Go — identity (legacy
zhinian_sessionHMAC/chunking, password lifecycle, authorization), administration (accounts, organizations, status/archive/delete, legacy subject), assets (local FS + OSS adapters, bounded remote import), jobs/providers/orchestration (embedded WorkerLoop, retries, artifacts, Seedance settlement, signed Webhooks), billing/usage (integer-fen quote/wallet/ledger/catalog, super-admin quota exemption), templates/prompt/settings/logging, postgres (fail-closed, verified-CA TLS, readiness, claim/wallet functions, grants includingplatform_account_migrations), localstore, httpapi/publicapi (OpenAPI output), health/ready. - Provider engines: image
jimeng/evolink/bailian(wan2.7-image-pro) and videoseedance/bailianare all wired in Go; the current Next capability surface is onlyimage.generateandvideo.generate, so Go matches it exactly.inpaint/upscaleare legacy asset-source labels, not active capabilities.
Verification
- Programmatic diff of
contracts/http/route-surface.v1.json(66 entries) against Next route exports (64) and Goroute_surface.go(66): contract minus Go is empty; Go minus Next is only the two static file routes. - Grep audits: provider engines, OSS, webhook HMAC, captcha proxy, WorkerLoop packages, admin account lifecycle, super-admin quota exemption.
- Binary string scan of
backend/zhinian-apiconfirms bailian image/video endpoints, seedance settlement, and OSS requirements are compiled in.
Follow-ups
- Ops tooling gaps (small, cutover-relevant, not runtime modules):
- Go has no super-admin bootstrap tool (Next has
scripts/bootstrap-admin.mjs); the Go binary exposes no CLI subcommands. - Go has no legacy-account import tool (Next has
scripts/import-legacy-accounts.mjs); the DB privilege grants forplatform_account_migrationsalready exist in Go's postgres layer. - The ACK migration Job still runs
node scripts/migrate-postgres.mjs; Go has no migration runner. Acceptable while the Job keeps shipping Node, but a Go runner is worth deciding before cutover.
- Go has no super-admin bootstrap tool (Next has
- Deployment artifacts for the Go workload (Go image, ACK manifests, Ingress routing) are intentionally deferred to the cutover workstream, not missing.
Promotion Candidates
- None; this review recommends no canonical changes.