[PR #71] [CLOSED] [1/4] feat(snapshot): template build-context archive store (posixfs + oss) #156

Closed
opened 2026-10-29 14:20:22 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/kvcache-ai/AgentENV/pull/71
Author: @JoyboyBrian
Created: 7/29/2026
Status: ❌ Closed

Base: main ← Head: e2b-build/03-build-file-store


📝 Commits (5)

  • 81a8edb feat(snapshot): template build-context archive store (posixfs + oss)
  • a858335 fix(snapshot): align build archive cache semantics
  • 7e0dff1 fix(snapshot): clarify build upload grant lifecycle
  • ba92573 fix(snapshot): reject non-file build archive entries
  • 2ea4bcc fix(snapshot): prune abandoned build imports

📊 Changes

13 files changed (+1259 additions, -0 deletions)

View changed files

📝 config/default.toml (+2 -0)
📝 docs/src/configuration/reference.md (+1 -0)
📝 src/snapshot/image_export/service.rs (+2 -0)
📝 src/snapshot/manager.rs (+8 -0)
➕ src/snapshot/repository/backends/oss/build_files.rs (+170 -0)
📝 src/snapshot/repository/backends/oss/mod.rs (+1 -0)
📝 src/snapshot/repository/backends/oss/repository.rs (+12 -0)
📝 src/snapshot/repository/backends/posixfs/backend.rs (+12 -0)
➕ src/snapshot/repository/backends/posixfs/build_files.rs (+835 -0)
📝 src/snapshot/repository/backends/posixfs/mod.rs (+2 -0)
➕ src/snapshot/repository/build_files.rs (+202 -0)
📝 src/snapshot/repository/interfaces.rs (+10 -0)
📝 src/snapshot/repository/mod.rs (+2 -0)

📄 Description

What

Add repository-backed template build-context archive storage for POSIX and OSS deployments, including immutable content-addressed archives, single-use upload grants, bounded pruning, and a SnapshotManager accessor.

This is the first layer of the active COPY/ADD stack, replayed directly onto current main at 00ba6cb. The alias-rebuild work in #70 is intentionally not a dependency and is parked pending the planned alias-system refactor.

Layer PR Branch Scope
1/4 #71 e2b-build/03-build-file-store Build-context archive store
2/4 #72 e2b-build/04-upload-api Upload API and configuration
3/4 #73 e2b-build/05-copy-plan Host-side COPY planning
4/4 #74 e2b-build/06-copy-exec COPY/ADD execution, E2E, and documentation

Why

The E2B SDK uploads build-context archives separately from the template build request. This layer provides the shared repository primitive needed to accept those uploads on one node and consume them during a later build, including clustered deployments backed by the OSS repository.

Related: #28. The original PR remains the full concept/reference discussion.

Scope and non-goals

This layer contains only the storage interfaces, POSIX/OSS implementations, repository wiring, accessors, and focused storage tests. It does not expose an HTTP upload surface or execute COPY/ADD steps. Existing-alias rebuild remains unsupported.

Exact layer diff: 00ba6cb...e2b-build/03-build-file-store

Design

  • TemplateBuildFileStore abstracts archive lookup, import, materialization, upload-grant issue/verify/claim, and pruning.
  • POSIX publication uses staging, fsync, and no-clobber hard links for first-write-wins behavior.
  • OSS stores the same logical archive and grant records under repository object keys.
  • Snapshot repositories may return no build-file store; the POSIX and OSS backends wire concrete implementations.
  • The rebase includes the minimal constructor updates required by current main's image-export repository creation paths.

Compatibility and operations

  • No public API change in this layer.
  • No new configuration or host dependency.
  • Committed snapshot manifests are unchanged; the repository gains additive build-context archive/grant data.
  • Old repositories remain readable, and unreferenced archives can be pruned.

Validation

The rewritten stack was validated on Linux against the #74 tip:

cargo fmt --all -- --check
cargo test --locked -p agentenv --lib template::
# 68 passed, 0 failed
cargo clippy --locked -p agentenv --lib -- -D warnings
make agentenv-server
# regeneration produced no intended generated-code diff

This layer includes focused tests for immutable import, first-write-wins publication, grants/claims, pruning, mtime refresh, and failure cleanup. GitHub CI validates this cumulative branch independently.

Reviewer notes

The main review surfaces are single-use grant behavior, no-clobber publication, and bounded cleanup. #70 is not required to merge this stack.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/kvcache-ai/AgentENV/pull/71 **Author:** [@JoyboyBrian](https://github.com/JoyboyBrian) **Created:** 7/29/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `e2b-build/03-build-file-store` --- ### 📝 Commits (5) - [`81a8edb`](https://github.com/kvcache-ai/AgentENV/commit/81a8edbae406df6d93a21063322370cf1bffd109) feat(snapshot): template build-context archive store (posixfs + oss) - [`a858335`](https://github.com/kvcache-ai/AgentENV/commit/a858335e36920183ba5370451440f712f33df248) fix(snapshot): align build archive cache semantics - [`7e0dff1`](https://github.com/kvcache-ai/AgentENV/commit/7e0dff1610f3f119cb814fa1cb41d4abeab8386d) fix(snapshot): clarify build upload grant lifecycle - [`ba92573`](https://github.com/kvcache-ai/AgentENV/commit/ba925734e6474bba2af8a46e64b38ac314f69169) fix(snapshot): reject non-file build archive entries - [`2ea4bcc`](https://github.com/kvcache-ai/AgentENV/commit/2ea4bccfba37ab74c85b4ef75f5bbb0fcc85b103) fix(snapshot): prune abandoned build imports ### 📊 Changes **13 files changed** (+1259 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `config/default.toml` (+2 -0) 📝 `docs/src/configuration/reference.md` (+1 -0) 📝 `src/snapshot/image_export/service.rs` (+2 -0) 📝 `src/snapshot/manager.rs` (+8 -0) ➕ `src/snapshot/repository/backends/oss/build_files.rs` (+170 -0) 📝 `src/snapshot/repository/backends/oss/mod.rs` (+1 -0) 📝 `src/snapshot/repository/backends/oss/repository.rs` (+12 -0) 📝 `src/snapshot/repository/backends/posixfs/backend.rs` (+12 -0) ➕ `src/snapshot/repository/backends/posixfs/build_files.rs` (+835 -0) 📝 `src/snapshot/repository/backends/posixfs/mod.rs` (+2 -0) ➕ `src/snapshot/repository/build_files.rs` (+202 -0) 📝 `src/snapshot/repository/interfaces.rs` (+10 -0) 📝 `src/snapshot/repository/mod.rs` (+2 -0) </details> ### 📄 Description ## What Add repository-backed template build-context archive storage for POSIX and OSS deployments, including immutable content-addressed archives, single-use upload grants, bounded pruning, and a `SnapshotManager` accessor. This is the first layer of the active COPY/ADD stack, replayed directly onto current main at `00ba6cb`. The alias-rebuild work in #70 is intentionally not a dependency and is parked pending the planned alias-system refactor. | Layer | PR | Branch | Scope | |---|---|---|---| | **1/4** | **#71** | **`e2b-build/03-build-file-store`** | **Build-context archive store** | | 2/4 | #72 | `e2b-build/04-upload-api` | Upload API and configuration | | 3/4 | #73 | `e2b-build/05-copy-plan` | Host-side COPY planning | | 4/4 | #74 | `e2b-build/06-copy-exec` | COPY/ADD execution, E2E, and documentation | ## Why The E2B SDK uploads build-context archives separately from the template build request. This layer provides the shared repository primitive needed to accept those uploads on one node and consume them during a later build, including clustered deployments backed by the OSS repository. Related: #28. The original PR remains the full concept/reference discussion. ## Scope and non-goals This layer contains only the storage interfaces, POSIX/OSS implementations, repository wiring, accessors, and focused storage tests. It does not expose an HTTP upload surface or execute COPY/ADD steps. Existing-alias rebuild remains unsupported. Exact layer diff: [00ba6cb...e2b-build/03-build-file-store](https://github.com/JoyboyBrian/AgentENV/compare/00ba6cb...e2b-build/03-build-file-store) ## Design - `TemplateBuildFileStore` abstracts archive lookup, import, materialization, upload-grant issue/verify/claim, and pruning. - POSIX publication uses staging, fsync, and no-clobber hard links for first-write-wins behavior. - OSS stores the same logical archive and grant records under repository object keys. - Snapshot repositories may return no build-file store; the POSIX and OSS backends wire concrete implementations. - The rebase includes the minimal constructor updates required by current main's image-export repository creation paths. ## Compatibility and operations - No public API change in this layer. - No new configuration or host dependency. - Committed snapshot manifests are unchanged; the repository gains additive build-context archive/grant data. - Old repositories remain readable, and unreferenced archives can be pruned. ## Validation The rewritten stack was validated on Linux against the #74 tip: ```text cargo fmt --all -- --check cargo test --locked -p agentenv --lib template:: # 68 passed, 0 failed cargo clippy --locked -p agentenv --lib -- -D warnings make agentenv-server # regeneration produced no intended generated-code diff ``` This layer includes focused tests for immutable import, first-write-wins publication, grants/claims, pruning, mtime refresh, and failure cleanup. GitHub CI validates this cumulative branch independently. ## Reviewer notes The main review surfaces are single-use grant behavior, no-clobber publication, and bounded cleanup. #70 is not required to merge this stack. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-29 14:20:22 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
kvcache-ai/AgentENV#156
No description provided.