main
ply4 git calls318 ms43 KiB2 cachedprotocol v2
57 lines2.1 KiBRaw
1import { REVOKED_STATUS } from './baseline.ts'
3/** Artifacts' own 403 text when the bearer this stage minted is dead. */
4export const EXPIRED_TOKEN = 'Invalid or expired token'
6/** Git info/refs on the scratch remote. The bearer is not part of the URL. */
7export function artifactsProbeUrl(remote: string): string {
8 const base = remote.endsWith('/') ? remote.slice(0, -1) : remote
9 return `${base}/info/refs?service=git-upload-pack`
12/** The post-revoke probe succeeded when Artifacts answered 403. */
13export function revokeConfirmed(status: number): boolean {
14 return status === REVOKED_STATUS
17export type OpeningRevoke =
18 | { readonly ok: true }
19 | { readonly ok: false; readonly reason: string }
21/**
22 * The token Artifacts returns from repo create is revoked before the smoke mints its own.
23 * The check is unevaluable without that token, a listed id, a successful revoke, and a 403.
24 */
25export function openingRevokeResult(input: {
26 readonly hadToken: boolean
27 readonly listed: number
28 readonly revoked: boolean
29 readonly confirmed: boolean
30}): OpeningRevoke {
31 if (!input.hadToken) return { ok: false, reason: 'repo create returned no token' }
32 if (input.listed === 0) return { ok: false, reason: 'repo create token was not listed' }
33 if (!input.revoked || !input.confirmed) return { ok: false, reason: 'repo create token was not revoked' }
34 return { ok: true }
37export type FailureClass = 'harness_fault' | 'worker'
39export type CallEvidence = {
40 readonly status: number
41 readonly body: string
42 /** Abort, curl 000, or no HTTP response. */
43 readonly timedOut: boolean
44 /** The call presented a token this stage minted. */
45 readonly mintedToken: boolean
48/**
49 * No response is the harness: the version was never reached.
50 * A 403 that names a token minted in this stage is the same fault.
51 * A Worker that answered anything else is a version failure.
52 */
53export function classifyCall(evidence: CallEvidence): FailureClass {
54 if (evidence.timedOut || evidence.status === 0) return 'harness_fault'
55 if (evidence.status === REVOKED_STATUS && evidence.mintedToken && evidence.body.includes(EXPIRED_TOKEN)) return 'harness_fault'
56 return 'worker'
Diagnostics4 git calls · 318 ms
CallStatusSizeTime0318 ms
discover200152 B3 ms
git.upload-pack discover
http.response.status_code=200
git.upstream.cf_ray=-
git.upstream.phase=fetch
git.upstream.dur_ms=2
git.response.bytes=152
git.server.agent=gitty/1.0
git.server.object_format=sha1
git.server.caps=agent ls-refs fetch object-format
git.server.fetch=shallow filter sideband-all
git.protocol.version=2
git.pkt.frames=8
git.pkt.data=6
git.pkt.flush=2
git.pkt.delim=0
git.pkt.bytes=152
git.pkt.payload.max=34
ls-refs200145 B · hit3 ms
git.upload-pack ls-refs
http.response.status_code=200
git.upstream.cf_ray=-
git.upstream.phase=ls-refs
git.upstream.dur_ms=3
git.response.bytes=145
git.response.cache=HIT
git.response.duration_ms=3
git.protocol.version=2
git.pkt.frames=3
git.pkt.data=2
git.pkt.flush=1
git.pkt.delim=0
git.pkt.bytes=145
git.pkt.payload.max=76
git.ls_refs.count=2
git.ls_refs.head=refs/heads/main
fetchblob:none · deepen 1020042 KiB · hit2 ms
git.upload-pack fetch
http.response.status_code=200
git.upstream.cf_ray=-
git.upstream.phase=fetch
git.upstream.dur_ms=313
git.response.bytes=42585
git.response.cache=HIT
git.response.duration_ms=2
git.fetch.filter=blob:none
git.fetch.filter.requested=tree:0
git.fetch.filter.fallback=blob:none
git.fetch.filter.learned=false
git.fetch.wants=262b639aa1b258fc1777c3a66ba8f811df3a3da2
git.fetch.haves.count=0
git.fetch.deepen=10
git.fetch.thin_pack=false
git.fetch.ofs_delta=true
git.protocol.version=2
git.pkt.frames=6
git.pkt.data=4
git.pkt.flush=1
git.pkt.delim=1
git.pkt.bytes=42585
git.pkt.payload.max=42490
git.sideband.band1.bytes=42489
git.sideband.band2.bytes=0
git.sideband.band3.bytes=0
git.pack.objects=61
git.pack.bytes=42489
git.pack.ofs_delta=0
git.pack.ref_delta=0
git.pack.chain.max=0
git.pack.trailer=7dbf576d97429022615f79aa46b440d9da603496
git.pack.full=61
Open pack map
fetch200970 B313 ms
git.upload-pack fetch
http.response.status_code=200
git.response.bytes=970
git.response.cache=MISS
git.response.duration_ms=313
git.fetch.wants=ddd527b6f26cb17831d41600b99bfaba875fee10
git.fetch.haves.count=0
git.fetch.deepen=0
git.fetch.thin_pack=false
git.fetch.ofs_delta=true
git.protocol.version=2
git.pkt.frames=3
git.pkt.data=2
git.pkt.flush=1
git.pkt.delim=0
git.pkt.bytes=970
git.pkt.payload.max=949
git.sideband.band1.bytes=948
git.sideband.band2.bytes=0
git.sideband.band3.bytes=0

Each row is one HTTP round trip ply made to the git server for this page, on one timeline. discover asks what the server speaks, ls-refs lists branch tips, fetch brings objects by id. A hit was served by Workers Cache. Tap a row for its wire details.

Remote
https://5ad2236b39de4c8bd8f6270ea63f3ea9.artifacts.cloudflare.net/git/public-v0/ply-web.git
Ref
refs/heads/main
Commit
262b639aa1b258fc1777c3a66ba8f811df3a3da2
cf-ray
a5e22798bfbda151
Request
2b98d113…
Protocol
v2 · sha1
Agent
gitty/1.0
Filter
advertised
Fetch
shallow filter sideband-all
Capabilities
agent ls-refs fetch object-format