Skip to content

Audit: PR1824 payload comparator false equivalences, plus a strict opt-in comparator (no new kappa) - #2040

Merged
Mister-Meeseeks merged 1 commit into
CrocSwap:mainfrom
commdata2338:strict-replay-payload-comparison
Oct 15, 2026
Merged

Mister-Meeseeks merged 1 commit into
CrocSwap:mainfrom
commdata2338:strict-replay-payload-comparison

Conversation

@commdata2338

Copy link
Copy Markdown
Contributor

Change and mathematical scope

PR #1824's reusable payload comparator can classify a changed JSON type, or input keys that collapse into one, as mere formatting or relocation. On the pinned PR1094 final-stage replay corpus, this package reproduces 39 source-bound false equivalences and adds an opt-in comparator that rejects them while keeping valid generated-payload portability.

Status: a scoped audit finding and a verifier tool (verifier-engineering track). This is not a production false acceptance: no wrong mathematics is shown to pass the selected verifier. Frozen predecessors and the selected construction are unchanged; no supplier or κ claim.

The finding: PR #1824's comparator treats 39 mutations as formatting or relocation:

  • 25 Boolean/integer substitutions in three receipts;
  • 12 input-path alias cases (six literal-placeholder replacements and six overwritten-key insertions);
  • one duplicate key;
  • one exact decimal change.

RESULT.json identifies every case by file, typed path, mutated SHA-256 and both classifications.

The tool: research/strict-replay-payload-comparison/ (nine new files) adds a comparator that rejects duplicate and nonfinite JSON, compares exact Decimal values with type tags, maps relocated paths to tagged values that cannot collide with literal placeholders, and masks only explicitly declared timing locations, keeping every other field and every raw digest reference. Its exit status distinguishes equivalent, different and invalid configuration. No frozen caller is rewired.

Positive coverage: all 105 unchanged files, all 22 alternate gzip containers, all 72 plain JSON reformats and a complete six-path, 22-timing relocation fixture are accepted; each of the 22 individual timing-field deletions is rejected.

An observation on Linux: the unmodified PR #1824 verify.py completed the final supplier stage at the selected κ, then failed its expected comparison-count assertion. Its PREFIX-AND-INVOICE.json differed only in object-key order, so its raw hash changed (212cf4ee…0d12 → e3fc03bf…6ca2), and with it the input_sha256/fresh_invoice references in ADMISSION-CONTROLS.json and ASSEMBLY.json. The strict comparator confirms that the complete typed invoice payload is equal and flags both references. Cross-platform byte equality is not claimed, and those bindings are not ignored.

Remaining obligations.

  • Not established: a production false acceptance, the full cold supplier replay, Windows execution, the interpreter matrix, a formal proof of the Python implementation, or any all-size, physical, hosting, precision or analytic discharge.
  • Large generated arrays get complete positive comparison, not exhaustive mutation enumeration. The relocated positive corpus is a constructed transformation of reviewed output. JSON integer versus decimal is deliberately conservative, roots are lexical POSIX prefixes, and timing policies need caller review.

Task and overlap

Validation

python3 -I -B research/strict-replay-payload-comparison/verify.py
python3 -I -O -B research/strict-replay-payload-comparison/test_compare.py
python3 scripts/research_package.py --package research/strict-replay-payload-comparison --check-only
python3 scripts/research_package.py --package research/strict-replay-payload-comparison

Linux x86_64, CPython 3.12.3, standard library. Nine semantic test groups cover numeric types, duplicate and nonfinite JSON, root injectivity and stale paths, exact timing locations, gzip corruption, complete containers, CLI statuses and immutable archive-header rejection. The audit also passed under -I -O -B from a minimal export holding only this package and its six declared inputs, without Git; an exported receipt mutated from integer schema version 1 to Boolean true was rejected (complete audit receipt differs), and a source-header control that preserved the decompressed tar bytes failed the immutable SHA-256 admission. The registered replay was run again on the final package bytes before submission, under an 8 GiB memory cap, and passed.

PASS_STRICT_REPLAY_PAYLOAD_COMPARISON files=105 false_equivalences=39 type_cases=25 path_cases=12 timing_rejections=22 no_new_kappa
PASS_REGISTERED_RESEARCH_PACKAGE research/strict-replay-payload-comparison outcome=completed

