Skip to content

fix(dispatch): validate repository path components - #382

Merged
StepenkoAnatoli merged 1 commit into
mainfrom
fix/issue-379-validate-repository
Oct 14, 2026
Merged

StepenkoAnatoli merged 1 commit into
mainfrom
fix/issue-379-validate-repository

Conversation

@StepenkoAnatoli

Copy link
Copy Markdown
Owner

Repository components containing .., query/fragment delimiters or separators could alter token-bearing GitHub API request paths. Reject components outside [A-Za-z0-9._-]+, and reject . and .., in the shared repository splitter before any request.

Fixes #379

what changed: Validated both repository components; expanded refusal coverage across dispatch, run lookup, artifact listing and download. Added a positive case for normal dots, underscores and hyphens.

why: Keep every request on its intended repository API route and report malformed repository input as REPOSITORY. No alternative design was set aside.

what it touched: lib/dispatch.mjs, dispatch tests, architecture row, changelog and test inventory. Existing ADR-0033 behavior; no new domain term or public interface.

what you verified: verified - isolated dispatch tests (33 passed), including zero requests for rejected names. The required full suite was accepted by the repository commit gate.

what you got wrong and fixed: mistake - the first validation expression used a $ anchor that can match before a final newline; where - splitRepository during local implementation; impact - caught before commit or delivery, with no published result affected; cause - JavaScript regular-expression end-anchor semantics; fix - refuse any character outside the permitted alphabet and explicitly reject empty/dot components; verified - 33 passing dispatch tests, including trailing CR/LF cases across all four request helpers.

Validation retry: mistake - running six full suites concurrently exceeded the default 3900-second budget; where - local commit validation on this Windows host; impact - affected hooks refused commits before publication; cause - excess concurrent subprocess and filesystem work; fix - retry one commit at a time with the ADR-0142 timeout extension (RESEARCH_KIT_GATE_TIMEOUT=7920); verified - the required full-suite commit gate accepted the commit.

Full-suite detail: verified - 1,778 passed, 0 failed, 12 unsupported capabilities on Windows/Node 24.20.0 in 1772.5 seconds. The gate's documented local unsupported-capability opt-in was used; CI exercises its supported platforms separately.

what changed: Fix #379; dispatch.mjs, dispatch regression coverage, architecture map, changelog and test inventory.

why: Restore the existing collection input and credential-handling contract. This is a bug fix with one remedy; no alternative design was set aside.

what it touched: Shared remote collection seams; existing ADR-0033/0034 behavior. No new domain term or public interface.

what you verified: verified - dispatch/MCP red-first reproduction and passing combined regression run (83 tests); CLI integration regressions pass in the broader command run. The commit gate runs the required complete offline suite before accepting this commit.

what you got wrong and fixed: mistake - running six full suites concurrently exceeded the default 3900-second budget; where - local commit validation on this Windows host; impact - affected hooks refused commits before publication; cause - excess concurrent subprocess and filesystem work; fix - retry one commit at a time with the ADR-0142 timeout extension (RESEARCH_KIT_GATE_TIMEOUT=7920); verified - the required full-suite commit gate accepted the commit.
@StepenkoAnatoli
StepenkoAnatoli merged commit 0dc3ff0 into main Oct 14, 2026
7 checks passed
@StepenkoAnatoli
StepenkoAnatoli deleted the fix/issue-379-validate-repository branch October 14, 2026 18:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

repository is interpolated into GitHub URLs unencoded, so '../x', 'o/..' and 'o/r?x=1' move the token-bearing request off the dispatch route

1 participant