feat(config): add per-repository configuration scopes - #1117
Open
j-token wants to merge 2 commits into
Open
Conversation
…r repository Adds a project config scope alongside the global one so per-repository settings and per-user settings stop mixing: - Harness state gains a project store in <project>/.prime/agent/harness/, merged as global < project < local and selectable with /refine --project, refine.run(scope="project"), and rlm.harness.*(scope="project"). Project refinements are recorded next to their store so they can be rolled back from a later session in the same repository. - rlmMaxDepth is read from project settings before global settings, and /rlm-max-depth accepts --project alongside --global. - contextFiles settings can disable AGENTS.md/CLAUDE.md discovery, drop the global AGENTS.md, or stop the walk above the project root, with /settings toggles for the first two. - Project settings, SYSTEM.md, and APPEND_SYSTEM.md resolve against the project root (nearest .prime/agent directory, else the repository root), so running from a subdirectory uses the repository's configuration. The home directory is never treated as a project. The harness Python API takes scope="local"|"project"|"global" instead of global_=True; the bootstrap schema is bumped so existing kernel venvs rebuild. Daemon: adds the config_scopes server capability and schema revision 15. Clients fall back to the legacy boolean flag on older daemons and fail loudly when project scope is requested.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
<project>/.prime/agent/harness/contextFilescontrols for global and ancestor instruction discoveryrlmMaxDepthuse project settings and support/rlm-max-depth --projectglobal_flag withscope="local" | "project" | "global"Daemon compatibility
This is capability-gated by
config_scopesand updates the daemon schema revision to 15. Clients retain the legacy boolean request for older daemons; project scope reports an explicit error when the daemon does not support it.Note
Add project-repository configuration scope to harness refinement, RLM max depth, and context file settings
projectscope (alongside existinglocalandglobal) for harness state, refinement history, and RLM max depth, stored under<repo-root>/.prime/agent/./refinenow accepts--projectin addition to--global; the Pythonrefine.run()API replacesglobal_=Truewithscope="project"|"global"|"local".global < project < local) instead of two;mergeHarnessStatesand related helpers are updated accordingly.contextFilessettings (enabled,global,ancestors) controllable per scope, with new UI toggles in the interactive settings panel andAGENTS.md/CLAUDE.mddiscovery respecting these flags.config_scopesserver capability; clients connecting to older daemons will receive a clear error when requesting project scope.getProjectDir/getProjectConfigDirhelpers resolve the project root by walking ancestors for.prime/agentor.git, explicitly excluding the home directory.global_=Truekwargs are no longer accepted byget_harness_stateand related Python APIs; callers must migrate toscope="global"; bootstrap schema incremented to 9, requiring a venv rebuild.Macroscope summarized f83974f.