Skip to content
C.W.K.
Stream
Lesson 03 of 04 · published

Attachments Cross the Boundary

~12 min · attachments, storage, manifest, retention

Level 0Cold Vessel
0 XP0/36 lessons0/12 achievements
0/100 XP to next level100 XP to go0% complete

Attachments Cross the Boundary

Some scoped work cannot fit in text. A spreadsheet, screenshot, export, or source packet may be the evidence the executor must inspect. Attachments belong to the delegation package, but they do not belong in the source repository that implements the workshop.

An engine-owned material store gives them a separate lifecycle. Metadata lives with the delegation: original name, media type, byte size, digest, and storage key. Blobs live outside Git under limits and access rules. The brief contains a manifest so the author knows what exists without embedding bytes in prose.

Upload and replacement are queued-only mutations. Taking the work freezes the manifest and bytes together. Deleting a still-queued delegation may remove its material; taken, landed, or abandoned records keep the package because it explains what the session saw.

Serving attachments requires narrow identifiers and authorization. Raw filesystem paths never cross the API. A request resolves delegation plus attachment key, checks ownership and state, and streams the stored bytes with a safe content type and filename.

Manifest Before Bytes

Let the session inspect the manifest first: name, size, type, and digest. It can decide which files to open without crawling a directory or guessing from private paths.

Verify lifecycle as a matrix: upload, replace, take, read, delete delegation, and retention. A happy-path download proves almost none of the boundary.

An attachment becomes evidence only after the engine owns its bytes. Copy or ingest the file under bounded size and identity rules, then bind that stored object to the work order. A path into someone else's mutable filesystem is a hint, not a durable input.

Code

Build an attachment manifest without leaking paths·python
from hashlib import sha256

payload = b"account,total\nA,42\n"
manifest = {
    "name": "summary.csv",
    "media_type": "text/csv",
    "size": len(payload),
    "sha256": sha256(payload).hexdigest(),
}
assert "path" not in manifest
print(manifest)

External links

Exercise

Create a lifecycle matrix for one attachment: which operations are allowed in queued, taken, landed, and abandoned states, and why?
Hint
Separate read permission from mutation permission.

Progress

Progress is local-only — sign in to sync across devices.
Spotted a bug or have feedback on this page?Report an Issue

Comments 0

🔔 Reply notifications (sign in)
Sign inPlease sign in to comment.

No comments yet — be the first.