Skip to content

ci(fleet-search): drift guard for the atlas-search writer copies (#5920) - #6393

Merged
dezren39 merged 1 commit into
mainfrom
queue/10804-5920-fleet-search-parity-guard
Nov 5, 2026
Merged

dezren39 merged 1 commit into
mainfrom
queue/10804-5920-fleet-search-parity-guard

Conversation

@dezren39

@dezren39 dezren39 commented Nov 5, 2026 •

Copy link
Copy Markdown
Member

Fixes #5920 (queue task 10804; triage route from task 10317)

What

The fleet-search copies of atlas-search's pyjson.rs / render.rs writers (#5433 byte-parity contract) had no mechanical drift guard. This adds one, following the repo's existing guard pattern (.github/scripts/check-*.sh + .test.sh + a basic-tier workflow, as in mcpx-fix-test-guard / production-line-guard):

  • .github/scripts/check-fleet-search-parity.sh — for each pair, removes the file's parity header (lines 2–5, directly after the shared first line) and requires the remainders to be byte-identical. The header text itself is pinned in the script: a changed or removed header fails too, and an intentional header change must update the script in the same PR.
  • .github/scripts/check-fleet-search-parity.test.sh — contract tests: verbatim copies pass; body drift in either copy fails; changed fleet header fails; removed atlas header fails; a change mirrored in both copies passes.
  • .github/workflows/fleet-search-parity-guard.yml — new basic-tier workflow (basic: fleet-search pyjson/render parity (#5920)), merge_group + workflow_dispatch, pure bash, runs the contract tests and the guard.
  • Headers — both copies now reference the fleet step 5: search domain joins fleet — gated on #5350 step 6 cutover #5433 contract and the guard: the atlas-search files gain the parity header (source of the verbatim copy; mirror every change there; guard path), and the fleet files gain the guard line under their existing port header. No writer behavior changes.
  • .github/ci-policy.md — documents the guard next to the other basic-tier guards.

Verification

  • Guard on this tree (laptop, base cb8eee8): fleet-search parity: OK.
  • Contract tests: 6/6 pass (listed above).
  • Acceptance: guard fails on any divergence beyond the documented headers ✓; runs in CI on changes via the merge-group basic tier, path scope is the writer pairs themselves (whole-tree check is seconds of bash, same as production-line-guard) ✓; both copies reference fleet step 5: search domain joins fleet — gated on #5350 step 6 cutover #5433 + the guard ✓.

🤖 Queue worker lane code-m, task 10804.


Autofix with [code]smith
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

Summary by CodeRabbit

  • Chores
    • Added automated checks to detect unintended differences between the two search implementations.
    • Added tests that verify the checks pass for matching changes and flag mismatches.
  • Documentation
    • Clarified the parity requirements and how to update them when intentional changes are made.

pkgs/fleet/crates/fleet-search/src/{pyjson,render}.rs are verbatim copies of the atlas-search writers (fleet step 5, #5433) with no mechanical drift guard: a fix to a float-formatting or escaping edge case in one copy would silently break the byte-parity contract.

Add .github/scripts/check-fleet-search-parity.sh: after removing each file's pinned four-line parity header (lines 2-5), both pairs must be byte-identical; a changed or removed header fails too. Contract tests (.test.sh) pin pass/fail shapes: verbatim pass, body drift in either copy fails, changed/removed header fails, mirrored change passes. Wire both into a new basic-tier workflow (fleet-search-parity-guard, merge_group + dispatch, following the mcpx-fix-test-guard / production-line-guard pattern) and document it in .github/ci-policy.md.

Both copies now reference the #5433 contract and the guard: atlas-search files gain the parity header (source of the verbatim copy, mirror changes, guard path), fleet files gain the guard line under their port header. No writer behavior changes.
@dezren39
dezren39 requested a review from a team as a code owner November 5, 2026 22:58
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 5, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-05T23:00:05.465589Z bfbd19e PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@coderabbitai

coderabbitai Bot commented Nov 5, 2026 •

Copy link
Copy Markdown

Explain Change →

Caution

Review failed

The pull request is closed.

Walkthrough

Adds a script that checks parity between the atlas-search and fleet-search pyjson.rs and render.rs files, contract tests for the check, and a workflow that runs both. Documentation identifies the parity contract and its guard.

Changes: Writer parity guard

Layer / File(s) Summary
Parity check and writer contract
.github/scripts/check-fleet-search-parity.sh, pkgs/atlas-search/crates/atlas-search/src/{pyjson.rs,render.rs}, pkgs/fleet/crates/fleet-search/src/{pyjson.rs,render.rs}
The script checks pinned headers and compares each writer pair outside lines 2–5. Module comments identify the parity contract and drift-check script.
Parity guard contract tests
.github/scripts/check-fleet-search-parity.test.sh
Tests pass cases for unchanged and mirrored copies, and failure cases for body drift and header changes.
Workflow and CI policy
.github/workflows/fleet-search-parity-guard.yml, .github/ci-policy.md
The workflow runs the contract tests and parity check for merge-group events or manual dispatch. The policy documents the check and intentional-change requirements.

Estimated code review effort: 2 (Simple) | ~12 minutes

Change: Other · Severity of issue fixed: Low

Possibly related issues

Merge Risk: Low · up to bfbd1

The guard checks parity in the merge queue, but writer changes receive no automatic feedback during pull-request review. Adding that feedback and strengthening the header test are bounded improvements; whether parity failures block merging still needs confirmation.

- [ ] Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@dezren39
dezren39 merged commit 967fb22 into main Nov 5, 2026
1 check failed
@dezren39
dezren39 deleted the queue/10804-5920-fleet-search-parity-guard branch November 5, 2026 23:01
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.

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

1 participant