Repository navigation
Unify repository context across planning and execution #197
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| # app/repository_context.py — repository context boundary | ||
|
|
||
| <!-- verified-against: 2026-09-26 --> | ||
|
|
||
| `RepositoryContextResolver.for_spec` produces the checkout, planner | ||
| capabilities, protected branches, and high-risk modules for one `TaskSpec`. | ||
| The frozen `spec.repo_path` wins over ambient `REPO_PATHS` and the adapter | ||
| path. The resulting immutable `RepositoryContext` is passed from planning to | ||
| execution and re-resolved before execution starts; a change blocks the run. | ||
|
|
||
| Only genuine adapter absence permits compatibility behavior. With no adapter, | ||
| capabilities are unknown (`None`) when a checkout exists and empty otherwise. | ||
| A known adapter with a missing, unreadable, malformed, or mismatched manifest | ||
| raises `AdapterError`. Malformed checkout or policy fields also raise | ||
| `AdapterError`; no execution path silently substitutes the default policy. | ||
|
|
||
| The resolver owns no planner, executor, persistence, or transport behavior. | ||
| `Copilot` retains its older path and adapter helpers as delegates. Tests in | ||
| `test/test_repository_context.py` cover checkout precedence, policy | ||
| propagation, malformed manifests, and context drift. |
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When
REPO_PATHSor the adapter manifest changes while confirmation is pending, the context comparison occurs only afterrun_taskhas created the run directory and writtentask.json.resume_last()treats that artifact as resumable and calls_executewithoutplanned_context, so the next resume accepts the changed context and executes the run that this drift check just refused, potentially against a different checkout or policy. Recheck before persisting the run, or persist and enforce the planned context during resume.Useful? React with 👍 / 👎.