Skip to content

Scope hosted memory by canonical repo identity instead of local path #99

Closed

Description

@CompleteDotTech

Local source: coven-code/issues/03-scope-memory-by-canonical-repo-identity.md

Summary

Hosted review memory should be keyed by canonical GitHub repository identity, not by local checkout path. The current local memory and transcript stores use project root paths, which is fragile in CI, worker pools, and hosted GitHub App deployments.

Current Evidence

  • session_storage::transcript_dir(project_root) uses base64url of the local project root.
  • memdir::auto_memory_path(project_root) uses a sanitized local project root component.
  • settings_sync comments mention project memory keyed by git-remote hash, but helpers accept a caller-supplied project_id.

Problem

Path-derived identity causes several risks:

  • Two checkouts of the same repo under different paths do not share correct memory.
  • A reused workspace path can inherit memory from a different repo.
  • Fork checkouts and upstream checkouts can collide or diverge incorrectly depending on path layout.
  • Hosted workers cannot rely on filesystem path as a security boundary.

Proposed Design

Add a canonical repo identity resolver for hosted mode:

pub struct CanonicalRepoIdentity {
    pub provider: String,      // github
    pub host: String,          // github.com or enterprise host
    pub owner: String,
    pub name: String,
    pub repo_id: Option<String>,
    pub node_id: Option<String>,
    pub default_branch: Option<String>,
}

The GitHub App control plane should pass repo_id, node_id, and full_name from webhook payloads or REST responses. Coven Code should not trust git remote as the only source in hosted mode.

Acceptance Criteria

  • Hosted mode accepts canonical repo identity as structured input.
  • Memory and transcript paths use canonical repo identity, not local checkout path.
  • If canonical identity is missing in hosted mode, durable memory read/write fails closed.
  • Tests cover same repo at two paths mapping to the same hosted memory namespace.
  • Tests cover different repos at the same path mapping to different namespaces.
  • Documentation explains local path identity versus hosted canonical identity.

Implementation Notes

Local interactive mode can continue using project_root. Hosted mode should use GitHub payload identity first, with git remote only as a fallback for diagnostics.

Activity

  1. self-assigned this
    on Jun 20, 2026
  2. added
    security
    hosted-mode
    on Jun 27, 2026
  3. CompleteDotTech commented on Jul 5, 2026

    @CompleteDotTech
    ContributorAuthor

    Cross-repo dependency links from the hosted GitHub App checklist:

    • OpenCoven/coven-github#6
    • OpenCoven/coven-github#7
  4. BunsDev commented on Jul 7, 2026

    @BunsDev
    Member

    PR #132 (merged as 175e65e) added CanonicalRepoIdentity with SSH/HTTPS normalization (hosted_review.rs), and hosted memory/transcripts now require the scope and ignore the local project root (memdir.rs, session_storage.rs).

    Remaining before close:

    • Acceptance tests: same repo checked out at two paths maps to one memory namespace; different repos at the same path map to different namespaces.
    • Reject empty/arbitrary repo ids instead of accepting any string.
  5. added a commit that references this issue on Jul 18, 2026
    0491621
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

hosted-modesecurity

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions