Skip to content

test: objstore_userinfo gets its pytest twin, every check by the shell's name (#1341) - #1378

Merged
jdatcmd merged 22 commits into
commandprompt:mainfrom
OffgridwithJD:test/1341-objstore-userinfo-twin
Oct 15, 2026
Merged

jdatcmd merged 22 commits into
commandprompt:mainfrom
OffgridwithJD:test/1341-objstore-userinfo-twin

Conversation

@OffgridwithJD

Copy link
Copy Markdown
Collaborator

Part of #1341: the High twin-parity item "userinfo in a caller-written URL is refused (22023) on every path". objstore_userinfo.sh had no pytest twin. test_objstore_userinfo.py is one now, covering all 26 shell checks by name, and it is added to COMPLETE so compare_to_bash holds it there. The existing test_objstore_endpoint_userinfo.py covers the endpoint half independently and says it doesn't pair with the shell, so it's left as it is.

The twin

Three tests: the URL guard, the controls, and the configured-endpoint guard.

  • Each refusal: asserted by SQLSTATE plus whether the primary message names userinfo, the endpoint, AWS_ENDPOINT_URL or AWS_ACCESS_KEY_ID, as the shell's msg_of/msg_has do.
  • The allow-list: set per session (it's superuser-settable), as the endpoint file does.
  • Isolation: nothing reads anything under test/*.sh.

Proof it is a twin, not just a file

The write path's userinfo guard removed (os_write_handle, the shell header's own removal proof). PG17, main 4027b8d against this branch:

shell (main, and this branch) pytest twin
guard removed 24 + 2 failed: "and the export_parquet message names userinfo: got [0]", "export_arrow refuses userinfo…: got [42501]" red at the same check: "and the export_parquet message names userinfo: got 0 want 1"

The export is still refused 22023, by a different guard, so only the message tells the userinfo guard is gone. Both twins see that.

Evidence

🤖 Generated with Claude Code

@jdatcmd jdatcmd left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving 416cf02 on content. Reproduced on PG18.

  • Green: shell 26/26; pytest 3 passed; compare_to_bash: 26 literal matches, 0 missing.
  • Red: with the os_write_handle userinfo guard disabled (objstore/columnar_objstore_module.c:1795, if (false && memchr(…))), both twins fail the same two names:
    FAIL and the export_parquet message names userinfo: got [0] want [1]
    FAIL export_arrow refuses userinfo through the same handle (22023): got [42501] want [22023]

Notes, not blocking:

  • Inherited from main: "export_parquet refuses userinfo (22023, not an allow-list 42501)" stays green with that guard removed, in both twins. The 22023 likely comes from parsing u:p@ as a port (unverified). The suite header's claim that the write arms "read 42501 again" is half true. That belongs on #1339.
  • The twin's "…names no userinfo" controls read only the primary message. The shell greps all of psql's output, including DETAIL and HINT.
  • Unlike #1379 and #1380, this PR seeds no ledger rows.

Before merge: a rebase. TESTS.md §105 is taken on main by test_import_export_privilege.py, and cluster_tests and expected_tests.txt conflict.

@OffgridwithJD

OffgridwithJD commented Oct 15, 2026 •

Copy link
Copy Markdown
Collaborator Author

Rebased onto 57f6e0e (#1401), on top of #1403. The new head is 4799e34. Only the count files changed, so this needs your re-approval.

  • Same patch: outside the count files, the changed lines match the head you approved, except for TESTS.md section renumbers where main's new sections took the old numbers.
  • The ledger is restated on main's census and agrees with its tsv: 2786 rows, 2095 never, 691 dated, read back from the file. Each changed paragraph's arithmetic starts from main's last numbers.
  • cluster_tests 569, by collection over the cluster files on this tree. guard_tests 433 is unchanged.
  • Runs on the rebased tree at 217f23b, PG17 and PG18: PG17 harness_selftest: 1245 passed + 0 failed + 0 unrunnable + 0 skipped; PG17 pytest: 43 passed in 5.82s; PG18 harness_selftest: 1245 passed + 0 failed + 0 unrunnable + 0 skipped; PG18 pytest: 43 passed in 7.68s. harness_selftest 1245/1245 and docs_style passed on both. fix: a read inside an aborted inner block no longer loses the enclosing statement's rows (#1360) #1403 has since changed the write path's subtransaction flush, which every suite here exercises, so I'm re-running them all on 758039f and will post the result. CI runs PG17 and PG18 on this head.

🤖 Generated with Claude Code

@OffgridwithJD

Copy link
Copy Markdown
Collaborator Author

Re-run finished on the tree after #1403 (758039f or later). Everything is green, so the head above stands:

  • PG17 docs_style: passed
  • PG17 harness_selftest: 1245 passed + 0 failed + 0 unrunnable + 0 skipped
  • PG17 pytest: 44 passed in 4.31s
  • PG17 vacuum_lock_privilege: 19 passed + 0 failed + 0 unrunnable + 0 skipped
  • PG18 docs_style: passed
  • PG18 harness_selftest: 1245 passed + 0 failed + 0 unrunnable + 0 skipped
  • PG18 pytest: 44 passed in 4.61s
  • PG18 vacuum_lock_privilege: 19 passed + 0 failed + 0 unrunnable + 0 skipped

🤖 Generated with Claude Code

@OffgridwithJD
OffgridwithJD force-pushed the test/1341-objstore-userinfo-twin branch from 4799e34 to d0febce Compare October 15, 2026 17:06
@OffgridwithJD

Copy link
Copy Markdown
Collaborator Author

Rebased onto 7da848d (#1432, #1409). The new head is d0febce; only the count files changed, so please re-approve this head.

🤖 Generated with Claude Code

@jdatcmd jdatcmd left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re-approved at d0febce. Compared with 416cf02, the head I approved, file by file: the changed lines are the same, apart from the count files (check_ledger_budget.txt, expected_tests.txt) and, in #1378/#1379/#1380/#1383, the TESTS.md section number, now 115.

🤖 Generated with Claude Code

@OffgridwithJD

Copy link
Copy Markdown
Collaborator Author

Rebased onto 1f7b5da (#1411, #1412, #1417, #1418). The new head is 8aa85df. Only the count files changed, plus TESTS.md section numbers where main took 115, so please re-approve this head.

🤖 Generated with Claude Code

@jdatcmd jdatcmd left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re-approved at 8aa85df, the rebase onto 1f7b5da. File by file, the changed lines are the same as the head I approved before, apart from the count files and, in #1378/#1379/#1380/#1383, the TESTS.md section number.

🤖 Generated with Claude Code

@OffgridwithJD

Copy link
Copy Markdown
Collaborator Author

The PG18 re-run on this head (8aa85df, on 1f7b5da with #1412's index-build change) is all green:

  • docs_style: passed
  • harness_selftest: 1245 passed + 0 failed + 0 unrunnable + 0 skipped
  • pytest: 43 passed in 2.30s

🤖 Generated with Claude Code

@OffgridwithJD

Copy link
Copy Markdown
Collaborator Author

Rebased onto 37ea557 (#1414, #1425). The new head is 6e50c49. Only the count files changed, so please re-approve this head.

🤖 Generated with Claude Code

@OffgridwithJD
OffgridwithJD force-pushed the test/1341-objstore-userinfo-twin branch from 8aa85df to 6e50c49 Compare October 15, 2026 18:29
@OffgridwithJD

Copy link
Copy Markdown
Collaborator Author

Rebased onto f2bd5f1 (#1427). The new head is bb6b091. Only the count files changed, so please re-approve this head.

🤖 Generated with Claude Code

@OffgridwithJD
OffgridwithJD force-pushed the test/1341-objstore-userinfo-twin branch from 6e50c49 to bb6b091 Compare October 15, 2026 18:39
@OffgridwithJD
OffgridwithJD force-pushed the test/1341-objstore-userinfo-twin branch from bb6b091 to 0349440 Compare October 15, 2026 19:27
@OffgridwithJD

Copy link
Copy Markdown
Collaborator Author

Rebased onto 2d1a77f (#1413–#1424). The new head is 3671017, so please re-approve this head.

🤖 Generated with Claude Code

@OffgridwithJD
OffgridwithJD force-pushed the test/1341-objstore-userinfo-twin branch from 0349440 to 3671017 Compare October 15, 2026 20:58

@jdatcmd jdatcmd left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re-approved at 3671017, the rebase onto 2d1a77f. File by file, the changed lines are the same as the head I approved before, apart from the count files and the TESTS.md section number.

🤖 Generated with Claude Code

jdatcmd and others added 22 commits October 15, 2026 21:15
…ws are reworded

The mutation column is a ';'-separated set, written back sorted. A --mutation
whose text held "; " was stored as two mutations, one a fragment starting with
a space, and every later merge re-sorted it. commandprompt#1427's recovery_minimal_wal text
did this to 8 rows, and commandprompt#1423, commandprompt#1424 and commandprompt#1426 each carried them as a change of
their own. Four older harness_selftest rows were split the same way.

- merge refuses a --mutation holding ';' (rc 2, ledger untouched).
- the reader refuses a ';'-piece with whitespace at an end, by line: the writer
  joins with a bare ';', so such a piece is a fragment, never a mutation.
- the 12 rows are reworded without ';', from their original text in history.
  Only field 6 changes; the census stays 3007 / 2282 / 725.

Red first: the two refusal arms got 0 want 2 on the unchanged tool, and the
committed-ledger arm was red at line 1783 with the refusal in and the rows not
yet reworded. guard_tests 435 -> 438 by collection.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ment-mark mutation (commandprompt#1341 item 75)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VjTxfQJj5pnii9wzmPP9Ho
…wn privileges, in both twins (commandprompt#1341)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VjTxfQJj5pnii9wzmPP9Ho
…d the refused tier writes no file, in both twins (commandprompt#1341)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VjTxfQJj5pnii9wzmPP9Ho
… back; both its branches echoed "ran" (commandprompt#1341)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VjTxfQJj5pnii9wzmPP9Ho
…nd every owner arm reports a number when refused, in both twins (commandprompt#1341)

A guard widened to refuse the owner stopped the fixture's own export, so a
premise reddened for the product code and the pytest twin crashed in setup
rather than failing an arm by name.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VjTxfQJj5pnii9wzmPP9Ho
…e mutations of the RLS guard (commandprompt#1341)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VjTxfQJj5pnii9wzmPP9Ho
…x, and the twin fails it by name rather than raising (commandprompt#1383 review)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VjTxfQJj5pnii9wzmPP9Ho
…name (commandprompt#1341)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…rompt#1341)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… arm runs with the configured list empty, in both twins (commandprompt#1341)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…n comparing two empty strings (commandprompt#1341)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…d the shell names 'empty' itself (commandprompt#1379 review)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VjTxfQJj5pnii9wzmPP9Ho
…l's name (commandprompt#1341)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@OffgridwithJD

Copy link
Copy Markdown
Collaborator Author

Restated for the chain you asked for. The new head is 3baef6a, so please re-approve this head.

🤖 Generated with Claude Code

@OffgridwithJD
OffgridwithJD force-pushed the test/1341-objstore-userinfo-twin branch from 3671017 to 3baef6a Compare October 15, 2026 21:23

@jdatcmd jdatcmd left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re-approved at 3baef6a, its place in the chain on 17420be. This PR's own commits, measured from the link below it, change the same lines as the head I approved before, apart from the count files and the TESTS.md section number.

🤖 Generated with Claude Code

@jdatcmd
jdatcmd merged commit 532d744 into commandprompt:main Oct 15, 2026
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants