Repository navigation
Description
AppSurface 0.2.0-preview.11 supports reconciling multiple PostgreSQL runtime/dispatcher pairs, but its schema-11 structural preflight still requires exactly one runtime principal. A valid two-pair catalog cannot complete the documented pre-activation upgrade gate.
This is a follow-up to #823 and its implementation in #826, and to the heartbeat-retention work in #795. Both issues are closed. The released documentation still explicitly identifies this integration as unfinished.
Released-source evidence
Version: v0.2.0-preview.11, commit 8c1086ddbcb96d846281b856f5862c86082c412a.
- The role recipe contract accepts a complete version-1 manifest of 1–32 pairs, including a forwarding
fullpair and a Sourcework_onlypair. - The released recipe targets the heartbeat runtime policy at the complete runtime set, and grants heartbeat pruning to all manifest runtimes.
- In
DurableSchemaCommand.cs, theruntime_roleCTE excludes policies unlesscardinality(policy.polroles) = 1. The checks also require one runtime, a single-role heartbeat policy, and pruning EXECUTE grants limited to the owner plus that one runtime. Relaxing only the CTE would leave the policy and ACL checks incompatible. - The released README explicitly records the two-pair rejection. The schema-11 operations guide requires passing restricted-runtime preflight after migrations and role reconciliation, before activation.
Reproduction contract
Please exercise this against a disposable PostgreSQL database with the released provider and CLI artifacts:
- Apply the matching provider migrations through schema 11. Provision distinct, restricted login leaf roles and a separate migration owner and retention operator.
- Run the released role recipe with the complete reviewed manifest below; retain the same StoreId and runtime epoch.
- Run
appsurface durable schema preflight --connection-env FORWARDING_RUNTIME_CONNECTION, then repeat usingSOURCE_RUNTIME_CONNECTION.
{
"version": 1,
"pairs": [
{ "dispatcher": "forwarding_dispatcher", "runtime": "forwarding_runtime", "dispatcher_profile": "full" },
{ "dispatcher": "source_dispatcher", "runtime": "source_runtime", "dispatcher_profile": "work_only" }
]
}Expected: preflight passes the correctly reconciled two-pair catalog and continues to reject privilege or structural drift. Current source rejects the complete runtime policy and its legitimate pruning grants. Changing the connection role does not change that catalog.
Evidence level: tagged source and the release's explicit documented limitation. We have not run this reproduction against a live deployment, and are not reporting a captured production preflight failure.
Consumer impact
Skoolit #659 needs a second restricted Source lifecycle pair on the existing forwarding store. This prevents completing supported multi-pair schema-11 upgrade/enrollment evidence and activation. It also affects an upgrade of any store that already has multiple pairs. A one-pair store can still use the documented maintenance upgrade. Passing application builds and schema-version checks does not establish this structural gate.
Requested acceptance criteria
- Define how preflight receives or matches the reviewed manifest, and validate the exact complete runtime set. Reject missing or extra principals, aliases, and privilege drift; do not merely accept any nonempty set.
- Verify pruning EXECUTE for every reviewed runtime without grant option, and reject PUBLIC, dispatcher, or unreviewed grants. Preserve the existing leaf-role restrictions, ownership, forced RLS, security-definer/search-path, direct DELETE/TRUNCATE denial, and index checks.
- Add released-artifact disposable-database proof for one pair, second-pair enrollment, identical recipe rerun, and a schema-10-to-11 upgrade with two installed pairs. Prove the established forwarding lane still executes and the
work_onlydispatcher retains its restricted boundary. Cover both runtime credentials and negative policy/ACL drift cases. - Publish matching CLI/provider/documentation guidance that permits the complete multi-pair upgrade gate. Removing installed pairs or bypassing preflight is not an acceptable workaround.
Related diagnostics work: #801. This report concerns the existing structural preflight required for schema-11 activation, rather than adding a general runtime doctor.
Activity
fix(testing): observe PostgreSQL backend exit on rejected preflight
chore: merge main into evidence readiness branch