feat: add authoritative verification goal registry revisions - #330
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e87e7b4419
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| public.verification_goal_snapshots | ||
| TO forge_s4_routines_owner; | ||
| --> statement-breakpoint | ||
| SELECT public.forge_begin_epic_172_s4_owner_bootstrap_v1(); |
There was a problem hiding this comment.
Route all upgrades through the 0033 handoff
When a database at 0032 is upgraded through a custom/Docker installation, forge repair, or another documented migration command, those entrypoints still invoke plain npm run db:migrate (scripts/install.sh:1612-1615, scripts/repair.sh:644-648, and scripts/setup.sh:123). The previous protected-migration finalizer revokes the migration login's access to this bootstrap routine, so this unconditional call fails before any 0033 tables are created; only the managed-native installer path restores the grant via apply-verification-goal-registry-migration.sh. Route every supported migration entrypoint through the bounded administrator handoff, or integrate that handoff into the canonical migrator.
Useful? React with 👍 / 👎.
| IF session_user <> 'forge' OR current_user <> 'forge_s4_routines_owner' THEN | ||
| RAISE EXCEPTION 'verification goal registry commit requires the fixed Forge login' | ||
| USING ERRCODE = '42501'; |
There was a problem hiding this comment.
Permit the configured application login to commit revisions
In deployments where the ordinary application login is not literally forge, every registry import is rejected here even if the role is granted EXECUTE. This is a supported configuration: provision-epic-172-application-role.ts:63-76 derives an arbitrary direct application login from FORGE_APPLICATION_DATABASE_URL, and the operator guide uses forge-app as its example. Because the migration also grants this routine only to forge, such deployments cannot use the new import endpoint at all; provision, grant, and validate the actual configured application principal instead of hard-coding the local-install role name.
Useful? React with 👍 / 👎.
Part of #187
What changed
Why
Immutable snapshots alone cannot tell a future runner which complete registry is current. Removed, disabled, or superseded goals could otherwise be selected from history. This slice creates an explicit authoritative head without authorizing execution, queueing, outcomes, or reliability claims.
Validation
Scope boundary
This PR stores and selects authoritative definitions only. It does not run a goal, enqueue work, create evidence, change autonomy, create findings, or repair code. Issue #187 remains open for the later policy, run-ledger, authority, manual-run, history, and scheduling slices.