test(fuzz): cover native producer boundaries - #22
Conversation
|
I ran a two-round adversarial review of the new fuzz oracles using six independent, persona-inspired review lenses. Each requested item below was reproduced with a temporary local mutation and then challenged by another reviewer. These are harness false positives, not claims that the current production code is broken. Requested before merge1. Exercise the real line policy and validate every publishable result
The wait loop also overwrites each result and validates only the reader-done terminal value. That is observable, not hypothetical: real delayed producers returned growing, publishable Please:
Also narrow the file commentary: NUL-bearing output and nonzero exits become visible failures, while invalid UTF-8 bytes are intentionally retained. 2. Give the ugrep test a positive controlThe fixture writes Please require exit status 0 and the exact normal-file sentinel in both raw stdout and the final candidate list before checking that excluded and NUL-bearing files stayed out. Nonblocking follow-upSeeds 1-10 already reach all ten producer categories, and much of the parser combinatorics exists in fzf-native's ERT/C/session fuzz suites. After the adapter assertions above are explicit, consider keeping a small fzfa boundary matrix and leaving high-volume parser variation to fzf-native. Baseline remained green before mutations: 261/261 fzfa ERT tests and producer runs through 1,000 generated cases. The isolated worktree was restored and verified clean after every probe. |
315f178 to
2052729
Compare
2052729 to
1535033
Compare
|
Phase-two oracle work is now on this branch at The requested findings are addressed:
FZFA-C07 remains partial because the “report once” assertion does not yet have |
What this adds
This is stack PR 2 of 3. It sends generated command output through fzfa and the
real fzf-native 2.7 session API. It also tests the command assembled by
fzfa-ugrep.There are no runtime changes in this PR.
This PR is based on #21. Until #21 merges, GitHub's full diff includes the
earlier state harness. Review this PR's incremental change here:
dangduc/fzfa@codex/fzfa-fuzz-state-models...codex/fzfa-fuzz-native-producers
What one producer case does
Each case starts a real child process, lets fzfa submit and read a real native
request, records every publishable result, waits for the terminal snapshot,
redraws three more times, and stops the source.
Generated byte streams include:
café,你好, and raw invalid UTF-8 bytes;Simple examples
A bad tail must not erase a good prefix
The child writes these bytes:
The expected result is:
validremains available because it was a complete row before the error;abnorlatereaches Emacs as a candidate;the error again.
Every interim and terminal
finalvalue is checked for a proper list ofstrings and for forbidden NULs. A self-test injects a NUL only into an interim
publication, then allows the terminal value to be clean. The oracle must still
reject the run.
A real stream must publish before it finishes
One fixed child process writes:
The harness requires a publishable
("first")observation before the final("first" "second")observation. This checks a growing stream, not only afully buffered process result.
The line limit has three different meanings
For a limit of 4, the fixed rows have lengths 3, 4, and 5:
4: keepaaaandbbbb; excludeccccc.-4: keepaaaandbbbb; truncate the last row tocccc.nil: keep all three rows without a limit.If a case omits
:max-line-length, the harness now preserves the ambient fzfasetting. A controlled mutation recreates the old harness mistake—silently
changing an omitted value to
nil—and must be rejected.The ugrep test needs proof that search worked
The generated directory looks like this:
The test first requires all positive evidence:
normal.txtsentinel; andOnly then does it accept the absence of the excluded Info and EMMS paths as
evidence.
late.binis not an explicit fzfa exclusion: ugrep may omit it asbinary, or the native seam must reject it if its NUL reaches the pipe.
This prevents an empty or unrelated command from passing every negative
assertion.
Oracle qualification
make producer-selftestfirst checks that seeds 1 through 200 reach all tenbyte-stream categories. It then requires five controlled defects to fail:
This qualifies FZFA-C11, C12, and C13 in the contract catalog. C07 remains
partial because its “report exactly once” assertion does not yet have its own
controlled mutation.
CI and local use
Pull requests run 100 generated producer cases. The weekly job runs 1,000. CI
installs ugrep and runs the tool boundary after the producer lane.
Python 3 is required.
make toolsprints a skip when ugrep is not installed.Verification performed
The local tool run skipped because ugrep is not installed. The Linux CI job is
the ugrep execution gate.
Stack