Skip to content

test(gate): install --frozen refuses a declared package the lock lacks - #5012

Merged
Daniel Meppiel (danielmeppiel) merged 3 commits into
mainfrom
ql/w2b-gate-frozen-unlocked
Nov 23, 2026
Merged

Daniel Meppiel (danielmeppiel) merged 3 commits into
mainfrom
ql/w2b-gate-frozen-unlocked

Conversation

@danielmeppiel

Copy link
Copy Markdown
Collaborator

Description

A full-sequence GATE scratch at main 3d03dc9 (run 45142640048) falsified the nightly state machine in both scopes: declare(hook) -> update -> declare(plugin) -> audit_ci. install --frozen exited 1 where the model expected 0.

Classification: stale model (test bug), not a product bug. reference/cli/install.md:321 ("Frozen mode") says a --frozen install fails when the lockfile is missing a declared direct dependency. Since #4912, --frozen enforces this for a package it could not restore from the lock. The GATE reference (_install_reference) expected a refusal only when no lockfile existed at all. It now also expects exit 1 when any declared kind has no lock row in the lock before the step. Every other frozen expectation is unchanged.

Regression test: test_m_gate.py::test_frozen_refuses_a_declared_package_the_lock_lacks replays the falsifier. It asserts that apm.lock.yaml stays byte-identical and still has no row for the newly declared package.

Issue and approved scope

Issue: Refs #4919

Human scope-approval comment: QL owns the lifecycle machines (GATE nightly lane, approved by the Quality & Lifecycle VP as a standalone car before tonight's GATE nightly).

Does not close an issue: it keeps the scheduled GATE nightly green after #4912.

Type of change

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

Testing

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

Validation (CI only; host under load, rule 17):

  • Scratch gate-machine-nightly.yml run 45148566874 (25 random examples per scope plus the replay): GATE 3 passed, SPINE 3 passed.
  • Before the fix, scratch 45142640048 failed test_gate_generated_sequences_keep_cross_cutting_laws[project] and [user] with install-frozen exited 1, expected 0.

Changelog

  • One fragment per section, changelog.d/<pr>.<section>.md, holding
    one line: user-visible effect first, 25 words or fewer, ending with
    (#PR); breaking changes only under upgrade notes; no Highlights; no
    new lines under ## [Unreleased]. See changelog.d/README.md and
    .github/instructions/changelog.instructions.md.
  • N/A -- internal-only change (CI, tests, refactor).

Spec conformance (OpenAPM v0.1)

No req-XXX behaviour changes; test model only.

The GATE reference expected --frozen to refuse only without a lockfile.
install.md (Frozen mode) refuses any declared direct dependency the lock
has no row for, which #4912 now enforces; the model was stale. Replays the
nightly falsifier (declare, update, declare, audit --ci).

Co-authored-by: Copilot App <[email protected]>
# Conflicts:
#	tests/lifecycle/machines/test_m_gate.py
Copilot AI balanced review requested due to automatic review settings November 23, 2026 12:28
@danielmeppiel Daniel Meppiel (danielmeppiel) added the full-integration Run the full integration suite (ci-integration.yml) on this PR before merge label Nov 23, 2026

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 the test-only update aligning frozen-install expectations with missing lockfile entries.

No open issues 🎉

What changed in this PR

Corrects the GATE lifecycle test model to match install --frozen behavior when a declared dependency is absent from an existing lockfile, addressing the nightly failure reported in #4919. Production behavior is unchanged.

Changes:

  • Expect frozen installation to fail when any declared package lacks a lockfile entry.
  • Add a regression replay that checks refusal, unchanged lockfile contents, and the newly declared package’s continued absence from the lock.
File Description
tests/​lifecycle/​machines/​test_m_gate.py Adds the nightly failure replay and lockfile assertions.
tests/​lifecycle/​machines/​_gate_kit.py Updates frozen-mode expectations to detect missing dependency rows.

Review effort: Balanced

@danielmeppiel
Daniel Meppiel (danielmeppiel) merged commit 545cece into main Nov 23, 2026
81 checks passed
@danielmeppiel
Daniel Meppiel (danielmeppiel) deleted the ql/w2b-gate-frozen-unlocked branch November 23, 2026 13:13
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