Repository navigation
Description
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.rsstores transcripts under~/.coven-code/projects/{base64url(project_root)}/{session_id}.jsonl.src-rust/crates/core/src/memdir.rsstores auto memory under~/.coven-code/projects/<sanitized-root>/memoryorCOVEN_CODE_REMOTE_MEMORY_DIR/projects/<sanitized-root>/memory.src-rust/crates/core/src/claudemd.rsloads managed, user, project, and local memory into one prompt fragment.docs/configuration.mddocuments 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.
Activity
CompleteDotTech commentedon Jul 5, 2026
Cross-repo dependency links from the hosted GitHub App checklist:
BunsDev commentedon Jul 7, 2026
Reviewed against current
main(post #122). Status: foundation landed, but the acceptance criteria are only partially met. This should stay open.Implemented by #122 (verified in code)
--hosted-review(crates/cli/src/main.rs:253),COVEN_CODE_HOSTED_REVIEW(crates/core/src/hosted_review.rs:49), andconfig.hostedReview.enabled(crates/core/src/lib.rs:1290).MemoryLoadOptions::hosted_review()disables user memory and managed rules, wired into runtime context building (crates/cli/src/main.rs:597,609). Testshosted_review_excludes_user_memory_by_defaultandhosted_review_context_skips_global_user_memorycover this, plus a local-mode-unchanged path viaMemoryLoadOptions::local().memdir::auto_memory_path_for_modeandsession_storage::transcript_path_for_moderesolve to~/.coven-code/hosted-review/tenants/<tenant>/repos/<repo>/...and return a config error when noHostedReviewScopeis supplied.hostedReview: true(crates/cli/src/main.rs:1981).docs/configuration.md("Hosted review mode") anddocs/advanced.md("Hosted review memory isolation").Remaining gaps
auto_memory_path_for_mode,transcript_dir_for_mode,transcript_path_for_mode, andHostedReviewScopeare only exercised by their own unit tests. Runtime transcript writes still go through localtranscript_path(crates/commands/src/lib.rs:8134), and sessions still save to the shared~/.coven-code/sessions/<id>.json(crates/core/src/lib.rs:3466) regardless of mode. So the "hosted mode uses a separate memory/session namespace" and "refuses to persist without tenant scope" criteria are enforced only in dead code paths; hosted sessions currently persist into the same path-keyed local namespaces, just tagged withhostedReview: true.HostedReviewScope, so the hosted namespaces are unreachable at runtime.crates/tools.crates/mcp.Suggested follow-up scope
--hosted-tenant/--hosted-repo, or env equivalents; optionally derive canonical repo identity from the git remote) and threadHostedReviewScopeinto session startup.history::save_session, auto-memory writes) through the_for_modefunctions whenhosted_review_enabled(), so a missing scope hard-fails or disables durable persistence instead of silently falling back to local paths.~/.coven-code/projects/or~/.coven-code/sessions/.Related: tracking issue #119, #100, and the cross-repo items OpenCoven/coven-github#6 / OpenCoven/coven-github#4.
feat(hosted): upstream hosted review hardening stack (OpenCoven#132)