docs: promote deployment artifacts completion into canonical memory

This commit is contained in:
2026-08-14 09:51:52 +08:00
parent 4a8f2d56e2
commit 550edcdc05
5 changed files with 49 additions and 3 deletions

View File

@@ -4,7 +4,7 @@
There is no deployed production architecture yet. Local development keeps the Next.js full-stack Web workload plus the HTTP-polling Node Worker; production server state is stored directly in PostgreSQL through a shared server-only adapter, and development/tests can explicitly use local JSON.
The first production deployment will run the ADR-003 split topology directly: Next.js serves pages/static/SSR, and the merged Go backend under `backend/` owns `/api`, `/uploads`, and `/generated-results`. There is no legacy production instance, so there is no cutover and no Node Worker in production — the Go process embeds the WorkerLoop from day one. The deployment artifacts for the Go workload are still to be built.
The first production deployment will run the ADR-003 split topology directly: Next.js serves pages/static/SSR, and the merged Go backend under `backend/` owns `/api`, `/uploads`, and `/generated-results`. There is no legacy production instance, so there is no cutover and no Node Worker in production — the Go process embeds the WorkerLoop from day one. The deployment artifacts are checked in: `backend/Dockerfile` (non-root static Go image), `deploy/ack/go-api.yaml` (Deployment plus Service), and the split-path Ingress in `deploy/ack/ingress.yaml`; the image build/push and target-cluster validation remain.
## Approved Target Architecture

View File

@@ -12,6 +12,7 @@ This file is the integrated default-branch snapshot. Feature tasks record progre
- `d0fb346` (merge of `c1cbd78` — Go backend implementation, contract fixtures, migration 0002, and task-scoped records into `main`; tasks `20260813-go-remaining-modules-7d3a9e42` and `20260814-go-remaining-integration-5e7c9a1b`)
- `f10cdd9` (record of completed task `20260812-architecture-task-breakdown-a83f61c2`)
- `ff055c9` (config-driven super-admin bootstrap in the Go backend, task `20260814-go-bootstrap-admin-6e2b7d9c`)
- `4a8f2d5` (Go workload deployment artifacts and split Ingress routing, task `20260814-go-deploy-artifacts-2a5f8e1d`)
## Current Focus
@@ -26,6 +27,7 @@ ADR-003's Go modular-monolith backend is implemented and merged into `main` unde
- 2026-08-14: Reconciled canonical architecture, decision, history, commitment, and positioning memory with the merged Go implementation (task `20260814-go-memory-reconcile-7f2a9c41`).
- 2026-08-14: Added config-driven first-super-administrator bootstrap to the Go backend (task `20260814-go-bootstrap-admin-6e2b7d9c`).
- 2026-08-14: Recorded the first-deployment model: no production cutover, manual schema initialization without the migration Job pod (task `20260814-deploy-model-reconcile-9b4c2e7f`).
- 2026-08-14: Built the Go workload deployment artifacts: `backend/Dockerfile`, `deploy/ack/go-api.yaml`, split-path Ingress routing, non-root/read-only-filesystem workload config, and updated manifest assertions (task `20260814-go-deploy-artifacts-2a5f8e1d`).
## In Progress
@@ -33,7 +35,7 @@ ADR-003's Go modular-monolith backend is implemented and merged into `main` unde
## Next Recommended Steps
1. Build the Go workload deployment artifacts for the first production deployment: Go container image, ACK Deployment/Service manifests, and Ingress routing that sends page/static paths to Next.js and `/api`, `/uploads`, `/generated-results` to Go.
1. Build and push the `zhinian-go-api` image from `backend/Dockerfile`, then validate all manifests with `kubectl apply --dry-run=server` on the target ACK cluster.
2. Initialize the production schema by manually executing `database/migrations/0001_initial_schema.sql` then `0002_generation_lifecycle_fencing.sql` as the migration role, then apply the application-role grants (tables plus the two concurrency functions).
3. Configure `ZHINIAN_BOOTSTRAP_ADMIN_*` on the first Go startup; the process creates the first super administrator exactly once.
4. Validate against non-production RDS (real application role, verified-CA TLS), real OSS, provider credentials, and external Webhooks before the first production rollout.

View File

@@ -13,6 +13,9 @@
| 2026-08-14 | `20260813-go-remaining-modules-7d3a9e42` | Remaining Go modules (administration, assets, billing, usage, jobs/providers/webhooks/worker loop, HTTP surfaces), language-neutral contract fixtures, and migration 0002 merged into `main`. | Task record |
| 2026-08-14 | `20260814-go-remaining-integration-5e7c9a1b` | Serialized Integration Gate merging the completed Go remaining modules into `main`. | Task record |
| 2026-08-14 | `20260814-go-memory-reconcile-7f2a9c41` | Reconciled canonical architecture, decisions, history, commitments, positioning, domain, and success-criteria memory with the merged Go backend. | Current state, system overview, module map, data flow, decision index, ADR-003, migration proposal, commitments, positioning, business rules, glossary, success criteria |
| 2026-08-14 | `20260814-deploy-model-reconcile-9b4c2e7f` | Recorded the first-deployment model (split topology from day one, manual SQL schema initialization, config-driven bootstrap) across canonical memory and deployment docs. | Current state, decisions (DEP-001), architecture, commitments, deployment docs |
| 2026-08-14 | `20260814-go-bootstrap-admin-6e2b7d9c` | Config-driven first-super-administrator bootstrap in the Go backend. | Task record, backend README |
| 2026-08-14 | `20260814-go-deploy-artifacts-2a5f8e1d` | Go workload deployment artifacts: `backend/Dockerfile`, `deploy/ack/go-api.yaml`, split-path Ingress, database-free Web workload, updated manifest assertions. | Task record, deployment docs, READMEs |
## Notes

