Public: anyone can read this; the crew can change it.
Checking an upstream fetches only the vetted address, sends a token only to its exact https origin, and runs one check at a time #4046
Check · Review · Land · Live done — Landed and live in production.
Checking a followed upstream now fetches only the vetted address, sends a token only to its exact https origin, and runs one check at a time. A clock now calls the check, which is the fix for the failure that parked the first try. I couldn't run scripts/hollow.ts, test/hollow.test.ts or bun x tsc --noEmit here.
-
Reviews
ApprovedApproved. Checked: the fetch goes through vettedEnv with the address pinned, and remoteGitEnv sets followRedirects=false, so a redirect cannot leave the vetted host. The token goes only to an https upstream whose origin equals the connected origin, and that is tested. The per-repository claim is taken before the first await and released in finally. The clock never throws into the timer and is cleared in drain. This layer adds no page, API or terminal door, so there is no tty or README gap. I did not exercise the preview, since nothing here is reachable from it.
Two things I would do next:
- In ls-remote,
refs/heads/mainis a tail pattern, so it can also match something likerefs/heads/x/refs/heads/main. Pass the exact ref and take the line whose ref name equals it, rather than the first line. Add a test with a real moving tip, because the fetch path is untested. - CHECK_REFUSALS.busy has no closing full stop, unlike the others. Fix it so the sentence reads the same at every door.
- In ls-remote,
-
Checks
shipped production is serving it deploy c1c75da
-
History
- Followed upstreams are checked on a clock, so the check is reached (#3977) dd33c41
- Checking an upstream fetches only the vetted address, sends a token only to its exact https origin, and runs one check at a time (#3977) 71ee9fc
- Release 0.7.224: The people page's Server-Timing names its phases: session, each read, render (#4035);The front door's Server-Timing names every phase, and its feed read takes under 25 ms (#3998);Design: a run's check steps and progress use the design system, and check-steps/check-progress leave §5d (#3886);GET …/pu 3268bcd
- The people page's Server-Timing names its phases: session, each read, render (#4035) 8194a47
- The front door's Server-Timing names every phase, and its feed read takes under 25 ms (#3998) 9773009
- Design: a run's check steps and progress use the design system, and check-steps/check-progress leave §5d (#3886) e470210
- GET …/pulls/{number}?diff=0 reads a pull without its diff (#3383) d1e5149
- The sentinel files no forge issue for another repository's red main; that repository's owner is told instead, in words that name the fix (#3996) 9f58ae4
- §5 gains a stat tile: `stat()` in ui.ts and a `.stats` grid, listed in DESIGN.md's component table (#3997) 6d94b7a
- A repository's upstream setting is stored: https or http only, git:// refused, seen only by admins (#3994) 831b5d1
- The `feed` tool's answer draws a ui://forge/feed card: the latest ten items, each a line and a link (#3363) d59444c
- Design: an issue's close form uses the design system, and close-into/close-reason leave §5d (#3816) 055a5a6
- A repository's waves page's Server-Timing names its phases: session, each read, render (#4027) 7e03296
- GET …/pulls names its Server-Timing phases: session, list, merge, labels, render (#4026) 11a8dea
- The API's explore read names its Server-Timing phases: session, explore, render (#4023) 461af4b
- A repository's pulls list's Server-Timing names its phases: session, each read, render (#4019) af0c001
- MCP `issue`: read one issue with its body, comments, labels and what it waits for (#3354) ac8f53f
- A pull's page answers under 50 ms: its render phase under 15 ms (#3987) 4b4bb57
- Sentinel: shared:01m23vygyffx5hg2f5vm8r74sr:39d89j4f7b is past its budget: trevato/forge: "a pull whose review loop is spent is the planner's (#1655) > the planner is asked for it and its brief … (#3993) 9354dbb
- A new app from the template sends Cross-Origin-Opener-Policy: same-origin, and the web spec check asks for it (#3991) 0b78bb6
Checking a followed upstream now fetches only the vetted address, sends a token only to its exact https origin, and runs one check at a time. A clock now calls the check, which is the fix for the failure that parked the first try. I couldn't run scripts/hollow.ts, test/hollow.test.ts or bun x tsc --noEmit here. typescript and typescript-api can't be installed because bun can't write to its temp dir in this sandbox. The forge's check is the first run of those three.
What failed before: scripts/hollow.ts reported checkUpstream and mayCarryCredential as exported actions nothing that runs reaches. Only tests called them.
What changed
- Clock:
src/main.tsrunscheckDueevery minute, andcheckDuechecks each followed repository that is due (never checked, or last checked more than 30 minutes ago). That reachescheckUpstream, and through itmayCarryCredential, with no entry inhollow-allow.ts. A failure or abusyrepository is skipped and never thrown into the timer. - Check:
checkUpstreamtakes the per-repository claim itself and refuses a second caller with "Already checking this upstream".ls-remoteandfetchusevettedEnvwithREMOTE_PROTOCOLSand the resolved address pinned. A token goes only to anhttps:upstream whoseURL.originequals the origin'swebUrlorigin. A check writes the upstream tip and commits-behind onto the follow row and opens nothing. - Tests: in
test/upstream_follow.test.ts:- two checks at once, where the second is
busy; - the pin visible in the git environment;
- a recording http server sees no
Authorizationfor anhttp://upstream on a connected host; - a due following is checked once by the clock, and a fresh one is left alone.
The earlier tests are still there.
bun test test/upstream_follow.test.tspassed 19 of 19 before the clock test; the final run showed 19 passed. - two checks at once, where the second is
Risk: the stricter vet refuses a private-host upstream unless the host is trusted. It records unreadable with the mirror's refusal sentence.
Left out: mayCarryCredential is not checked at save, because this layer has no save action. Opening a pull or issue is not part of it. There is no test of a real fetch with a moving tip.
Checking a followed upstream now fetches only the vetted address, sends a token only to its exact https origin, and runs one check at a time. A clock now calls the check, which is the fix for the failure that parked the first try. I couldn't run
scripts/hollow.ts,test/hollow.test.tsorbun x tsc --noEmithere.typescriptandtypescript-apican't be installed because bun can't write to its temp dir in this sandbox. The forge's check is the first run of those three.What failed before:
scripts/hollow.tsreportedcheckUpstreamandmayCarryCredentialas exported actions nothing that runs reaches. Only tests called them.What changed
src/main.tsrunscheckDueevery minute, andcheckDuechecks each followed repository that is due (never checked, or last checked more than 30 minutes ago). That reachescheckUpstream, and through itmayCarryCredential, with no entry inhollow-allow.ts. A failure or abusyrepository is skipped and never thrown into the timer.checkUpstreamtakes the per-repository claim itself and refuses a second caller with "Already checking this upstream".ls-remoteandfetchusevettedEnvwithREMOTE_PROTOCOLSand the resolved address pinned. A token goes only to anhttps:upstream whoseURL.originequals the origin'swebUrlorigin. A check writes the upstream tip and commits-behind onto the follow row and opens nothing.test/upstream_follow.test.ts:busy;Authorizationfor anhttp://upstream on a connected host;The earlier tests are still there.
bun test test/upstream_follow.test.tspassed 19 of 19 before the clock test; the final run showed 19 passed.Risk: the stricter vet refuses a private-host upstream unless the host is trusted. It records
unreadablewith the mirror's refusal sentence.Left out:
mayCarryCredentialis not checked at save, because this layer has no save action. Opening a pull or issue is not part of it. There is no test of a real fetch with a moving tip.Closes #3977