FLT-281 — Quack parameter inlining result¶
Implemented in the existing quack-tls worktree, version 0.1.2. Files only; no staging, commit, push, or .git changes. Local validation passes. EF CRUD against a real Quack 2.0 server remains unverified because no compatible native DLL was available.
Behavior¶
UseQuack now registers a command interceptor. It wraps commands at creation, before EF creates mapped parameters, and rewrites SQL at the actual driver execution boundary for all six sync/async reader, scalar, and nonquery paths. DuckDB receives expanded SQL and an empty parameter collection. The public command retains the original SQL for diagnostics; original parameters and SQL are restored after execution, including failure. This boundary is necessary because EF can log before completion/failure interception callbacks.
The lexer matches complete $name and $1 placeholders. It preserves single-quoted strings, doubled quotes, escaped E'...' strings, quoted identifiers, dollar-quoted strings, line comments, nested block comments, and dollar signs within identifiers. Missing, unused, duplicate, positional ?, malformed, and unsupported parameters fail before command mutation. Inserted literals are never rescanned. SQL text containing NUL is rejected; parameter values containing NUL use the provider's chr(0) literal support.
Mapped parameters retain their original relational mapping. EF has already converted their values, so GenerateProviderValueSqlLiteral invokes the provider's literal generator without applying converters twice. Raw parameters fall back to CLR mappings; null/DBNull become NULL. Quack-created native parameters preserve precision/scale, which the driver's inherited setters otherwise discard. Local bound NUL rejection remains intact.
Driver and deferred reader errors are redacted before EF sees them, including reader advancement, materialization, streams, disposal, and cancellation. Existing ATTACH token/fingerprint redaction remains in place. EF diagnostics contain original parameterized SQL; explicitly enabling EF sensitive-data logging still opts into its normal parameter-value logging.
The tests also exposed an existing raw/interpolated SQL issue: EF's default raw builder used the provider's bare binding name (p0) as SQL. The new provider builder emits $p0 in SQL while keeping p0 for native binding. This correction applies to local and Quack contexts; both modes have executable regression coverage.
Files changed¶
| File | Change |
|---|---|
src/EFCore.DuckDB/Diagnostics/DuckDBQuackCommandInterceptor.cs |
Command wrapper, six execution paths, parameter facets, error redaction |
src/EFCore.DuckDB/Diagnostics/QuackParameterSql.cs |
Lexer, exact binding validation, mapping metadata and literal generation |
src/EFCore.DuckDB/Diagnostics/QuackDataReader.cs |
Deferred reader error redaction |
src/EFCore.DuckDB/Infrastructure/DuckDBDbContextOptionsBuilder.cs |
Automatic Quack-only interceptor registration |
src/EFCore.DuckDB/Storage/DuckDBTypeMapping.cs |
Preserve original mapping; restrict NUL binding exception to local commands |
src/EFCore.DuckDB/Storage/DuckDBRawSqlCommandBuilder.cs |
Separate raw SQL placeholders from native binding names |
src/EFCore.DuckDB/Extensions/DuckDBServiceCollectionExtensions.cs |
Register the raw SQL builder |
src/EFCore.DuckDB/EFCore.DuckDB.csproj |
Version 0.1.2; test assembly internal access |
tests/EFCore.DuckDB.Tests/QuackParameterTests.cs |
Lexer, hostile values, mapping fidelity, local EF CRUD, logging and registration tests |
tests/EFCore.DuckDB.Tests/QuackCommandBoundaryTests.cs |
Actual driver SQL/empty-parameter assertions and deferred error privacy tests |
README.md |
Document Quack inlining, placeholder rules and logging behavior |
QUACK-PARAMS-RESULT.md |
This receipt and handoff |
QUACK-PARAMS-BRIEF.md was pre-existing and was not changed. Local scripts/logs are under the already-ignored artifacts/quack-params/ directory.
Build, test and package receipts¶
| Run | Passed | Failed | Skipped | Total |
|---|---|---|---|---|
| Baseline | 136 | 0 | 1 | 137 |
| Final | 203 | 0 | 1 | 204 |
The unchanged skipped test is QuackTests.Local_quack_attachment_executes_query. The 67 new cases include hostile strings, quotes, backslashes, embedded placeholder text, NUL, Unicode, long strings, byte arrays, Guid, decimal precision, enums/converters, pre-epoch DateTime/DateTimeOffset microsecond flooring, sync/async CRUD, command reuse, cancellation, and logging on success/error. Boundary tests inspect the actual driver command and assert after returning from the redaction wrapper, so swallowed assertion exceptions cannot create false passes.
Initial restore attempts encountered denied access to the user's NuGet config and unavailable NuGet TLS credentials. Successful runs used the existing package cache and an isolated APPDATA directory. Validation ran serially with headless console settings:
set MSBUILDDISABLENODEREUSE=1
set MSBUILDENSURESTDOUTFORTASKPROCESSES=1
set DOTNET_CLI_TELEMETRY_OPTOUT=1
set DOTNET_NOLOGO=1
set VSTEST_HOST_DEBUG=0
set POWERSHELL_UPDATECHECK=Off
set APPDATA=%CD%\artifacts\appdata
set NUGET_PACKAGES=C:\Users\fives\.nuget\packages
dotnet build -c Release -m:1 -p:RestoreConfigFile=NuGet.Config -p:NuGetAudit=false -p:RestoreIgnoreFailedSources=true
dotnet test -c Release -m:1 -p:RestoreConfigFile=NuGet.Config -p:NuGetAudit=false -p:RestoreIgnoreFailedSources=true
dotnet pack -c Release -m:1 -p:RestoreConfigFile=NuGet.Config -p:NuGetAudit=false -p:RestoreIgnoreFailedSources=true
Reproduction script: Validate.cmd. Observed final output:
Build succeeded.
0 Warning(s)
0 Error(s)
Passed! - Failed: 0, Passed: 203, Skipped: 1, Total: 204
Successfully created package 'C:\Users\fives\source\repos\EFCore.DuckDB.wt\quack-tls\src\EFCore.DuckDB\bin\Release\JonesGaffney.EntityFrameworkCore.DuckDB.0.1.2.nupkg'.
Logs: baseline, build, test, pack. git diff --check exited 0 with only the repository's LF-to-CRLF advisory for the project file.
Package: JonesGaffney.EntityFrameworkCore.DuckDB.0.1.2.nupkg. dir observed 69,133 bytes after the final pack.
Real server attempt and limits¶
Ran pwsh -NoProfile -File artifacts/quack-params/Probe-Quack.ps1 (the directory was named .artifacts at execution time). The script starts the CLI hidden, generates a random token into QUACK_TEST_TOKEN at runtime, supplies SQL through stdin, redacts the token before writing output, and stops its local processes afterward. No token literal is stored in a command argument or script. It loads the already-installed extension and uses only 127.0.0.1:18797, with TLS disabled for this isolated loopback check.
Server receipt from C:\Tools\duckdb\2.0.0\duckdb.exe:
version(): v2.0.0
listen_uri: quack://127.0.0.1:18797
listen_url: http://127.0.0.1:18797
auth_token: [REDACTED]
An additional CLI-to-CLI CRUD smoke attempt returned exit 1 with Duplicate key "id: 1" violates primary key constraint. This is recorded as a failed smoke attempt, not successful CRUD or evidence about EF. Sanitized output: e2e.out; script: Probe-Quack.ps1.
Native inventory (Get-ChildItem plus file version inspection) found only duckdb.exe in C:\Tools\duckdb\2.0.0. Cached DuckDB.NET.Bindings.Full/1.5.6.1 Windows native DLLs and worktree test/tool runtime copies report v1.5.6. No compatible 2.0 native DLL was located. Therefore EF UseQuack CRUD against the 2.0 server was not runnable; local native roundtrips and EF CRUD through the same command interceptor provide the available executable evidence. No GCP access was attempted.
Review and outstanding work¶
Independent static review found no high-confidence correctness/security issue; it is not a cross-family council approval. The council-seat Jenny plan invocation failed before seating with fatal: detected dubious ownership in repository. The runner clears inherited Git configuration overrides, and this session cannot change global ownership/configuration or .git. The requested files-only implementation proceeded; Clahadore still owns the commit gate.
Could not do:
- Run real EF
UseQuackCRUD against DuckDB 2.0: compatible native DLL unavailable. - Establish successful CLI-to-CLI CRUD: the extra smoke attempt returned a duplicate-key error; cause not established.
- Obtain the cross-family council gate in this sandbox: runner Git ownership check blocked it.
- Run a fresh NuGet vulnerability audit: restore used cached packages with audit disabled because network authentication failed.
- Commit or push: explicitly reserved for Clahadore by the brief; no Git writes performed.