Skip to content

fleet-search: pyjson/render verbatim copies of atlas-search have no drift guard — the byte-parity contract (#5433) is unenforced #5920

Closed

Description

@dezren39

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) and pkgs/fleet/crates/fleet-search/src/pyjson.rs (282 lines) — diff on 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.rs or render.rs in 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

  1. added
    kind/debtTechnical debt worth paying down deliberately
    app/fleetpkgs/fleet multicall binary + platform crates
    on Nov 5, 2026
  2. developing-today commented on Nov 5, 2026

    @developing-today
    Contributor
  3. added
    priority/normalOrdinary priority (the default)
    effort/sSmall: expected under 2 hours of work
    meta/enrichedIntake review done: acceptance criteria, links, and normalized labels added
    on Nov 5, 2026
  4. dezren39 commented on Nov 5, 2026

    @dezren39
    MemberAuthor

    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.

  5. added
    task/triageQueue packet kind: verify, reproduce, and route this item
    work/assignedQueue worker lifecycle state
    queue/claimedQueue worker lifecycle state
    and removed on Nov 5, 2026
  6. 48 remaining items

  7. added and removed
    task/triageQueue packet kind: verify, reproduce, and route this item
    queue/claimedQueue worker lifecycle state
    work/assignedQueue worker lifecycle state
    on Nov 5, 2026
  8. dezren39 commented on Nov 5, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · triaged / follow-up queued

  9. added a commit that references this issue on Nov 5, 2026
  10. dezren39 commented on Nov 5, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · done

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

app/fleetpkgs/fleet multicall binary + platform crateseffort/sSmall: expected under 2 hours of workkind/debtTechnical debt worth paying down deliberatelymeta/enrichedIntake review done: acceptance criteria, links, and normalized labels addedpriority/normalOrdinary priority (the default)status:donetask/small-fixQueue packet kind: bounded fix with reproduction and targeted tests

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions