Skip to content

Commit b0a5c65

Browse files
author
JayLin
committed
docs: require tracked repair scope
1 parent 144bb67 commit b0a5c65

1 file changed

Lines changed: 22 additions & 5 deletions

File tree

docs/superpowers/specs/2026-06-30-m4c-bounded-repair-loop-design.md

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@ unit one responsibility.
5050
1. The Repair session receives one explicit approval before Provider or test execution.
5151
2. The repository must be clean at admission. Staged, unstaged, untracked, renamed, deleted,
5252
unmerged, or submodule changes reject the session.
53-
3. Every editable path is an existing regular workspace file, is unique after normalization, and
54-
is listed explicitly. Directory scopes and wildcard scopes are not accepted.
53+
3. Every editable path is an existing Git-tracked regular workspace file, is unique after
54+
normalization, and is listed explicitly. Directory scopes and wildcard scopes are not accepted.
5555
4. The Repair worker's governed executor has a `RepairActionGuard` with the same scope
5656
fingerprint as the coordinator.
5757
5. The guard permits read-only actions, permits writes only when every preview resource is one
@@ -145,6 +145,21 @@ The guard sees trusted Tool preview resources rather than parsing arbitrary Tool
145145
denial returns the existing generic `permission_denied` ToolResult so resource policy details are
146146
not exposed to the model.
147147

148+
### `mini_code_agent.git` tracked-path evidence
149+
150+
`GitService.tracked_paths(paths)` adds one fixed read-only query for exact, already
151+
Workspace-validated paths. `GitClient` invokes:
152+
153+
```text
154+
git <hardened-prefix> ls-files --error-unmatch -z -- <exact-path>...
155+
```
156+
157+
The query has the existing timeout and output budgets, rejects malformed UTF-8/NUL output, and
158+
requires the returned normalized set to equal the requested set exactly. Model-controlled
159+
wildcards and directories never reach Git. This closes the ignored-file gap: a clean status does
160+
not reveal edits to an ignored file, so ignored or otherwise untracked paths cannot enter a Repair
161+
scope.
162+
148163
### `mini_code_agent.repair.fingerprint`
149164

150165
Failure identity is canonical SHA-256 over:
@@ -219,9 +234,10 @@ After approval:
219234
1. read Git status;
220235
2. require a clean repository and no submodule state;
221236
3. revalidate every editable path through the Workspace to catch approval-time drift;
222-
4. verify the worker scope fingerprint;
223-
5. record a required `RepairStarted` journal event;
224-
6. run baseline tests and compare pre/post Git evidence.
237+
4. require the hardened tracked-path query to return every exact editable path;
238+
5. verify the worker scope fingerprint;
239+
6. record a required `RepairStarted` journal event;
240+
7. run baseline tests and compare pre/post Git evidence.
225241

226242
Persistence failure is fail-closed. Best-effort UI event publication is separate from the
227243
required journal, matching the existing Agent runtime pattern.
@@ -307,6 +323,7 @@ start a new approved session. This is fail-closed and avoids replaying writes.
307323

308324
- bounds and cross-field validation;
309325
- canonical scope ordering and duplicate rejection;
326+
- exact tracked-path parsing and ignored/untracked path rejection;
310327
- stable fingerprint under diagnostic reordering and unstable detail changes;
311328
- different execution/report/count/message inputs produce different fingerprints.
312329

0 commit comments

Comments
 (0)