Skip to content

feat(xim): recipe packaging revision and the install_targets record (2026.9.27.1) - #1

Closed
speak-agent wants to merge 1 commit into
mainfrom
feat/install-targets-revision
Closed

speak-agent wants to merge 1 commit into
mainfrom
feat/install-targets-revision

Conversation

@speak-agent

Copy link
Copy Markdown
Owner

Summary

xlings 2026.9.27.1: a recipe's packaging revision (openxlings#620), and a record of what each install request resolved to.

Revision (openxlings#620)

A version entry may state revision = N (libxpkg 0.0.58), counting changes to what a recipe installs under an unchanged upstream version. Until now the store could only answer "is 2.44.3 here", so a fixed recipe never reached a machine that had installed the broken payload.

  • Stamp: the payload stamp records the revision it was built from, always written as "revision": N in .xpkg-install.json.
  • Verdict: one function, payload_revision_verdict (install_state), decides whether a payload is current.
    • A payload is current if and only if its recorded revision equals the recipe's.
    • A stamp without the field reads as revision 0, so only a recipe that states revision 1 or higher reinstalls.
    • No stamp, or a stamp recording a failed install, gives no verdict.
  • Planning: the resolver plans a stale payload as not installed. The installer asks the same verdict again and states the reason, for example reinstalling glibc@2.44.3: recipe revision 1, installed revision 0.
  • Replacement: the version is never left without a payload.
    • The old tree is renamed to <data>/stale/ and the new one is installed at the real path.
    • On success the old tree is deleted; on any failure it is renamed back (PayloadReplacement).
  • Plan entries: install_plan entries carry the revision as a third element and the reinstall reason as their note.

install_targets (interface protocol 1.1, additive)

  • The top-level install reports {request, namespace, name, version, revision, status, payload_dir} per request, in request order, with status installed, already_present or failed.
  • It is emitted on every path: fresh installs, "everything already installed" (which previously put nothing on the wire), and failures.
  • Nested installs and dry runs do not report.
  • install_summary.success now counts only what the run installed, as its comment already stated. This is the one observable change for existing clients.
  • Documented in docs/spec/interface-ndjson-v1.md and docs/spec/xpkg-manifest-v1.md.

Version-grammar conformance vectors

tests/data/semver-vectors.tsv lists request, available versions, active version and expected result. tests/unit/test_semver_vectors.cpp drives every vector through the resolver. mcpp vendors the file and runs the vectors without an active version against its own implementation.

Tests

  • Unit: test_install_state, test_interface_protocol, test_payload_remove, test_semver_vectors. 55 of 56 pass locally; test_identity fails only because the tests ran as root (uid 0).
  • e2e: tests/e2e/install_revision_test.sh (E2E-121).

Dependencies

Refs openxlings#620, openxlings#621.


🤖 Generated with Claude Code

https://claude.ai/code/session_01MajuX4J8ewFeWvZJjzRJt5


Generated by Claude Code

…2026.9.27.1)

A version entry may now state `revision = N` (libxpkg 0.0.58): a change to
what a recipe installs under an unchanged upstream version. Until now the
store could only answer "is 2.44.3 here", so a fixed recipe never reached a
machine that had installed the broken payload: `install` of that version
returned on the strength of the `installed` hook or the version database.

Revision (openxlings#620)
- The payload stamp records the revision it was built from
  (`"revision": N` in `.xpkg-install.json`, always written).
- One verdict, `payload_revision_verdict` (install_state): a payload is
  current iff its recorded revision equals the recipe's. A stamp without the
  field reads as revision 0, so only a recipe that states revision >= 1
  reinstalls, and it reaches every older payload. No stamp at all, or a stamp
  that records a failed install, gives no verdict.
- The resolver plans a stale payload as not installed (its artifact is
  downloaded and verified first); the installer asks the same verdict again
  after its own fast paths and says why:
  `reinstalling glibc@2.44.3: recipe revision 1, installed revision 0`.
- The replacement never leaves the version without a payload: the old tree
  is renamed to `<data>/stale/`, the new one is installed at the real path
  (recipes embed install_dir()), and the old tree is deleted on success or
  renamed back on any failure (`PayloadReplacement`, payload.cppm). Files
  other tools wrote into the old tree go with it.
- `install_plan` entries carry the revision as a third element and the
  reinstall reason as their note.

install_targets (interface protocol 1.1, additive)
- The top-level install reports, per request and in request order,
  `{request, namespace, name, version, revision, status, payload_dir}` with
  status `installed | already_present | failed`, on every path: fresh
  installs, "everything already installed" (which previously put nothing on
  the wire), and failures. Nested installs requested by recipes and dry runs
  do not report. Registered as interface-only for the terminal.
- A node whose payload was present and current is recorded as present
  rather than installed, so `install_summary.success` counts what the run
  installed, as its comment already stated.
- docs/spec/interface-ndjson-v1.md documents install_plan, install_summary
  (as emitted) and install_targets; docs/spec/xpkg-manifest-v1.md documents
  `revision`.

Version-grammar conformance vectors
- tests/data/semver-vectors.tsv: request, available versions, active
  version, expected result; driven through the resolver by
  tests/unit/test_semver_vectors.cpp. Self-describing for vendoring.

Also: xlings 2026.9.27.1, mcpplibs.xpkg 0.0.58, E2E-121
(install_revision_test.sh).

Refs: openxlings#620

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MajuX4J8ewFeWvZJjzRJt5
@speak-agent

Copy link
Copy Markdown
Owner Author

Superseded by openxlings#622.

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