Credit

Original source bytes and notices are intact; new work is Apache-2.0.

AI assistance: submitted by @commdata2338 with substantial AI assistance. OpenAI Codex (GPT-6 Astra) did the audit design, the implementation, the experiments, the tests and the writing; it was packaged and submitted with Claude Code. No independent human review is claimed.

Open next questions

From the package README:

  1. Adopt the strict comparator in a future wrapper? That would remove the demonstrated ambiguity. First step: review each caller's intended number, path and time contract, then test that caller with explicit timing paths. Blocker: caller-specific compatibility and source-pin review; adoption is not part of this package.
  2. Bind portable invoice references without ignoring them? The Linux observation shows why formatting-independent payload equality alone is not enough for receipts that contain raw hashes. First step: authenticate both complete invoice payloads and design an explicit reference-rebinding rule. Blocker: preserving that binding across the complete receipt graph; a global log_sha256 or input_sha256 exemption would not.

Workflow feedback (optional)

  • What helped: the card's canonical-payload audit method and the retained replay archive gave a concrete bounded experiment, and the package generator and source-pin checks worked directly.
  • Friction: a first chooser output was lost in a truncated combined tool response before any suggestion was readable, so one recovery draw was needed and is recorded.
  • Suggestion: document saving the chooser output immediately, or add an optional --output argument, so a long orientation response cannot lose the nonce and suggestions.

…mparator

On the pinned PR1094 final-stage replay corpus (105 files), PR CrocSwap#1824's
reusable comparator classifies 39 mutations as mere formatting or
relocation: 25 Boolean/integer substitutions in three receipts, 12
input-path alias cases, one duplicate key and one exact decimal change.
A new opt-in comparator (typed exact JSON, injective tagged paths,
explicitly declared timing fields) rejects all 39 and still accepts the
105 unchanged files, 22 recompressions, 72 reformats and a complete valid
relocation fixture. No frozen caller is rewired; no kappa claim.

Adds research/strict-replay-payload-comparison/ only.

Submitted by @commdata2338 with substantial AI assistance (OpenAI Codex
research and implementation; packaged with Claude Code).
@ywz65

ywz65 commented Oct 15, 2026

Copy link
Copy Markdown
Contributor

CLAIM — strict payload comparator paired traversal (ywz65, N014). Canonical main 8513ab1, priority revision5; picker7b211647cc73d979992dbe2661a5d40f selected verifier-engineering/replay-runtime and baseline binding passed. I am testing an opt-in source-authenticated successor to PR2040 strict-replay-payload-comparison: compare parsed JSON by a paired typed traversal on positive cases, avoiding two complete tagged-tree allocations. Keep duplicate-key rejection, exact Decimal versus integer/Boolean distinctions, injective root tags, full explicit timing validation and original fallback diagnostics. Initial five large frozen payload measurements show the paired traversal itself faster; acceptance requires complete105-file retained corpus and39 adverse witnesses, new masking/type/collision controls, exact full-result differential checks, measured end-to-end timings and invalidation. No source mutation, cache-based acceptance, cold supplier replay or new kappa. PR2344 Windows path adaptation is separate and not replaced. Complete780-open-PR snapshot17:19UTC plus local notes inspected; Discussion snapshot15:22UTC is stale because GraphQL quota is exhausted. Stop if semantic differences or no useful full-call speedup. Substantial OpenAI Codex assistance.

@ywz65

ywz65 commented Oct 15, 2026

Copy link
Copy Markdown
Contributor

DONE — opt-in paired traversal submitted as PR2693 at5793ceb2006cc5c4939fd2a80886b54ab119bc4f from ywz65. The full1012-call differential replay preserves the retained105-file39-adverse audit and complete negative diagnostics;15testgroups,3.12registered and3.14Git-free/read-only checks pass. Five largest compressed JSON full-call benchmarks gave aggregate median2.447x, with machine-dependent timings and slower mismatch fallback explicitly noted. PR2040 source and default callers remain unchanged; credit retained. No supplier replay or new kappa.

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.

3 participants