GitHubivarvong

ply

main
ply6 git calls30 ms25 KiB5 cachedprotocol v2
317 lines21 KiBRaw
1// Decision-point inventory: every place in src/ where ply decides an outcome, extracted statically (no hand list).
2//
3// site a call that builds a typed error: `fail(...)`, `failHere(...)`, or a call to a wrapper. A wrapper is a function
4// of at most three statements whose result is a fail() (or another wrapper's) built from its parameters,
5// unconditionally (`proto(msg)`, `limitError(what, got, max)`, `bad(why)`) or with a code its caller picks
6// (`take(buf, off, n, code)`). A guarded check (`validateWire`) is not a wrapper: its own fail() is the site.
7// The wrapper's own fail() is a site too.
8// producer a literal error code from src/errors.js produced outside a site: returned, a conditional's branch, a `code:`
9// property, an assignment (`e.code = code` in `coded`), a default parameter. Comparisons are not producers.
10// untyped a `throw new Error(...)` in src/: an error with no code from errors.js (SAFETY I1 says every error has one).
11// decode every bytes-to-string decode, with its mode: lossless (decodeBytes), strict (TextDecoder fatal,
12// decodeURIComponent: throws on non-UTF-8), replacement (default TextDecoder: non-UTF-8 becomes U+FFFD).
13// Whether a decode is display-only is the registry's call (an exclusion with that reason).
14// export every exported parse*/decode*/classify*/decide* function.
15//
16// Every entry has a stable id `<file>#<function>:<code>:<message stem>` (line numbers move on every edit; the id moves
17// only when the decision does). Ids repeated inside one function get `#2`, `#3`, ... in source order.
18//
19// node scripts/decision-points.mjs table
20// node scripts/decision-points.mjs --json JSON (what test/space/gates.test.js reads)
21import { readFileSync, readdirSync, existsSync } from 'node:fs';
22import { join, dirname } from 'node:path';
23import { fileURLToPath } from 'node:url';
24import { createRequire } from 'node:module';
26const ROOT = join(dirname(fileURLToPath(import.meta.url)), '..');
27const { parse } = createRequire(import.meta.url)('@babel/parser');
28const { CODES } = await import(join(ROOT, 'src/errors.ts'));
29const CODE_SET = new Set(CODES);
30// Files that define or document the taxonomy rather than decide with it.
31const SKIP_PRODUCERS = new Set(['src/errors.ts', 'src/errors-doc.ts']);
32// The constructors a site calls: `fail` (an Err), plyError itself, and `thrown` (its pre-0.2.0 name, for old trees).
33const CONSTRUCTORS = new Set(['fail', 'thrown', 'plyError']);
34// Source keeps `.js` specifiers for .ts files (test/ts-resolve.mjs): the file an import names is whichever exists.
35const srcFile = spec => { const js = `src/${spec.slice(2)}`; const ts = js.replace(/\.js$/, '.ts'); return existsSync(join(ROOT, ts)) ? ts : js; };
36const EXPORT_NAME = /^(parse|decode|classify|decide)/i;
37const STEM = 56;
39const children = n => {
40 const out = [];
41 for (const k of Object.keys(n)) {
42 if (k === 'loc' || k === 'start' || k === 'end' || k === 'leadingComments' || k === 'trailingComments' || k === 'innerComments' || k === 'extra') continue;
43 const v = n[k];
44 if (Array.isArray(v)) { for (const x of v) if (x && typeof x.type === 'string') out.push(x); } else if (v && typeof v.type === 'string') out.push(v);
45 }
46 return out;
47};
48const isFn = n => n.type === 'FunctionDeclaration' || n.type === 'FunctionExpression' || n.type === 'ArrowFunctionExpression' || n.type === 'ObjectMethod' || n.type === 'ClassMethod' || n.type === 'ClassPrivateMethod';
49const keyName = k => (k?.type === 'Identifier' ? k.name : k?.type === 'StringLiteral' ? k.value : k?.type === 'PrivateName' ? `#${k.id.name}` : null);
50// The name a function is known by: its own id, the variable / property / method it is assigned to.
51function fnName(fn, parent) {
52 if (fn.id?.name) return fn.id.name;
53 if (fn.type === 'ObjectMethod' || fn.type === 'ClassMethod' || fn.type === 'ClassPrivateMethod') return keyName(fn.key);
54 if (parent?.type === 'VariableDeclarator') return parent.id?.name ?? null;
55 if (parent?.type === 'ObjectProperty' || parent?.type === 'ClassProperty') return keyName(parent.key);
56 if (parent?.type === 'AssignmentExpression') return parent.left?.type === 'MemberExpression' ? keyName(parent.left.property) : parent.left?.name ?? null;
57 return null;
60function walk(node, visit, ancestors = []) {
61 visit(node, ancestors);
62 ancestors.push(node);
63 for (const c of children(node)) walk(c, visit, ancestors);
64 ancestors.pop();
67const src = (text, n) => text.slice(n.start, n.end);
68// A message argument as text: string literals as is, template literals with each `${...}` as `…`, anything else as
69// `<expr>`. Whitespace collapsed; cut at STEM characters.
70function messageText(text, n) {
71 if (!n) return '';
72 let s;
73 if (n.type === 'StringLiteral') s = n.value;
74 else if (n.type === 'TemplateLiteral') s = n.quasis.map(q => q.value.cooked ?? q.value.raw).join('…');
75 else if (n.type === 'ConditionalExpression') s = `${messageText(text, n.consequent)} | ${messageText(text, n.alternate)}`;
76 else if (n.type === 'BinaryExpression' && n.operator === '+') s = `${messageText(text, n.left)}${messageText(text, n.right)}`;
77 else s = `<${src(text, n).replace(/\s+/g, ' ').slice(0, 40)}>`;
78 return s.replace(/\s+/g, ' ').trim();
80const codeText = (text, n) => (!n ? '?' : n.type === 'StringLiteral' ? n.value : `<${src(text, n).replace(/\s+/g, ' ').slice(0, 40)}>`);
81const stemOf = s => (s.length > STEM ? `${s.slice(0, STEM)}…` : s);
83function parseFile(file) {
84 const text = readFileSync(join(ROOT, file), 'utf8');
85 const ast = parse(text, { sourceType: 'module', errorRecovery: false, plugins: file.endsWith('.ts') ? ['typescript'] : [] });
86 return { file, text, ast: ast.program };
89// Every function node with its name, parameter names, enclosing function, and statement count.
90function functionsOf(f) {
91 const fns = [];
92 walk(f.ast, (n, anc) => {
93 if (!isFn(n)) return;
94 const parent = anc[anc.length - 1];
95 const enclosing = [...anc].reverse().find(isFn) ?? null;
96 const params = new Set();
97 for (const p of n.params) walk(p, x => { if (x.type === 'Identifier') params.add(x.name); });
98 const stmts = n.body.type === 'BlockStatement' ? n.body.body.length : 1;
99 fns.push({ node: n, name: fnName(n, parent), params, stmts, enclosing });
100 });
101 return fns;
104// A TextDecoder's mode: `fatal: true` throws on bytes that are not UTF-8 (strict); the default replaces them with
105// U+FFFD (replacement: the bytes are lost). Both differ from git, which passes names, messages and paths as raw bytes.
106const decoderMode = n => (n.arguments[1]?.type === 'ObjectExpression' && n.arguments[1].properties.some(p => keyName(p.key) === 'fatal' && p.value.value === true) ? 'strict' : 'replacement');
107// name -> mode for every TextDecoder bound at a module's top level, and `td` imported from bytes.js
108const decoderCache = new Map();
109function decoders(f) {
110 if (decoderCache.has(f.file)) return decoderCache.get(f.file);
111 const m = new Map();
112 walk(f.ast, n => { if (n.type === 'VariableDeclarator' && n.init?.type === 'NewExpression' && n.init.callee.name === 'TextDecoder' && n.id.type === 'Identifier') m.set(n.id.name, decoderMode(n.init)); });
113 for (const st of f.ast.body) if (st.type === 'ImportDeclaration' && st.source.value === './bytes.js') for (const sp of st.specifiers) if (sp.imported?.name === 'td') m.set(sp.local.name, 'replacement');
114 decoderCache.set(f.file, m);
115 return m;
117// The innermost named function around a node: a callback (`.map(x => ...)`) is part of the function that wrote it.
118const nameAt = (f, anc) => {
119 for (let i = anc.length - 1; i >= 0; i--) if (isFn(anc[i])) { const n = f.fns.find(x => x.node === anc[i])?.name; if (n) return n; }
120 return '(top)';
121};
122// A callee under a type-only wrapper (`(fail as (code: 'limit_exceeded', ...) => Thrown)(...)`) is the callee itself.
123const TS_WRAPPERS = new Set(['TSAsExpression', 'TSSatisfiesExpression', 'TSNonNullExpression', 'TSTypeAssertion', 'TSInstantiationExpression']);
124const bare = n => (TS_WRAPPERS.has(n.type) ? bare(n.expression) : n);
125const calleeName = c => { const k = bare(c.callee); return k.type === 'Identifier' ? k.name : null; };
126const calleePos = c => (c.callee.type === 'MemberExpression' ? c.callee.property.loc.start : c.callee.loc.start);
127const usesAny = (n, names) => { let hit = false; walk(n, x => { if (x.type === 'Identifier' && names.has(x.name)) hit = true; }); return hit; };
129export function inventory() {
130 const files = readdirSync(join(ROOT, 'src')).filter(x => /\.(js|ts)$/.test(x) && !x.endsWith('.d.ts')).sort().map(x => parseFile(`src/${x}`));
131 // ---- wrappers, to a fixpoint: (file, name) -> { code, def } ----
132 const wrappers = new Map(); // `${file}:${name}` -> [{ fn, file, codeArg }]
133 const imports = new Map(); // file -> Map(local -> `${srcFile}:${imported}`)
134 for (const f of files) {
135 const m = new Map();
136 for (const st of f.ast.body) {
137 if (st.type !== 'ImportDeclaration' || !st.source.value.startsWith('./')) continue;
138 const from = srcFile(st.source.value);
139 for (const s of st.specifiers) if (s.type === 'ImportSpecifier') m.set(s.local.name, `${from}:${s.imported.name}`);
140 }
141 imports.set(f.file, m);
142 f.fns = functionsOf(f);
143 }
144 const isProducerCall = (f, call) => {
145 const name = calleeName(call);
146 if (!name) return null;
147 if (CONSTRUCTORS.has(name)) return { kind: 'fail' };
148 if (name === 'failHere') return { kind: 'failHere' };
149 const imp = imports.get(f.file).get(name);
150 const key = imp ?? `${f.file}:${name}`;
151 const ws = wrappers.get(key);
152 if (!ws) return null;
153 // innermost definition whose scope (the function enclosing the definition) contains the call; top level otherwise
154 const inScope = ws.filter(w => !imp && (!w.fn.enclosing || (w.fn.enclosing.start <= call.start && call.end <= w.fn.enclosing.end)));
155 const w = imp ? ws[0] : inScope.sort((a, b) => (b.fn.enclosing?.start ?? -1) - (a.fn.enclosing?.start ?? -1))[0];
156 return w ? { kind: 'wrapper', via: name, wrapper: w } : null;
157 };
158 for (let changed = true; changed;) {
159 changed = false;
160 for (const f of files) for (const fn of f.fns) {
161 if (!fn.name || fn.stmts > 3 || fn.name === 'failHere') continue;
162 const key = `${f.file}:${fn.name}`;
163 if (wrappers.get(key)?.some(w => w.fn === fn)) continue;
164 // the error must be the function's result: the arrow's body, or a thrown / returned value, through conditionals
165 // and `if` branches only (a call inside a try, a loop or a nested function is a use, not a construction)
166 // Behind an `if` it is a check, not a wrapper, unless the caller picks the code (`take(buf, off, n, code)`): a check's
167 // call sites are ordinary calls, its own fail() is the decision point.
168 let hit = null;
169 const result = (n, guarded) => {
170 if (hit || !n) return;
171 if (n.type === 'CallExpression') {
172 const p = isProducerCall(f, n);
173 if (!p || p.kind === 'failHere' || !usesAny(n, fn.params)) return;
174 const codeArg = p.kind === 'fail' ? n.arguments[0] : null;
175 if (!guarded || (codeArg?.type === 'Identifier' && fn.params.has(codeArg.name))) hit = { call: n, p };
176 return;
177 }
178 if (n.type === 'ConditionalExpression') { result(n.consequent, guarded); result(n.alternate, guarded); }
179 else if (n.type === 'LogicalExpression') result(n.right, guarded);
180 else if (n.type === 'ThrowStatement' || n.type === 'ReturnStatement') result(n.argument, guarded);
181 else if (n.type === 'IfStatement') { result(n.consequent, true); result(n.alternate, true); }
182 else if (n.type === 'BlockStatement') n.body.forEach(x => result(x, guarded));
183 };
184 result(fn.node.body, false);
185 if (!hit) continue;
186 wrappers.set(key, [...(wrappers.get(key) ?? []), { fn, file: f.file, inner: hit }]);
187 changed = true;
188 }
189 }
190 // a wrapper exported under another name (`export { limitExceeded as limitError }`) is that wrapper under both names
191 for (const f of files) for (const st of f.ast.body) {
192 if (st.type !== 'ExportNamedDeclaration' || st.source) continue;
193 for (const sp of st.specifiers ?? []) {
194 const from = `${f.file}:${sp.local.name}`, to = `${f.file}:${keyName(sp.exported)}`;
195 if (from !== to && wrappers.has(from) && !wrappers.has(to)) wrappers.set(to, wrappers.get(from));
196 }
197 }
198 // the code a wrapper produces: its inner call's literal code, or the default of the parameter it forwards
199 const wrapperCode = (w, args, text) => {
200 const call = w.inner.call;
201 if (w.inner.p.kind === 'wrapper') return wrapperCode(w.inner.p.wrapper, call.arguments, text);
202 const c = call.arguments[0];
203 if (c?.type === 'StringLiteral') return c.value;
204 if (c?.type === 'Identifier') {
205 const i = w.fn.node.params.findIndex(p => (p.type === 'Identifier' ? p.name : p.left?.name) === c.name);
206 if (i >= 0 && args?.[i]?.type === 'StringLiteral') return args[i].value;
207 const p = w.fn.node.params[i];
208 if (p?.type === 'AssignmentPattern' && p.right.type === 'StringLiteral') return p.right.value;
209 }
210 return codeText(text, c);
211 };
212 // the message a wrapper call carries: the call's first string-ish argument (its `what`)
213 // the message a wrapper call carries: its first string-ish argument other than the one the wrapper uses as the code
214 // (`take(buf, off, n, 'protocol')` is `<buf>, <off>, <n>`), else every other argument
215 const codeParam = w => { const c = w.inner.p.kind === 'fail' ? w.inner.call.arguments[0] : null; return c?.type === 'Identifier' ? w.fn.node.params.findIndex(p => (p.type === 'Identifier' ? p.name : p.left?.name) === c.name) : -1; };
216 const wrapperWhat = (text, call, w) => {
217 const args = call.arguments.filter((_, i) => i !== codeParam(w));
218 const a = args.find(x => x.type === 'StringLiteral' || x.type === 'TemplateLiteral');
219 return a ? messageText(text, a) : args.map(x => messageText(text, x)).join(', ');
220 };
222 const sites = [], producers = [], exports = [], untyped = [], decodes = [];
223 for (const f of files) {
224 const siteCalls = new Set();
225 walk(f.ast, (n, anc) => {
226 if (n.type !== 'CallExpression') return;
227 const p = isProducerCall(f, n);
228 if (!p) return;
229 // errors.ts's constructors calling one another (fail -> plyError) are the taxonomy, not a decision
230 if (SKIP_PRODUCERS.has(f.file) && p.kind === 'fail' && CONSTRUCTORS.has(nameAt(f, anc))) return;
231 siteCalls.add(n);
232 const fname = nameAt(f, anc);
233 const pos = calleePos(n);
234 let code, what;
235 if (p.kind === 'fail') { code = codeText(f.text, n.arguments[0]); what = messageText(f.text, n.arguments[1]); }
236 else if (p.kind === 'failHere') { code = n.arguments[0]?.type === 'CallExpression' && CONSTRUCTORS.has(calleeName(n.arguments[0])) ? codeText(f.text, n.arguments[0].arguments[0]) : '<rethrown or pack_corrupt>'; what = n.arguments[0]?.type === 'CallExpression' ? messageText(f.text, n.arguments[0].arguments[1]) : messageText(f.text, n.arguments[0]); }
237 else { code = wrapperCode(p.wrapper, n.arguments, f.text); what = wrapperWhat(f.text, n, p.wrapper); }
238 // a fail() passed straight into failHere is one decision, recorded as the failHere site
239 if (p.kind === 'fail' && anc[anc.length - 1]?.type === 'CallExpression' && calleeName(anc[anc.length - 1]) === 'failHere') return;
240 sites.push({ file: f.file, line: n.loc.start.line, endLine: n.loc.end.line, col: pos.column + 1, callLine: pos.line, fn: fname, kind: p.kind, ...(p.via ? { via: p.via } : {}), code, what });
241 });
242 if (!SKIP_PRODUCERS.has(f.file)) walk(f.ast, (n, anc) => {
243 if (n.type !== 'StringLiteral' || !CODE_SET.has(n.value)) return;
244 const parent = anc[anc.length - 1];
245 // a code inside a site's code argument (`fail(c ? 'protocol' : 'pack_corrupt', ...)`) is that site's, not a producer
246 if (anc.some(a => siteCalls.has(a) && a.arguments[0] && a.arguments[0].start <= n.start && n.end <= a.arguments[0].end)) return;
247 let ctx = null;
248 if (parent?.type === 'ReturnStatement' || (parent?.type === 'ArrowFunctionExpression' && parent.body === n)) ctx = 'return';
249 else if (parent?.type === 'ConditionalExpression' && parent.test !== n) ctx = 'conditional';
250 else if (parent?.type === 'ObjectProperty' && parent.value === n && keyName(parent.key) === 'code') ctx = 'code-property';
251 else if (parent?.type === 'AssignmentExpression' && parent.right === n) ctx = 'assignment';
252 else if (parent?.type === 'AssignmentPattern' && parent.right === n) ctx = 'default';
253 else if (parent?.type === 'CallExpression' && calleeName(parent) === 'coded') ctx = 'coded';
254 if (!ctx) return;
255 const fname = nameAt(f, anc);
256 producers.push({ file: f.file, line: n.loc.start.line, fn: fname, kind: 'producer', ctx, code: n.value, what: src(f.text, anc.findLast(a => a.type.endsWith('Statement') || a.type === 'VariableDeclarator') ?? n).replace(/\s+/g, ' ').slice(0, 80) });
257 });
258 // decoders: every `<decoder>.decode(...)`, `decodeURIComponent(...)`, `decodeBytes(...)`, with the decoder's mode
259 walk(f.ast, (n, anc) => {
260 if (n.type !== 'CallExpression') return;
261 let mode = null, via = null;
262 const c = n.callee;
263 if (c.type === 'Identifier' && (c.name === 'decodeURIComponent' || c.name === 'decodeURI')) { mode = 'strict'; via = c.name; }
264 else if (c.type === 'Identifier' && c.name === 'decodeBytes') { mode = 'lossless'; via = 'decodeBytes'; }
265 else if (c.type === 'MemberExpression' && keyName(c.property) === 'decode') {
266 const o = c.object;
267 if (o.type === 'NewExpression' && o.callee.name === 'TextDecoder') { mode = decoderMode(o); via = 'new TextDecoder'; }
268 else if (o.type === 'Identifier') { const d = decoders(f).get(o.name); if (d) { mode = d; via = o.name; } }
269 }
270 if (!mode) return;
271 decodes.push({ file: f.file, line: n.loc.start.line, fn: nameAt(f, anc), kind: 'decode', mode, via, code: `<decode:${mode}>`, what: src(f.text, n.arguments[0] ?? n).replace(/\s+/g, ' ').slice(0, 60) });
272 });
273 if (f.file !== 'src/errors.ts') walk(f.ast, (n, anc) => {
274 if (n.type !== 'NewExpression' || n.callee.type !== 'Identifier' || !/^(Error|TypeError|RangeError)$/.test(n.callee.name)) return;
275 untyped.push({ file: f.file, line: n.loc.start.line, fn: nameAt(f, anc), kind: 'untyped', code: '<untyped>', what: messageText(f.text, n.arguments[0]) });
276 });
277 for (const st of f.ast.body) {
278 if (st.type !== 'ExportNamedDeclaration') continue;
279 const names = [];
280 if (st.declaration?.type === 'FunctionDeclaration') names.push([st.declaration.id.name, st.declaration.loc.start.line]);
281 if (st.declaration?.type === 'VariableDeclaration') for (const d of st.declaration.declarations) if (d.init && isFn(d.init)) names.push([d.id.name, d.loc.start.line]);
282 if (!st.source) for (const s of st.specifiers ?? []) {
283 const local = s.local.name;
284 const def = f.fns.find(x => x.name === local && !x.enclosing);
285 if (def) names.push([s.exported.name, def.node.loc.start.line]);
286 }
287 for (const [name, line] of names) if (EXPORT_NAME.test(name)) exports.push({ file: f.file, line, fn: name, kind: 'export', code: '-', what: `export ${name}` });
288 }
289 }
290 // stable ids
291 const seen = new Map();
292 const idOf = e => {
293 const base = e.kind === 'decode' ? `${e.file}#${e.fn}:decode:${e.mode}:${stemOf(e.what)}` : e.kind === 'untyped' ? `${e.file}#${e.fn}:untyped:${stemOf(e.what)}` : e.kind === 'export' ? `${e.file}#${e.fn}:export` : `${e.file}#${e.fn}:${e.kind === 'producer' ? `${e.ctx}=` : ''}${e.code}:${stemOf(e.what)}`;
294 const n = (seen.get(base) ?? 0) + 1;
295 seen.set(base, n);
296 return n === 1 ? base : `${base}#${n}`;
297 };
298 for (const list of [sites, producers, exports, untyped, decodes]) for (const e of list.sort((a, b) => a.file.localeCompare(b.file) || a.line - b.line || (a.col ?? 0) - (b.col ?? 0))) e.id = idOf(e);
299 const wrapperList = [...wrappers.entries()].map(([k, ws]) => ({ wrapper: k, lines: ws.map(w => w.fn.node.loc.start.line) }));
300 return { sites, producers, exports, untyped, decodes, wrappers: wrapperList };
303// The decision points the registry must account for: every site, every producer, every untyped throw, every export.
304export const decisionPoints = inv => [...inv.sites, ...inv.producers, ...inv.untyped, ...inv.decodes, ...inv.exports];
306if (process.argv[1] === fileURLToPath(import.meta.url)) {
307 const inv = inventory();
308 if (process.argv.includes('--json')) process.stdout.write(`${JSON.stringify(inv, null, 2)}\n`);
309 else printTable(inv);
311function printTable(inv) {
312 const pad = (s, n) => String(s).padEnd(n);
313 console.log(`wrappers: ${inv.wrappers.map(w => w.wrapper.replace('src/', '')).join(' ')}`);
314 console.log(`sites ${inv.sites.length} (fail ${inv.sites.filter(s => s.kind === 'fail').length}, failHere ${inv.sites.filter(s => s.kind === 'failHere').length}, wrapper calls ${inv.sites.filter(s => s.kind === 'wrapper').length}), producers ${inv.producers.length}, untyped ${inv.untyped.length}, decodes ${inv.decodes.length} (${['lossless', 'strict', 'replacement'].map(m => `${m} ${inv.decodes.filter(d => d.mode === m).length}`).join(', ')}), exports ${inv.exports.length}\n`);
315 console.log(`${pad('file:line', 26)} ${pad('kind', 16)} ${pad('code', 18)} ${pad('function', 22)} what`);
316 for (const e of decisionPoints(inv)) console.log(`${pad(`${e.file.replace('src/', '')}:${e.line}`, 26)} ${pad(e.kind === 'wrapper' ? `wrapper:${e.via}` : e.kind === 'producer' ? `producer:${e.ctx}` : e.kind === 'decode' ? `decode:${e.mode}` : e.kind, 16)} ${pad(e.code, 18)} ${pad(e.fn, 22)} ${e.what.slice(0, 70)}`);
Diagnostics6 git calls · 30 ms
CallStatusSizeTime030 ms
discover200191 B2 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=191
git.server.agent=git/github-9922ec520325-Linux
git.server.object_format=sha1
git.server.caps=agent ls-refs fetch server-option object-format
git.server.fetch=shallow wait-for-done filter
git.protocol.version=2
git.pkt.frames=9
git.pkt.data=7
git.pkt.flush=2
git.pkt.delim=0
git.pkt.bytes=191
git.pkt.payload.max=36
ls-refs20012 KiB · hit2 ms
git.upload-pack ls-refs
http.response.status_code=200
git.upstream.cf_ray=-
git.upstream.phase=ls-refs
git.upstream.dur_ms=2
git.response.bytes=11990
git.response.cache=HIT
git.response.duration_ms=2
git.protocol.version=2
git.pkt.frames=152
git.pkt.data=151
git.pkt.flush=1
git.pkt.delim=0
git.pkt.bytes=11990
git.pkt.payload.max=122
git.ls_refs.count=151
git.ls_refs.head=refs/heads/main
fetchtree:0 · deepen 102004.2 KiB · hit2 ms
git.upload-pack fetch
http.response.status_code=200
git.upstream.cf_ray=-
git.upstream.phase=fetch
git.upstream.dur_ms=3
git.response.bytes=4347
git.response.cache=HIT
git.response.duration_ms=2
git.fetch.filter=tree:0
git.fetch.wants=19912563f540228593df0c489082e5e2508e21e4
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=7
git.pkt.data=5
git.pkt.flush=1
git.pkt.delim=1
git.pkt.bytes=4347
git.pkt.payload.max=4247
git.sideband.band1.bytes=4247
git.sideband.band2.bytes=0
git.sideband.band3.bytes=0
git.pack.objects=10
git.pack.bytes=4247
git.pack.ofs_delta=0
git.pack.ref_delta=0
git.pack.chain.max=0
git.pack.trailer=a6caf8e129bea82c9bae4cbc7c130c9205add400
git.pack.full=10
Open pack map
fetchtree:0200919 B · hit3 ms
git.upload-pack fetch
http.response.status_code=200
git.upstream.cf_ray=-
git.upstream.phase=fetch
git.upstream.dur_ms=2
git.response.bytes=919
git.response.cache=HIT
git.response.duration_ms=3
git.fetch.filter=tree:0
git.fetch.wants=800d30ba8923860bfc460ca884b7f9ba22083588
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=4
git.pkt.data=3
git.pkt.flush=1
git.pkt.delim=0
git.pkt.bytes=919
git.pkt.payload.max=892
git.sideband.band1.bytes=892
git.sideband.band2.bytes=0
git.sideband.band3.bytes=0
git.pack.objects=1
git.pack.bytes=892
git.pack.trailer=5323b9266eea5ded637285d1c5320699f12be76e
Open pack map
fetchtree:0200831 B · hit2 ms
git.upload-pack fetch
http.response.status_code=200
git.upstream.cf_ray=-
git.upstream.phase=fetch
git.upstream.dur_ms=21
git.response.bytes=831
git.response.cache=HIT
git.response.duration_ms=2
git.fetch.filter=tree:0
git.fetch.wants=b9290e370bd091fd3272931655a175dd1a7af82d
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=4
git.pkt.data=3
git.pkt.flush=1
git.pkt.delim=0
git.pkt.bytes=831
git.pkt.payload.max=804
git.sideband.band1.bytes=804
git.sideband.band2.bytes=0
git.sideband.band3.bytes=0
git.pack.objects=1
git.pack.bytes=804
git.pack.trailer=81ddc1f73214935b4ee953ad84f959db955ce0d1
Open pack map
fetch2007.0 KiB · hit21 ms
git.upload-pack fetch
http.response.status_code=200
git.response.bytes=7187
git.response.cache=HIT
git.response.duration_ms=21
git.fetch.wants=01e5ea8f0cc4a8786588d1b08db67e33f5678bef
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=4
git.pkt.data=3
git.pkt.flush=1
git.pkt.delim=0
git.pkt.bytes=7187
git.pkt.payload.max=7160
git.sideband.band1.bytes=7160
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://github.com/ivarvong/ply
Ref
refs/heads/main
Commit
19912563f540228593df0c489082e5e2508e21e4
cf-ray
a5e0fc1c38c2332c
Request
1e503ff5…
Protocol
v2 · sha1
Agent
git/github-9922ec520325-Linux
Filter
advertised
Fetch
shallow wait-for-done filter
Capabilities
agent ls-refs fetch server-option object-format