|
16 | 16 | answer the question, so preview now derives `--workspace` from them: each is |
17 | 17 | attributed to the nearest directory at or above it carrying a project marker |
18 | 18 | (`pyproject.toml`, `package.json`, `go.mod`, `Cargo.toml`, …), and the scope |
19 | | - is that project when exactly one is claimed. The workspace root is left |
20 | | - unchanged whenever the paths do not narrow it — a root-level change, or one |
21 | | - spanning two projects, which narrows to *nothing* rather than to their common |
22 | | - parent, because the parent of two projects is not itself a project. |
23 | | - Documentation and tests cannot outvote code: when more than one project is |
24 | | - claimed, the projects claimed *only* by documentation or test paths drop out, |
25 | | - and the trigger catalog's own docs-only rule decides which paths those are so |
26 | | - the two surfaces cannot drift. That leg is load-bearing — the reported PR |
27 | | - edits `python/agents/README.md` one directory above the project it adds, and |
28 | | - counting that README as a competing claim sends the answer straight back to |
29 | | - the repository root. When that project already carries its own |
30 | | - `shipgate.yaml`, preview |
31 | | - routes to `verify` there instead of to setup, so following the suggestion |
32 | | - once does not turn the next preview into a loop against a manifest that now |
33 | | - exists. `init --write` closes the same gap from the other side: a workspace |
34 | | - whose agents live in more than one project reports |
35 | | - `manifest_status: "refused_ambiguous_scope"` (exit 2) with |
36 | | - `auto_detected.agent_scope` and `agent_project_candidates[]` naming each one, |
37 | | - rather than adopting the first agent name it parsed. A refused run writes |
38 | | - *nothing* — not the manifest, not the CI workflow, not the agent-instruction |
39 | | - snippets, not the reports `.gitignore` block — so a workspace Shipgate |
40 | | - declined to adopt carries no Shipgate edits into the diff. Rank 1 of the |
41 | | - emitted recovery is deliberately not a command: promoting one candidate would |
42 | | - make the same arbitrary pick the refusal exists to prevent. `--minimal` |
43 | | - adopts no detected name or tool surface and is unaffected; a repository that |
44 | | - really is one agent surface across several projects passes |
45 | | - `--allow-ambiguous-scope`; and re-running `init --write |
| 19 | + is that project when exactly one is claimed **and** every capability-bearing |
| 20 | + changed path was claimed by it. A capability path no project owns — a root |
| 21 | + `prompts/system.md` travelling with a change to `services/b` — vetoes the |
| 22 | + answer rather than being dropped, because "this change belongs to |
| 23 | + `services/b`" would then be a false statement about the diff. The workspace |
| 24 | + root is likewise left unchanged whenever the paths do not narrow it — a |
| 25 | + root-level change, or one spanning two projects, which narrows to *nothing* |
| 26 | + rather than to their common parent, because the parent of two projects is not |
| 27 | + itself a project. Documentation and tests cannot outvote code: when more than |
| 28 | + one project is claimed, the projects claimed *only* by documentation or test |
| 29 | + paths drop out, and the trigger catalog's own docs-only rule decides which |
| 30 | + paths those are so the two surfaces cannot drift. That leg is load-bearing — |
| 31 | + the reported PR edits `python/agents/README.md` one directory above the |
| 32 | + project it adds, and counting that README as a competing claim sends the |
| 33 | + answer straight back to the repository root. Base detection now runs in |
| 34 | + preview exactly as it does in `verify` (honoring `--no-base`), because the |
| 35 | + promoted adoption command is the bare `verify --preview --json`: without it |
| 36 | + the preview every first adoption runs evaluates an empty change set and |
| 37 | + nothing below it can fire. Markers are read from the working tree — what |
| 38 | + `init` will run against — so a preview of a head that is not the current |
| 39 | + checkout claims no scope at all rather than recommending a directory that |
| 40 | + depends on what happens to be checked out. When the changed project already |
| 41 | + carries its own `shipgate.yaml`, preview routes to `verify` **there**, ahead |
| 42 | + of any root manifest, which governs a different boundary; that also stops the |
| 43 | + next preview from looping against a manifest that now exists. A change |
| 44 | + spanning several projects routes to `detect` instead of to an `init` that |
| 45 | + would deterministically refuse. |
| 46 | + |
| 47 | + `init --write` closes the same gap from the other side: a workspace whose |
| 48 | + manifest scope is unresolved reports |
| 49 | + `manifest_status: "refused_unresolved_scope"` (exit 2) with |
| 50 | + `auto_detected.agent_scope` and `agent_project_candidates[]`, rather than |
| 51 | + adopting the first agent name it parsed. Two things make a scope unresolved. |
| 52 | + `agent_scope: "ambiguous"` is agents in several self-contained projects — |
| 53 | + evidenced by everything `init` would turn into a manifest, so an |
| 54 | + OpenAPI-only or MCP-only project with no Python at all counts, as does a |
| 55 | + nested `shipgate.yaml` somebody already scoped by hand. `agent_scope: |
| 56 | + "unknown"` is discovery capped before it could tell: Python parsing stops at |
| 57 | + `--max-python-files`, and in a workspace with several project roots a |
| 58 | + "single project" verdict would just be whichever files were read first. |
| 59 | + Truncation alone is not enough to withhold an answer — a repository with one |
| 60 | + project root has nowhere for a second project to hide, so large |
| 61 | + single-project repositories keep their verdict and their working `init`. A |
| 62 | + refused run writes *nothing* — not the manifest, not the CI workflow, not the |
| 63 | + agent-instruction snippets, not the reports `.gitignore` block — so a |
| 64 | + workspace Shipgate declined to adopt carries no Shipgate edits into the diff. |
| 65 | + Rank 1 of the emitted recovery is deliberately not a command: promoting one |
| 66 | + candidate would make the same arbitrary pick the refusal exists to prevent, |
| 67 | + and the refused workspace itself is never offered back. The per-candidate |
| 68 | + commands repeat the setup flags the caller passed, so a recovery cannot |
| 69 | + silently complete with less than `--ci` or an agent-instruction selection |
| 70 | + asked for. `--minimal` adopts no detected name or tool surface and is |
| 71 | + unaffected; a repository that really is one agent surface across several |
| 72 | + projects passes `--allow-unresolved-scope`; and re-running `init --write |
46 | 73 | --agent-instructions=…` on an adopted repository is untouched, because its |
47 | 74 | scope was settled when its manifest was written. |
| 75 | + |
| 76 | + Two surfaces around it were wrong in the same direction. `init --ci` scoped |
| 77 | + to a sub-directory wrote `<project>/.github/workflows/agents-shipgate.yml`, |
| 78 | + which GitHub never loads — a gate reported as written that could not run; the |
| 79 | + workflow now lands at the repository root with a `config:` naming the |
| 80 | + manifest relative to that root. And `TRIGGER-SHIPGATE-MANIFEST` matched |
| 81 | + `shipgate.yaml` only at the repository root, so an edit to |
| 82 | + `services/refund/shipgate.yaml` — the file that declares that project's |
| 83 | + agent, purpose, and tool surface — reported `no_match`; it now matches at any |
| 84 | + depth, as do the pre-commit `files:` regex and the Cursor activation globs |
| 85 | + that copy the catalog, and a nested manifest counts as the repo-already-opted-in |
| 86 | + signal. `tools/shipgate-detect.py` (`script_version` `0.3.0`) carries |
| 87 | + `agent_scope` and `agent_project_candidates[]` too, pinned against the CLI by |
| 88 | + the parity test: an agent that consults the zero-install path must not adopt |
| 89 | + a scope the CLI refuses. |
48 | 90 | ([#363](https://github.com/ThreeMoonsLab/agents-shipgate/issues/363)) |
49 | 91 |
|
50 | 92 | - **The recommended next command now runs where it was recommended.** Every |
|
0 commit comments