NOXR-fiaxqahj

Image Attachments for Issues & Comments

End-to-end attachment support across CLI, desktop, and sync — local-first asset storage with content-addressed naming, logical URI references in markdown, and out-of-band binary sync for linked projects.

4
Phases
14
Subtasks
3
Checkpoints
0%
Complete
📷

Attach & Render Screenshots

Insert and display image attachments inside issue descriptions and comments from both CLI and desktop.

💾

Local-First Storage

Assets stored on the local filesystem by default under .fp/assets/ with content-addressed SHA-256 naming.

🔃

Out-of-Band Sync

Sync binary assets to remote object storage independently of Yjs issue sync frames — no binary blobs in WebSocket protocol.

📄

Markdown Source of Truth

Use fp-asset://<id> logical URIs in markdown. Shared resolver renders consistently across all surfaces.

🗃

Content-Addressed Storage

Binary files stored under .fp/assets/ with SHA-256 hash filenames and MIME/size metadata in SQLite.

🔗

Logical URI Scheme

fp-asset://<asset-id> replaces raw file:// URLs in markdown for portable, resolver-agnostic references.

📈

Derived Asset Indexes

Local and remote tables track which issues/comments reference which assets — driven from Y.Doc state, not command handlers.

🔒

Authenticated Asset API

Project-scoped upload/download via Worker routes backed by R2 object storage. Separate from WebSocket Yjs protocol.

🔄

Sidecar Reconciliation

Asset reconcile pass runs after issue sync converges. Upload/download queue handles races and retries independently.

🎨

Shared Markdown Resolver

One resolver pipeline for fp-asset:// refs across desktop, fp-ui review, and console — no per-surface forks.

graph TD
    subgraph LOCAL["Local Storage"]
        ASSETS[".fp/assets/\nContent-Addressed Files"]
        SQLITE["SQLite\nMetadata + Ref Indexes"]
    end

    subgraph MARKDOWN["Markdown Layer"]
        URI["fp-asset:// URIs\nin Issue/Comment Markdown"]
    end

    subgraph RESOLVER["Shared Resolver"]
        PIPE["Attachment-Aware\nMarkdown Pipeline"]
    end

    subgraph SURFACES["Rendering Surfaces"]
        CLI["CLI"]
        DESKTOP["Desktop"]
        CONSOLE["Console Web"]
    end

    subgraph SYNC["Asset Sync Layer"]
        QUEUE["Reconcile Queue"]
        API["Worker Asset API\nAuthenticated Routes"]
        R2["R2 Object Storage"]
    end

    ASSETS --> URI
    SQLITE --> URI
    URI --> PIPE
    PIPE --> CLI
    PIPE --> DESKTOP
    PIPE --> CONSOLE
    ASSETS -.->|upload| QUEUE
    QUEUE -->|HTTP| API
    API --> R2
    R2 -->|download| QUEUE
    QUEUE -.->|hydrate| ASSETS

    classDef localStyle fill:#22d3ee11,stroke:#22d3ee44,stroke-width:2px
    classDef mdStyle fill:#34d39911,stroke:#34d39944,stroke-width:2px
    classDef resolverStyle fill:#fbbf2411,stroke:#fbbf2444,stroke-width:2px
    classDef surfaceStyle fill:#a78bfa11,stroke:#a78bfa44,stroke-width:2px
    classDef syncStyle fill:#f4728011,stroke:#f4728044,stroke-width:2px

    class ASSETS,SQLITE localStyle
    class URI mdStyle
    class PIPE resolverStyle
    class CLI,DESKTOP,CONSOLE surfaceStyle
    class QUEUE,API,R2 syncStyle
        
Phase 1 · Foundations
→
Phase 2 · Local Workflows
→
⚑ Local Checkpoint
→
Phase 3 · Asset Sync
→
⚑ Sync Checkpoint
→
Phase 4 · Hardening
→
⚑ Final Regression
1
NOXR-utgfvrkk High Todo

Attachment Foundations & Shared Primitives

Lock down asset identity, local storage layout, and logical markdown URI rules. Build shared rendering and derived-data machinery once.

