Repository navigation
fix(tests): restore release-gate lanes for 0.36.0 - #3723
Conversation
Main's tag-gate lanes (build-release push + manual-build-release) were red on runs 43381609442, 43381682871 and 43394173235. PR CI never runs them. Product regressions (Windows/real installs), fixed: - Hook cleanup removed nothing on Windows: remove_stale_deployed_files looked up recorded hashes with POSIX keys while callers passed native backslash keys, so content proof failed closed (#3672, Refs #3649). - describe_path_obstruction returned None on Windows, which reports a directory-for-file as EACCES and a file-for-parent as ENOENT instead of EISDIR/ENOTDIR (#3709, Refs #3678). - Skill preflight refused claimed members of an unclaimed, populated skill directory that materialization leaves alone, failing a local bundle install (Refs #3625). Stale tests (behaviour changed intentionally), updated: - policy chain mocks now return real PolicyFetchResult (#2933, Refs #2753) - bare-cache/downloader/anonymous-https fixtures use real Git checkouts (#3603, Refs #3457) - mcp install help, registry error wording, deps why -g help (#3633 Refs #3588, #2803 Refs #2478, #3614 Refs #2884) - downloader stub carries carried_licenses (#3646, Refs #3556) - frozen-hash lifecycle uses a generic git host so -g URL validation uses git ls-remote instead of a live api.github.com 404 (#3672) New Windows-shaped regression tests are marked windows_compat. Co-authored-by: Copilot App <[email protected]>
APM Review Panel:
|
| Persona | B | R | N | Takeaway |
|---|---|---|---|---|
| Python Architect | 0 | 2 | 0 | Two follow-ups where one decision is copied into a second place. The EACCES handling is sound. Acceptable for a release fix. |
| Test Coverage Expert | 0 | 0 | 0 | All three regression tests fail on the pre-fix code, no stale-test update weakened its test, and the refusal path is still covered. |
B = blocking-severity findings, R = recommended, N = nits.
Counts are signal strength, not gates. The maintainer ships.
Top 2 follow-ups
- [Python Architect] Extract a
posix_path_key()helper intoutils/paths.pyand use it wheredeployed_file_hashesis written and read, instead of a backslashreplacein each caller. -- This removes a class of Windows-only bugs that fail silently, at their source. - [Python Architect] Extract
is_unclaimed_user_skill_dir()intoskill_support.py, call it from bothskill_preflight.pyandskill_integrator.py, and add a test that the two agree. -- The preflight check and the materialization guard already differ, including for directories claimed earlier in the same run.
Recommendation
Ship now and tag 0.36.0. File the two architecture follow-ups as issues for the 0.37.0 cycle. Neither is a regression introduced by this PR, and the tag cannot ship until these lanes are green.
Full per-persona findings
Python Architect
- [recommended] The backslash normalization in
remove_stale_deployed_fileshappens in the caller; the code that owns path keys should guarantee POSIX keys at the boundary. Atsrc/apm_cli/integration/cleanup.py:363.
"Lockfile path keys use forward slashes" should have one owner, but about 30 call sites already do their ownreplace. This PR adds two more instead of fixing the point where backslash keys enterdeployed_file_hashes. That is pragmatic for a release fix.
Suggested: Aposix_path_key()helper used wheredeployed_file_hashesis written and read, plus a boundary lint against new ad-hocreplacecalls. - [recommended]
user_skill_direxplicitly mirrors the materialization guard. It should live in one shared place to prevent drift. Atsrc/apm_cli/integration/skill_preflight.py:208.
The architecture rules say a second place computing the same decision splits authority. The two checks already differ in structure, and no test checks that they agree.
Suggested: A sharedis_unclaimed_user_skill_dir()inskill_support.pywith a test that the two callers agree.
Test Coverage Expert
No findings.
This panel is advisory. It does not block merge. Re-apply the
panel-review label after addressing feedback to re-run.
Generated by autopilot-pr-review-worker. This comment is AI-generated and may contain errors.
There was a problem hiding this comment.
🟡 Changes recommended
Preflight’s duplicated directory-skip logic uses inconsistent ownership rules, potentially rejecting cross-target skills that native materialization would skip.
1 open issue
What changed in this PR
This PR repairs regressions and stale fixtures behind the 0.36.0 release-gate failures, preserving APM’s existing install and cleanup behavior across platforms.
Changes:
- Normalize cleanup hash paths and recognize Windows path obstructions.
- Align skill preflight with materialization’s handling of unclaimed directories.
- Refresh policy, Git, CLI and lifecycle tests to match current behavior and avoid live GitHub validation.
| File | Description |
|---|---|
tests/unit/integration/test_skill_preflight.py |
Cover claimed members inside unclaimed skill directories. |
tests/unit/integration/test_hook_integrator.py |
Verify cleanup with Windows-style hash keys. |
tests/unit/install/test_obstructed_path_diagnostics.py |
Add Windows obstruction cases and negative controls. |
tests/integration/test_uninstall_policy_pack_flow.py |
Use a real policy result and assert discovery outcomes. |
tests/integration/test_github_downloader_validation_flow.py |
Build committed cache fixtures and reject clone fallback. |
tests/integration/test_git_semver_install_e2e.py |
Add licence records to the download stub. |
tests/integration/test_frozen_deployed_hash_lifecycle.py |
Use a generic host to keep validation local. |
tests/integration/test_deps_why_promises_e2e.py |
Update the global-scope help assertion. |
tests/integration/test_deps_coverage.py |
Verify bare-cache materialization using real Git fixtures. |
tests/integration/test_deep_coverage_deps_policy.py |
Replace a permissive mock with PolicyFetchResult. |
tests/integration/test_config_surface_lifecycle_contract.py |
Assert specific registry diagnostics and parsed URLs. |
tests/integration/test_commands_mcp_flow.py |
Check the forwarded-options help section. |
tests/integration/test_anonymous_https_git_suffix_e2e.py |
Give the clone fixture real Git objects. |
src/apm_cli/utils/file_ops.py |
Recognize Windows directory and parent-path obstructions. |
src/apm_cli/integration/skill_preflight.py |
Skip receipt checks for directories materialization leaves alone. |
src/apm_cli/integration/cleanup.py |
Normalize recorded hash keys and lookups to forward slashes. |
Review effort: Balanced
apm-spec-waiver: restores pre-existing behaviour on Windows and in skill preflight; no OpenAPM-observable change Co-authored-by: Copilot App <[email protected]>

Description
The 0.36.0 tag-gate lanes on main are red: build-release push run 43381682871,
repository_dispatch43381609442 and gate 43394173235. PR CI never runs these lanes (Windows full unit suite, macOS/Linux arm64 full integration suite), so the breakage reached main unseen. This PR restores every failing test. For each one I decided whether the test was stale or the product had regressed.Product regressions (fixed in
src/)test_hook_integrator.py::TestEndToEnd::test_full_hookify_lifecycle,::test_multiple_packages_lifecycle(Windows)remove_stale_deployed_fileslooked up recorded hashes by POSIX path, but on Windows the hashes are keyed with backslashes. The content-hash proof never matched, so cleanup kept every hook file./inintegration/cleanup.pytest_obstructed_path_diagnostics.py(2 tests, Windows)describe_path_obstructiononly recognised POSIXEISDIR/ENOTDIR. Windows raisesEACCESfor a directory in place of a file andENOENTfor a file in place of a parent, so users got the raw OS error instead of "Move it aside".utils/file_ops.py: handle both Windows shapes, gated on the real on-disk obstruction so that a POSIXEACCESorENOENTstill returnsNonetest_local_shared_root_skill_cleanup.py::test_local_bundle_output_survives_an_authored_skill_coming_and_goingapm install <bundle>output), so a valid install failed.integration/skill_preflight.pymirrors that skipStale tests (behavior changed intentionally; updated)
test_deep_coverage_deps_policy.py::...test_discover_policy_with_chain_no_git,test_uninstall_policy_pack_flow.py::...test_local_file_no_extendsMagicMockfetch results inventedancestry_parents/extends/cache_ref; the mocks now return realPolicyFetchResultvalues. A real local file with noextendsand a real 2-level chain were checked against real files.test_deps_coverage.py::TestBareCache::...,test_github_downloader_validation_flow.py(2),test_anonymous_https_git_suffix_e2e.pytest_commands_mcp_flow.py::TestMcpGroupHelp::test_mcp_install_helptest_config_surface_lifecycle_contract.py(2)KeyErrorhid them behind a generic message. Both tests still check that no user state changed, and they reject the old generic message.test_deps_why_promises_e2e.py::test_promise_h_...-ghelp wording changed.test_git_semver_install_e2e.py::...test_invalid_update_preserves_live_hook_and_lockfilecarried_licenses.test_frozen_deployed_hash_lifecycle.py::test_warm_frozen_with_kept_skill_edit_fails_closed[user](macOS x86_64)apm install -g <github.com URL>validated against the liveapi.github.com, which returns 404 for the fixture repo. It passed locally only because the isolated environment cannot reach the API, which is inconclusive and allowed. The test now uses the generic hostgit.example.test, the same approach as #3719, so validation goes throughgit ls-remotewith theinsteadOfrewrite.The new Windows-shaped regression tests carry
windows_compat, so the PR-time Windows gate runs them, and each reproduces the Windows shape on POSIX. No CHANGELOG entry: per the release captain, these are fixes for regressions within the unreleased cycle.Issue and approved scope
Issue: Refs #3649 (umbrella for the #3672 sweep). Also refs #3678, #3625, #2753, #3457, #3588, #2478, #2884 and #3556: the issues of the PRs that broke each test.
Human scope-approval comment: none for this PR. This is a release-blocking repair commissioned by the 0.36.0 coordinator to restore the tag-gate lanes of already-approved work. Each change stays within the scope of the breaking PR's own approved issue.
This PR completes the gate repair. What remains: dispatch
manual-build-releaseafter merge and loop until green.Type of change
Testing
macOS arm64,
APM_E2E_TESTS=1 APM_BINARY_PATH=.venv/bin/apm,-p no:xdist:test_local_shared_root_skill_cleanup.py,test_git_semver_install_e2e.pyandtest_frozen_deployed_hash_lifecycle.py: 55 passed. On unmodified main, the 12 dispatch failures reproduced locally.srcmodules (integration.cleanup,skill_preflight,utils.file_ops),-m "not live": 1478 passed, 3 skipped.--verbose: the github.com URL goes through the GitHub API pre-flight, whilegit.example.testgoes throughgit ls-remote (file) rc=0.ruff checkandruff format --check(0.15.12), pylint R0801,lint-auth-signals.sh, the architecture-boundaries lint and the file-length and ASCII guards all pass.manual-build-releaserun cover real Windows.Spec conformance (OpenAPM v0.1)
docs/src/content/docs/specs/openapm-v0.1.mdupdated(new/changed
<a id="req-XXX"></a>anchor + prose + Appendix Crow).
docs/src/content/docs/specs/manifests/openapm-v0.1.requirements.ymlupdated.
@pytest.mark.req("req-XXX")test undertests/spec_conformance/added or extended.CONFORMANCE.{md,json}regenerated viauv run --extra dev python -m tests.spec_conformance.gen_statementand committed.