Repository navigation
feat(OMN-16930): derive the tenant_registry_mirror TABLE grant from the released omnimarket contract - #3058
Conversation
…he released omnimarket contract
Leg 3 of the OMN-16804 chain. omnimarket 0.4.12 (tag v0.4.12 -> 4dcd92ee, the
squash of omnimarket#2238) is the first build carrying
node_projection_tenant_registry/contract.yaml, so its db_io.db_tables
declaration of tenant_registry_mirror can now be projected into the shipped
topology TABLE grants.
Regenerated, not hand-listed:
scripts/generate_application_database_table_grants.py --write \
--contracts-root <omnimarket@v0.4.12>/src/omnimarket/nodes
scripts/render_application_database_topology.py --environment <e> \
--output docker/catalog/database-topology/<e>.yaml # all 7
Proof, same invocation CI runs:
grant derivation check: 3 instance(s) in sync
profile={judge,local,onex-dev,onex-prod,prod,stability-test,test}
PASS=54 FAIL=0 RESIDUAL=0 (all seven)
tests/unit/topology: 152 passed
open_obligations is REMOVED, and that is the derivation being honest rather
than a regression
--------------------------------------------------------------------
omnibase_infra#3046 (OMN-17019, merged 03:01:45Z, currently dev tip 3af6898)
added an open_obligations TABLE grant whose source contract is NOT on
omnimarket dev. It landed with the branch escape hatch in its PR body --
`Omnimarket-Source-Ref: jonah/omn-17019-obligation-projection` -- so its own
CI derived grants from omnimarket#2227's UNMERGED branch and passed
legitimately. #2227 is still open and is currently CONFLICTING/DIRTY against
dev.
The consequence is mechanical, not a judgement call: this job runs
`--check --prove` against `.proof-dependencies/omnimarket` at live omnimarket
dev HEAD for any PR without that trailer, and `--check` fails in BOTH
directions. So on dev today the grant set is unreachable for every subsequent
PR -- a regeneration either drops open_obligations or fails the gate. Verified
empirically before touching anything: `--check` on pristine dev HEAD already
reported all three instances drifted.
This commit takes the honest branch. The grants are a projection of MERGED
contracts, per the generator's own docstring ("this script is the only
sanctioned way to write them. Hand-listing is what ADR-0027 exists to
remove"), so a grant no merged contract declares does not survive a
regeneration. Preserving it by hand would be exactly the hand-listing
ADR-0027 removed, and would still fail the gate.
Nothing live breaks: node_projection_open_obligations has no contract on
omnimarket dev, therefore no writer exists to be denied. The vendored
migration docker/migrations/forward/nodes/node_projection_open_obligations/
0001_create_open_obligations.sql is untouched.
When omnimarket#2227 merges, a regeneration re-derives the grant from the
then-merged contract. That regeneration was already required by this gate --
the same `--check` would have failed in the opposite direction (a
contract-declared table with no grant) the moment #2227 landed. Recorded on
#2227 so that lane is not surprised.
Refs: OMN-16930, OMN-16804, OMN-17019
|
Warning Review limit reachedNext included review available in 3 minutes. View limit detailsLimit details: You’ve used the included review currently available. Your 137 included PR review attempts over the past 7 days set your current allowance at 1 review per hour. Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. Review configuration: ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (10)
Comment |
|
OCC autobind did not mint a companion for this PR: no changed-file candidate could be proven RED against the merge base, and emitting a PR-existence probe instead would be non-falsifiable evidence (OMN-15247). Hand-authored evidence is required. |
|
| Verdict | Meaning | Blocks merge? |
|---|---|---|
passed |
No critical findings | No |
blocked |
CRITICAL findings found | Yes |
degraded |
All models unavailable (infra) | No (pilot) |
Powered by omniintelligence.review_pairing.cli_review — multi-model adversarial review (OMN-8468/OMN-8524)
The first body quoted #3046's omnimarket source-ref trailer verbatim inside a fenced block. scripts/resolve_node_migration_source_ref.py matches that field anywhere in the body with no fence tracking, so the PR hijacked its own derivation and CI checked omnimarket out at jonah/omn-17019-obligation-projection instead of dev -- producing a self-inflicted open_obligations failure on a PR whose point is that that contract is not on dev. Body corrected; ci.yml deliberately excludes the 'edited' event (OMN-16171), so a synchronize is the only way to re-derive. Also restores the Evidence-Ticket line the body rewrite dropped.
#7791) * evidence: OCC companion pass 1 for OmniNode-ai/omnibase_infra#3058 * evidence: OCC companion self-bind for #7790 * evidence(OMN-16930): bind OCC companion identity for PR 7790 * evidence(OMN-16930): retarget companion self-bind to PR 7791 --------- Co-authored-by: node-occ-companion-effect <occ-companion-effect@omninode.ai>
…ts contract is on omnimarket dev (#3061) Generated files only. Restores `omninode_internal.open_obligations` to the three topology instances and the seven rendered catalogs, derived from a merged contract rather than preserved by hand. This is the follow-through omnibase_infra#3058 committed to in writing, not a reversal of it. #3058 removed the grant because no MERGED omnimarket contract declared the table -- the declaring node was on the then-open omnimarket#2227 -- and stated: "When omnimarket#2227 merges, a regeneration re-derives the grant from the then-merged contract." omnimarket#2227 has now merged (omnimarket dev `2f123b4c`, "feat(OMN-17019): obligation-kind work events + open-obligations projection (C9)"), so `node_projection_open_obligations/contract.yaml` exists at dev and the derivation picks it up on its own: 68 `db_io.db_tables` declarations, up from the 67 #3058 saw. No supplemental manifest entry was added -- LEGACY_MIGRATION_TABLE_DECLARATIONS is untouched at one entry -- because none is needed once the contract is real. The gate had already flipped direction and was failing in the opposite sense on infra#3057 (a PR touching zero topology files): node_projection_open_obligations: Projection binding 'omninode_runtime_service' principal 'omninode_runtime' lacks declared write privileges: INSERT, SELECT, UPDATE on table omninode_internal.open_obligations [x7 profiles] plus the three instances reported drifted. That is the same repo-wide block OMN-17290 was filed for, now in its second phase: #3058 cleared the granted-but-undeclared direction, this clears the declared-but-ungranted one. This also reconciles the topology with the physical grant that already ships: `0001_create_open_obligations.sql` section 7 issues `GRANT SELECT, INSERT, UPDATE ON omninode_internal.open_obligations TO omninode_runtime` (line 411), which is exactly what `access: write` derives under the OMNINODE_INTERNAL projection binding. Between #3058 and this commit the declared topology and the shipped migration disagreed. Proof -- the exact CI invocation, `--contracts-root` at omnimarket dev `2f123b4c` (the ref the job live-resolves per OMN-15703): scripts/generate_application_database_table_grants.py --check --prove grant derivation check: 3 instance(s) in sync profile=judge/local/onex-dev/onex-prod/prod/stability-test/test PASS=55 FAIL=0 RESIDUAL=0 exit 0 PASS goes 54 -> 55, the one new passing resolution being open_obligations. tests/unit/topology + test_application_database_domain_enforcement.py: 280 passed. Refs: OMN-17290, OMN-17019, OMN-16930
What
Leg 3 of the OMN-16804 chain. Regenerates the application-database
TABLEgrants from node contracts sotenant_registry_mirror— the runtime-populated slug→UUID mirror OMN-16930 introduced — is granted rather than ungranted.omnimarket 0.4.12 (tag
v0.4.12→4dcd92ee5f6a7d21339e0f3d599bc1fe94d357f1, the squash of omnimarket#2238) is the first build carryingnode_projection_tenant_registry/contract.yaml, so itsdb_io.db_tablesdeclaration can now be projected into the shipped topology.Refs: OMN-16930, OMN-16804, OMN-17019
How — regenerated, never hand-listed
Proof — the same invocation CI runs
Forward-proven against the consumer, not just against itself. Re-ran
--check --provewith--contracts-rootpointed at omnimarket#2239's tree (the reader side of this chain, which addsnode_projection_delegation'saccess: readdeclaration of the same relation): 3 instances in sync, PASS=54 FAIL=0 on all seven profiles, 68 declarations loaded. So these grants are already complete for the reader too — no second regeneration is needed when #2239 lands.That forward-proof is what caught a real defect in the reader: #2239 originally declared the relation
schema: public, which has domainPUBLIC, whichtable_grant_derivation.DOMAIN_PROJECTION_BINDINGSdoes not map (onlyTENANTandOMNINODE_INTERNAL), so it derived no binding and therefore no grant — unfixable by regeneration. Corrected there toomninode_internal(omnimarket#2239, commit21ff02a7), matching the owning node and OMN-16930's own classification ruling.open_obligationsis removed, and that is the derivation being honestThis is the one reviewable judgement in the PR, so it is stated plainly rather than buried in the diff.
omnibase_infra#3046 (OMN-17019, merged 03:01:45Z, current dev tip
3af68989b) added anopen_obligationsTABLEgrant whose source contract is not on omnimarketdev. It landed using the branch escape hatch in its PR body:a body trailer naming
jonah/omn-17019-obligation-projectionas the omnimarket source ref,so its own run of this gate derived grants from omnimarket#2227's unmerged branch and passed legitimately. #2227 is still open and currently
CONFLICTING/DIRTYagainst dev.The consequence is mechanical, not a preference. This job runs
--check --proveagainst.proof-dependencies/omnimarketat live omnimarket dev HEAD for any PR without that trailer, and--checkfails in both directions — a contract-declared table with no grant, and a granted table no contract declares. Verified empirically before touching anything:--checkon pristine dev HEAD already reported all three instances drifted.So this branch takes the honest option. Per the generator's own docstring — "this script is the only sanctioned way to write them. Hand-listing is what ADR-0027 exists to remove" — a grant no merged contract declares does not survive a regeneration. Preserving it by hand would be exactly the hand-listing ADR-0027 removed, and would still fail the gate.
Nothing live breaks.
node_projection_open_obligationshas no contract on omnimarket dev, so no writer exists to be denied.docker/migrations/forward/nodes/node_projection_open_obligations/0001_create_open_obligations.sqlis untouched.When omnimarket#2227 merges, a regeneration re-derives the grant from the then-merged contract. That regeneration was already required by this gate regardless of this PR — the same
--checkwould have failed in the opposite direction the moment #2227 landed. Recorded on omnimarket#2227 so that lane is not surprised.Two process observations (neither blocks this PR)
1. The source-ref trailer lets a grant derived from an unmerged branch land on
dev, leavingdevin a state where every subsequent unrelated PR either reverts that grant or fails the gate. Worth making the trailer carry a follow-up obligation rather than leaving the cost to whoever regenerates next.2.
scripts/resolve_node_migration_source_ref.pymatches the trailer anywhere in the PR body, including inside fenced code blocks. The first revision of this very PR body quoted #3046's trailer verbatim in a fenced block to explain it — and thereby hijacked its own derivation, checking omnimarket out atjonah/omn-17019-obligation-projectioninstead ofdev:which produced a confusing, entirely self-inflicted failure (
node_projection_open_obligations ... lacks declared write privileges) on a PR whose whole point is that that contract is not on dev._parse_refdoesline.strip().lower().startswith(prefix)with no fence tracking, so a PR that merely documents the mechanism silently changes its own behaviour. Worth ignoring fenced regions, or requiring the trailer in a trailing block the way git trailers work.Scope
Generated files only — 3 topology instances + 7 rendered catalogs. No source, no migration, no runtime, no lane, no prod contact.
Evidence-Source: OCC#7791
Evidence-Ticket: OMN-16930