[Feature] Project-scoped continual harness (per-project global state) #1532
Bonobo791
started this conversation in
Feature requests
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Area
Agent core, Coding agent and CLI
Problem
What I'm trying to do: Keep durable, project-specific agent knowledge (build quirks, env-var conventions, dev-server diagnostics, deployment notes) attached to the project it belongs to, so it's available in future sessions
for that project and invisible elsewhere.
What's difficult today: The continual harness has only two scopes — local (a per-session file) and global (one machine-wide file at ~/.prime/agent/harness/harness_state.json). There is no project dimension:
mergeHarnessStates(loadHarnessState(globalDir), loadHarnessState(localDir)) and formats all entries (capped at 6/kind, 180 chars).
from what the host actually loads (split-brain).
path: edit.path ?? before?.path ?? "general".
Net effect: the only way to get project-scoped global state today is a manual convention (pass path="" on every entry, rely on the model to route by relevance). That is not isolation, and nothing enforces or verifies
it.
Proposed direction
Treat the existing path field as a project key and filter on it end-to-end:
host via the session manager (which already knows cwd). Allow an explicit per-session override for repos whose basename isn't the desired key.
option for auditing.
optionally flag project-looking content created without a path.
preserve update()'s preserve-on-None semantics; ship a retag/backfill helper for existing entries.
Expected experience: an entry created with path="project-a" shows up in project A sessions and never appears in project B sessions' prompts or refine-planner context; path="general" entries keep today's behavior; the same
project value is used by kernel CRUD, host prompt assembly, and the refine planner (no split-brain); refine.run() tags entries automatically with no extra prompting.
Alternatives considered
smaller change. Happy to go this route if the team prefers filesystem isolation.
writes and reads diverge (split-brain) unless the host is also made env-aware.
and nudges refinement, but it does not give isolation — host injection still shows everything, and the venv patch is lost on package reinstall.
Additional context
formatHarnessStateForPrompt() with DEFAULT_OVERVIEW_ENTRY_LIMIT = 6 and DEFAULT_OVERVIEW_CONTENT_LIMIT = 180, applyRefinementProposal(), refine-planner system prompt).
future sessions in that repo and noise everywhere else — exactly the case this feature targets.
All reactions