Skip to content

feat(cli): append-only artifact store — bin/ and wit/ never deleted#579

Merged
joshuajbouw merged 1 commit intomainfrom
feat/append-only-store
Mar 21, 2026
Merged

feat(cli): append-only artifact store — bin/ and wit/ never deleted#579
joshuajbouw merged 1 commit intomainfrom
feat/append-only-store

Conversation

@joshuajbouw
Copy link
Contributor

Linked Issue

Closes #578

Summary

Content-addressed artifacts in bin/ and wit/ are never auto-deleted on capsule remove. The audit chain records BLAKE3 hashes that must always resolve to real binaries. Deleting artifacts breaks provability.

Changes

  • Remove cleanup_wasm_binary() function (was called on capsule remove)
  • Remove cleanup_wit_files() function (was called on capsule remove)
  • capsule remove now only deletes the capsule directory (metadata, Capsule.toml, config)
  • Artifacts are append-only by default
  • CHANGELOG.md updated

This is the Nix model: append-only store, explicit garbage collection. Future astrid gc command for operator-initiated purge with confirmation and audit entry.

Test Plan

  • 8 remove tests pass
  • 149 total tests pass
  • cargo clippy -p astrid -- -D warnings clean

Checklist

  • Linked to an issue
  • CHANGELOG.md updated under [Unreleased]

Remove cleanup_wasm_binary and cleanup_wit_files from capsule remove.
Content-addressed artifacts in bin/ and wit/ stay forever. The audit
chain records BLAKE3 hashes that must always resolve to real binaries.
Deleting artifacts breaks provability.

capsule remove now only deletes the capsule directory (metadata,
Capsule.toml, config). Artifacts are append-only by default.

Future: astrid gc for explicit operator-initiated purge.

Closes #578
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request fundamentally changes the artifact storage policy to an append-only model, ensuring that content-addressed binaries and WIT files are never automatically removed. This change is crucial for maintaining the integrity of the audit chain, as deleting these artifacts would compromise provability. Consequently, the capsule remove command's scope has been narrowed to only remove capsule-specific metadata, with future plans for a dedicated garbage collection utility.

Highlights

  • Artifact Storage Policy: Content-addressed artifacts in bin/ and wit/ directories are now append-only and will never be automatically deleted during capsule removal to maintain the audit trail and provability.
  • Capsule Removal Behavior: The capsule remove command now exclusively deletes the capsule's metadata directory (containing Capsule.toml and configuration), no longer attempting to clean up associated WASM binaries or WIT files.
  • Code Simplification: The cleanup_wasm_binary() and cleanup_wit_files() functions, previously responsible for artifact deletion, have been removed.
  • Future Cleanup Mechanism: A future astrid gc command is planned for explicit, operator-initiated garbage collection of artifacts, aligning with the Nix model.
  • Documentation: The CHANGELOG.md has been updated to reflect the new append-only artifact store policy.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.


Artifacts now stay, Audit trail, forever true, No more auto-delete.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request successfully implements an append-only artifact store for bin/ and wit/ directories, ensuring that content-addressed artifacts are never automatically deleted during capsule removal. This change is well-justified by the need to maintain an audit trail and provability of binaries, aligning with the Nix model for artifact management. The removal of cleanup_wasm_binary() and cleanup_wit_files() simplifies the remove_capsule logic, and the updated CHANGELOG.md clearly documents this architectural shift. The implementation is clean and directly addresses the stated goal.

@joshuajbouw joshuajbouw merged commit dfe3fcc into main Mar 21, 2026
13 checks passed
@joshuajbouw joshuajbouw deleted the feat/append-only-store branch March 21, 2026 21:30
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.

feat: append-only artifact store — bin/ and wit/ never deleted

1 participant