Skip to content

test: local-bundle cleanup oracle supplies deployment evidence (#3701) - #4222

Closed
Daniel Meppiel (danielmeppiel) wants to merge 3 commits into
mainfrom
danielmeppiel-bundle-cleanup-evidence-test
Closed

Daniel Meppiel (danielmeppiel) wants to merge 3 commits into
mainfrom
danielmeppiel-bundle-cleanup-evidence-test

Conversation

@danielmeppiel

Copy link
Copy Markdown
Collaborator

Description

tests/integration/test_install_local_bundle_e2e.py::TestLocalBundleHashFormatCrossFlow::test_recorded_hash_compares_equal_in_cleanup_provenance_check fails on main. Since #4049, remove_stale_deployed_files requires a keyword-only evidence argument, and this test calls the owner directly without one.

What failed: a stale test caller, not production code. The production local-bundle path (install/local_bundle_handler.py) already passes DeploymentEvidence.collect(...). I scanned every test for calls to owners whose evidence argument has no default (remove_stale_deployed_files, remove_synced_files, sync_remove_files), and this is the only caller missing it.

Fix (test oracle only):

  • First, the test calls cleanup with DeploymentEvidence.none(project) and asserts every bundle file is kept. A lockfile hash alone never deletes (req-lk-024).
  • Then it builds receipts from the digests the bundle install recorded, which models the deploying machine. Cleanup compares that recorded format with compute_file_hash and deletes every unchanged file. This keeps the hash-format contract the test was written to pin (bare hex vs sha256:<hex>, 0.12.0).

Issue and approved scope

Issue: Refs #3701 (Part of #3701)

Human scope-approval comment: #3701 (comment). The 0.37 Stream H lead requested this fix (gate 6, RC validation).

Does this PR complete the issue, or what remains? #4049 already completed the issue. This PR fixes one test oracle.

Type of change

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

Testing

  • Tested locally. Static only (ruff); this host is overloaded. The file runs only in the merge-queue ci-integration workflow, which cannot be dispatched on a branch.
  • All existing tests pass (CI)
  • Added tests for new functionality (if applicable): a req-lk-024 negative assertion in the same test.

Changelog

  • N/A -- internal-only change (CI, tests, refactor).

Spec conformance (OpenAPM v0.1)

  • N/A -- this PR does not change OpenAPM-observable behaviour.

remove_stale_deployed_files requires evidence since #4049 (req-lk-024).
The hash-format oracle now models the deploying machine's receipts with
the digests the bundle install recorded, and asserts that a lockfile
hash alone keeps every file.

Part of #3701

Co-authored-by: copilot-swe-agent[bot] <[email protected]>

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.

🟢 Approval recommended

No active review issues are reported for this test-only update to local-bundle cleanup regression coverage.

No open issues 🎉

What changed in this PR

Updates the local-bundle cleanup regression test to supply the deployment evidence required by #4049, while preserving its hash-format check. This is a test-only fix; production behavior is unchanged.

Changes:

  • Asserts that cleanup preserves bundle files when no deployment evidence is supplied.
  • Supplies simulated receipts using bundle-recorded digests to verify that cleanup deletes unchanged files.
File Description
tests/​integration/​test_install_local_bundle_e2e.py Adds the no-evidence preservation check and receipt-backed cleanup verification.

Review effort: Balanced

@danielmeppiel Daniel Meppiel (danielmeppiel) added the full-integration Run the full integration suite (ci-integration.yml) on this PR before merge label Nov 20, 2026
Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Daniel Meppiel (danielmeppiel) added a commit that referenced this pull request Nov 20, 2026
… cowork oracles

More test doubles for the deletion-evidence API (req-lk-024):
- seed_receipts() records the receipt the installing machine holds, for
  fixtures that forge a lockfile and its deployed files (uninstall of
  agent-skills and grok-bot, the uninstall hook fixture);
- Gemini command and skill syncs supply receipts; skill claims list
  their members as real installs record them;
- the cross-package collision ctx gains apm_dir;
- the local-bundle cleanup oracle supplies evidence (same change as
  #4222);
- the cowork lifecycle case declares its dependency instead of a
  positional github.com package, which validation probes via REST.

Part of #3701

Co-authored-by: copilot-swe-agent[bot] <[email protected]>
@danielmeppiel

Copy link
Copy Markdown
Collaborator Author

Superseded by #4250, which carries the same test update.

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

Labels

full-integration Run the full integration suite (ci-integration.yml) on this PR before merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants