## JobFS Overview **JobFS** is ProcBlock's **virtual filesystem**, used to manage all files in a template-driven job. Paths follow this format: ``` {store}/{filename} ``` All stores are **job-specific**, except for `account/`, which is scoped per account. Paths are flat—**no subdirectories** are allowed. --- ### **Store Roles and Rules** | Store | Purpose | Notes | | --------- | ------------------------------------------------- | ----------------------------------------------------------- | | `input` | Initial user uploads | **Read-only** after upload. | | `mem` | Temporary in-memory files | Ephemeral. Auto-cleared after the job finishes. | | `temp` | Temporary on-disk files | Ephemeral. Auto-cleared after the job finishes. | | `cache` | Job-local cache for reusables (e.g. masks, depth) | Persisted for reuse. Copied forward if job is regenerated. | | `output` | Final deliverables | **Versioned**. CDN-backed. **Included in all exports.** | | `account` | Shared static assets (e.g., logos, overlays) | **Read-only** during processing. Available across all jobs. | --- ### **Versioning & Regeneration Behavior** - **`output/` files are versioned.** Every time the job is processed, the version is incremented. - **Job regeneration** copies over `input/` and `cache/` files from the original job to preserve state without overwriting. --- ### **Export Behavior** - All files written to `output/` are **automatically bundled** into job exports for delivery or download. --- ### **Authoring Guidance** - Never write to `input/` or `account/`. - Use `mem`, `temp`, or `cache` for intermediate results. - Use `account/` only for static, pre-uploaded assets. - Write final results to `output/`—they will be versioned and exported. ### Notable files: - `input/input.png`: A preprocessed uploaded image. - `output/output.png`: The expected target for most jobs. (not enforced) - `input/prefix.yaml`: Will be appended to the job definition during processing. - `cache/mask.png`: The mask editor references this file." - `cache/mask-or.png`: The mask editor saves to this file and the `mask_background` processor will favor it when available.