Skip to content

docs(openspec): plan #5590 Accept a repaired base test in fail-to-pass - #5596

Merged
dan-petty merged 2 commits into
mainfrom
fix/5590-fail-to-pass-refuses-the-fix
Nov 14, 2026
Merged

dan-petty merged 2 commits into
mainfrom
fix/5590-fail-to-pass-refuses-the-fix

Conversation

@devops-cli-service

Copy link
Copy Markdown
Contributor

Plans #5590

The Fail-to-Pass Check refuses every unchanged test that fails on the merge base, so a change that repairs a red main cannot pass it. The check now replays the changed test files that hold an unchanged failure on the head tree and compares both runs. An unchanged test that fails on base and passes on head is named as repaired and no longer refuses the replay. One that does not pass on head still refuses it, and a head run that cannot run refuses it too. The gate still needs one changed test that fails on base or a gate case that fails on base and passes on head, so a repair alone satisfies nothing. devops ci fail-to-pass --dry-run lists the head replay.

Change: openspec/changes/5590-fail-to-pass-refuses-the-fix/

@devops-cli-service devops-cli-service Bot added type/docs Type docs: a change to the documents scope/openspec OpenSpec changes, specs and their checks labels Nov 14, 2026
@devops-cli-service
devops-cli-service Bot marked this pull request as ready for review November 14, 2026 02:15
@dan-petty

Copy link
Copy Markdown
Owner

An agent vetted this plan before a merge (shepherd, 2026-11-14). Verdict: needs fix. Each point below blocks a correct build.

  1. The planned rule removes almost all of the fix(ci): the fail-to-pass base replay fails every test on the worktree HEAD guard #3124 protection against an unclean replay, and the plan does not say so. Example: a fix changes a shared test file (tests/support or tests/conftest.py) that calls new code under src. On the base tree with the head tests, an unchanged test fails for that cause, and the changed test can fail for the same cause. On the head, both tests pass. The plan calls the unchanged test 'repaired' and accepts the changed failure as proof. Scratch proof, done in a git repo with the current check of main: the report is 'SATISFIED: False', with the unchanged failure tests.test_mod::test_kept ('AttributeError: module pkg.core has no attribute g'). A head pytest run passes test_kept and test_fixed, so the planned rule would accept this replay. Tests & Coverage already fails a pull request whose head fails a test. Thus the remaining rule ('fails on base and on head') almost never refuses in CI. A local fix that needs no network: also replay the unchanged failures on the plain merge base, with no head tests on it. Call a test 'red on main, repaired' only when it fails on the plain base and passes on the head. In the scratch repo, test_kept passes on the plain merge base, so the check would still refuse. In the fix(security): bump helm to 4.3.2 and renew the kubectl Trivy ignores #5584 case, the expired-entry test also fails on the plain base, so the check would accept the repair. Option 2 of the issue (read Tests & Coverage of main) also keeps the protection.
  2. CONTRIBUTING.md:179 (Fail-to-Pass Evidence) becomes wrong, and the plan does not name it. Two sentences become false: 'Every test that fails on the base is one that the fix adds or changes.' and 'A change to a shared file, such as tests/conftest.py or a module of tests/support/, can make an unchanged test fail on the base. Then the replay fails...'. design.md lists the CLI documents that stay unchanged, but it does not list CONTRIBUTING.md (AGENTS.md rule 8).
  3. The spec delta contradicts itself. The MODIFIED requirement 'An unchanged test that still fails on the head refuses the replay' keeps the old scenario 'An unchanged test fails': one changed test and one unchanged test fail on base, so the command exits 1 and says 'fails on base'. The new scenario 'An unchanged test that the head repairs' has the same WHEN, but it exits 0. Also, the plan rewords fail_to_pass_unchanged_failed to name the head, so the old THEN text becomes wrong. Remove the old scenario, or change it to 'and does not pass on the head'. openspec validate --strict does not find this problem.
  4. Two spec scenarios have no failing test in the tasks: 'A named head with an unchanged failure' (the head replay runs in the same worktree as the head gate rows) and 'The default head' (the head replay runs in the working tree and adds no worktree). Task 1.2 names tests only for repair, repair alone, head could not run, and the updated unchanged test. Add a named failing test for each of the two scenarios, for example near test_a_named_head_runs_the_gate_row_in_a_worktree_of_that_head.

Paths that the change must touch and that the plan does not name: CONTRIBUTING.md (line 179, Fail-to-Pass Evidence: two sentences become false), src/devops_cli/lang/en/help.py (fail_to_pass_head: --head help is incomplete; optional, then docs/CLI_REFERENCE.md and docs/commands/ci.md by 'devops docs generate')