View File

@@ -0,0 +1,41 @@
# Task: Promote deployment artifacts completion into canonical memory
## Identity
- Task ID: 20260814-deploy-artifacts-memory-5e1c3b8a
- Mode: Integration
- Branch: main
- Worktree: /Users/brother7/Documents/AI/NianAIGC
- Base commit: 4a8f2d56e24a4d05e7dc30ba1b536e66bb20048c
- Owner: dsh
- Status: Ready for Integration
## Scope
- Promote the completion of task `20260814-go-deploy-artifacts-2a5f8e1d` into canonical memory: record the commit, update the current-focus/next-steps narrative, mark the deployment-artifacts commitment completed, and append the recent tasks to integrated history.
## Intent And Constraints
- Keep the "image build/push and target-cluster dry-run validation remain" boundary explicit; no production validation is claimed.
- Only canonical documents and the integration task's own record change.
## Outcome
- Added `4a8f2d5` to `Integrated Through` and the artifacts task to `Recently Completed` in `current-state.md`; the first Next step now reads "build and push the image, then dry-run validate manifests on the cluster".
- Updated `system-overview.md` current-architecture paragraph: artifacts are checked in (`backend/Dockerfile`, `deploy/ack/go-api.yaml`, split Ingress); image build/push and cluster validation remain.
- Marked the deployment-artifacts commitment `Completed` in `commitments.md` with the remaining build/push and validation next action.
- Appended `20260814-deploy-model-reconcile-9b4c2e7f`, `20260814-go-bootstrap-admin-6e2b7d9c`, and `20260814-go-deploy-artifacts-2a5f8e1d` to `task-history.md`.
## Verification
- `check_doc_drift.py --task-id 20260814-deploy-artifacts-memory-5e1c3b8a` passes.
- `npm run deploy:check` unaffected (no manifest changes in this task).
## Follow-ups
- Build and push the `zhinian-go-api` image and run `kubectl apply --dry-run=server` on the target cluster (tracked in `commitments.md`).
- Decide whether to delete the deprecated `worker.yaml` and `migration-job.yaml`.
## Promotion Candidates
- None beyond what this integration task already applied.

View File

@@ -8,7 +8,7 @@ Track future-facing memory: promised follow-ups, unfinished loops, timed checks,
| 2026-08-12 | Keep each workload at one replica until generated assets use OSS or another shared store. | Before raising replicas | Deployment owner | Open | Configure and validate external object storage. |
| 2026-08-12 | Harden the runtime image to non-root after writable paths are designed. | Security hardening follow-up | Application owner | Open | Define ownership for runtime and settings paths, then update Docker/ACK security context. |
| 2026-08-12 | Implement ADR-003 only after executable compatibility contracts exist. | Before starting the Go migration | Application owner | Completed | Contracts exist under `contracts/`; Go implementation merged 2026-08-14. |
| 2026-08-14 | Build the Go workload deployment artifacts: container image, ACK Deployment/Service manifests, and Ingress routing that sends page/static paths to Next.js and `/api`, `/uploads`, `/generated-results` to Go. | Before the first production deployment | Application owner | Open | Create the Go Dockerfile, split-topology manifests, and Ingress rules, then validate on a non-production cluster. |
| 2026-08-14 | Build the Go workload deployment artifacts: container image, ACK Deployment/Service manifests, and Ingress routing that sends page/static paths to Next.js and `/api`, `/uploads`, `/generated-results` to Go. | Before the first production deployment | Application owner | Completed | `backend/Dockerfile`, `deploy/ack/go-api.yaml`, and the split Ingress are merged (2026-08-14); remaining work is image build/push and cluster dry-run validation. |
| 2026-08-14 | Initialize the production schema by manually executing `database/migrations/0001_initial_schema.sql`, then `0002_generation_lifecycle_fencing.sql`, then the application-role grants. No migration Job pod is deployed. | Before the first Go/Web rollout | Deployment owner | Open | Run the SQL as the migration role against RDS and verify the application-role grants with the readiness checks. |
| 2026-08-14 | Configure `ZHINIAN_BOOTSTRAP_ADMIN_PHONE` / `ZHINIAN_BOOTSTRAP_ADMIN_PASSWORD` / `ZHINIAN_BOOTSTRAP_ADMIN_NAME` for the first Go startup; the process creates the first super administrator exactly once. | First Go startup | Deployment owner | Open | Provide strong bootstrap credentials through the deployment Secret/ConfigMap. |
| 2026-08-14 | Validate the Go backend against non-production RDS, real OSS, provider credentials, and external Webhooks before the first production rollout. | Before the first production deployment | Deployment owner | Open | Stand up non-production RDS/OSS and run the contract and recovery suites against the Go binary. |