Repository navigation
Description
Finding
The Python-compatible JSON/text writers that define atlas-search's output-parity contract exist as two verbatim copies with no mechanical drift guard:
pkgs/atlas-search/crates/atlas-search/src/pyjson.rs(279 lines) andpkgs/fleet/crates/fleet-search/src/pyjson.rs(282 lines) —diffon main 83f78ed (2026-11-05) shows the ONLY difference is fleet-search's 3-line header comment ("Ported verbatim from pkgs/atlas-search's bin crate in fleet step 5 (fleet step 5: search domain joins fleet — gated on #5350 step 6 cutover #5433)").- Same for
render.rs: atlas-search 187 lines vs fleet-search 190 lines, diff is only the header comment.
The port is deliberate and documented (#5433): the fleet verb must render service envelopes byte-identically to atlas-search. But nothing enforces that after the port — pkgs/fleet/crates/fleet-search/ has no tests/ directory, and no test or CI step compares the two copies or renders the same envelope through both binaries. A future fix to a float-formatting or escaping edge case in one copy (the exact class of bug these hand-rolled writers exist to control — CPython repr semantics in the small-value range) will silently break the byte-parity contract the port was created to guarantee.
Why it matters
Output parity is a stated contract ("the output-parity contract lives in these writers", pyjson.rs module doc). Unenforced verbatim copies drift; the failure mode is subtle stdout differences between the atlas-search binary and the fleet verb, found by users rather than CI.
Suggested fix shape
Direction only, pick one: (a) extract the two modules into a small shared crate both binaries depend on; (b) add a cheap CI/repo check that diffs the two copies modulo the header comment; or (c) a cross-binary parity test rendering a fixed envelope corpus through both writers. (b) is the smallest step that makes drift loud.
Evidence
Verified 2026-11-05 on main 83f78ed: diff of both file pairs (4 diff lines each, header only), ls pkgs/fleet/crates/fleet-search/ (Cargo.toml + src only, no tests/).
Filed by the Scheduled Suggestions pass, tracking issue #5648 (task 9736).
Acceptance criteria
- A mechanical drift guard (CI check or test) fails when
pyjson.rsorrender.rsin atlas-search and fleet-search diverge by anything beyond the documented header comment. - The guard runs in an existing CI workflow on changes to either copy.
- Both copies reference the fleet step 5: search domain joins fleet — gated on #5350 step 6 cutover #5433 byte-parity contract and the guard, so the next porter finds the rule where the code is.
Activity
developing-today commentedon Nov 5, 2026
CODE-1599
dezren39 commentedon Nov 5, 2026
Intake review
Related: Contract origin: #5433 (fleet step 5 port). Copies verified byte-identical except headers on main 83f78ed (2026-11-05) — the guard lands while they still agree.
Still-live check: searched merged PRs referencing this issue at 2026-11-05T04:31:57Z — none found; the issue stands as filed.
Notes / risks: An over-strict guard (raw diff) will false-positive on the header comment; an over-loose one (hash of behaviour) misses format drift. The comparison must be exactly 'equal after header strip'.
Suggested approach: Small script/test that strips the known header block from each file and diffs the remainder; wire it into the workflow that already builds either crate.
Acceptance criteria were appended to the issue body and labels normalised by the fleet monitor's intake pass.
48 remaining items
dezren39 commentedon Nov 5, 2026
🤖 Agent note · triaged / follow-up queued
cb8eee8d680be82b0eb4ba9e783206495e98c7e5.repo-health-code-pilotto add the exact-header parity guard, PR-CI coverage, and focused drift tests.Merge pull request #6393 from developing-today/queue/10804-5920-fleet…
dezren39 commentedon Nov 5, 2026
🤖 Agent note · done
pyjson.rs+render.rsverbatim copies (fleet step 5: search domain joins fleet — gated on #5350 step 6 cutover #5433 byte-parity contract)..github/scripts/check-fleet-search-parity.sh(byte-compare outside the pinned 4-line parity headers; changed/removed header also fails), contract tests.github/scripts/check-fleet-search-parity.test.sh(6/6 pass: verbatim pass, body drift in either copy fails, changed/removed header fails, mirrored change passes), basic-tier workflow.github/workflows/fleet-search-parity-guard.yml, ci-policy documentation, and parity headers cross-referencing fleet step 5: search domain joins fleet — gated on #5350 step 6 cutover #5433 + the guard in all four writer files. No writer behavior changes.