Skip to content

fix(cli): validate complete runtime role sets in schema-11 preflight #845

Open

Description

@akrock

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.

Reproduction contract

Please exercise this against a disposable PostgreSQL database with the released provider and CLI artifacts:

  1. Apply the matching provider migrations through schema 11. Provision distinct, restricted login leaf roles and a separate migration owner and retention operator.
  2. Run the released role recipe with the complete reviewed manifest below; retain the same StoreId and runtime epoch.
  3. Run appsurface durable schema preflight --connection-env FORWARDING_RUNTIME_CONNECTION, then repeat using SOURCE_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_only dispatcher 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions