Skip to content

CI contract verification skips sliced PRs (slice-N → work) — contract divergence ships unverified #3040

Closed

Description

@jwbron

Summary

The "egg: Contract Verification" CI workflow (.github/workflows/on-pull-request-contract-verify.yml) does not verify sliced PRs (egg/issue-N/slice-M → egg/issue-N/work) against the SDLC contract. As a result a significant scope change shipped unchecked: slice-2 of #3023 was descoped from 12 tasks to 1 ("slice-2a", PR #3037) during implement, and no CI gate verified the shipped PR against the contract.

Evidence

On slice PR #3037 (egg/issue-3023/slice-2 → egg/issue-3023/work) the contract-verification job skipped:

Check if verification should run     pass      4s
egg-review / Contract Verification   skipping   0

Why it skips: the should-run gate runs verification only when (a) the PR has the sdlc:pr label, or (b) the PR adds a new file under .egg-state/contracts/. Slice PRs carry egg, agent:orchestrator labels (no sdlc:pr), and a slice→work PR does not add a contract file (it already exists on work from the base / an earlier slice). So run=false and the reviewer_contract verification never runs. Both slice PRs here (#3034, #3037) are in this state.

Why it matters

The descope of slice-2 → slice-2a (drop TASK-2-0, defer TASK-2-2…2-11 — the entire OnDemandSpawner) left the shipped PR materially out of sync with the contract's slice-2 task set, and nothing flagged it. build-contract-verification-prompt.sh calls this "the last check before human review" — for sliced pipelines it isn't running at all.

Two gaps to address

  1. Trigger gap (primary, proven): contract verification should run on sliced PRs. Options — detect slice branches (^egg/issue-[0-9]+/slice-) and/or a base of egg/issue-N/work in the should-run gate; or have the orchestrator apply the sdlc:pr label when it opens slice PRs (today it applies agent:<role>).
  2. Contract-location / base-ref gap (surfaces once it runs): even when triggered, verification must (a) locate the contract on a slice→work checkout (egg-contract show reads .egg-state/contracts/{issue}.json — confirm it's present on the slice ref), and (b) use the correct base. build-contract-verification-prompt.sh defaults BASE_REF to main; for a slice→work PR the base is egg/issue-N/work, so the re-review delta (git log … --not origin/${base_ref}) is computed against the wrong base unless the PR's actual base is threaded through.

Repro

  1. Open any sliced PR (egg/issue-N/slice-M → egg/issue-N/work) — the normal case: no sdlc:pr label, no added .egg-state/contracts/ file.
  2. The "egg: Contract Verification" workflow's verify job reports skipping.

Found while reviewing #3023's slice-2a (PR #3037). Related: #3032 (operator observability).

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions