Skip to content

spec: apt.drop-esm-pins, for boxes leaving a release u-a-t pinned (wend#47) - #66

Merged
TusanHomichi merged 2 commits into
mainfrom
claude/project-thread-ho6u7w
Oct 13, 2026
Merged

TusanHomichi merged 2 commits into
mainfrom
claude/project-thread-ho6u7w

Conversation

@TusanHomichi

Copy link
Copy Markdown
Member

Before: a fully updated trusty box has ubuntu-advantage-tools 19.7ubuntu0.2. Its postinst writes an unowned /etc/apt/preferences.d/ubuntu-esm-infra-trusty with Pin-Priority: never. xenial's apt 1.2 refuses every command over it, so after the xenial transaction autoremove and every later apt call fail. No op could remove it without shell.

After: a new Ubuntu op, apt.drop-esm-pins with release, removes ubuntu-esm-{release} and ubuntu-esm-*-{release} from /etc/apt/preferences.d. It only removes a file when all of these hold:

  • it is a plain file, not a symlink;
  • dpkg -S names no package for it;
  • every line is one u-a-t writes (Package: *, Pin: release o=UbuntuESM..., n={release}, Pin-Priority: never, a comment or a blank line);
  • it pins to never.

Anything else is left alone with a line saying why, and the step passes.

This is a spec change (adapters, tools, SPEC, client), so the route fix and the fully updated trusty box follow in their own PRs once this is on main. CI judges a PR with the base branch's tools.

How:

  • adapters/ubuntu.toml declares the op.
  • tools/backends.py (ESM_PINS) and client/src/backend.rs compile it to the same shell loop; client/parity.py reports identical output.
  • SPEC gets an Op reference entry.
  • tools/test_esm_pins.py runs the step against a stand-in directory and dpkg (12 cases). It is wired into wend check and the client job.

Part of #47.

🤖 Generated with Claude Code

https://claude.ai/code/session_01F6HrWAW4tB9vuYRQRN86zE


Generated by Claude Code

…ase being left (wend#47)

A fully updated trusty box carries u-a-t 19.7ubuntu0.2, whose postinst writes an
unowned /etc/apt/preferences.d/ubuntu-esm-infra-trusty with Pin-Priority: never.
xenial's apt 1.2 refuses every command over it. The op removes such a file only
when it is a plain, unowned file in u-a-t's exact shape for the named release.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01F6HrWAW4tB9vuYRQRN86zE
Signed-off-by: Claude <[email protected]>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 13, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-13T13:15:13.203263Z 915a8f5 New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

Copy link
Copy Markdown
Member Author

Independent Claude review: sign-off on head e463d14. No blockers.

Checks:

  • tools/test_esm_pins.py passes 12/12.
  • wend check passes, including on a clean git archive of e463d14.
  • cargo build --release + client/parity.py: identical, and the Python and Rust ESM_PINS strings are byte-identical.

The step script:

  • Globs: a glob that matches nothing stays literal and is skipped. The two name forms can't match the same file.
  • Symlinks and non-files: refused before dpkg or grep see them.
  • Ownership: dpkg -S on an absolute path with no wildcards is an exact match. A diverted file counts as owned and is left alone, which is the safe side.
  • Content: the grep -vxE alternation is anchored as a whole, and a separate check requires a never line.
  • release: held to [a-z]+, so nothing can be injected.
  • Scope: the op is declared only in the Ubuntu adapter.

SPEC matches the code.

Two nits, neither blocking:

  1. If dpkg -S fails for some reason other than "not found", the file is treated as unowned.
  2. A file in u-a-t's shape but missing its Pin: line is still removed. That's harmless, and the SPEC wording allows it.

Generated by Claude Code

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e463d14d5c

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread tools/backends.py Resolved
A file holding only a subset of u-a-t's lines (say a lone Pin-Priority: never
with comments) is an admin's, not u-a-t's: leave it.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01F6HrWAW4tB9vuYRQRN86zE
Signed-off-by: Claude <[email protected]>

Copy link
Copy Markdown
Member Author

Independent Claude review: sign-off on head 915a8f5. No new findings.

The only change since the sign-off on e463d14 is commit 915a8f5 (DCO signed). The step now also requires the Package: * line and the anchored release Pin: line, changed identically in Python and Rust. Checks on this head:

  • The compiled step removes an unowned copy of u-a-t 19.7ubuntu0.2's real pin file, with the expected message.
  • tools/test_esm_pins.py passes 15/15.
  • wend check exits 0.
  • client/parity.py reports identical after a fresh release build.
  • The SPEC wording matches the code.

Generated by Claude Code

@github-actions github-actions Bot added the needs-claude-review Waiting on the Claude review layer label Oct 13, 2026
@TusanHomichi
TusanHomichi merged commit 7157500 into main Oct 13, 2026
8 checks passed
@TusanHomichi
TusanHomichi deleted the claude/project-thread-ho6u7w branch October 13, 2026 13:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-claude-review Waiting on the Claude review layer

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants