fix(corporate): restore persisted orchestration APIs with code-only Stage CI
Deploy Canina / deploy (push) Successful in 4m39s
Deploy Canina / deploy (push) Successful in 4m39s
This commit is contained in:
1 parent
4d41a5bbf7
commit
85ef01d337
16 files changed
+2832
-1
No files matched your search
@@ -0,0 +1,6 @@
|
||||
# Plan
|
||||
Baseline develop 4d41a5bbf70e9bf9f9ead2412822668998b2c2cf; historical implementation 216e05ba258cf7882350f00da9d9b659885d9816. Restore only corporate policy/service/controller and matching standalone Prisma models, register in AdminModule. Keep existing shared JWT and role guards (admin API-key scope enforced). Restore original regression tests and add module registration gate. No historical migrations applied: existing tables must match generated types read-only.
|
||||
|
||||
Graphify baseline graph SHA256 6a73473cee9e207543fdeeb668bea544f766200a1b16b8a3a9ce18d4e42e51af (4304 nodes, source binding unknown); isolated query returned unrelated review symbols and is navigation only. Direct source establishes AdminModule → controller → service → Prisma, guards → ApiKeysService. No frontend changes. Durable isolated repository /opt/data/engineering/canina-corporate-restoration-repo (metadata .git), official SSH origin.
|
||||
|
||||
Release blocker discovered: current CI deploy.sh resets operational Stage, recreates shared bot and runs migrations. Add a narrow Stage-only early dispatcher using tracked isolated archive and operational Compose override, existing host lock, backend-only build/recreate, no database operations. Main path untouched. Exercise dispatcher regression before modification. Confirm exact pushed SHA/run/image then authenticated existing-record reads; no live lifecycle mutation of publisher tasks.
|
||||
@@ -0,0 +1,27 @@
|
||||
# Restoration review and execution evidence
|
||||
|
||||
## Scope
|
||||
|
||||
Restore historical `216e05ba258cf7882350f00da9d9b659885d9816` corporate policy/controller/service onto develop `4d41a5bbf70e9bf9f9ead2412822668998b2c2cf`. Physical corporate tables already exist: no migration file, SQL deployment, seed, runtime credential change, publication or schedule enablement is included. All lifecycle mutations remain explicit authenticated API operations. Existing PLANNED rows are read, never regenerated.
|
||||
|
||||
## Review
|
||||
|
||||
Self-review only; an independent reviewer is unavailable within this nondelegating leaf task. Reviewed AdminModule registration, authenticated stable actor identity, API-key admin scope guard, strict object input allowlists (Body unknown intentionally delegates to policy), mandatory mutation idempotency, transaction/advisory locks, skip-locked claims, lease fencing, independent exact-artifact review, and completed-QA effect gate. Added production-style ValidationPipe to integration harness to ensure strict global validation does not reject the unknown-body contract.
|
||||
|
||||
Stage rollout uses official develop push CI, commit-pinned script download, and exact origin/develop SHA check. A historical tested shared-daemon lock prefix is retained. Build and recreate target backend_stage only; command is node dist/main.js. Operational Compose/env, frontend, bot, DB, Redis and Production remain untouched. No remove-orphans, migration or seeding commands. Image/container revision labels and immutable source hash manifest establish provenance. Guarded-route readiness is separate from authenticated acceptance.
|
||||
|
||||
## Tests and evidence
|
||||
|
||||
Durable raw logs: `/opt/data/engineering/corporate-restoration-evidence/`.
|
||||
|
||||
- Backend initial full suite: 3 failed, 1 skipped, 85 passed; 4 failed, 17 skipped, 708 passed. Failing files are existing support-chat HTTP/settings/service tests.
|
||||
- Equivalent base full suite with identical resolved dependencies: 3 failed, 84 passed; 4 failed, 701 passed. Same unrelated failures; no claim of full-suite green.
|
||||
- Disposable PostgreSQL 16.14 actual API policy/integration suite: 2 suites, 24 tests passed, including concurrent claims/idempotency/monthly-plan contention and rollback fault injection. Database is loopback corporate_test only, historical corporate DDL fixture only, never runtime DATABASE_URL.
|
||||
- Lock transport suite: 14 tests passed including exact inode contention, lock loss, fail-closed contention, bounded stubborn transport and owned-ID cleanup.
|
||||
- Restoration wiring node tests: 2 passed. Bash syntax and non-CI denial (exit 2) checked.
|
||||
- Backend TypeScript build successful. No frontend changes/build required for backend-only rollout.
|
||||
- Read-only Stage inventory: 107 physical corporate columns with UUID, enum, JSONB, timestamptz, float8 mappings recorded in stage-columns.txt; 42 PLANNED events. No live DDL.
|
||||
|
||||
Graphify existing graph was stale and returned unrelated review nodes; a scoped structural extraction was generated outside Git: graphify-restoration.json, 93 nodes/399 raw edges. Integrity diagnostics report 72 dangling endpoint edges (partial corpus), 3 self-loops, 2 directed pair collapses; graph is navigation only, not proof of completeness. Direct source and executable tests are authoritative. Semantic token use: zero (AST-only extraction).
|
||||
|
||||
Live exact SHA, official CI completion and authenticated reads must be recorded in the external release receipt after push; tests/commit alone are not Stage acceptance.
|
||||
@@ -0,0 +1,5 @@
|
||||
# Existing corporate API restoration — Stage only
|
||||
|
||||
Restore the existing authenticated monthly-roadmap listing, monthly-plan readback, task list/detail and claim → evidence → independent review → effect lifecycle. The existing November roadmap 1c0c4ffb-17d0-48ae-b53e-f0f51bffd1e0 and its 30 article tasks must remain unchanged; never regenerate the plan.
|
||||
|
||||
Acceptance: authenticated reads return existing records; uncredentialed requests fail 401; non-admin scopes fail 403; leases, artifact matching, independent review and idempotency survive restoration. No arbitrary status bypass. No publication, scheduler, credential or Production changes. Code-only Stage CI must not migrate/seed or overwrite operational configuration. PostgreSQL compatibility is required before release; table presence alone is insufficient.
|
||||
@@ -0,0 +1,9 @@
|
||||
# Tasks and consistency check
|
||||
- [x] Read discovery and verify official develop/SSH access; inspect original and deployed contracts.
|
||||
- [x] Scope/spec/plan and graph navigation recorded; no conflicting Production authority.
|
||||
- [ ] RED: existing corporate runtime registration and policy/API regression.
|
||||
- [ ] GREEN: minimal original corporate runtime/models, module registration.
|
||||
- [ ] Typed Stage catalog compatibility and disposable PostgreSQL lifecycle regressions.
|
||||
- [ ] RED/GREEN safe Stage-only CI dispatcher; full backend/build gates.
|
||||
- [ ] Commit/push develop; wait for exact CI completion, immutable image and authenticated reads.
|
||||
- [ ] Receipt with distinct test/CI/live acceptance limitations, no regenerated plan.
|
||||
Reference in new issue
Block a user