Skip to content

Backend should not depend on HOME or host filesystem mirroring #167

@changhoon-sung

Description

@changhoon-sung

Problem

The current backend crosses the client/backend boundary.

Today the backend requires a bind mount of the client host filesystem, effectively /Users/<username>, so it can resolve absolute local paths persisted as provenance.source_uri.

That is the wrong abstraction.

A backend should not depend on:

  • client HOME
  • client absolute paths
  • host filesystem visibility
  • path mirroring inside the container

This is both:

  • a privacy/security issue — mounting HOME is far too broad
  • an architecture issue — the backend is not client-agnostic

Why this matters

The CLI is the client. The backend should only deal with:

  • API payloads
  • graph persistence
  • query/analysis

It should not know where a repo lives on a user machine, how files are read, or what local path layout the client uses.

Right now we have path-coupled persistence and path-coupled backend behavior. That makes the system fragile, privacy-invasive, and harder to support across environments, runtimes, and future clients.

Proposed direction

Separate responsibilities cleanly.

Client responsibilities

  • file discovery
  • file reads
  • hashing / caching
  • parsing / patch generation
  • absolute → workspace-relative path conversion

Backend responsibilities

  • revisions
  • persistence
  • graph query
  • conflict / map / analysis services

The backend should ingest structured facts, not read client files.

Required changes

  1. Stop using host absolute paths as canonical source identity
  2. Introduce workspace-scoped relative identity:
    • workspace_id
    • workspace_relative_path
  3. Move ingestion/file access fully to the client side
  4. Remove backend reliance on HOME bind mounts
  5. Refactor backend joins and lookups away from absolute source_uri

Acceptance criteria

  • backend runs without HOME or broad host bind mounts
  • ingestion works from client-provided payloads only
  • persisted source identity is workspace-scoped and relative
  • backend query/analysis paths do not require filesystem access

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions