Skip to content

fix(ci): compare requirements.txt drift against git, not a scratch export - #967

Merged
blove merged 2 commits into
mainfrom
blove/fix-requirements-drift-guard
Sep 2, 2026
Merged

fix(ci): compare requirements.txt drift against git, not a scratch export#967
blove merged 2 commits into
mainfrom
blove/fix-requirements-drift-guard

Conversation

@blove

@blove blove commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Summary

The requirements.txt drift guard added in #966 can never pass, and disagrees with reality in three ways. All lanes that have a requirements.txt currently fail on main and on every open PR: examples/ag-ui — e2e plus the eight Cockpit — e2e (cockpit-*) caps.

1. The header records the -o path. The guard exported to /tmp/requirements.check.txt and diffed that against the checked-in file, but uv stamps the -o path it was given into the export's header comment, so line 2 always differs:

-#    uv export --no-hashes -o requirements.txt
+#    uv export --no-hashes -o /tmp/requirements.check.txt

2. Some lanes export with --no-dev. cockpit/ag-ui/subagents, cockpit/runtimes/aws-strands and cockpit/runtimes/microsoft-agent-framework declare a dev dependency group. The guard always ran a bare --no-hashes export, so it demanded that pytest and pytest-asyncio be committed into the files the Railway images install from.

3. One lane isn't a uv export. cockpit/langgraph/streaming/python/requirements.txt is hand-maintained loose pins (langgraph>=0.2.0, …). The guard would have replaced it wholesale with a 257-line resolved export.

The guard now regenerates in place using the command uv stamps into each file's own header — skipping files that aren't uv exports, and mirroring --no-dev when the header used it — and lets git diff --exit-code compare against the committed file, so real drift is still caught.

aws-strands and microsoft-agent-framework are re-exported so their headers record the --no-dev they were actually built with. Content is byte-identical; the change is one header line each. No package is added to or removed from any deployed image.

Verification

  • Reproduced the false failure locally: the only diff hunk was the header line.
  • Swept all 12 lanes that have a requirements.txt under the new logic — 9 clean, 1 skipped as hand-maintained, 2 corrected here.
  • Mutation probe: committed a deliberately stale ag-ui-protocol==0.1.19, re-ran the guard → exit 1. The guard is not vacuous.

Known gap (not fixed here)

cockpit/langgraph/streaming/python/requirements.txt is now explicitly skipped because it is hand-maintained with >= pins — which is exactly the silent-drift risk the guard exists to prevent. Converting it to a pinned uv export changes what that deployment installs, so it deserves its own PR rather than riding along with a CI fix.

🤖 Generated with Claude Code

…port

The guard added in #966 exports to /tmp/requirements.check.txt and diffs it
against the checked-in file. uv stamps the -o path it was given into the
export's header comment, so the two files differ on line 2 no matter how
fresh the checked-in export is:

    -#    uv export --no-hashes -o requirements.txt
    +#    uv export --no-hashes -o /tmp/requirements.check.txt

Every lane that has a requirements.txt fails: examples/ag-ui e2e and the six
cockpit/ag-ui cockpit e2e caps. Regenerate in place with the exact command the
error message tells you to run, and let `git diff --exit-code` decide — that
compares against the committed file, so real drift is still caught.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Automated approval: this PR received an intelligent (AI) code review. See the review comments on this PR.

@vercel

vercel Bot commented Sep 2, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
threadplane Ready Ready Preview Sep 2, 2026 10:43pm UTC

Request Review

@github-actions

github-actions Bot commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Claude finished @blove's task in 0s —— View job


I'll analyze this and get back to you.

Follow-up to the header fix in this branch. Two more ways the guard disagreed
with reality:

- Three lanes export with --no-dev (their header records it), but the guard
  always ran a bare --no-hashes export, so it demanded that pytest and
  pytest-asyncio be committed into the files the Railway images install from.
- cockpit/langgraph/streaming/python/requirements.txt is hand-maintained loose
  pins, not a uv export at all; the guard would have replaced it wholesale with
  a 257-line resolved export.

The guard now reads the command uv stamps into each file's own header: it skips
files that aren't uv exports, and mirrors --no-dev when the header used it.

aws-strands and microsoft-agent-framework are re-exported so their headers
record the --no-dev they were actually built with. Content is byte-identical —
the change is one header line each, no package added or removed from any image.

Verified across all 12 lanes that have a requirements.txt: 9 clean, 1 skipped
as hand-maintained, 2 corrected here.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Claude finished @blove's task in 0s —— View job


I'll analyze this and get back to you.

@blove
blove merged commit df91042 into main Sep 2, 2026
37 checks passed
@blove
blove deleted the blove/fix-requirements-drift-guard branch September 2, 2026 22:53
blove added a commit that referenced this pull request Sep 3, 2026
…e-export (#970)

#967 re-exported cockpit/runtimes/{aws-strands,microsoft-agent-framework}
requirements.txt so their headers record the --no-dev they were actually built
with. deployments/ag-ui-dev/deps/ is generated from those files, so its copies
still carried the old header and the Railway deploy's drift check failed on
main.

The Deploy AG-UI Railway workflow only runs on push to main, so neither #967
nor #963 exercised this check before merge.

Content is unchanged — two header lines, no package added or removed.

Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
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.

1 participant