fix(git,macos,runs): close the review findings on #22, #34 and #38

- validateRemoteUrl checks the literal scheme prefix git will receive and
  refuses %/backslash in the authority (WHATWG normalises https:/host and
  percent-escapes that git reads differently); route test for EBADURL.
- Parent-session scrub also drops AI_AGENT, and GIT_EDITOR when it is
  Claude Code's `true`.
- canonicalCwd resolves a not-yet-existing path through its deepest
  existing ancestor, so a symlinked parent still yields one lane.
- Note the clock-step ceiling on liveServers' boot-time filter.
- Docs/header wording: the Active runs count is lane-scoped.
This commit is contained in:
2026-09-23 12:28:02 +07:00
parent 478418f602
commit 04b6b98d97
9 changed files with 61 additions and 9 deletions
+7
View File
@@ -117,6 +117,13 @@ function validateRemoteUrl(url) {
// eslint-disable-next-line no-control-regex
if (/[\s\x00-\x1f\x7f]/.test(url) || url.startsWith("-")) throw refuse();
if (SCP_LIKE.test(url)) return url;
// WHATWG is more forgiving than git: it reads `https:host/x` or `https:\\host`
// as https://host/x, where git sees no "://" and dials an ssh host named
// "https". So the scheme must be spelled out literally, and the authority
// may carry no `%` (git decodes `%2D` into the leading "-" refused below)
// and no backslash — the string checked is the string git gets.
const scheme = ["https://", "ssh://"].find((p) => url.startsWith(p));
if (!scheme || /[%\\]/.test(url.slice(scheme.length).split("/")[0])) throw refuse();
let parsed;
try {
parsed = new URL(url);