Files
pad/internal
xarmian cc8bf888d2 fix(store,server): close codex round 3 — inspect what is actually bound
Eight findings, four P1. The three parameter ones share a cause: the guard
inspected one value and forwarded another.

[P1] Value() was called for the CHECK and the original driver.Valuer was
forwarded, so pgx called it again — a stateful valuer could show the guard
clean text and the database a NUL. Resolution now happens once and the
resolved value is written back into the argument.

[P1] A typed-nil valuer, (*sql.NullString)(nil), was called directly and
panicked. database/sql special-cases it as SQL NULL; so does the guard now.

[P1] Only an exact `string` was recognised. pgx implements NamedValueChecker
and binds *string, named string types and json.RawMessage unconverted, so each
carried text the guard never saw. Resolution is by reflected KIND now, not by
a list of types.

[P1] Registration opened a probe connection for BOTH drivers, so creating a
SQLite store attempted a live PostgreSQL connection against whatever host the
environment happened to name — network access as a side effect of opening a
local file — and swallowed the error, skipping the guarantees in exactly the
case the check could not run. The assertions moved to connect and prepare
time, where the object being asserted about is the one in hand.

[P2] The statement-interface assertions were claimed in a COMMENT and existed
nowhere. guardStmt forwards neither NamedValueChecker nor ColumnConverter, so
a driver gaining one would silently lose its own argument conversion. Asserted
now, and the parity test covers the statement level too.

[P2] The cross-workspace copy gave a guard refusal its ambiguous
"may or may not have landed" message. That refusal fires at parameter binding,
before any statement executes — nothing landed, and telling the caller to
reconcile invites exactly the manual work DR-13's wording exists to prevent.

[P2] The Valuer integration test passed for the wrong reason by default:
SQLite's driver lacks NamedValueChecker, so database/sql unwrapped the
NullString before the guard ran. The three properties are unit-tested now,
independent of which driver is present. And the NULL control asserted only
that the write succeeded — it reads the row back and asserts SQL NULL, which
an incorrect conversion to "" would otherwise have passed.

Full Go suite green on SQLite and Postgres 17; lint 0 issues.

Claude-Session: https://claude.ai/code/session_01XLtX4dbjBpApbAv3SuBcTm
2026-09-01 14:29:07 +00:00
..
2026-03-26 01:52:36 +00:00