Points that do not block:

  • The premise holds. On origin/main (3d6cae6), src/devops_cli/ci/fail_to_pass.py is the same as at the plan base 79eb893. The refusal is at fail_to_pass.py:813 (_unsatisfied_reasons), and run_fail_to_pass replays only on the base tree. fix(security): bump helm to 4.3.2 and renew the kubectl Trivy ignores #5584 merged at 01:16Z, and main is green again, but the gate rule did not change. fix(roadmap): keep no tool versions in runner_tools.py #5585 is open and has a different scope (it scopes the trigger). No newer work replaces fix(ci): fail-to-pass refuses the fix of a red main #5590.
  • The --head help (src/devops_cli/lang/en/help.py:970, fail_to_pass_head) says that the head supplies 'the overlaid tests/ tree and the head tree of a gate row run'. After the change, the head also supplies the head replay. The help becomes incomplete, but it is not wrong. docs/CLI_REFERENCE.md:217 and docs/commands/ci.md come from it. Think about a change to the help text and a run of 'uv run devops docs generate'.
  • Task 1.2 says 'add the head could-not-run branch before the unchanged branch'. Put it after the host path guard branch. In test_a_host_path_guard_message_in_a_replay_failure_refuses_the_replay[call], test_kept is an unchanged failure. Thus the head replay runs, and by default the fake writes no head report. The test asserts that the last line is the guard sentence. Also think about not running the head replay when a guard failure already refuses the replay.
  • The rename of _run_pytest_on_base to _run_pytest_replay is safe. Only replay_on_base in the same module calls it. src/devops_cli/roadmap/implement/implement_base_replay.py uses the public replay_on_base and BaseReplayRun, and these do not change. git grep finds no other reference.
  • The snapshot file tests/ci/snapshots/test_fail_to_pass.ambr holds only base could-not-run reports, and these start no head run. The model_dump assertions use _replay_report, and the plan names it for the new keys. No invariant test lists the record keys of FailToPassReport. The CI workflows need no change: fail-to-pass.yml runs 'devops ci fail-to-pass --base origin/${BASE_REF}' with HEAD, so the head replay uses the working tree, inside the 20-minute job timeout.
  • No model review points are on the PR: it has 0 comments and 0 reviews. The stage comment on fix(ci): fail-to-pass refuses the fix of a red main #5590 lists 2 task groups (39422 and 24937 tokens, for a budget of 64000).
  • Security: the plan touches no security control and no CI threshold. The only relaxation is the gate rule that the issue asks for (see blocking item 1).
  • ASD-STE100: much of the prose is close to STE, but 25 sentences have more than 25 words (the longest has 48 words). Task 1.2 is one very long paragraph. In proposal.md, 'Modified Capabilities' also lists the ADDED requirements as modified.

@dan-petty dan-petty added the verdict/fix-plan Verdict Needs fix of a plan: an open finding keeps the plan in draft until a fix label Nov 14, 2026
@dan-petty

Copy link
Copy Markdown
Owner

An agent vetted this plan before a merge (2026-11-14). Verdict: still needs work.

The proposed implementation in the plan has blocking flaws that compromise quality gates:

  1. Weakens fix(ci): the fail-to-pass base replay fails every test on the worktree HEAD guard #3124 unclean replay protection: Merely verifying that an unchanged test passes on the head does not prove it was broken on main. If a pull request modifies a shared file (such as tests/conftest.py or tests/support/), an unchanged test can fail on the base tree (with overlaid head tests) due to missing code in base src/, and pass on head. The current plan would treat this test as 'repaired' and accept the replay. To preserve fix(ci): the fail-to-pass base replay fails every test on the worktree HEAD guard #3124 protection, the check must also replay unchanged failures on the plain merge base (without overlaid head tests) to confirm they were red on main, or check the commit check runs of main.
  2. Contradictory spec scenarios: In specs/ci-fail-to-pass/spec.md, the modified requirement keeps the old scenario 'An unchanged test fails' (which exits 1) while adding 'An unchanged test that the head repairs' with the identical WHEN condition (exiting 0). The old scenario must be updated (e.g. 'and does not pass on the head') or removed.
  3. Missing test coverage in tasks: The scenarios 'A named head with an unchanged failure' and 'The default head' lack corresponding tests in Task 1.2.
  4. Outdated documentation: CONTRIBUTING.md:179 (Fail-to-Pass Evidence) contains sentences that become inaccurate ('Every test that fails on the base is one that the fix adds or changes' and explanations of changes to shared files), which must be updated in the plan (Rule 8).

@dan-petty
dan-petty force-pushed the fix/5590-fail-to-pass-refuses-the-fix branch from 0b106f7 to fd1e8e8 Compare November 14, 2026 14:40
@dan-petty

Copy link
Copy Markdown
Owner

An agent vetted this plan before a merge (2026-11-14). Verdict: ready.

All shepherd findings have been resolved:

  1. Preserves fix(ci): the fail-to-pass base replay fails every test on the worktree HEAD guard #3124 protection: Replays unchanged failures on both the plain merge base (with no head tests overlaid) and the head tree. A test is classified as repaired only when it fails on the plain merge base and passes on the head; an unchanged test that passes on plain merge base is refused as an unclean replay.
  2. Synchronized documentation: Updated proposal, design, and tasks to update CONTRIBUTING.md:179 (Fail-to-Pass Evidence) and src/devops_cli/lang/en/help.py:970 (fail_to_pass_head), with doc generation.
  3. Consistent spec delta: Updated specs/ci-fail-to-pass/spec.md scenarios so the old conflicting scenario is replaced by distinct scenarios for unrepaired tests and plain merge-base verification.
  4. Complete task test mapping: Explicitly named failing tests in Task 1.2 for test_a_named_head_with_an_unchanged_failure_runs_the_replay_in_a_worktree_of_that_head, test_the_default_head_with_an_unchanged_failure_runs_the_replay_in_the_working_tree, and test_an_unchanged_failure_that_passes_on_the_plain_merge_base_refuses_the_replay.

@dan-petty
dan-petty merged commit 8435876 into main Nov 14, 2026
22 checks passed
@dan-petty
dan-petty deleted the fix/5590-fail-to-pass-refuses-the-fix branch November 14, 2026 14:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

scope/openspec OpenSpec changes, specs and their checks type/docs Type docs: a change to the documents verdict/fix-plan Verdict Needs fix of a plan: an open finding keeps the plan in draft until a fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant