Skip to content

fix(tests): restore MCP and update-plan CI contracts - #3343

Merged
Daniel Meppiel (danielmeppiel) merged 3 commits into
mainfrom
danielmeppiel-ci-test-contract-repair
Oct 22, 2026
Merged

Daniel Meppiel (danielmeppiel) merged 3 commits into
mainfrom
danielmeppiel-ci-test-contract-repair

Conversation

@danielmeppiel

@danielmeppiel Daniel Meppiel (danielmeppiel) commented Oct 22, 2026 •

Copy link
Copy Markdown
Collaborator

Description

TL;DR

Correct the MCP failed-write test's selected-empty runtime expectation and prove zero durable ownership/hashes. Add five content-hash scenarios to the pure update-plan seam, killing nine genuine surviving mutations. Remap only nine historically equivalent survivor IDs after actual execution; production behavior and CI thresholds are unchanged.

Important

Current head 691f22772c0a68b4719dbac82a3e2c8e563797a6 includes the actual public #3347 scheduling landing cdecf44bfc29d6f1bb3926021081f565d30e1ba1. Fresh local qualification, the hosted CI workflow and required gate passed. Earlier 7246 CI remains cancelled, not retrospectively green. Receipt repairs remain with #3344. No release, tag, version bump, package publication, deployment or full dispatch occurred.

Problem (WHY)

Approach (WHAT)

  • Preserve selected-empty semantics and the original zero-result/error/adapter assertions.
  • Exercise real lockfile serialization and ledger projection for durable non-ownership.
  • Cover content changes independently of ref/commit in the configured pilot seam.
  • Compare semantic diffs, not mutant suffixes, before updating accepted IDs.

Implementation (HOW)

File Change
tests/integration/test_mcp_install_flow.py Correct transient selection oracle; prove no in-memory hashes or persisted ownership/hash/ledger rows.
tests/unit/install/test_plan.py Add, changed, introduced, equal and absent hash cases with full PlanEntry assertions.
tests/mutation/baseline.json Nine-to-nine historical semantic ID remap only.
docs/src/content/docs/contributing/development-guide.md Explain semantic ID comparison and configured test-seam coverage.

Diagrams

Dashed nodes are strengthened test obligations; production flow is unchanged. This unchanged diagram was validated with mmdc.

flowchart LR
    subgraph MCP["MCP failed-write contract"]
        A["Adapter returns false"] --> B["Selected target with zero names"]
        B --> C["update_lockfile filters empty targets"]
        C --> D["Zero durable ownership and hashes"]
    end
    subgraph Plan["Update-plan contract"]
        E["Resolved hash with fixed ref and commit"] --> F["Five action and hash cases"]
        F --> G["Nine genuine mutants killed"]
        G --> H["Nine historical survivor IDs remapped"]
    end
    classDef new stroke-dasharray: 5 5;
    class D,F,G new;
Loading

Trade-offs

  • Preserve the nine equivalent survivors; do not allowlist the nine real hash gaps.
  • Adapter failure is mocked; persistence is real. This is not native-client or successful whole-command evidence.
  • No production, workflow, governance or CHANGELOG change in this carrier. I5 and scheduling repairs were consumed only after public landing; fix(install): retain trustworthy rendered skill receipts #3344 remains separate.

Benefits

  1. The MCP test proves transient selection and durable non-ownership together.
  2. All nine real hash mutants are killed by the configured pilot seam.
  3. Accepted update-plan survivors remain nine with explicit historical correspondence.

Issue and approved scope

Issue: #3342

Human scope-approval comment: No public approval comment is claimed. The responsible human explicitly authorized these bounded CI fixes and waived the issue/public-record prerequisite for this task: "you do it, and do not mandate for these fixes to require an issue and approval, it's not needed. get CI working ASAP". Earlier needs-evidence remains historical; no governance helper, accepted label or policy was changed.

Fixes #3342. Broad daily signal #3341 remains OPEN. The #3339 and I5 implementations are outside this PR.

Type of change

  • Bug fix
  • New feature
  • Documentation
  • Maintenance / refactor

Testing

  • Tested locally
  • All existing tests pass
  • Added tests for new functionality (if applicable)

The full repository/release suite is not claimed green. Public-main composition used both rerere.enabled=false and rerere.autoupdate=false, with no conflicts. The four repair files and full-index delta are byte-identical to the original reviewed repair. Heavy execution used one shared validation slot.

Validation

Current published-head evidence

Evidence at exact 691f227 on public cdecf44 Actual result
uv run --frozen --extra dev python -m pytest tests/integration/test_mcp_install_flow.py tests/unit/install/test_plan.py tests/unit/scripts/test_lifecycle_smoke_sharding.py tests/quality -p no:randomly -p no:cacheprovider -q --basetemp=/Users/danielmeppiel/.copilot/session-state/067b35fc-52fb-4db4-b316-c606d23b4b34/files/3343-cdec-qualified-tmp --junitxml=/Users/danielmeppiel/.copilot/session-state/067b35fc-52fb-4db4-b316-c606d23b4b34/files/3343-cdec-qualified.xml 305 passed, 0 failures/errors/skips, 83.97s; clean exact-head guards before and after.
Full canonical lint/static/quality mirror below Passed at 691f227; original command and terminal exit receipts retained.
Exact-base/head owner proof Full completion schema passed; strict verification returned verified=true, terminal_evidence_required=true, zero touched application owners.
Current-head CI 39776509376 and required gate Success. All 16 CI jobs succeeded: contracts186s/scaling145s/strict aggregate3s; lifecycle237s/397s/aggregate4s; Windows compatibility467s, other Windows/Linux jobs and lint all passed. No borrowed #3347 result.
Mutation-proof input identity All 18 configured pilot source/seam, runner, baseline and dependency files byte-identical to original ccb; no unchanged 552-mutant replay or relabelled execution.
305 passed in 83.97s (0:01:23)

The sole current-head observer completed0; independent REST verification confirmed 26 terminal qualification checks: 23 success, two neutral, one skipped. Actual CodeQL analyses passed; imposed-native CodeQL remains missing/neutral under the existing human exception, not passed. Docs deployment was skipped. Later metadata-only body/comment checks are separate from this captured engineering snapshot.

The first publication guard failed closed because REST .base.sha and GraphQL baseRefOid retained the old 2f comparison snapshot. No push occurred. Independent live baseRef.target, canonical refs/heads/main, ls-remote, qualified ancestry and source-diff guards all agreed on cdec; only then was 691f227 pushed once. The failed equality remains failed.

Historical evidence, not current-head execution

Head / command Actual result
7246 affected/sharding/quality selection 270 passed, 82.75s; full lint passed.
7246 CI 39763302551 Cancelled solely at architecture job 119772530067: 302s, explicit 5m0s maximum. Both lifecycle shards/aggregate, Linux, lint and Windows succeeded.
7246 required gate Success, but architecture was not in EXPECTED_CHECKS; this did not make whole CI pass.
Original ccb: uv run --frozen --extra dev pytest -q tests/integration/test_mcp_install_flow.py::TestExcludeRuntime::test_write_failure_is_explicit_and_does_not_claim_ownership before correction Expected failure: {} versus selected-empty map.
Original ccb: uv run --frozen --extra dev pytest -q tests/integration/test_mcp_install_flow.py tests/unit/install/test_plan.py tests/unit/integration/test_mcp_integrator.py 240 passed; isolated temp/JUnit paths supplied.
Original ccb: uv run --frozen --extra dev python scripts/run_mutation_pilot.py --output <evidence>/3342-pilot-before-id-refresh.json 552 executed, 34 survivors; exit1 only for historical ID mismatch. Nine real hash mutants killed.
Original ccb: uv run --frozen --extra dev python scripts/run_mutation_pilot.py --report-only --output <evidence>/3342-pilot-mapped.json Accepted, exit0, identical actual outcomes; metadata-only, not another execution.
Original ccb: uv run --frozen --extra dev pytest -p no:cacheprovider -q tests/quality 68 passed; isolated temp/JUnit paths supplied.

The old 7246 observer ended124 at its 1800s bound; later REST captured 24 terminal: 20 success, two neutral, one skipped, one cancelled. Its contracts/scaling printed passes but shared one exhausted job budget. Neither old observer timeout nor passing summaries replace the cancelled conclusion.

Original causal proof and current full lint
[+] Mutation pilot report: 552 mutants, 34 survivors, 88.7s runtime
[i] subset-selection: total=144 killed=121 survived=23 timeout=0 suspicious=0
[i] update-plan: total=203 killed=194 survived=9 timeout=0 suspicious=0
[i] policy-serialization: total=139 killed=139 survived=0 timeout=0 suspicious=0
[i] link-projection: total=39 killed=39 survived=0 timeout=0 suspicious=0
[i] lockfile-normalization: total=27 killed=25 survived=2 timeout=0 suspicious=0

Killed hash mutants: 15,16,65,71,92,102,112,128,138. Historical mapping: 26->33,45->53,97->114,121->140,149->168,170->189,178->197,180->199,181->200. These are equivalent optional-attribute defaults, unused display-key arguments or unreachable action-sort fallbacks, not newly accepted behaviors.

Three external in-memory MCP controls (lost selection, false ownership, false hash) each failed the intended assertion; unmodified code passed afterward. No production mutation remains. Root independently checked the committed baseline and semantic-diff correspondence; this is not a new mutation execution.

All commands below passed again at exact 691f227:

uv run --frozen --extra dev ruff check src/ tests/ scripts/lint_architecture_boundaries.py scripts/architecture_linter/ scripts/windows_native_symlink_probe_entry.py
uv run --frozen --extra dev ruff format --check src/ tests/ scripts/lint_architecture_boundaries.py scripts/architecture_linter/ scripts/windows_native_symlink_probe_entry.py
uv run --frozen --extra dev python -m pylint --disable=all --enable=R0801 --min-similarity-lines=10 --fail-on=R0801 src/apm_cli/ scripts/lint_architecture_boundaries.py scripts/architecture_linter/ scripts/windows_native_symlink_probe_entry.py
bash scripts/lint-auth-signals.sh
bash scripts/lint-architecture-boundaries.sh
uv run --frozen python scripts/check_test_assertions.py
uv run --frozen python scripts/check_exact_test_duplicates.py

Ruff: 2087 formatted files; pylint10.00; AQ001=4/AQ002=12; 1411 test files/zero duplicate groups. YAML I/O, portable relative-path and2100-line guards passed via exact portable Python regex equivalents on macOS. The original substantive review carries only through the identical four-path delta, not through borrowed execution.

Scenario Evidence

# Scenario (user promise) Principle(s) Test(s) proving it Type
1 A failed MCP write cannot become recorded ownership or a managed native hash. Secure by default; Multi-harness support tests/integration/test_mcp_install_flow.py::TestExcludeRuntime::test_write_failure_is_explicit_and_does_not_claim_ownership integration
2 Content changes update the plan with unchanged ref/commit; unchanged content stays unchanged. DevX (pragmatic as npm) tests/unit/install/test_plan.py::TestBuildUpdatePlan::test_resolved_content_hash_controls_action_and_is_preserved unit

How to test

  • Run the current published-head pytest command with fresh evidence paths; expect305 passes at 691f227.
  • Run the mutation pilot from the development guide; inspect all surviving transformations, not numeric suffixes alone.
  • Inspect actual current-head job conclusions, not only passing test summaries or the required gate.
  • Keep full-main/nonpublishing release validation separate from this PR's qualification.

Spec conformance (OpenAPM v0.1)

If this PR changes behaviour that an OpenAPM v0.1 req-XXX covers,
confirm the three-step ritual in the
development guide:

  • Spec edit: docs/src/content/docs/specs/openapm-v0.1.md updated
    (new/changed <a id="req-XXX"></a> anchor + prose + Appendix C
    row).
  • Manifest edit: docs/src/content/docs/specs/manifests/openapm-v0.1.requirements.yml
    updated.
  • Test edit: a @pytest.mark.req("req-XXX") test under
    tests/spec_conformance/ added or extended.
  • CONFORMANCE.{md,json} regenerated via
    uv run --extra dev python -m tests.spec_conformance.gen_statement
    and committed.
  • N/A -- this PR does not change OpenAPM-observable behaviour.

Co-authored-by: Copilot [email protected]

Preserve selected-empty MCP targets while proving failed writes create no durable ownership or hashes. Cover resolved content hashes in the pure update-plan seam and remap only the nine historically equivalent survivor IDs after actual mutation execution.

Fixes #3342

Co-authored-by: Copilot App <[email protected]>
Copilot-Session: 067b35fc-52fb-4db4-b316-c606d23b4b34
@danielmeppiel

Copy link
Copy Markdown
Collaborator Author

Docs sync advisory

Verdict: no_change * Pages affected: 0 additional * LLM calls: 1 attempted / 15 * Took: bounded L0 path check

All changed paths are tests or documentation and match the index's no-impact paths; no user-facing source, CLI, schema or API changes. The development guide already includes the related mutation-seam advice.

The delegated classifier could not access the repository. The orchestrator completed and schema-validated the deterministic L0 path check directly; no independent panel result is claimed.


AI-generated advisory; maintainer judgment remains authoritative.

Copilot AI 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.

🔵 Needs a closer look

The nine survivor-ID remappings need independent historical/current mutation-diff verification before approval.

No open issues 🎉

What changed in this PR

This PR addresses the bounded CI test-contract repairs in #3342 without changing production behavior or CI thresholds. It does not resolve the separate deployment-convergence failures or establish full release readiness.

Changes:

  • Correct the failed MCP-write expectation and verify that no ownership or hashes persist.
  • Add five update-plan content-hash scenarios with complete plan-entry assertions.
  • Remap nine accepted mutation survivor IDs and document semantic comparison requirements.
File Description
tests/​unit/​install/​test_plan.py Cover content-hash effects on plan actions and returned state.
tests/​mutation/​baseline.json Replace nine historical survivor IDs with their reported equivalents.
tests/​integration/​test_mcp_install_flow.py Verify selected-empty runtime state and zero durable ownership after write failure.
docs/​src/​content/​docs/​contributing/​development-guide.md Explain survivor-ID comparison and pilot test coverage placement.

Review effort: Balanced

Co-authored-by: Copilot App <[email protected]>
Copilot-Session: 067b35fc-52fb-4db4-b316-c606d23b4b34
Co-authored-by: Copilot App <[email protected]>
Copilot-Session: 067b35fc-52fb-4db4-b316-c606d23b4b34
@danielmeppiel

Daniel Meppiel (danielmeppiel) commented Oct 22, 2026 •

Copy link
Copy Markdown
Collaborator Author

CI recovery qualification

Exact head 691f22772c0a68b4719dbac82a3e2c8e563797a6 includes actual public main cdecf44bfc29d6f1bb3926021081f565d30e1ba1, with both rerere options disabled. The reviewed four-path repair is unchanged.

  • Fresh local qualification: 305 passed, zero failures/errors/skips; full canonical lint passed. All 18 mutation-pilot inputs remain byte-identical; the original 552-mutant execution is historical, not replayed or relabelled.
  • Current CI and required gate succeeded. All 16 CI jobs passed, including both scheduling aggregates and Windows compatibility.
  • Full completion schema and strict owner proof passed: terminal_evidence_required=true, zero touched application owners. No review threads remain.

The earlier 7246 cancellation and failed prepush snapshot-equality guard remain failures; the latter stopped before any push. Independent live branch-reference reconciliation preceded the single authorized push. Actual CodeQL analyses passed; imposed-native CodeQL remains missing/neutral under the existing exception, not passed.

Ready for the exclusive Merge Master's fresh identity and capability checks. Only #3342 is a closing reference. This is not full-main or release-readiness evidence: #3344 remains separate, and no release, deployment or full validation dispatch occurred.

Merge Master delivery assessment: ship_now

After ALL-writes release, MM verified the exact head, actual public main, all 65 sealed artifacts, full completion schema and fresh strict terminal owner-v2 proof. The complete four-path diff and all 18 pilot inputs match the reviewed original bytes; pure current-main compatibility yields tree 227c7ee4925a398465e8e66f3d77f4097d0e07ba.

All six regression cases are individually bound to the fresh 305-pass XML. The actual command receipts establish pytest exit zero and the later terminal lint exit zero; the earlier nonterminal lint return is not treated as completion. Historical mutation outcomes remain identical before and after metadata refresh: 552 mutants, 34 survivors, and all nine genuine hash gaps killed. The three intentional MCP assertion failures and restoration remain separately attributed.

The original Copilot caveat about independent survivor-ID verification is addressed by the retained independent root semantic-mapping review: nine historical-equivalent transformations only, not acceptance of the nine genuine gaps. That review and the substantive coverage review carry through the unchanged diff; no new panel or human approval is claimed. No outstanding in-scope findings remain.

Fresh own-head CI and required gate are complete and successful; all 27 checks are terminal (24 success, two neutral, one skipped). ADMIN and applicable ruleset bypass always are available. The sole closing reference is #3342, whose bounded Done-when is met; #3341, #2070 and #1882 stay open. Missing imposed-native CodeQL remains an exception, not a pass. Final exact-head guards still precede normal merge. Full-main nonpublishing recovery remains open with the existing CI owner.


Generated by autopilot-pr-merge-worker. This comment is AI-generated and may contain errors.

@danielmeppiel
Daniel Meppiel (danielmeppiel) merged commit 5a9eff6 into main Oct 22, 2026
27 checks passed
@danielmeppiel
Daniel Meppiel (danielmeppiel) deleted the danielmeppiel-ci-test-contract-repair branch October 22, 2026 12:32
Daniel Meppiel (danielmeppiel) added a commit that referenced this pull request Oct 22, 2026
Compose landed #3343 without changing receipt production, guards or tests.

Co-authored-by: Copilot App <[email protected]>
Copilot-Session: 13c28cd3-d648-498c-97d8-95dd47e91145
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.

[BUG] Restore CI test contracts for failed MCP writes and update-plan hashes

2 participants