mirror of
https://github.com/kvcache-ai/AgentENV.git
synced 2026-11-05 01:17:36 +00:00
[PR #73] [CLOSED] [3/4] feat(template): host-side COPY plan (archive rewrite to guest paths) #158
Labels
No labels
bug
documentation
enhancement
enhancement
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
kvcache-ai/AgentENV#158
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/kvcache-ai/AgentENV/pull/73
Author: @JoyboyBrian
Created: 7/29/2026
Status: ❌ Closed
Base:
main← Head:e2b-build/05-copy-plan📝 Commits (3)
81a8edbfeat(snapshot): template build-context archive store (posixfs + oss)d11d80afeat(api): E2B build-context upload endpoints and [template_build] configa5377b6feat(template): host-side COPY plan (archive rewrite to guest paths)📊 Changes
24 files changed (+3378 additions, -2 deletions)
View changed files
📝
config/default.toml(+24 -0)➕
src/api/build_files.rs(+287 -0)📝
src/api/generated/src/apis/templates.rs(+29 -0)📝
src/api/generated/src/models.rs(+158 -0)📝
src/api/generated/src/server/mod.rs(+172 -0)📝
src/api/impls/mod.rs(+4 -0)📝
src/api/impls/template.rs(+95 -0)📝
src/api/mod.rs(+1 -0)📝
src/api/openapi.yml(+48 -0)📝
src/api/server.rs(+3 -2)📝
src/cfg.rs(+223 -0)📝
src/snapshot/image_export/service.rs(+2 -0)📝
src/snapshot/manager.rs(+8 -0)➕
src/snapshot/repository/backends/oss/build_files.rs(+169 -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(+726 -0)📝
src/snapshot/repository/backends/posixfs/mod.rs(+2 -0)➕
src/snapshot/repository/build_files.rs(+197 -0)...and 4 more files
📄 Description
What
Add a host-side COPY planner that reads an uploaded build-context archive and emits a bounded rewritten tar whose entries are mapped to their final guest paths.
This is layer 3 of the active COPY/ADD stack, replayed onto current main at
00ba6cbwithout #70.e2b-build/03-build-file-storee2b-build/04-upload-apie2b-build/05-copy-plane2b-build/06-copy-execWhy
COPY/ADD requires Docker-compatible source matching and destination mapping without allowing an untrusted context archive to escape the intended guest paths. Keeping this logic host-side makes validation deterministic before anything is uploaded to the build sandbox.
Related: #28. The original PR remains the full concept/reference discussion.
Scope and non-goals
This layer adds only
src/template/copy_plan.rsand its private module declaration. It has no runtime caller until #74, so the temporarydead_codeallowance is removed by the next layer. Storage, HTTP upload, guest transfer/extraction, and build-spec wiring are outside this PR.Exact layer diff: e2b-build/04-upload-api...e2b-build/05-copy-plan
Design
Compatibility and operations
Validation
The rewritten stack was validated on Linux against the #74 tip:
This layer's focused tests cover path resolution, globs, destination semantics, metadata, gzip, traversal/link safety, unsupported types, and entry/byte budgets. GitHub CI validates this cumulative branch independently.
Reviewer notes
Archive path rewriting and decompression bounds are the primary security review surfaces. #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.