Skip to content

test(install): align shared-file ownership expectation#2120

Merged
danielmeppiel merged 4 commits into
mainfrom
danielmeppiel-release-v0-25-prep
Jul 10, 2026
Merged

test(install): align shared-file ownership expectation#2120
danielmeppiel merged 4 commits into
mainfrom
danielmeppiel-release-v0-25-prep

Conversation

@danielmeppiel

Copy link
Copy Markdown
Collaborator

fix(release): align shared-file cleanup test with single-owner lockfiles

TL;DR

The v0.24.1 tag workflow exposed a stale integration assertion: the test still expected two packages to claim one deployed path, although #2052 intentionally made ownership single-writer. This PR requires pkg-b, the last writer, to be the sole lockfile owner while preserving the existing cleanup behavior checks. The correction unblocks release validation without changing production behavior.

Important

This is the deterministic failure from v0.24.1 release run 29093268394; no GitHub Release or PyPI publication occurred.

Problem (WHY)

Why this matters: release evidence must match the shipped lockfile contract. "Grounding outputs in deterministic tool execution transforms probabilistic generation into verifiable action."

Approach (WHAT)

# Fix Principle Source
1 Require the shared prompt's owner-name set to equal {"pkg-b"}. Governed by policy #2052
2 Keep the subsequent reinstall and stale-file cleanup assertions unchanged. DevX (pragmatic as npm) test_intra_package_cleanup.py

Implementation (HOW)

  • tests/integration/test_intra_package_cleanup.py -- replaces the obsolete duplicate-owner count with an exact assertion that pkg-b, the last writer in the manifest order, is the only package claiming the shared prompt. Production lockfile and cleanup code are deliberately untouched.

Diagrams

Legend: the dashed node is the corrected assertion; the install and cleanup flow remains unchanged.

flowchart LR
    subgraph Install[Initial install]
        A[pkg-a writes shared prompt]
        B[pkg-b writes shared prompt]
    end
    subgraph Lockfile[Lockfile reconciliation]
        C[Last writer owns path]
    end
    subgraph Test[Integration assertion]
        D["Owner names equal pkg-b"]
        E[Remove pkg-a prompts]
        F[Shared survives and only-a is removed]
    end
    A --> C
    B --> C
    C --> D
    D --> E
    E --> F
    classDef new stroke-dasharray: 5 5;
    class D new;
Loading

Trade-offs

  • Correct the test, not production. Chose to align the assertion with fix(skills): key ownership tracking on owner/repo, not the leaf directory name #2052's single-owner contract; rejected restoring duplicate ownership because that would reintroduce stale lockfile claims.
  • Retain end-to-end coverage. Chose an exact owner-name assertion and the existing real CLI reinstall; rejected mocking reconciliation because it would weaken the release-boundary regression test.

Benefits

  1. All three release jobs that hit this assertion can evaluate the intended single-owner contract.
  2. The test now verifies exactly one owner, pkg-b, rather than only checking a count.
  3. The cleanup regression still proves the shared prompt survives while the unclaimed only-a prompt is removed.

Validation

uv run --extra dev pytest -q tests/integration/test_intra_package_cleanup.py::TestCrossPackageSharedFileCleanup::test_shared_file_survives_when_other_package_still_deploys_it:

.                                                                        [100%]
1 passed in 2.09s

uv run --extra dev pytest -q tests/integration/test_intra_package_cleanup.py:

...                                                                      [100%]
3 passed in 4.14s
CI lint mirror

.agents/skills/cut-release/scripts/verify-lint-mirror.sh:

ruff check                     PASS
ruff format --check            PASS
pylint R0801 duplication       PASS
auth-signals boundary          PASS
all lint-mirror checks PASSED

Scenario Evidence

# Scenario (user promise) Principle(s) Test(s) proving it Type
1 When two packages deploy the same prompt, the last writer is the sole recorded owner and its file survives another package dropping its copy. Governed by policy, DevX (pragmatic as npm) tests/integration/test_intra_package_cleanup.py::TestCrossPackageSharedFileCleanup::test_shared_file_survives_when_other_package_still_deploys_it (regression-trap for release run 29093268394) integration

How to test

  • Run the targeted cross-package cleanup test; observe one pass.
  • Run the complete test_intra_package_cleanup.py file; observe three passes.
  • Run the CI lint mirror; observe all four gates pass.
  • Re-run the tag workflow after merge; observe Release Validation and publication jobs proceed.

Co-authored-by: Copilot 223556219+Copilot@users.noreply.github.com

danielmeppiel and others added 4 commits July 10, 2026 08:05
Bump pyproject.toml and uv.lock to 0.24.1 and move the [Unreleased] CHANGELOG block to [0.24.1] - 2026-07-10. PATCH bump: 13 user-facing fixes since v0.24.0 with no new public surface or BREAKING changes. Lint mirror green locally (ruff check + format, pylint R0801, auth-signals).

Post-merge: tag v0.24.1 to trigger the release workflow.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Use pytest temporary directories for the four default-policy MCP integration cases so subprocess policy discovery receives a valid working directory on Windows as well as POSIX.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Update the cross-package cleanup integration test for the single last-writer ownership contract introduced by #2052, unblocking tagged release validation.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings July 10, 2026 13:08
@danielmeppiel

Copy link
Copy Markdown
Collaborator Author

Docs sync advisory

Verdict: no_change * Pages affected: 0 * LLM calls: 0/15 * Took: <1s

No docs impact detected. Reason: L0 path gate matched a test-only change under tests/**; no user-observable command, schema, authentication, policy, or primitive format changed.

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.

Pull request overview

Updates an integration regression test to match the post-#2052 lockfile contract where cross-package shared deployed paths are reconciled to a single (last-writer) owner, aligning release validation expectations without changing production behavior.

Changes:

  • Replace the stale “two packages claim shared file” assertion with an ownership assertion aligned to single-writer reconciliation.
Show a summary per file
File Description
tests/integration/test_intra_package_cleanup.py Updates the shared-file ownership assertion to reflect single-owner lockfile reconciliation behavior.

Review details

  • Files reviewed: 1/1 changed files
  • Comments generated: 1
  • Review effort level: Low

Comment on lines +283 to 285
assert {dep["name"] for dep in shared_claims} == {"pkg-b"}, (
"Only the last writer may claim the shared prompt before testing cleanup"
)
@danielmeppiel

Copy link
Copy Markdown
Collaborator Author

Release-blocking hotfix: v0.24.1 publication is paused because the tag workflow exposed this stale single-owner assertion. All PR checks are green; requesting code-owner approval so the merge queue can proceed.

@danielmeppiel danielmeppiel merged commit 4257698 into main Jul 10, 2026
14 checks passed
@danielmeppiel danielmeppiel deleted the danielmeppiel-release-v0-25-prep branch July 10, 2026 15:37
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.

2 participants