Skip to content

train: v0.39.0 bugfix - #5433

Closed
Daniel Meppiel (danielmeppiel) wants to merge 19 commits into
mainfrom
cimq/train-bugfix
Closed

Daniel Meppiel (danielmeppiel) wants to merge 19 commits into
mainfrom
cimq/train-bugfix

Conversation

@danielmeppiel

@danielmeppiel Daniel Meppiel (danielmeppiel) commented Nov 25, 2026 •

Copy link
Copy Markdown
Collaborator

TL;DR

TRAIN 2 for v0.39.0 ("bugfix"): the PM MUST-FIX cars only, stacked on main 8225ec64 (after the #5406 night train). Every car enters only when W3d and Copilot are clean at its row head. QL signs a range H8 on the final head. CI is the only validator.

Cars (in merge order)

# Car Head Fixes Entry evidence
1 #5429 c0483deb #5428 QL H8 SIGNED at head (W3d 32764b8 carries, test-only delta)
2 #5422 05e0db81 #4954 community; W3d ACCEPT carries, QL NO-H8, Copilot at head, 0 threads, green. Fold c1d3509f (fragment ends #5422, test marker component)
3 #5426 933f233c #5424 QL H8 at 4ae6dd0/0ae72e3f; 933f233 test-only delta (AQ003/AQ004 fold) carries; Copilot at head; 0 threads; green

FROZEN at 9e6c1d9a (regent 08:52). Remaining MUST-FIX rows ride TRAIN 3. Each merge commit reads train: merge #N (<sha>).

Ejected: #5423 (regent 08:12; re-targets 0.40, needs S93 input-mutation oracle).

Validation

  • Tier-1 CI + Merge Gate on the train head.
  • One Integration run (ci-integration.yml, all shards) on the final head.
  • QL range H8 over every car merge.

Changelog

Each car carries its own changelog.d/ fragment.

Two spellings of one local directory on a case- or normalization-folding
volume (APFS, NTFS) must be one lock row: install records it once, uninstall
of the root spelling re-anchors it, and prune removes the orphan beside it.
A unit cell drives the fold decision with a simulated fold probe so Linux CI
guards it: a folded entry merges, an exact entry wins, a case-sensitive
volume never merges, and a link out of the project is never listed. An
exactly spelled graph keeps its lock bytes on --frozen and a re-install.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
…ory (#5424)

Path.resolve keeps the spelling it was given, so on a folding volume a root
./vendor/E-Pkg and a transitive ../e-pkg (or NFC and NFD names) became two
node identities and two lock rows for one directory. Since #4994 the
reachability walk ties both edges to one row by inode, so uninstall refused
the re-anchor ('already belongs to another entry') and prune kept the orphan.

deps/local_identity.stored_directory gives the anchored directory the
spelling the volume stores (utils.paths.stored_spelling: an exact entry
wins, a folded entry needs samefile), below the project root only. The root
map and transitive_local_identity both key through it, so install, the
--frozen verdict, the reachability walk, uninstall and prune agree on one
row. Exactly spelled paths keep their identity: no lock churn.
The lock format is unchanged; a pre-fix lock with two rows for one folded
directory still passes --frozen, and the next plain install keeps one row.

apm-spec-waiver: platform path-spelling fold of the local anchor; lockfile schema and identity format unchanged

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
The cell rewrites a fresh lock into the exact shape a pre-fix install wrote
(two rows, the ledger owner and the hashed copy of the transitive spelling;
byte-identical to a real 4287880 install). apm install --frozen accepts it
unchanged, a plain install records one row, and --frozen passes again. The
changelog fragment carries the migration line.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
…p POSIX backslash names

Copilot round 1 on #5426:
- A pre-fix transitive row keyed by its declared spelling (vendor/f-pkg for
  a stored F-Pkg) made the post-fix install --frozen refuse. The frozen
  verdict now falls back, read-only, to a lock row whose anchored path has
  the same caseless key and is the same directory below the project root
  (samefile): deps/local_identity.locked_spelling. A case-sensitive volume
  never confirms two spellings; --frozen never rewrites the lock; a plain
  install re-keys the row.
- On POSIX a literal backslash is part of a name, not a separator:
  stored_directory keeps such an anchor unchanged.
- The unit cells that need case-sensitive path comparison skip on Windows,
  which resolves and compares paths caselessly.

apm-spec-waiver: read-only compatibility lookup for pre-fix local lock spellings; lockfile schema unchanged

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
…5428)

Red on main 1e4a208: APM_INSTALL_FAST_PATH=decide folds the legacy file into
config.json and deletes it. Positive control: the full install migrates.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
#5428)

The install fast path's decision is speculative: it runs before its apply
journal (and under APM_INSTALL_FAST_PATH=decide writes nothing by contract),
so a later decline could not undo a consent write. executables.py owns the one
migration point (_migrate_legacy_approvals / load_user_executables) and now
exposes speculative_consent(): inside it, legacy approvals.yml is read and
never persisted or deleted. fast_entry runs try_apply inside it; the full
install and apm approve keep migrating.

apm-spec-waiver: personal consent migration timing is local install state, outside the OpenAPM spec

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot #5429: the trace prefix alone also matched early declines that never
read consent; the cell now asserts DECIDE_EXIT and the no-op decision this
world reaches.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
The new test module carries its promise marker and drives the command
without patching the uninstall owner (AQ004). A rebuild that records an
error and then raises no longer counts as two failed packages: the
exception path records its error only when the rebuild added none.
Red before the fix (run locally): package_failures was 2.

Refs #4954

Co-authored-by: abhishekacharya200 <abhishekacharya200@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: abhishekacharya200 <abhishekacharya200@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>

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 request factory rejects install_mcp, causing frozen installs to fail before enforcement, while a missing frozen-owner classification also causes the closed-world test to fail.

No open issues 🎉

What changed in this PR

This v0.39.0 bugfix train carries #5423, extending APM's verified no-op fast path so a plain install can serve subsequent --frozen installs outside CI.

Changes:

  • Bind attestations to the effective frozen mode and allow one-way reuse from plain to frozen installs.
  • Re-run frozen checks and preserve trust notices without migrating consent during speculative checks.
  • Add attestation, tampering, and full-pipeline parity tests, plus a changelog fragment.
File Description
tests/​integration/​test_verdict_record.py Tests frozen reuse, tampering, edge checks, and owner classification.
tests/​integration/​test_verdict_record_attested_world.py Adds real-CLI parity and consent-preservation checks.
src/​apm_cli/​integration/​mcp_config_view.py Adds trust-notice state snapshot and rollback helpers.
src/​apm_cli/​install/​verdict_write.py Stores and authenticates frozen-mode metadata.
src/​apm_cli/​install/​verdict_record.py Implements one-way attestation reuse and frozen-mode tracking.
src/​apm_cli/​install/​verdict_attest.py Adds live frozen checks and owner classifications.
src/​apm_cli/​install/​service.py Records frozen mode and avoids speculative consent migration.
src/​apm_cli/​install/​request.py Introduces a shared frozen-preflight request factory.
src/​apm_cli/​install/​fast_output.py Preserves frozen output and restores notices after fallback.
src/​apm_cli/​install/​diff_apply.py Runs frozen preflight before fast-path decisions.
src/​apm_cli/​commands/​install.py Uses the shared preflight factory in the full pipeline.
changelog.d/​5423.changed.md Documents frozen fast-path reuse outside CI.

Review effort: Balanced

The new folded-spelling and upgrade cells now also assert the exit code of
the commands they drive and, for prune, the deployed skill file, so the
assertion-quality ratchet sees an observed outcome; every existing
assertion stays. The fold-probe unit cell patches os.path.samefile, the
volume's answer, instead of utils.paths._same_entry, the owner it imports.

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

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.

🟡 Changes recommended

The changelog fragment’s final reference is #4954 instead of the required PR #5422, causing validation to fail, and the regression tests are incorrectly marked as unit rather than component tests.

2 open issues

Review effort: Balanced

Comment thread changelog.d/5422.fixed.md Resolved
…#5422 (#5422)

The cells touch the filesystem and drive CliRunner, so they are component
tests per tests/quality/test_test_taxonomy.py. The changelog fragment now
closes both #4954 and #5422.

Co-authored-by: abhishekacharya200 <abhishekacharya200@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>

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

Distinct local survivors with the same basename share a failure identity, causing uninstall to undercount failed packages; each survivor needs a unique identity and regression coverage.

No open issues 🎉

1 previously missed issue

In code that hasn't changed since last review

Medium severity Preserve distinct failure identities for same-basename local survivors

src/​apm_cli/​commands/​uninstall/​engine.py:1712

Using the public display label as the failure identity undercounts distinct local survivors. For example, /first/pkg and /second/pkg have different dependency keys but _dependency_public_label() returns _local/pkg for both. If both rebuilds raise before recording diagnostics, DiagnosticCollector.failed_package_count deduplicates these errors and uninstall reports only one failed package. Keep a distinct failure identity per survivor while retaining path-safe display labels, and add a regression with two same-basename local survivors.

2 resolved since last review

Review effort: Balanced

@danielmeppiel

Copy link
Copy Markdown
Collaborator Author

Superseded: cars landed as singles (#5426, #5429, #5422) in the 09:33 fastland.

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.

3 participants