Skip to content

Add a hosted-mode memory isolation model #97

Description

@CompleteDotTech

Local source: coven-code/issues/01-hosted-mode-memory-isolation.md

Summary

Coven Code should have an explicit hosted review mode for GitHub App and CI-style deployments where memory, session state, tools, and write behavior are isolated differently than in the local interactive CLI. The current memory model is reasonable for a single local user, but a hosted reviewer needs stronger invariants because one process may review many repositories, installations, and tenants.

Current Evidence

  • src-rust/crates/core/src/session_storage.rs stores transcripts under ~/.coven-code/projects/{base64url(project_root)}/{session_id}.jsonl.
  • src-rust/crates/core/src/memdir.rs stores auto memory under ~/.coven-code/projects/<sanitized-root>/memory or COVEN_CODE_REMOTE_MEMORY_DIR/projects/<sanitized-root>/memory.
  • src-rust/crates/core/src/claudemd.rs loads managed, user, project, and local memory into one prompt fragment.
  • docs/configuration.md documents that user memory applies to all projects.

These are path/user oriented boundaries, not hosted tenant boundaries.

Problem

If Coven Code is used as the coding agent behind a GitHub App reviewer, default local behavior can mix memory across repositories or customers. A hosted process needs to know when it is operating under stricter rules and must refuse memory sources that are appropriate only for a personal local CLI.

Proposed Design

Add a hosted mode flag, for example:

  • CLI flag: --hosted-review
  • Environment variable: COVEN_CODE_HOSTED_REVIEW=1
  • Config field: hostedReview.enabled

When hosted mode is active:

  • Disable global user memory unless explicitly enabled by a trusted tenant policy.
  • Require tenant/install/repo memory scope inputs before durable memory is read or written.
  • Use hosted-specific memory roots rather than ~/.coven-code/projects/<path>.
  • Disable write-capable tools by default.
  • Disable project-local MCP/plugins unless explicitly allowlisted.
  • Mark transcripts and memory entries as hosted-mode artifacts.

Acceptance Criteria

  • Hosted mode can be enabled from CLI, env, and config.
  • Hosted mode changes memory path resolution so no default global user memory is loaded.
  • Hosted mode refuses to persist memory unless a tenant scope and canonical repo identity are supplied.
  • Unit tests prove local mode behavior remains unchanged.
  • Unit tests prove hosted mode uses a separate memory/session namespace.
  • Documentation explains the difference between local personal mode and hosted review mode.

Test Notes

Add tests around memdir::auto_memory_path, claudemd::load_all_memory_files, and session path construction. Tests should verify that hosted mode cannot accidentally read ~/.coven-code/AGENTS.md or path-keyed project memory.

Metadata

Metadata

Assignees

Labels

hosted-modeHosted review mode (GitHub App reviewer) worksecuritySecurity-sensitive issue or work

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions