Repository navigation
test: entry_point_privilege gets its pytest twin, every check by the shell's name (#1341) - #1387
Conversation
jdatcmd
left a comment
There was a problem hiding this comment.
The twin is sound and never weaker than the shell. It needs a rebase, and its two premises behave differently in the two twins. Reviewed on PG18 at 522132b.
What works:
- Green: shell 31/31; pytest 32 checks pass;
compare_to_bash: 17 literal + 3 template matches, 0 missing. The names actually run differ only by the pytest-only "premise: the behavioural loop covers the five guarded names". - Red, same names in both twins: I deleted the owner check in
pgcolumnar_vm_is_visible(src/columnar_visibilitymap.c:377) and added an unbucketedzz_unbucketed()to the install script:
FAIL coverage: no entry point is unbucketed: got [ zz_unbucketed] want [none]
FAIL vm_is_visible refuses an unprivileged caller with 42501: got [noerror] want [42501]
That arm's row could be dated rather thannever. - The #1386 gap is reproduced faithfully: a
regclassfunction with no check leaves both twins green.
What to change:
-
Rebase.
check_ledger_budget.txtandexpected_tests.txtconflict with main. Against main today: ceiling 244 → 243, never 1893 + 26 = 1919,cluster_tests539 → 540. Recount if #1364 or #1388 lands first. -
The two premises don't redden the same way in the two twins. Under one mutant (
vm_selftestdeclared(regclass, bigint), plusreconstruct_via_projectionrefusing a superuser):- Shell:
FAIL premise: t_ep now holds EXECUTE, so a refusal below can only be the C check: got [f] want [t]. Its GRANT names a hard-coded signature and discards the error. - pytest: grants on every overload by OID, so that premise stays green. But it fails
premise: the owner can call reconstruct_via_projection, …: got 'broken' want 'ok'. - The shell's owner-call premise can't fail at all:
qends in|| true, soq "$sql" && echo okalways printsok. Under that mutant the server log shows the ERROR and the shell check passes.
Both are product-reddenable, so by #1236 they are controls, not premises. The cleanest fix renames both in both twins. The shell owner call would then go through something that reports failure, e.g.
psql_runwithON_ERROR_STOP, or by checking forERRORin the output. If you'd rather keep this PR a pure port, file the shell half and I'll approve the port once it's rebased. - Shell:
Suspected, not run:
- The file-sibling arms read the first line of combined output in the shell (
2>&1 | head -1), butmessage_primaryin pytest. A NOTICE before the error would make only the shell report "unexpected". - The pytest-only premise checks a constant in the test file, so only an edit to the test can redden it. That's harmless, but it isn't a premise about the system.
…call by exit status, and the owner-call checks lose the premise prefix, in both twins (commandprompt#1387 review) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VjTxfQJj5pnii9wzmPP9Ho
…ted (commandprompt#1387 review) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VjTxfQJj5pnii9wzmPP9Ho
522132b to
5bd00e1
Compare
|
Taken: the two-twins disagreement is fixed in the shell, so I didn't need to file it separately. Now 5bd00e1, rebased on main.
The pytest-only premise ("the behavioural loop covers the five guarded names") stays as it is. You're right that it guards a constant; it's there as the loop's cardinality premise, which the corpus requires. 🤖 Generated with Claude Code |
jdatcmd
left a comment
There was a problem hiding this comment.
Reproduced at 5bd00e1 on PG18. entry_point_privilege is 31/31.
reconstruct_via_projectionrefusing a superuser: 30 + 1,the owner can call reconstruct_via_projection, so a refusal below is a refusal: got [broken] want [ok]. The owner call now reads psql's exit status, so it's no longer vacuous.vm_is_visible's owner check deleted: 30 + 1,vm_is_visible refuses an unprivileged caller with 42501: got [noerror] want [42501].
The EXECUTE grant by OID on every overload makes the two twins' premises agree. Keeping the loop-cardinality premise is fine. Approving. I'll merge once CI is green, after checking the approval is on this head.
🤖 Generated with Claude Code
…shell's name (commandprompt#1341) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VjTxfQJj5pnii9wzmPP9Ho
…and takes section 106 (commandprompt#1341) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VjTxfQJj5pnii9wzmPP9Ho
…dprompt#1341) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VjTxfQJj5pnii9wzmPP9Ho
…call by exit status, and the owner-call checks lose the premise prefix, in both twins (commandprompt#1387 review) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VjTxfQJj5pnii9wzmPP9Ho
…ted (commandprompt#1387 review) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VjTxfQJj5pnii9wzmPP9Ho
5bd00e1 to
de0a5c5
Compare
jdatcmd
left a comment
There was a problem hiding this comment.
Verified de0a5c5 against my approval of 5bd00e1. It sits on current main (b3d81f4), the patch is identical outside the count files, and no main row changes (2584 / 1986, ceiling 240). I'll merge once CI is green.
🤖 Generated with Claude Code
Part of #1341.
entry_point_privilege.sh(#569) gets its pytest twin, with every check under the shell's name, and the suite is seeded into the ledger.The twin keeps the shell's three rules:
prosrcis the C symbol), and the install script's symbols are checked against it as a set.proargtypes[0] = regclass).The deny arms run as a login role that holds EXECUTE on each function, so the C check is the only thing left to refuse it. Two small differences:
regprocedure). The shell's loop grantsget_storage_id(regclass,int), a signature that doesn't exist, and2>/dev/nullhides the error. That's harmless today becauseget_storage_idis PUBLIC-executable, but the twin doesn't copy it.Evidence
Clean: shell 31/31 and pytest passing on each of 15, 16, 17, 18 and 19.
Mutants (PG17), both twins:
get_storage_idwithout its SELECT checkget_storage_id refuses an unprivileged caller with 42501read_projectionwithout its SELECT checkread_projection refuses an unprivileged caller with 42501export_parquetwithout its SELECT checkexport_parquet refuses ... before touching the fileimport_arrowwithout its INSERT checkimport_arrow refuses ... before touching the filecoverage: no entry point is unbucketedBookkeeping
suites_not_covered245 → 244. The gate is clean against origin/main.cluster_tests538 → 539 (collection +1 against main).guard_testsis 429/429.COMPLETE.Rebase note: #1383 also takes §106,
cluster_tests539 and the 245 → 244 ceiling. Whichever lands second gets restated from main.🤖 Generated with Claude Code