Skip to content

refactor(release): move the agent-image index publish logic into a tested tool - #1804

Merged
trunk-io[bot] merged 2 commits into
compass-native/rig-3751-agent-image-indexfrom
compass-native/rig-4735-index-publish-tool
Oct 7, 2026
Merged

trunk-io[bot] merged 2 commits into
compass-native/rig-3751-agent-image-indexfrom
compass-native/rig-4735-index-publish-tool

Conversation

@rigel-mintaka

@rigel-mintaka rigel-mintaka commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Move the decision logic of publish-image-manifest from inline shell into tools/agent-image-index, a bun tool. The logic covers: compose the index by digest, guard :git-<sha12>, the :latest ordering guard, and verify. A pure core takes an injected command runner; the edge uses Bun.spawn with argument arrays.
  • Behaviour is unchanged: the same checks, order, abort-on-ambiguity paths, and ::error:: messages. The one addition: the ambiguous :git refusal now includes the inspect stderr, which the shell printed separately.
  • The job now installs nix and puts the pinned bun from gate-tools.nix on PATH. The tool has no runtime dependencies, so there is no bun install.
  • bun:test covers the decision paths with fake git, skopeo and podman results.

Verification

  • bun test in tools/agent-image-index: 13 pass. Cases covered:
    • :latest paths: no newer index; newer index with a matching or a stale :latest; sha not on main; ambiguous registry error while walking.
    • :git guard: equal, different, manifest-unknown and other errors.
    • Composed index: wrong member count, wrong platform set, member config arch mismatch.
    • Push order: :git before :latest.
    • Digests ignore trailing newlines.
  • Mutation checks:
    • Removing the newline strip fails the digest test.
    • Pushing :latest before the guard fails the order test.
  • bunx tsc --noEmit and biome check tools/agent-image-index: clean. actionlint findings match the parent commit's baseline.
  • End-to-end smoke against a local registry:2, with real skopeo and podman behind ref-rewriting shims:
    • fresh publish of the tip;
    • a rerun takes the immutable skip;
    • an older run leaves :latest to the newer index.

Risks

The first main run exercises the new bootstrap and tool. A failure stops before :latest moves or fails loudly afterwards; consumers keep the previous index. Rollback is a revert.

Compatibility

No tag, registry or consumer change. Workflow-internal only.

Documentation

None: CI-internal refactor.

Refs RIG-4735

rigel-mintaka and others added 2 commits October 6, 2026 15:43
…sted tool

tools/agent-image-index composes, guards, publishes and verifies the
compass-agent OCI index with the same checks the inline shell made.
bun:test drives the decision paths with fake git, skopeo and podman
results. The job now installs nix and the pinned bun to run it.

Refs RIG-4735

Co-authored-by: Matt Wilkinson <matt@rigel.build>
- Assert the :git push precedes the :latest push.
- Assert trailing newlines on raw inspect output do not change the
  digest, matching the shell's command-substitution behaviour.
- Keep the inspect stderr in the ambiguous :git refusal message.

Refs RIG-4735

Co-authored-by: Matt Wilkinson <matt@rigel.build>
@linear-code

linear-code Bot commented Oct 6, 2026

Copy link
Copy Markdown

RIG-4735

@github-actions

github-actions Bot commented Oct 6, 2026

Copy link
Copy Markdown

Compass engineering docs preview: https://compass-native-rig-4735-inde.compass-eng-docs.pages.dev

Deployed from compass-native/rig-4735-index-publish-tool at 7d159c0.

@rigel-mintaka
rigel-mintaka marked this pull request as ready for review October 6, 2026 20:38
@mattwilkinsonn
mattwilkinsonn added this pull request to stack #1836 October 7, 2026 00:39
@mattwilkinsonn

Copy link
Copy Markdown
Contributor

/trunk merge

@trunk-io

trunk-io Bot commented Oct 7, 2026 •

Copy link
Copy Markdown

😎 Stack merged successfully - details.

@trunk-io
trunk-io Bot merged commit 285f693 into main Oct 7, 2026
16 checks passed
@trunk-io
trunk-io Bot deleted the compass-native/rig-4735-index-publish-tool branch October 7, 2026 05:34
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