NOXR-qccjjwzw Define asset model, filesystem layout & URI format
  • .fp/assets/ layout with content-addressed naming
  • SQLite metadata tables for assets and derived reference indexes
  • fp-asset:// URI syntax definition
  • Placeholder/error states for missing, pending, unauthorized assets
High
NOXR-gjeqjgwk Build shared markdown image resolver pipeline
  • Single shared resolver contract for fp-asset:// refs
  • Used by desktop, fp-ui review, and console markdown consumers
  • Handles pending, missing, unauthorized states consistently
  • Normal http(s) images pass through unchanged
Med
NOXR-qqsuxvop Maintain derived asset-reference indexes
  • Local derived index for attachment refs keyed by issue + logical location
  • Issue-level reindex function from Y.Doc
  • Wired into createIssue, updateIssue, createComment, deleteComment, deleteIssue, and sync callbacks
Med
Phase 1 complete → Phase 2 begins
2
NOXR-djpgrzyw Medium Todo

Local Attachment Workflows

Let users ingest local images and place logical attachment refs into issue/comment markdown. Local-only projects work without sync.

NOXR-vnuguytv Add CLI attachment workflows
  • fp attach <file> command — ingest, hash, print markdown reference
  • --attach flag on issue create/update/comment
  • Linked vs unlinked project handling
Med
NOXR-ndyvpbkb Auto-detect local image paths in markdown
  • Auto-rewrite local file paths to fp-asset:// URIs
  • Skip existing fp-asset:// and http(s) refs
  • Convenience layer on top of explicit fp attach
Med
NOXR-xcegicoy Desktop attachment ingestion & compose UX
  • Paperclip, paste, drag-drop flows
  • Electron-specific protocol/IPC for shared resolver
  • Upload/download pending states and preview sizing
Med
⚑NOXR-xfkywlhw Checkpoint: Verify local attachment workflows
  • First E2E sweep before remote sync work begins
  • CLI, review UI, and desktop surfaces exercised
  • Uses repo QA scripts and Playwright infrastructure
High
Local checkpoint passed → Phase 3 begins
3
NOXR-ndvhgjbe High Todo

Asset Sync Layer for Linked Projects

Keep binary asset movement outside Yjs frames. Make linked projects converge attachment bytes independently of markdown state.

NOXR-ldpjgifm Specify asset sync protocol & reconcile semantics
  • Canonical asset identity + manifest/reconcile shapes
  • Upload, download, skip, retry, missing states
  • Sidecar HTTP vs protocol changes decision
  • Race and failure semantics
High
NOXR-imrgklti Implement project asset API & object storage
  • Worker routes for authenticated upload/download/reconcile
  • Object storage bindings + metadata tables
  • Project-scoped access control
  • Presigned vs Worker-proxied upload decision
High
NOXR-itbogrpr Integrate reconciliation with project sync & desktop
  • Asset reconcile/upload/download in fp project sync
  • Asset queue in desktop persistent sync
  • Fresh clone convergence
  • Markdown-before-bytes race handling
High
⚑NOXR-takuanxa Checkpoint: Verify linked-project attachment sync
  • Two linked clients creating/syncing attachments
  • Race/failure case exercise
  • Sync logs + browser/desktop evidence
High
Sync checkpoint passed → Phase 4 begins
4
NOXR-lfpeoyar Medium Todo

Harden Security, Cleanup, Recovery & Tests

Close the loop on correctness and operability. Enforce validation, define GC, add recovery, run final regression.

NOXR-snoxmqaf Enforce validation, authorization & access policy
  • MIME/extension/size policy at all boundaries
  • Project-scoped read/write auth
  • Blocked/unauthorized placeholder states
High
NOXR-pwieiqpy Define retention, cleanup & recovery behavior
  • GC for unreferenced local and remote assets
  • Missing/corrupt blob handling
  • Recovery path for re-download/re-ingest
Med
⚑NOXR-ivqxrclg Checkpoint: Final attachment regression
  • Full regression sweep across CLI, sync, browser, and desktop
  • Extends existing QA scenarios
  • Recorded run with evidence in packages/qa-scripts/results/
Med