docs: update slice-dag rebase_onto helper reference [doc-updater] - #2547
Conversation
There was a problem hiding this comment.
No agent-mode design concerns — this is a docs-only update aligning slice-dag.md with the helper inlining done in #2542.
— Authored by egg
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Review
Doc-only change to docs/architecture/slice-dag.md (+11/-7) that updates the rebase_onto callable description to reflect the inlining done in #2542 (closes #2535).
Verification
I traced every claim in the new text against the current code:
| Claim | Verified at |
|---|---|
_build_rebase_onto_args lives at orchestrator.gateway_client._build_rebase_onto_args |
orchestrator/gateway_client.py:55 |
Mirrors gateway.git_client.build_rebase_onto_args (same regex, same shape checks, same canonical argv) |
gateway/git_client.py:2004 |
Orchestrator image does not ship gateway/ |
orchestrator/Dockerfile:15-32 — no COPY gateway/ |
Canonical argv shape ["--onto", new_base, old_base, branch] |
orchestrator/gateway_client.py:101 |
| Client-side rejects flag-shaped, whitespace-bearing, non-git-ref inputs | orchestrator/gateway_client.py:84-99 |
Gateway server re-validates via validate_git_args("rebase", ...) |
gateway/gateway.py:2228 (the /git/execute endpoint runs the allowlist on every submission) |
Caller rebase_onto uses the local helper |
orchestrator/gateway_client.py:1479 |
| #2535 reference | PR #2542 closes #2535 ✓ |
The PR body's justification for not documenting the slice-consensus-isolation fix from #2542 is sound — that change was a bug fix; the docs already describe the per-slice isolation behavior the fix restored.
Non-blocking precision note
The doc calls _build_rebase_onto_args "an inlined copy" of the gateway helper. It's not byte-equivalent — the orchestrator version intentionally diverges in two ways documented at orchestrator/gateway_client.py:66-75:
- Each ref is
.strip()-ed in the emitted argv (whitespace tolerated on input, normalised on output) - It does NOT call
gateway.git_client.validate_git_args(pulling in that import would defeat the point of inlining); the server-side/gitendpoint is the authoritative allowlist boundary.
"Inlined copy" is reasonable shorthand and the doc already captures the security-relevant detail (client-side ref-shape check + server-side validate_git_args re-validation), so this is not worth blocking on. Future doc passes could tighten "inlined copy" to "inlined adaptation" or similar if precision matters.
Verdict
No blocking issues. Approving.
— Authored by egg
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Address non-blocking precision note from reviewer on #2547: - Change "inlined copy" to "inlined adaptation" — the orchestrator helper is not byte-equivalent to the gateway version. - Document the two intentional divergences (matching the source docstring at orchestrator/gateway_client.py:65-75): refs are '.strip()'-ed in the emitted argv, and the helper does not call 'gateway.git_client.validate_git_args' (importing it would defeat the inlining). - Note that the gateway server is the authoritative allowlist boundary; the client-side check is a fast fail, not the security floor. Authored-by: egg
Review feedback dispositionsBoth reviewers approved the PR. The
|
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
No agent-mode design concerns — delta since ae1485c is a 7-line precision tightening of the _build_rebase_onto_args description in docs/architecture/slice-dag.md ("inlined copy" → "inlined adaptation", plus the two documented divergences from the gateway version). Doc-only, no impact on agent prompts, tooling, or sandbox boundaries.
— Authored by egg
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Re-review
Delta since ae1485c4 is a single commit (7d9d924) touching only docs/architecture/slice-dag.md (+10/-3). Verified the precision note from my prior review is addressed correctly.
Verification of the new claims
| Claim in doc | Verified at |
|---|---|
| "inlined adaptation" (not byte-equivalent to gateway helper) | Confirmed: orchestrator/gateway_client.py:101 strips each ref in the emitted argv; gateway/git_client.py:2064 does not. |
"each ref is .strip()-ed in the emitted argv" |
orchestrator/gateway_client.py:101 — ["--onto", new_base.strip(), old_base.strip(), branch.strip()]. |
"does NOT call gateway.git_client.validate_git_args" |
orchestrator/gateway_client.py:55-101 — only the regex shape check runs client-side; gateway helper at gateway/git_client.py:2065 calls validate_git_args, this one doesn't. |
| "the server is the authoritative allowlist boundary; the client-side check is a fast fail, not the security floor" | Matches the source docstring at orchestrator/gateway_client.py:71-75 ("The gateway server's /git endpoint runs the same allowlist validator on every submission, so the security floor is unchanged"). |
Reference to orchestrator/gateway_client.py:65-75 for divergence rationale |
Docstring at lines 65-75 documents both divergences, matches the doc text. |
Precision quibble (non-blocking, not worth a follow-up)
The parenthetical "input whitespace is normalised rather than rejected" is true only for leading/trailing whitespace — interior whitespace is still rejected by the any(ch.isspace() ...) check at orchestrator/gateway_client.py:88. Reading the immediately preceding "each ref is .strip()-ed in the emitted argv" makes the scope clear (.strip() only touches leading/trailing), so this is not actively misleading. Mentioning for completeness only — tightening to "leading/trailing whitespace is normalised" would be marginally more precise but is a wordsmithing pass at best.
No regression risk vs. main
Cross-checked: main's version of this section at docs/architecture/slice-dag.md still describes the pre-#2542 gateway-side build_rebase_onto_args flow, which is now stale. The PR's section update fixes that. The PR branch is behind main on unrelated sections (#2541/#2543/#2546), but those edits are non-overlapping with the rebase_onto callable section, so a merge or squash will compose cleanly.
Verdict
The non-blocking suggestion was addressed thoroughly and accurately. No new issues. Approving.
— Authored by egg
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Per re-review on PR #2547: the parenthetical 'input whitespace is normalised rather than rejected' was true only for leading/trailing whitespace — interior whitespace is still rejected by the any(ch.isspace()) check at orchestrator/gateway_client.py:88. Tightened to 'leading/trailing whitespace is normalised rather than rejected; interior whitespace is still rejected by the regex shape check' to match the docstring at lines 68-70 and the actual code behaviour.
Review feedback dispositionsRe-review on
|
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
No agent-mode design concerns — delta since 7d9d9245 is a single commit (2dc9f697) tightening one parenthetical in docs/architecture/slice-dag.md (+3/-2) so the doc distinguishes leading/trailing whitespace (normalised via .strip()) from interior whitespace (rejected by any(ch.isspace())). Pure precision fix, doc-only, no impact on agent design surface.
— Authored by egg
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Re-review (commit 2dc9f697)
Delta since 7d9d924 is a 5-line tightening of docs/architecture/slice-dag.md addressing the non-blocking precision note from my prior review. PR remains docs-only — full PR scope vs merge base (685253df7) is +19/-7 in one file.
Verification of the new claim
The new parenthetical reads: "leading/trailing whitespace is normalised rather than rejected; interior whitespace is still rejected by the regex shape check".
| Claim | Verified at |
|---|---|
| Leading/trailing whitespace is normalised (not rejected) | orchestrator/gateway_client.py:101 — [..., new_base.strip(), old_base.strip(), branch.strip()]. str.strip() only touches leading/trailing. |
| Interior whitespace is rejected | orchestrator/gateway_client.py:88 (and would also fail the regex at line 94) |
The behaviour is correctly described.
Non-blocking precision quibble (please ignore)
Strictly speaking, interior whitespace is gated by the explicit any(ch.isspace() or ch == "\x00" for ch in v) check at orchestrator/gateway_client.py:88, which fires before the regex fullmatch at line 94. The regex (^[A-Za-z0-9._/+-][A-Za-z0-9._/+-]*$) would reject whitespace too — \s is not in the allowlist — so calling it "the regex shape check" isn't wrong, but the actual rejecting gate is the dedicated isspace check. Saying "rejected by the shape check" or "rejected client-side" would be one notch more precise.
This is wordsmithing on top of wordsmithing on a docs-only PR. Not worth a follow-up commit — flagging for the record only.
Verdict
No blocking issues. The previous suggestion was addressed correctly. Approving.
— Authored by egg
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
The previous wording said interior whitespace was 'rejected by the regex shape check', which understates which gate actually rejects it: the explicit any(ch.isspace() or ch == '\x00' for ch in v) check at orchestrator/gateway_client.py:88 fires before the regex fullmatch at line 94. The regex would reject whitespace too (whitespace is not in the allowlist), but the dedicated isspace/NUL check is the active gate. Updated the parenthetical to say 'rejected client-side by the explicit isspace/NUL check that fires before the regex shape check'.
Review feedback dispositionsRe-review on
|
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
No agent-mode design concerns — delta since 2dc9f697 is a single commit (fd26c8f) that tightens one parenthetical in docs/architecture/slice-dag.md (+2/-1), addressing the precision quibble from my prior review. The wording now correctly attributes interior-whitespace rejection to the explicit isspace/NUL check at orchestrator/gateway_client.py:88 rather than the downstream regex. Pure doc precision fix, no impact on agent design surface.
— Authored by egg
There was a problem hiding this comment.
Re-review (commit fd26c8f)
Delta since 2dc9f697 is a single commit (fd26c8f) tightening one parenthetical in docs/architecture/slice-dag.md (+2/-1) per my prior non-blocking precision quibble.
Verification
The new wording reads: "interior whitespace is still rejected client-side by the explicit isspace/NUL check that fires before the regex shape check".
| Claim | Verified at |
|---|---|
| Leading/trailing whitespace normalised (not rejected) | orchestrator/gateway_client.py:101 — emits [..., new_base.strip(), old_base.strip(), branch.strip()]. |
Interior whitespace rejected by an explicit isspace/NUL check |
orchestrator/gateway_client.py:88 — if any(ch.isspace() or ch == "\x00" for ch in v):. |
| That check fires before the regex shape check | orchestrator/gateway_client.py:88 runs before the _REBASE_REF_RE.fullmatch(v) at line 94. |
| The regex check is "the regex shape check" | _REBASE_REF_RE is ^[A-Za-z0-9._/+-][A-Za-z0-9._/+-]*$ — a shape-only allowlist, not a semantic git-ref validator. |
The wording now correctly attributes the rejection to the active gate (isspace/NUL at line 88) rather than the downstream regex (line 94). This matches the docstring at orchestrator/gateway_client.py:60-75 and the precise code path.
No regression risk vs main
Cross-checked: this PR's change is still confined to a single paragraph in docs/architecture/slice-dag.md. The other unrelated edits to that file on main (#2541/#2543/#2546) do not overlap the rebase_onto callable section, so a merge or squash composes cleanly.
Verdict
The non-blocking precision quibble was addressed accurately. No new issues found in the delta or in the surrounding paragraph. Approving.
— Authored by egg
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
| egg is addressing review feedback... |
Review feedback dispositionsRe-review on
|
|
egg feedback addressed. View run logs 14 previous review(s) hidden. |
docs: update slice-dag rebase_onto helper reference for #2542
Update documentation to reflect changes from 685253d:
slice-dag.mdstill referencedgateway.git_client.build_rebase_onto_argsas the argv builder used by
GatewayClient.rebase_onto. That import wasinlined into
orchestrator/gateway_client._build_rebase_onto_argsin Fix #2535: stop slice-N from inheriting slice-(N-1) consensus, drop gateway import #2542to remove the orchestrator image's runtime dependency on the
gateway/package. Updated the description to reference the new inlined helper and note
that the gateway server still re-validates args server-side.
The slice consensus isolation fix (also in #2542) is a bug fix; the docs already
described the intended isolation behavior so no further changes were needed.
Triggered by: #2542
Authored-by: egg