fix(core): stabilize editor lifecycle, transactional versions, and runtime config

This commit is contained in:
greebo
2026-03-20 12:38:10 +03:00
parent 0f9c2a1cbd
commit 239b32a246
17 changed files with 1224 additions and 457 deletions

View File

@@ -17,17 +17,18 @@ export API_URL="http://127.0.0.1:9020"
export API_KEY="admin-local-dev-key"
export SCHEME_ID="82086336d385427f9d56244f9e1dd772"
## Main script
## Main scripts
Primary operator regression:
Primary operator regressions:
`backend/scripts/smoke_regression.sh`
- `backend/scripts/smoke_regression.sh`
- `backend/scripts/editor_mutation_regression.sh`
The script is expected to fail fast on any contract break or unexpected 5xx.
The scripts are expected to fail fast on any contract break or unexpected 5xx.
## 1. Health / system
- GET /healthz -> 200
- GET /healthz -> 200 (smoke uses a bounded retry/wait loop and fails explicitly if the API never becomes ready)
- GET /api/v1/ping -> 200
- GET /api/v1/db/ping -> 200
- GET /api/v1/manifest -> 200
@@ -129,25 +130,33 @@ Validate:
- test seat preview explains selectable / has_price state
- priced test seat amount is serialized as string
## 9. Draft mutations and validation guards
## 9. Draft mutation regression
For current draft version:
Use:
- `backend/scripts/editor_mutation_regression.sh`
- POST /api/v1/schemes/{scheme_id}/draft/sectors -> 200 or 422
- POST /api/v1/schemes/{scheme_id}/draft/groups -> 200 or 422
- PATCH /api/v1/schemes/{scheme_id}/draft/seats/records/{seat_record_id} -> 200 or 422
- POST /api/v1/schemes/{scheme_id}/draft/seats/bulk -> 200 or 422
- POST /api/v1/schemes/{scheme_id}/draft/remap/preview -> 200 or 422
- POST /api/v1/schemes/{scheme_id}/draft/remap/apply -> 200 or 422
- POST /api/v1/schemes/{scheme_id}/draft/repair-references -> 200
This script checks:
- create sector
- create group
- patch seat
- bulk seat update
- patch sector
- patch group
- duplicate entity validation paths
- stale draft conflict
- remap preview validation path
- repair references
- delete created sector/group
- post-mutation read-model consistency
Validate:
- duplicate ids return typed 422
- duplicate element binding returns typed 422
- unknown sector/group references return typed 422
- remap without filters returns typed 422
- created entities are returned by API
- patched draft records are actually changed
- bulk update changes persisted fields
- duplicate ids return 422
- stale expected_scheme_version_id returns typed 409
- published current version rejects draft mutations with typed draft_not_editable conflict
- remap preview without filters returns typed 422
- post-mutation summary / validation / compare-preview remain readable and deterministic
## 10. Draft publish preview
@@ -190,7 +199,9 @@ Validate:
- artifact audit does not report orphan files or missing files for DB rows in normal state
- validation report is readable and deterministic
- pricing cleanup preview returns matched candidates and safe_to_delete_count
- pricing cleanup dry-run returns deleted_count=0 and would_delete_count>0
- pricing cleanup dry-run returns deleted_count=0
- idempotent cleanup is valid in both states: `matched_total=0` with `would_delete_count=0`, or `matched_total>0` with `would_delete_count>0`
- smoke does not require cleanup dry-run to always find something to delete
- admin routes do not produce 500 for healthy scheme state
## 13. Audit trail
@@ -213,6 +224,7 @@ Regression is considered failed if any of the following happen:
- publish readiness returns 500
- editor context or draft ensure returns 500
- draft summary / structure / validation / compare-preview returns 500
- editor mutation regression returns non-zero exit code
- pricing bundle or diagnostics contract changes unexpectedly
- admin audit/cleanup endpoints fail on healthy environment
- pricing cleanup dry-run mutates data
@@ -230,3 +242,4 @@ Run this checklist after:
- draft lifecycle changes
- publish readiness changes
- admin cleanup changes
- editor mutation changes