main
1// The Git behaviour coverage matrix: every server behaviour ply can exercise (or cannot yet), the ply operations and
2// tests that exercise it, and who has independently checked the server's answer. ply is a conformance and behaviour
3// testing instrument for Cloudflare Artifacts as well as a client; the unit of progress is an independently validated
4// server behaviour or failure mode, not a git command.
5//
6// Rules (test/behaviours/matrix.test.js enforces each):
7// - every op is an export of its src/ module and every test anchor is text in the cited file (grep, not memory);
8// - ply_vs_reference_git evidence cites a file that runs real git;
9// - run evidence cites a run in runs.ts and a check that run recorded (the types refuse anything else);
10// - COVERAGE.md is `npm run coverage-matrix -- --md` of this file.
11// Status rule: `verified` needs at least one independent check of any kind. Evidence against git http-backend shows
12// ply's probe is right against the reference; only Artifacts evidence says anything about Artifacts. COVERAGE.md
13// reports both counts so a behaviour verified against git alone shows as an Artifacts gap.
14import type { Area, Behaviour, BehaviourIn, Evidence, NonEmpty, OtherEvidence, PlyOp, Status, TestRef } from './types.js';
15import type { CheckOf } from './runs.js';
17const op = (module: PlyOp['module'], symbol: string): PlyOp => ({ module, symbol });
18const t = (path: TestRef['path'], anchor: string): TestRef => ({ tag: 'test', path, anchor });
20// Evidence, one constructor per source. The check argument is typed by the run: a check the run did not record does
21// not compile.
22const git = (path: TestRef['path'], anchor: string): Evidence => ({ kind: 'ply_vs_reference_git', ref: t(path, anchor) });
23const validatePly = (check: CheckOf<'validate-7b0c310f'>): Evidence => ({ kind: 'ply_vs_artifacts', ref: { tag: 'run', run: 'validate-7b0c310f', check } });
24const validateGit = (check: CheckOf<'validate-7b0c310f'>): Evidence => ({ kind: 'native_git_vs_artifacts', ref: { tag: 'run', run: 'validate-7b0c310f', check } });
25const plyWorker = (check: CheckOf<'loadgen-phase6-plyw-20261025'>): Evidence => ({ kind: 'ply_vs_artifacts', ref: { tag: 'run', run: 'loadgen-phase6-plyw-20261025', check } });
26const compat = (check: CheckOf<'loadgen-compat-20261024'>): OtherEvidence => ({ kind: 'native_git_vs_artifacts', ref: { tag: 'run', run: 'loadgen-compat-20261024', check } });
27const phase2Git = (check: CheckOf<'loadgen-phase2-20261025'>): OtherEvidence => ({ kind: 'native_git_vs_artifacts', ref: { tag: 'run', run: 'loadgen-phase2-20261025', check } });
28const phase2Wire = (check: CheckOf<'loadgen-phase2-20261025'>): OtherEvidence => ({ kind: 'wire_probe_vs_artifacts', ref: { tag: 'run', run: 'loadgen-phase2-20261025', check } });
29const phase3Git = (check: CheckOf<'loadgen-phase3-20261025'>): OtherEvidence => ({ kind: 'native_git_vs_artifacts', ref: { tag: 'run', run: 'loadgen-phase3-20261025', check } });
30const hostile = (check: CheckOf<'loadgen-phase4-hostile-20261025'>): OtherEvidence => ({ kind: 'wire_probe_vs_artifacts', ref: { tag: 'run', run: 'loadgen-phase4-hostile-20261025', check } });
31const hostileWrite = (check: CheckOf<'loadgen-phase4-hostile-write-20261025'>): OtherEvidence => ({ kind: 'wire_probe_vs_artifacts', ref: { tag: 'run', run: 'loadgen-phase4-hostile-write-20261025', check } });
32const deltaGit = (check: CheckOf<'loadgen-phase5-delta-20261025'>): OtherEvidence => ({ kind: 'native_git_vs_artifacts', ref: { tag: 'run', run: 'loadgen-phase5-delta-20261025', check } });
33const deltaWire = (check: CheckOf<'loadgen-phase5-delta-20261025'>): OtherEvidence => ({ kind: 'wire_probe_vs_artifacts', ref: { tag: 'run', run: 'loadgen-phase5-delta-20261025', check } });
34// The differential probe run, full matrix (test/probes, scripts/probes.mjs --artifacts): one scenario per check, `<scenario>/art-ply`
35// for ply against Artifacts, `<scenario>/art-git` for stock git against it; the same plans run in CI against the reference.
36const probePly = (check: CheckOf<'probes-20261114t2226-yyjq'> & `${string}/art-ply`): Evidence => ({ kind: 'ply_vs_artifacts', ref: { tag: 'run', run: 'probes-20261114t2226-yyjq', check } });
37const probeGit = (check: CheckOf<'probes-20261114t2226-yyjq'> & `${string}/art-git`): OtherEvidence => ({ kind: 'native_git_vs_artifacts', ref: { tag: 'run', run: 'probes-20261114t2226-yyjq', check } });
38// The malformed-pack run (probes-20261115t1926-gfhc): the 21 scenarios of 24cafa1 against Artifacts.
39const malPly = (check: CheckOf<'probes-20261115t1926-gfhc'> & `${string}/art-ply`): Evidence => ({ kind: 'ply_vs_artifacts', ref: { tag: 'run', run: 'probes-20261115t1926-gfhc', check } });
40const malGit = (check: CheckOf<'probes-20261115t1926-gfhc'> & `${string}/art-git`): OtherEvidence => ({ kind: 'native_git_vs_artifacts', ref: { tag: 'run', run: 'probes-20261115t1926-gfhc', check } });
42// The HTTP-framing wire run (wire-20261115t2038-ee4x): raw socket and curl (`/art-raw`, `/art-curl`), stock git (`/art-git`) and ply
43// (`/art-ply`) against Artifacts; the same plans run in CI against the reference (test/probes/wire.test.js).
44const wireArt = (check: CheckOf<'wire-20261115t2038-ee4x'> & (`${string}/art-raw` | `${string}/art-curl`)): OtherEvidence => ({ kind: 'wire_probe_vs_artifacts', ref: { tag: 'run', run: 'wire-20261115t2038-ee4x', check } });
45const wireGit = (check: CheckOf<'wire-20261115t2038-ee4x'> & `${string}/art-git`): OtherEvidence => ({ kind: 'native_git_vs_artifacts', ref: { tag: 'run', run: 'wire-20261115t2038-ee4x', check } });
46const wirePly = (check: CheckOf<'wire-20261115t2038-ee4x'> & `${string}/art-ply`): Evidence => ({ kind: 'ply_vs_artifacts', ref: { tag: 'run', run: 'wire-20261115t2038-ee4x', check } });
47// Phase 4 (15 Nov): ref and tag-object semantics (probes-20261115t2113-phhp, the directory/file three in
48// probes-20261115t2126-d4jn) and the ref-name, capability, dumb-HTTP and listing wire plans (wire-20261115t2116-1nam).
49const semPly = (check: CheckOf<'probes-20261115t2113-phhp'> & `${string}/art-ply`): Evidence => ({ kind: 'ply_vs_artifacts', ref: { tag: 'run', run: 'probes-20261115t2113-phhp', check } });
50const semGit = (check: CheckOf<'probes-20261115t2113-phhp'> & `${string}/art-git`): OtherEvidence => ({ kind: 'native_git_vs_artifacts', ref: { tag: 'run', run: 'probes-20261115t2113-phhp', check } });
51const dfPly = (check: CheckOf<'probes-20261115t2126-d4jn'> & `${string}/art-ply`): Evidence => ({ kind: 'ply_vs_artifacts', ref: { tag: 'run', run: 'probes-20261115t2126-d4jn', check } });
52const dfGit = (check: CheckOf<'probes-20261115t2126-d4jn'> & `${string}/art-git`): OtherEvidence => ({ kind: 'native_git_vs_artifacts', ref: { tag: 'run', run: 'probes-20261115t2126-d4jn', check } });
53const rpPly = (check: CheckOf<'probes-20261115t2133-txqj'> & `${string}/art-ply`): Evidence => ({ kind: 'ply_vs_artifacts', ref: { tag: 'run', run: 'probes-20261115t2133-txqj', check } });
54const rpGit = (check: CheckOf<'probes-20261115t2133-txqj'> & `${string}/art-git`): OtherEvidence => ({ kind: 'native_git_vs_artifacts', ref: { tag: 'run', run: 'probes-20261115t2133-txqj', check } });
55const w4Art = (check: CheckOf<'wire-20261115t2116-1nam'> & (`${string}/art-raw` | `${string}/art-curl`)): OtherEvidence => ({ kind: 'wire_probe_vs_artifacts', ref: { tag: 'run', run: 'wire-20261115t2116-1nam', check } });
56const w4Git = (check: CheckOf<'wire-20261115t2116-1nam'> & `${string}/art-git`): OtherEvidence => ({ kind: 'native_git_vs_artifacts', ref: { tag: 'run', run: 'wire-20261115t2116-1nam', check } });
57const w4Ply = (check: CheckOf<'wire-20261115t2116-1nam'> & `${string}/art-ply`): Evidence => ({ kind: 'ply_vs_artifacts', ref: { tag: 'run', run: 'wire-20261115t2116-1nam', check } });
58const WIRE_TEST = 'reference: ${plan.id} meets its answer with every sender';
59const verified = (...evidence: NonEmpty<Evidence>): Extract<Status, { readonly tag: 'verified' }> => ({ tag: 'verified', evidence });
60const IMPLEMENTED: Extract<Status, { readonly tag: 'implemented' }> = { tag: 'implemented' };
61const unsupported = (why: string, ...observed: readonly OtherEvidence[]): Extract<Status, { readonly tag: 'unsupported' }> => ({ tag: 'unsupported', why, observed });
62// Each entry is checked against its own area's type (the id's prefix must be the area).
63const b = <A extends Area>(x: BehaviourIn<A>): BehaviourIn<A> => x;
65// ply's operations, named once.
66const LS_REFS = op('src/lsrefs.ts', 'lsRefs');
67const LIST_REFS = op('src/refops.ts', 'listRefs');
68const DISCOVER = op('src/discover.ts', 'discover');
69const PARSE_CAPS = op('src/caps.ts', 'parseCapabilitiesV2');
70const REQUIRED_V2 = op('src/closed.ts', 'checkRequiredV2');
71const OBJECT_FORMAT = op('src/closed.ts', 'decideObjectFormat');
72const RECEIVE_CAPS = op('src/receivecaps.ts', 'receiveCaps');
73const CHECK_PUSH_CAPS = op('src/receivecaps.ts', 'checkPushCaps');
74const FETCH_PACK = op('src/fetchpack.ts', 'fetchPack');
75const FETCH_FILTERED = op('src/fetchpack.ts', 'fetchPackFiltered');
76const FETCH_OBJECT = op('src/fetch.ts', 'fetchObject');
77const FETCH_REQUEST = op('src/fetch.ts', 'fetchRequest');
78const NEGOTIATE = op('src/negotiate.ts', 'negotiate');
79const SIDEBAND = op('src/fetch.ts', 'parseSideband');
80const LEARN_FILTER = op('src/transport.ts', 'learnFilter');
81const PARSE_PACK = op('src/packresolve.ts', 'parsePack');
82const RESOLVE_PACK = op('src/packresolve.ts', 'resolvePack');
83const RESOLVE_RANGE = op('src/packrangeresolve.ts', 'resolvePackRange');
84const SCAN_PACK = op('src/pullstream.ts', 'scanPack');
85const PUSH = op('src/push.ts', 'push');
86const PUSH_PACK = op('src/receivecaps.ts', 'pushPack');
87const CLASSIFY_REPORT = op('src/push.ts', 'classifyReport');
88const EDIT_FILE = op('src/edit.ts', 'editFile');
89const COMMIT_CHANGES = op('src/changes.ts', 'commitChanges');
90const PUSH_TREE = op('src/tree.ts', 'pushTree');
91const CREATE_BRANCH = op('src/refops.ts', 'createBranch');
92const DELETE_BRANCH = op('src/refops.ts', 'deleteBranch');
93const CREATE_TAG = op('src/refops.ts', 'createTag');
94const DELETE_TAG = op('src/refops.ts', 'deleteTag');
95const READ_FILE = op('src/read.ts', 'readFile');
96const LIST_TREE = op('src/read.ts', 'listTree');
97const READ_COMMIT = op('src/read.ts', 'readCommit');
98const READ_LOG = op('src/log.ts', 'readLog');
99const MERGE_BASE = op('src/merge.ts', 'mergeBase');
100const MERGE_BRANCH = op('src/merge.ts', 'mergeBranch');
101const REBASE_BRANCH = op('src/rebase.ts', 'rebaseBranch');
102const CHERRY_PICK = op('src/rebase.ts', 'cherryPick');
103const REVERT_COMMIT = op('src/rebase.ts', 'revertCommit');
104const RUN_TRANSFER = op('src/transfer.ts', 'runTransfer');
105const CREATE_TRANSPORT = op('src/http.ts', 'createTransport');
106const REDIRECT_POLICY = op('src/http.ts', 'redirectPolicy');
107const EXCHANGE_CLOCK = op('src/deadline.ts', 'exchangeClock');
109const PARITY_LSREFS = 'ls-refs == git ls-remote (prefixes, symrefs, peeled tags, many refs)';
110const MATRIX = 'exhaustive fetch matrix: wants × haves × deepen × filter × server';
111const CLONE_SHAPES = 'clone --depth N / --filter / --shallow-since / --shallow-exclude: same invocation, same shallow set, same objects';
112const ADV_PUSH = 'push: request × advertised atomic × advertised push-options × object-format, judged by git push';
113const BAND3_NO_REPORT = 'push outcome (SAFETY.md I36): the exact report shapes, the decision, and the fields the enumerator does not compare';
115const PROBES = 'probe ${s.id}: ply and stock git against the reference meet the expectation and leave the same repository';
116const ADV_REAL = 'real git http-backend configurations advertise exactly what the renderer writes for their cell';
118const REFS: readonly BehaviourIn<'refs'>[] = [
119 b({
120 id: 'refs.ls-refs-listing', area: 'refs',
121 description: 'v2 ls-refs lists every ref with its object id.',
122 ops: [LS_REFS, LIST_REFS],
123 tests: [t('test/parity.test.js', PARITY_LSREFS), t('test/e2e-customer.test.js', 'listRefs is for-each-ref, before the deletes'), t('test/probes/wire.test.js', WIRE_TEST)],
124 status: verified(git('test/parity.test.js', PARITY_LSREFS), validatePly('refs list (peeled tags)'), plyWorker('refs/small'), compat('ls_remote/small/v2'), validateGit('git judge: fsck --strict, refs, history'), git('test/probes/wire.test.js', WIRE_TEST), w4Ply('refs.ls-refs-listing#two-thousand-refs/art-ply'), w4Git('refs.ls-refs-listing#two-thousand-refs/art-git'), w4Art('refs.ls-refs-listing#two-thousand-refs/art-raw'), w4Art('refs.ls-refs-listing#two-thousand-refs/art-curl'), w4Art('refs.ls-refs-listing#unknown-argument/art-raw'), w4Art('refs.ls-refs-listing#unknown-argument/art-curl')),
125 notes: ['The two-thousand-refs plan lists 1500 branches, 500 annotated tags and HEAD and compares a digest of the whole listing.'],
126 }),
127 b({
128 id: 'refs.ref-prefix', area: 'refs',
129 description: 'ls-refs `ref-prefix` arguments restrict the listing to refs under the given prefixes.',
130 ops: [LS_REFS, LIST_REFS],
131 tests: [t('test/parity.test.js', "['refs/heads/main', 'refs/tags/v1'], ['HEAD']")],
132 status: verified(git('test/parity.test.js', "['refs/heads/main', 'refs/tags/v1'], ['HEAD']"), plyWorker('refs/prefix'), plyWorker('refs/prefix_tags'), compat('ls_remote_ref_prefix/small/v2')),
133 notes: [],
134 }),
135 b({
136 id: 'refs.symref-head', area: 'refs',
137 description: 'ls-refs `symrefs` reports the target of HEAD, and the target is the default branch.',
138 ops: [LS_REFS, PUSH],
139 tests: [t('test/parity.test.js', PARITY_LSREFS), t('test/probes/probes.test.js', PROBES)],
140 status: verified(git('test/parity.test.js', PARITY_LSREFS), plyWorker('refs/n4_head'), plyWorker('refs/n4'), git('test/probes/probes.test.js', PROBES), semPly('refs.symref-head#delete-default-branch/art-ply'), semGit('refs.symref-head#delete-default-branch/art-git'), rpPly('refs.symref-head#delete-default-branch/art-ply'), rpGit('refs.symref-head#delete-default-branch/art-git')),
141 notes: ['The delete-default-branch probe asks for a delete of the branch HEAD names and reads HEAD back with ls-remote --symref.'],
142 }),
143 b({
144 id: 'refs.directory-file-conflict', area: 'refs',
145 description: 'A ref cannot be both a name and a directory: creating refs/heads/a/b while refs/heads/a exists (or the reverse, or both in one push) is refused and leaves the existing ref as it was.',
146 ops: [PUSH],
147 tests: [t('test/probes/probes.test.js', PROBES)],
148 status: verified(git('test/probes/probes.test.js', PROBES), dfPly('refs.directory-file-conflict#file-then-dir/art-ply'), dfGit('refs.directory-file-conflict#file-then-dir/art-git'), dfPly('refs.directory-file-conflict#dir-then-file/art-ply'), dfGit('refs.directory-file-conflict#dir-then-file/art-git'), dfPly('refs.directory-file-conflict#both-in-one-push/art-ply'), dfGit('refs.directory-file-conflict#both-in-one-push/art-git'), rpPly('refs.directory-file-conflict#file-then-dir/art-ply'), rpGit('refs.directory-file-conflict#file-then-dir/art-git'), rpPly('refs.directory-file-conflict#dir-then-file/art-ply'), rpGit('refs.directory-file-conflict#dir-then-file/art-git'), rpPly('refs.directory-file-conflict#both-in-one-push/art-ply'), rpGit('refs.directory-file-conflict#both-in-one-push/art-git')),
149 notes: [],
150 }),
151 b({
152 id: 'refs.peeled-tags', area: 'refs',
153 description: 'ls-refs `peel` attaches the peeled id to annotated tags, and only to them.',
154 ops: [LS_REFS, LIST_REFS],
155 tests: [t('test/parity.test.js', PARITY_LSREFS)],
156 status: verified(git('test/parity.test.js', PARITY_LSREFS), validatePly('refs list (peeled tags)'), compat('ls_remote_tags/small/v2')),
157 notes: [],
158 }),
159 b({
160 id: 'refs.unborn-empty-repo', area: 'refs',
161 description: 'An empty repository lists no refs, and ls-refs `unborn` names the branch HEAD will be born on.',
162 ops: [LS_REFS],
163 tests: [t('test/lsrefs-unborn.test.js', 'lsRefs unborn: the argument, the answer and the ref listing agree with git, across every cell'), t('test/lsrefs-unborn.test.js', 'lsRefs unborn: an empty repository clones to the branch ply reports (git clone is the oracle)')],
164 status: verified(git('test/lsrefs-unborn.test.js', 'lsRefs unborn: the argument, the answer and the ref listing agree with git, across every cell'), validatePly('refs (empty)'), plyWorker('refs/empty')),
165 notes: [],
166 }),
167 b({
168 id: 'refs.advertisement-shapes', area: 'refs',
169 description: 'Unusual but legal listings (duplicate names, ordering, raw bytes in names) are read as git reads them.',
170 ops: [LS_REFS],
171 tests: [t('test/space/advertisement.test.js', 'refs: every cell, judged by git ls-remote; a duplicate ref resolves to its first listing in git fetch'), t('test/git-bytes.test.js', 'byte content × object field × operation')],
172 status: verified(git('test/space/advertisement.test.js', 'refs: every cell, judged by git ls-remote; a duplicate ref resolves to its first listing in git fetch')),
173 notes: ['No Artifacts evidence: ply has never asked Artifacts to list a ref with non-UTF-8 or unusual bytes.'],
174 }),
175 b({
176 id: 'refs.v0-upload-pack-advertisement', area: 'refs',
177 description: 'The v0/v1 upload-pack advertisement (refs and capabilities on the info/refs GET, no Git-Protocol header).',
178 ops: [],
179 tests: [],
180 status: unsupported('ply asks for protocol v2 on upload-pack and refuses a server that answers otherwise (src/caps.ts).', compat('ls_remote/small/v0'), compat('clone_full/small/v0'), compat('depth_1/small/v0'), wireArt('refs.v0-upload-pack-advertisement#no-protocol-header/art-raw'), wireArt('refs.v0-upload-pack-advertisement#no-protocol-header/art-curl'), wireGit('refs.v0-upload-pack-advertisement#no-protocol-header/art-git'), w4Art('refs.v0-upload-pack-advertisement#two-thousand-refs/art-raw'), w4Art('refs.v0-upload-pack-advertisement#two-thousand-refs/art-curl'), w4Git('refs.v0-upload-pack-advertisement#two-thousand-refs/art-git')),
181 notes: ['Stock git, raw requests and curl have probed v0 on Artifacts; ply has not.'],
182 }),
183 b({
184 id: 'refs.receive-pack-advertisement', area: 'refs',
185 description: 'The receive-pack advertisement (v0 form: capabilities on the first ref, `capabilities^{}` for an empty repository).',
186 ops: [RECEIVE_CAPS, PUSH],
187 tests: [t('test/space/advertisement.test.js', ADV_PUSH), t('test/push.test.js', 'push matrix: configs × hooks × commands × caps, parity with git push')],
188 status: verified(git('test/space/advertisement.test.js', ADV_PUSH), validatePly('write: root commit (edit changes)'), phase2Wire('receive_caps/artifacts')),
189 notes: [],
190 }),
191];
193const CAPS: readonly BehaviourIn<'caps'>[] = [
194 b({
195 id: 'caps.v2-capability-advertisement', area: 'caps',
196 description: 'The v2 capability advertisement: version 2, agent, ls-refs and fetch features, object-format, server-option, session-id.',
197 ops: [DISCOVER, PARSE_CAPS],
198 tests: [t('test/space/advertisement.test.js', 'caps: every cell through discover() (derived from the table)'), t('test/space/advertisement.test.js', ADV_REAL)],
199 status: verified(git('test/space/advertisement.test.js', ADV_REAL), validatePly('discover'), plyWorker('discover/v2_caps'), phase2Wire('capability_table/v2'), deltaWire('caps/v2_fetch_features'), w4Art('caps.v2-capability-advertisement#unknown-capability-line/art-raw'), w4Art('caps.v2-capability-advertisement#unknown-capability-line/art-curl')),
200 notes: [],
201 }),
202 b({
203 id: 'caps.required-capabilities', area: 'caps',
204 description: 'A server missing a capability ply needs (ls-refs, fetch) is refused as unsupported before any operation.',
205 ops: [REQUIRED_V2, DISCOVER],
206 tests: [t('test/space/advertisement.test.js', 'caps: every cell through discover() (derived from the table)')],
207 status: verified(git('test/space/advertisement.test.js', ADV_REAL)),
208 notes: ['Artifacts advertises every required capability, so the refusal has never been reached against it.'],
209 }),
210 b({
211 id: 'caps.object-format', area: 'caps',
212 description: 'object-format=sha1 is accepted; any other object format is refused as unsupported.',
213 ops: [OBJECT_FORMAT, DISCOVER],
214 tests: [t('test/space/advertisement.test.js', ADV_PUSH)],
215 status: verified(git('test/space/advertisement.test.js', ADV_PUSH)),
216 notes: ['ply has not probed a sha256 repository on any server.'],
217 }),
218 b({
219 id: 'caps.fetch-argument-gating', area: 'caps',
220 description: 'ply sends a fetch argument (filter, shallow, include-tag, thin-pack, ofs-delta) only when the advertisement allows it, as git fetch does.',
221 ops: [FETCH_PACK, FETCH_REQUEST],
222 tests: [t('test/space/advertisement.test.js', 'request: fetch arguments ply sends, judged by git fetch')],
223 status: verified(git('test/space/advertisement.test.js', 'request: fetch arguments ply sends, judged by git fetch'), w4Art('caps.fetch-argument-gating#unknown-fetch-argument/art-raw'), w4Art('caps.fetch-argument-gating#unknown-fetch-argument/art-curl')),
224 notes: [],
225 }),
226 b({
227 id: 'caps.filter-not-advertised', area: 'caps',
228 description: 'A server whose fetch= line lists no `filter` (stock http-backend) gets no filter argument after one probe.',
229 ops: [FETCH_PACK, READ_FILE, LIST_TREE],
230 tests: [t('test/no-filter.test.js', 'reads: readFile, listTree, readCommit, readLog, checkoutTree answer the same on both; one probe, then no filter')],
231 status: verified(git('test/no-filter.test.js', 'reads: readFile, listTree, readCommit, readLog, checkoutTree answer the same on both; one probe, then no filter')),
232 notes: [],
233 }),
234 b({
235 id: 'caps.receive-pack-capabilities', area: 'caps',
236 description: 'receive-pack capabilities (report-status, report-status-v2, side-band-64k, atomic, push-options, delete-refs, ofs-delta, object-format) are read and checked before the POST.',
237 ops: [RECEIVE_CAPS, CHECK_PUSH_CAPS],
238 tests: [t('test/space/advertisement.test.js', ADV_PUSH), t('test/push-pack.test.js', 'atomic the server does not advertise: unsupported, no POST, the pack unread')],
239 status: verified(git('test/space/advertisement.test.js', ADV_PUSH), phase2Wire('receive_caps/artifacts'), deltaWire('caps/receive_pack_ofs_delta'), w4Art('caps.receive-pack-capabilities#unknown-capability-on-push/art-raw'), w4Art('caps.receive-pack-capabilities#unknown-capability-on-push/art-curl')),
240 notes: [],
241 }),
242 b({
243 id: 'caps.server-option', area: 'caps',
244 description: 'v2 `server-option` arguments on ls-refs and fetch.',
245 ops: [],
246 tests: [],
247 status: unsupported('discover() reads the capability; no ply operation sends a server-option.', phase2Wire('capability_table/v2')),
248 notes: [],
249 }),
250 b({
251 id: 'caps.wait-for-done-packfile-uris-sideband-all', area: 'caps',
252 description: 'v2 fetch features wait-for-done, packfile-uris and sideband-all.',
253 ops: [],
254 tests: [],
255 status: unsupported('src/closed.ts names them only to classify an advertisement; ply never requests them.', deltaWire('caps/v2_fetch_features')),
256 notes: [],
257 }),
258 b({
259 id: 'caps.object-info', area: 'caps',
260 description: 'The v2 `object-info` command (object sizes without a pack).',
261 ops: [],
262 tests: [],
263 status: unsupported('No ply operation sends command=object-info.', phase2Wire('object_info/artifacts'), wireArt('caps.object-info#size/art-raw'), wireArt('caps.object-info#size/art-curl')),
264 notes: [],
265 }),
266];
268const FETCH: readonly BehaviourIn<'fetch'>[] = [
269 b({
270 id: 'fetch.want-tip-full-pack', area: 'fetch',
271 description: 'want of a tip with done and no filter: the pack holds exactly what pack-objects sends.',
272 ops: [FETCH_PACK],
273 tests: [t('test/protocol.test.js', MATRIX)],
274 status: verified(git('test/protocol.test.js', MATRIX), compat('clone_full/small/v2'), compat('clone_full/big/v2'), validateGit('git judge: fsck --strict, refs, history')),
275 notes: ['On Artifacts only stock git has fetched full packs; ply always fetches there with a filter or a depth.'],
276 }),
277 b({
278 id: 'fetch.want-non-tip-object', area: 'fetch',
279 description: 'want of an object that is not an advertised tip (an older commit, a tree, a blob, a tag) by id.',
280 ops: [FETCH_PACK, FETCH_OBJECT, READ_FILE],
281 tests: [t('test/protocol.test.js', MATRIX), t('test/read.test.js', 'readFile bytes == git show <ref>:<path> for every blob path and every ref form')],
282 status: verified(git('test/protocol.test.js', MATRIX), git('test/read.test.js', 'readFile bytes == git show <ref>:<path> for every blob path and every ref form'), validatePly('read/blob README.md'), validatePly('tree (root, src)'), phase3Git('reachable_nontip/v2/artifacts'), phase2Git('fetch_reachable_sha')),
283 notes: ['The reference fixtures set uploadpack.allowAnySHA1InWant; a differential run must give the reference server the want policy Artifacts has.'],
284 }),
285 b({
286 id: 'fetch.want-unreachable-or-unknown', area: 'fetch',
287 description: 'want of an unreachable or nonexistent id: the server refuses (ERR not our ref), and ply reports a typed remote_error.',
288 ops: [FETCH_PACK],
289 tests: [t('test/mutant-kill-tree.test.js', 'ERR upload-pack: not our ref x'), t('test/probes/probes.test.js', PROBES)],
290 status: verified(phase3Git('unreachable_local/v2/artifacts'), phase3Git('fake_sha/v2/artifacts'), hostile('proto/want_short_oid'), hostile('proto/want_nonhex_oid'), git('test/probes/probes.test.js', PROBES), malPly('fetch.want-unreachable-or-unknown#phantom/art-ply')),
291 notes: ['ply sends an unknown want against git http-backend in the probes (#phantom, an id no one holds); an unreachable but present id is not probed.'],
292 }),
293 b({
294 id: 'fetch.want-have-line-syntax', area: 'fetch',
295 description: 'want/have/shallow lines: upload-pack\'s verdict on each class of id, and ply refusing non-ids before the wire.',
296 ops: [FETCH_REQUEST, NEGOTIATE],
297 tests: [t('test/want-oracle.test.js', 'want: git upload-pack and fetchRequest agree on every class')],
298 status: verified(git('test/want-oracle.test.js', 'want: git upload-pack and fetchRequest agree on every class'), hostile('proto/have_bad_oid'), hostile('proto/shallow_bad_oid')),
299 notes: [],
300 }),
301 b({
302 id: 'fetch.have-negotiation', area: 'fetch',
303 description: 'Multi-round have/ACK negotiation, then done: the server stops at common commits and sends only what is missing.',
304 ops: [NEGOTIATE, FETCH_PACK],
305 tests: [t('test/protocol.test.js', MATRIX), t('test/want-oracle.test.js', 'negotiate: an acknowledgment that is not an object id')],
306 status: verified(git('test/protocol.test.js', MATRIX), compat('incremental_fetch/scratch/v2')),
307 notes: ['On Artifacts only stock git has negotiated; no ply probe has sent haves there.'],
308 }),
309 b({
310 id: 'fetch.acknowledgments-ready-packfile', area: 'fetch',
311 description: 'v2 response sections in order (acknowledgments, ready, shallow-info, packfile); a server that breaks the order is a protocol error, as it is for git.',
312 ops: [FETCH_PACK],
313 tests: [t('test/fetch-lying-server.test.js', 'a fetch sent with done and answered with acknowledgments only is a protocol error, as it is for git'), t('test/fetch-lying-server.test.js', 'a fetch sent with done and answered with acknowledgments before its packfile is a protocol error, as it is for git')],
314 status: verified(git('test/fetch-lying-server.test.js', 'a fetch sent with done and answered with acknowledgments only is a protocol error, as it is for git')),
315 notes: [],
316 }),
317 b({
318 id: 'fetch.filter-blob-none', area: 'fetch',
319 description: 'filter blob:none: commits and trees, and blobs only when wanted by id.',
320 ops: [FETCH_PACK, FETCH_FILTERED, READ_FILE],
321 tests: [t('test/protocol.test.js', MATRIX), t('test/log.test.js', 'readLog on blob:none: the trees are harvested')],
322 status: verified(git('test/protocol.test.js', MATRIX), validatePly('read/blob README.md'), validatePly('tree (root, src)'), plyWorker('read/small'), compat('filter_blob_none+lazy_checkout/deep/v2')),
323 notes: [],
324 }),
325 b({
326 id: 'fetch.filter-tree-depth', area: 'fetch',
327 description: 'filter tree:<depth> (tree:0 commit only, tree:1, tree:2).',
328 ops: [FETCH_PACK, READ_COMMIT],
329 tests: [t('test/protocol.test.js', MATRIX), t('test/read.test.js', 'readCommit fetches the commit object only: one tree:0 deepen-1 fetch, no tree fetches')],
330 status: verified(git('test/protocol.test.js', MATRIX), compat('filter_tree_0/deep/v2')),
331 notes: [],
332 }),
333 b({
334 id: 'fetch.filter-blob-limit', area: 'fetch',
335 description: 'filter blob:limit=<n>.',
336 ops: [FETCH_PACK],
337 tests: [t('test/protocol.test.js', MATRIX)],
338 status: verified(git('test/protocol.test.js', MATRIX), compat('filter_blob_limit_2m/big/v2')),
339 notes: [],
340 }),
341 b({
342 id: 'fetch.filter-combine', area: 'fetch',
343 description: 'filter combine:blob:none+tree:<k> (a commit and the first levels of its path in one request).',
344 ops: [FETCH_PACK, READ_FILE],
345 tests: [t('test/protocol.test.js', MATRIX), t('test/path-trees.test.js', 'a server that takes it: first contact is tree:0')],
346 status: verified(git('test/protocol.test.js', MATRIX), git('test/path-trees.test.js', 'a server that takes it: first contact is tree:0')),
347 notes: ['No Artifacts evidence of any kind for combine filters.'],
348 }),
349 b({
350 id: 'fetch.filter-sparse-oid', area: 'fetch',
351 description: 'filter sparse:oid=<blob>.',
352 ops: [],
353 tests: [],
354 status: unsupported('No ply operation builds a sparse:oid filter; the wire probe hands one to fetchPackFiltered only to watch it refused, which is not support.', compat('filter_sparse_oid/wide/v2'), wireArt('fetch.filter-sparse-oid#refused/art-raw'), wireArt('fetch.filter-sparse-oid#refused/art-curl'), wireGit('fetch.filter-sparse-oid#refused/art-git')),
355 notes: [],
356 }),
357 b({
358 id: 'fetch.filter-refusal-fallback', area: 'fetch',
359 description: 'A server that advertises filter but refuses a filter spec with HTTP 400: ply records the refusal for that remote and falls back to blob:none.',
360 ops: [LEARN_FILTER, FETCH_PACK, READ_FILE],
361 tests: [t('test/artifacts-compat.test.js', 'Unsupported Git fetch filter; only blob:none is supported.'), t('test/path-trees.test.js', 'an Artifacts-like server (only blob:none): never asked for the deep fetch')],
362 status: verified(git('test/artifacts-compat.test.js', 'Unsupported Git fetch filter; only blob:none is supported.'), validatePly('read/blob README.md'), plyWorker('read/small')),
363 notes: ['The reference tests emulate the 400 with a proxy in front of git; git judges the results, not the refusal.'],
364 }),
365 b({
366 id: 'fetch.deepen-depth', area: 'fetch',
367 description: 'deepen <n>: a shallow pack cut n commits below each want, with shallow-info naming the boundary.',
368 ops: [FETCH_PACK, FETCH_OBJECT],
369 tests: [t('test/protocol.test.js', MATRIX), t('test/parity.test.js', CLONE_SHAPES), t('test/fetchobject-deepen.test.js', 'fetchObject costs one object')],
370 status: verified(git('test/parity.test.js', CLONE_SHAPES), compat('depth_1/small/v2'), compat('depth_n/small/v2')),
371 notes: [],
372 }),
373 b({
374 id: 'fetch.deepen-since', area: 'fetch',
375 description: 'deepen-since <time>.',
376 ops: [FETCH_PACK],
377 tests: [t('test/parity.test.js', CLONE_SHAPES)],
378 status: verified(git('test/parity.test.js', CLONE_SHAPES), compat('shallow_since/deep/v2')),
379 notes: [],
380 }),
381 b({
382 id: 'fetch.deepen-not', area: 'fetch',
383 description: 'deepen-not <ref>.',
384 ops: [FETCH_PACK],
385 tests: [t('test/parity.test.js', CLONE_SHAPES)],
386 status: verified(git('test/parity.test.js', CLONE_SHAPES), compat('shallow_exclude/deep/v2')),
387 notes: [],
388 }),
389 b({
390 id: 'fetch.deepen-relative-unshallow', area: 'fetch',
391 description: 'Fetch after a shallow clone: deepen-relative, a deeper depth, and unshallow, from the client\'s shallow list.',
392 ops: [FETCH_PACK],
393 tests: [t('test/parity.test.js', 'fetch after a shallow clone: --deepen (relative), --depth=N, --unshallow, --shallow-since, --shallow-exclude')],
394 status: verified(git('test/parity.test.js', 'fetch after a shallow clone: --deepen (relative), --depth=N, --unshallow, --shallow-since, --shallow-exclude'), phase2Git('deepen_relative_v2'), compat('unshallow/deep/v2'), phase2Git('depth_beyond_history')),
395 notes: [],
396 }),
397 b({
398 id: 'fetch.include-tag', area: 'fetch',
399 description: 'include-tag: annotated tags that point into the pack are sent with it.',
400 ops: [FETCH_PACK],
401 tests: [t('test/parity.test.js', 'includeTag: true')],
402 status: verified(git('test/parity.test.js', 'includeTag: true'), compat('depth_1/wide/v2'), compat('clone_full/small/v2')),
403 notes: ['ply\'s own operations never ask for include-tag; only a fetchPack caller that sets it does.'],
404 }),
405 b({
406 id: 'fetch.thin-pack', area: 'fetch',
407 description: 'thin-pack with haves: deltas against objects the client has, resolved against external bases.',
408 ops: [FETCH_PACK, RESOLVE_PACK],
409 tests: [t('test/protocol.test.js', MATRIX), t('test/edges.test.js', 'thin-pack fetch with have resolves against external base')],
410 status: verified(git('test/edges.test.js', 'thin-pack fetch with have resolves against external base'), deltaGit('storage/thin_fetch')),
411 notes: [],
412 }),
413 b({
414 id: 'fetch.ofs-delta-requested', area: 'fetch',
415 description: 'ofs-delta: OFS_DELTA entries only when asked for.',
416 ops: [FETCH_PACK, PARSE_PACK],
417 tests: [t('test/protocol.test.js', MATRIX)],
418 status: verified(git('test/protocol.test.js', MATRIX), deltaWire('caps/upload_v0_ofs_thin')),
419 notes: [],
420 }),
421 b({
422 id: 'fetch.sideband-bands', area: 'fetch',
423 description: 'Side-band in the packfile section: band 1 data, band 2 progress, band 3 fatal error.',
424 ops: [SIDEBAND, FETCH_PACK],
425 tests: [t('test/adversarial.test.js', "{ name: 'fetch band 3 (commit)'"), t('test/remote-text.test.js', 'listRefs (ERR) and readFile (fetch ERR, fetch band 3) carry none of it')],
426 status: verified(git('test/adversarial.test.js', 'every protocol-aware mutator × every stage: typed error or git-verified success, never silent corruption')),
427 notes: ['Band 3 is only ever injected by a proxy; no server has been made to send ply a fatal band-3 line.'],
428 }),
429];
431const PUSH_MATRIX = 'push matrix: configs × hooks × commands × caps, parity with git push';
433const PACK: readonly BehaviourIn<'pack'>[] = [
434 b({
435 id: 'pack.ofs-delta-resolve', area: 'pack',
436 description: 'A served pack with OFS_DELTA chains resolves to the objects git verify-pack lists.',
437 ops: [PARSE_PACK, RESOLVE_RANGE, SCAN_PACK],
438 tests: [t('test/pack-range-resolve.test.js', "this repository's pack with OFS deltas matches git verify-pack")],
439 status: verified(git('test/pack-range-resolve.test.js', "this repository's pack with OFS deltas matches git verify-pack")),
440 notes: ['Artifacts sends REF_DELTA only, so no fetch from it reaches OFS resolution.'],
441 }),
442 b({
443 id: 'pack.ref-delta-resolve', area: 'pack',
444 description: 'A served pack of REF_DELTA entries only (what Artifacts sends) resolves in any order.',
445 ops: [PARSE_PACK, RESOLVE_RANGE, SCAN_PACK],
446 tests: [t('test/pack-range-resolve.test.js', "this repository's pack, REF_DELTA only (what Artifacts sends)"), t('test/edges.test.js', 'REF_DELTA packs (server without ofs-delta) resolve identically')],
447 status: verified(git('test/pack-range-resolve.test.js', "this repository's pack, REF_DELTA only (what Artifacts sends)"), validatePly('read/blob README.md'), validatePly('viewer: /r/ply blob (README.md)')),
448 notes: [],
449 }),
450 b({
451 id: 'pack.thin-ref-base', area: 'pack',
452 description: 'A thin REF base supplied from outside the pack is checked against its claimed id before a delta applies.',
453 ops: [RESOLVE_PACK],
454 tests: [t('test/space/thin-base.test.js', 'thin REF base: every claim × byte form against git hash-object and index-pack --fix-thin')],
455 status: verified(git('test/space/thin-base.test.js', 'thin REF base: every claim × byte form against git hash-object and index-pack --fix-thin')),
456 notes: [],
457 }),
458 b({
459 id: 'pack.truncated-served-pack', area: 'pack',
460 description: 'A served pack cut at any byte is refused, typed, on every read path, where git index-pack refuses it.',
461 ops: [PARSE_PACK, SCAN_PACK, RESOLVE_RANGE],
462 tests: [t('test/space/pack-cut.test.js', 'cut: every byte offset of every pack is refused, typed, on every path')],
463 status: verified(git('test/space/pack-cut.test.js', 'git index-pack --strict refuses every cut')),
464 notes: [],
465 }),
466 b({
467 id: 'pack.corrupt-served-pack', area: 'pack',
468 description: 'A served pack with a corrupt header field, zlib member, delta or checksum is refused exactly where git index-pack --strict refuses it.',
469 ops: [PARSE_PACK, SCAN_PACK, FETCH_PACK],
470 tests: [t('test/space/pack-cut.test.js', 'corrupt: every header-field class is refused exactly where git index-pack --strict refuses it, typed'), t('test/adversarial.test.js', 'every protocol-aware mutator × every stage: typed error or git-verified success, never silent corruption')],
471 status: verified(git('test/space/pack-cut.test.js', 'corrupt: every header-field class is refused exactly where git index-pack --strict refuses it, typed')),
472 notes: [],
473 }),
474 b({
475 id: 'pack.served-pack-limits', area: 'pack',
476 description: 'Hostile sizes in a served pack (object size, delta result, chain depth, inflated total) are refused before allocation.',
477 ops: [PARSE_PACK, RESOLVE_RANGE],
478 tests: [t('test/adversarial.test.js', 'I4 limits: hostile sizes are rejected before allocation; memory does not grow'), t('test/delta-bound.test.js', 'A delta that asks for a huge result must die before the output buffer exists'), t('test/space/pack-cut.test.js', 'caps: maxObjectSize, maxInflatedTotal, maxDeltaChain at, and one under, what each real pack needs')],
479 status: verified(git('test/space/pack-cut.test.js', 'caps: maxObjectSize, maxInflatedTotal, maxDeltaChain at, and one under, what each real pack needs')),
480 notes: [],
481 }),
482 b({
483 id: 'pack.push-ofs-delta-accepted', area: 'pack',
484 description: 'receive-pack accepts a pushed pack with OFS_DELTA entries when it advertises ofs-delta.',
485 ops: [PUSH, PUSH_PACK],
486 tests: [t('test/push-once.test.js', 'push: an ofs delta whose base is a repeated object still names its base'), t('test/push-pack.test.js', 'a stock git pack of known length: chunked stream, ref moves, fsck --strict clean, span counts the body')],
487 status: verified(git('test/push-pack.test.js', 'a stock git pack of known length: chunked stream, ref moves, fsck --strict clean, span counts the body'), deltaWire('push/ofs')),
488 notes: [],
489 }),
490 b({
491 id: 'pack.push-thin-against-server-base', area: 'pack',
492 description: 'receive-pack completes a thin pushed pack whose REF bases it holds (every ply edit pushes blob and tree deltas this way).',
493 ops: [EDIT_FILE, PUSH],
494 tests: [t('test/edges.test.js', 'push = commit + 100 tree deltas + blob delta'), t('test/probes/probes.test.js', PROBES)],
495 status: verified(git('test/edges.test.js', 'push = commit + 100 tree deltas + blob delta'), validatePly('write: edit README find/replace (c1)'), deltaWire('push/thin_ok'), git('test/probes/probes.test.js', PROBES), probePly('pack.push-thin-against-server-base#literal-delta/art-ply'), probeGit('pack.push-thin-against-server-base#literal-delta/art-git')),
496 notes: [],
497 }),
498 b({
499 id: 'pack.push-thin-missing-base', area: 'pack',
500 description: 'receive-pack refuses a thin pushed pack whose base it does not hold, and moves no ref.',
501 ops: [PUSH_PACK],
502 tests: [t('test/probes/probes.test.js', PROBES)],
503 status: verified(deltaWire('push/thin_missing'), git('test/probes/probes.test.js', PROBES), probePly('pack.push-thin-missing-base#ghost-base/art-ply')),
504 notes: ['pushPack carries a thin pack whose delta base the server lacks in the probes, against the reference and Artifacts.'],
505 }),
506 b({
507 id: 'pack.push-corrupt-pack-refused', area: 'pack',
508 description: 'receive-pack refuses a corrupt pushed pack (unpack error, ng for every ref) and moves no ref.',
509 ops: [PUSH_PACK, CLASSIFY_REPORT],
510 tests: [t('test/push-pack.test.js', 'a corrupt pack against stock git'), t('test/custom-exchange.test.js', 'a corrupt pack: the report is unpackFailed'), t('test/push-unpack-host.test.js', 'the echoed shape is unpackFailed and decides push_rejected; delete-only stays ambiguous'), t('test/probes/probes.test.js', PROBES)],
511 status: verified(git('test/push-pack.test.js', 'a corrupt pack against stock git'), hostileWrite('pack/corrupt_zlib'), hostileWrite('pack/bad_checksum'), hostileWrite('pack/truncated'), hostileWrite('pack/bad_magic'), hostileWrite('pack/wrong_object_count'), git('test/probes/probes.test.js', PROBES), probePly('pack.push-corrupt-pack-refused#bad-trailer/art-ply'), probePly('pack.push-corrupt-pack-refused#bad-zlib/art-ply'), probePly('pack.push-corrupt-pack-refused#truncated/art-ply')),
512 notes: ['ply\'s reading of Artifacts\' own unpack-failure report is tested on bytes copied from prod into a fake (push-unpack-host.test.js) and live by the corrupt-pack probes (bad trailer, bad zlib, truncated).'],
513 }),
514 b({
515 id: 'pack.push-duplicate-object', area: 'pack',
516 description: 'A pushed pack never names one object twice (a strict receiver refuses it).',
517 ops: [PUSH],
518 tests: [t('test/push-once.test.js', 'push: a list that names objects twice is one object each on the wire')],
519 status: verified(git('test/push-once.test.js', 'push: a list that names objects twice is one object each on the wire')),
520 notes: [],
521 }),
522 b({
523 id: 'pack.push-malformed-object-refused', area: 'pack',
524 description: 'receive-pack refuses a well-framed pack that holds a malformed object or a delta with no base.',
525 ops: [PUSH_PACK],
526 tests: [t('test/probes/probes.test.js', PROBES)],
527 status: verified(hostileWrite('pack/invalid_commit_payload'), hostileWrite('pack/delta_missing_base'), git('test/probes/probes.test.js', PROBES), probePly('pack.push-malformed-object-refused#missing-blob/art-ply'), probePly('pack.push-malformed-object-refused#delta-copy-past-end/art-ply'), semPly('pack.push-malformed-object-refused#tag-type-mismatch/art-ply')),
528 notes: ['ply\'s encoders never write a malformed object (the encode-*-fsck tests); the probes carry one through pushPack: a commit naming a missing blob, a delta copying past its base.'],
529 }), b({
530 id: 'pack.push-bad-header-refused', area: 'pack',
531 description: 'receive-pack refuses a pushed pack whose header is wrong (signature, version, object count more or fewer than sent), moves no ref, and still serves the repository fsck-clean.',
532 ops: [PUSH_PACK],
533 tests: [t('test/probes/probes.test.js', PROBES)],
534 status: verified(git('test/probes/probes.test.js', PROBES), malPly('pack.push-bad-header-refused#bad-signature/art-ply'), malPly('pack.push-bad-header-refused#bad-version/art-ply'), malPly('pack.push-bad-header-refused#count-more/art-ply'), malPly('pack.push-bad-header-refused#count-fewer/art-ply')),
535 notes: ['Probe packs are written by the harness with the trailer recomputed, so only the header is wrong; ply sends them through pushPack.'],
536 }),
537 b({
538 id: 'pack.push-bad-entry-refused', area: 'pack',
539 description: 'receive-pack refuses a pushed pack with a bad entry (stated size not what the zlib stream inflates to, a reserved object type, an OFS_DELTA reaching before the pack, a delta whose stated result size it does not write), moves no ref, and still serves the repository fsck-clean.',
540 ops: [PUSH_PACK],
541 tests: [t('test/probes/probes.test.js', PROBES)],
542 status: verified(git('test/probes/probes.test.js', PROBES), malPly('pack.push-bad-entry-refused#size-header-mismatch/art-ply'), malPly('pack.push-bad-entry-refused#bad-type/art-ply'), malPly('pack.push-bad-entry-refused#ofs-delta-before-start/art-ply'), malPly('pack.push-bad-entry-refused#delta-size-mismatch/art-ply')),
543 notes: [],
544 }),
545 b({
546 id: 'pack.push-duplicate-entries', area: 'pack',
547 description: 'receive-pack with fsckObjects refuses a pushed pack that names every object twice (git index-pack --strict), moves no ref, and still serves the repository fsck-clean.',
548 ops: [PUSH_PACK],
549 tests: [t('test/probes/probes.test.js', PROBES)],
550 status: verified(git('test/probes/probes.test.js', PROBES), malPly('pack.push-duplicate-entries#every-object-twice/art-ply')),
551 notes: ['pack.push-duplicate-object is ply\'s side (it never sends one object twice); this is the server\'s answer to a pack that does.'],
552 }),
553 b({
554 id: 'pack.push-fsck-tree-refused', area: 'pack',
555 description: 'receive-pack with fsckObjects refuses a pushed tree git fsck calls an error (unsorted, a name twice, a `/` in a name, `.git`, a zero-padded mode), moves no ref, and still serves the repository fsck-clean.',
556 ops: [PUSH],
557 tests: [t('test/probes/probes.test.js', PROBES)],
558 status: verified(git('test/probes/probes.test.js', PROBES), malPly('pack.push-fsck-tree-refused#unsorted/art-ply'), malGit('pack.push-fsck-tree-refused#unsorted/art-git'), malPly('pack.push-fsck-tree-refused#duplicate-name/art-ply'), malGit('pack.push-fsck-tree-refused#duplicate-name/art-git'), malPly('pack.push-fsck-tree-refused#slash-in-name/art-ply'), malGit('pack.push-fsck-tree-refused#slash-in-name/art-git'), malPly('pack.push-fsck-tree-refused#dot-git/art-ply'), malGit('pack.push-fsck-tree-refused#dot-git/art-git'), malPly('pack.push-fsck-tree-refused#zero-padded-mode/art-ply'), malGit('pack.push-fsck-tree-refused#zero-padded-mode/art-git')),
559 notes: ['Seeded byte for byte with git hash-object --literally and pushed by both ply and stock git, whose pack writers carry the object unchecked. A tree with mode 100664 (badFilemode) is only a warning to receive.fsckObjects and is not probed.'],
560 }),
561 b({
562 id: 'pack.push-fsck-commit-refused', area: 'pack',
563 description: 'receive-pack with fsckObjects refuses a pushed commit with a malformed author line (bad date, missing email, bad time zone, a date that overflows), moves no ref, and still serves the repository fsck-clean.',
564 ops: [PUSH],
565 tests: [t('test/probes/probes.test.js', PROBES)],
566 status: verified(git('test/probes/probes.test.js', PROBES), malPly('pack.push-fsck-commit-refused#bad-date/art-ply'), malGit('pack.push-fsck-commit-refused#bad-date/art-git'), malPly('pack.push-fsck-commit-refused#missing-email/art-ply'), malGit('pack.push-fsck-commit-refused#missing-email/art-git'), malPly('pack.push-fsck-commit-refused#bad-timezone/art-ply'), malGit('pack.push-fsck-commit-refused#bad-timezone/art-git'), malPly('pack.push-fsck-commit-refused#date-overflow/art-ply'), malGit('pack.push-fsck-commit-refused#date-overflow/art-git')),
567 notes: [],
568 }),
569 b({
570 id: 'pack.push-decompression-ratio', area: 'pack',
571 description: 'receive-pack takes a pushed blob that inflates about a thousandfold (16 MiB of one byte in about 16 KiB), under its object and pack caps, and serves it back.',
572 ops: [PUSH],
573 tests: [t('test/probes/probes.test.js', PROBES)],
574 status: verified(git('test/probes/probes.test.js', PROBES), malPly('pack.push-decompression-ratio#zeros-16mib/art-ply'), malGit('pack.push-decompression-ratio#zeros-16mib/art-git')),
575 notes: [],
576 }),
577];
579const PUSHES: readonly BehaviourIn<'push'>[] = [
580 b({
581 id: 'push.create-ref', area: 'push',
582 description: 'A command with the zero old id creates a ref.',
583 ops: [PUSH, CREATE_BRANCH],
584 tests: [t('test/push.test.js', "'create': t =>"), t('test/e2e-customer.test.js', 'createBranch from a branch name, a short name, a peeled annotated tag'), t('test/probes/probes.test.js', PROBES)],
585 status: verified(git('test/push.test.js', "'create': t =>"), validatePly('branch create (feat from c0)'), plyWorker('branch/create'), phase2Git('new_branch'), git('test/probes/probes.test.js', PROBES), probePly('push.create-ref#plain/art-ply'), probeGit('push.create-ref#plain/art-git'), probePly('push.create-ref#already-exists/art-ply'), probeGit('push.create-ref#already-exists/art-git')),
586 notes: [],
587 }),
588 b({
589 id: 'push.first-commit-empty-repo', area: 'push',
590 description: 'The first push to an empty repository creates the default branch from a root commit.',
591 ops: [COMMIT_CHANGES, PUSH],
592 tests: [t('test/changes.test.js', 'commitChanges: start × place × op against git cat-file and fsck --strict'), t('test/probes/probes.test.js', PROBES)],
593 status: verified(git('test/changes.test.js', 'commitChanges: start × place × op against git cat-file and fsck --strict'), validatePly('write: root commit (edit changes)'), git('test/probes/probes.test.js', PROBES), probePly('push.first-commit-empty-repo#root/art-ply'), probeGit('push.first-commit-empty-repo#root/art-git')),
594 notes: [],
595 }),
596 b({
597 id: 'push.fast-forward-update', area: 'push',
598 description: 'A fast-forward update with the current old id lands.',
599 ops: [PUSH, EDIT_FILE],
600 tests: [t('test/push.test.js', PUSH_MATRIX), t('test/probes/probes.test.js', PROBES)],
601 status: verified(git('test/push.test.js', PUSH_MATRIX), validatePly('write: edit README find/replace (c1)'), plyWorker('edit/ok'), git('test/probes/probes.test.js', PROBES), probePly('push.fast-forward-update#plain/art-ply'), probeGit('push.fast-forward-update#plain/art-git')),
602 notes: [],
603 }),
604 b({
605 id: 'push.non-fast-forward', area: 'push',
606 description: 'A non-fast-forward update: refused under receive.denyNonFastForwards, accepted as a forced update otherwise.',
607 ops: [PUSH],
608 tests: [t('test/push.test.js', "'nonff-update': t =>"), t('test/push.test.js', "'deny-nonff': { 'receive.denyNonFastForwards': 'true' }"), t('test/probes/probes.test.js', PROBES)],
609 status: verified(git('test/push.test.js', "'nonff-update': t =>"), phase2Git('non_ff_reject'), compat('force_push/scratch/v2'), git('test/probes/probes.test.js', PROBES), probePly('push.non-fast-forward#with-old-id/art-ply'), probeGit('push.non-fast-forward#with-old-id/art-git')),
610 notes: [],
611 }),
612 b({
613 id: 'push.delete-ref', area: 'push',
614 description: 'A command with the zero new id deletes a ref (delete-refs); refused under receive.denyDeletes.',
615 ops: [PUSH, DELETE_BRANCH],
616 tests: [t('test/push.test.js', "'delete': t =>"), t('test/push.test.js', "'deny-deletes': { 'receive.denyDeletes': 'true' }"), t('test/probes/probes.test.js', PROBES)],
617 status: verified(git('test/push.test.js', "'delete': t =>"), validatePly('branch delete (CAS ok)'), plyWorker('branch/delete'), compat('tag_push_delete/scratch/v2'), git('test/probes/probes.test.js', PROBES), probePly('push.delete-ref#plain/art-ply'), probeGit('push.delete-ref#plain/art-git')),
618 notes: [],
619 }),
620 b({
621 id: 'push.atomic', area: 'push',
622 description: 'atomic: several ref updates land together or not at all.',
623 ops: [PUSH, PUSH_PACK, RUN_TRANSFER],
624 tests: [t('test/push.test.js', "'multi-atomic': t =>"), t('test/push-pack.test.js', 'atomic: checked against the advertisement, then sent; two refs land together'), t('test/probes/probes.test.js', PROBES)],
625 status: verified(git('test/push-pack.test.js', 'atomic: checked against the advertisement, then sent; two refs land together'), compat('atomic_push_multi_ref/scratch/v2'), git('test/probes/probes.test.js', PROBES), probePly('push.atomic#all-land/art-ply'), probePly('push.atomic#one-stale/art-ply'), probeGit('push.atomic#all-land/art-git'), probeGit('push.atomic#one-stale/art-git')),
626 notes: ['The one-stale variant makes one command fail at the server: another writer moves its ref while the request is held.'],
627 }),
628 b({
629 id: 'push.non-atomic-partial', area: 'push',
630 description: 'A non-atomic multi-ref push the server applies in part is push_partial, naming what landed.',
631 ops: [PUSH],
632 tests: [t('test/push.test.js', "assert.equal(err.code, 'push_partial'"), t('test/probes/probes.test.js', PROBES)],
633 status: verified(git('test/push.test.js', "assert.equal(err.code, 'push_partial'"), git('test/probes/probes.test.js', PROBES), probePly('push.non-atomic-partial#one-stale/art-ply'), probeGit('push.non-atomic-partial#one-stale/art-git')),
634 notes: ['Probed by a two-ref push while another writer moves one ref (src/probe-scenarios.ts). Per-check outcomes are in the private run record.'],
635 }),
636 b({
637 id: 'push.report-status', area: 'push',
638 description: 'report-status: an unpack line (ok or a reason) and an ok or ng line per command, classified as landed, rejected, conflict or ambiguous.',
639 ops: [PUSH, CLASSIFY_REPORT],
640 tests: [t('test/space/push-ng.test.js', 'push ng: cells observed from git'), t('test/space/push-outcome.test.js', 'The push-outcome enumerator'), t('test/push.test.js', PUSH_MATRIX)],
641 status: verified(git('test/push.test.js', PUSH_MATRIX), validatePly('write: root commit (edit changes)')),
642 notes: ['push-ng and push-outcome judge the class table over a fake transport; their git-observed cells are recorded bytes.'],
643 }),
644 b({
645 id: 'push.report-status-v2', area: 'push',
646 description: 'report-status-v2: option lines after ok.',
647 ops: [PUSH],
648 tests: [t('test/push.test.js', 'reportV2: true')],
649 status: verified(git('test/push.test.js', 'reportV2: true')),
650 notes: ['No Artifacts evidence: no recorded run says whether Artifacts advertises report-status-v2.'],
651 }),
652 b({
653 id: 'push.sideband-hook-output', area: 'push',
654 description: 'side-band-64k on receive-pack: the report on band 1, hook output on band 2.',
655 ops: [PUSH],
656 tests: [t('test/push.test.js', 'hook stderr visible on band 2 when side-band is requested')],
657 status: verified(git('test/push.test.js', 'hook stderr visible on band 2 when side-band is requested')),
658 notes: [],
659 }),
660 b({
661 id: 'push.push-options', area: 'push',
662 description: 'push-options: sent only when advertised; they reach the hook.',
663 ops: [PUSH, PUSH_PACK],
664 tests: [t('test/push.test.js', 'options reached the hook'), t('test/push-pack.test.js', 'push options: refused when not advertised, sent when they are')],
665 status: verified(git('test/push.test.js', 'options reached the hook'), phase2Git('push_options')),
666 notes: [],
667 }),
668 b({
669 id: 'push.hook-rejection', area: 'push',
670 description: 'A pre-receive or update hook that declines: ng with the hook\'s reason, ref unchanged.',
671 ops: [PUSH],
672 tests: [t('test/push.test.js', "'pre-receive-reject': ['pre-receive'")],
673 status: verified(git('test/push.test.js', "'pre-receive-reject': ['pre-receive'")),
674 notes: ['Artifacts runs no user hooks; this is reference-only by nature.'],
675 }),
676 b({
677 id: 'push.ref-name-rules', area: 'push',
678 description: 'receive-pack\'s ref-name rules ("funny refname"): ply refuses before the wire exactly what receive-pack refuses, and also any name over 1024 bytes, which receive-pack accepts.',
679 ops: [PUSH],
680 tests: [t('test/space/refname.test.js', 'ref names: ply agrees with git check-ref-format and receive-pack on every cell'), t('test/probes/wire.test.js', WIRE_TEST)],
681 status: verified(git('test/space/refname.test.js', 'ref names: ply agrees with git check-ref-format and receive-pack on every cell'), phase2Git('invalid_ref_names'), hostileWrite('ref/dotdot'), hostileWrite('ref/control_char'), hostileWrite('ref/long_name'), git('test/probes/wire.test.js', WIRE_TEST), w4Ply('push.ref-name-rules#leading-dash/art-ply'), w4Ply('push.ref-name-rules#component-200/art-ply'), w4Ply('push.ref-name-rules#path-1000/art-ply'), w4Ply('push.ref-name-rules#component-300/art-ply'), w4Git('push.ref-name-rules#leading-dash/art-git'), w4Git('push.ref-name-rules#component-200/art-git'), w4Git('push.ref-name-rules#path-1000/art-git'), w4Git('push.ref-name-rules#component-300/art-git'), w4Git('push.ref-name-rules#path-4000/art-git'), w4Art('push.ref-name-rules#dot-dot/art-raw'), w4Art('push.ref-name-rules#at-brace/art-raw'), w4Art('push.ref-name-rules#lock-suffix/art-raw'), w4Art('push.ref-name-rules#control-char/art-raw'), w4Art('push.ref-name-rules#del-char/art-raw'), w4Art('push.ref-name-rules#space/art-raw'), w4Art('push.ref-name-rules#colon/art-raw'), w4Art('push.ref-name-rules#backslash/art-raw'), w4Art('push.ref-name-rules#double-slash/art-raw'), w4Art('push.ref-name-rules#trailing-slash/art-raw'), w4Art('push.ref-name-rules#trailing-dot/art-raw'), w4Art('push.ref-name-rules#dot-component/art-raw'), w4Art('push.ref-name-rules#bare-head/art-raw'), w4Art('push.ref-name-rules#refs-heads-at/art-raw'), w4Art('push.ref-name-rules#refs-heads-head/art-raw'), w4Art('push.ref-name-rules#path-4000/art-raw'), w4Art('push.ref-name-rules#leading-dash/art-raw'), w4Art('push.ref-name-rules#component-200/art-raw'), w4Art('push.ref-name-rules#path-1000/art-raw'), w4Art('push.ref-name-rules#component-300/art-raw')),
682 notes: ['The wire plans send each refused name from a raw socket; stock git and ply refuse them before any request, so their Artifacts checks for those names say nothing about the server and are not cited. ply\'s 1024-byte cap (src/validate.ts) refuses the 4000-byte name receive-pack and stock git push.'],
683 }),
684 b({
685 id: 'push.ref-to-missing-object-refused', area: 'push',
686 description: 'receive-pack refuses a command whose new id is in neither the pack nor the repository (missing necessary objects), moves no ref, and still serves the repository fsck-clean.',
687 ops: [PUSH_PACK],
688 tests: [t('test/probes/probes.test.js', PROBES)],
689 status: verified(git('test/probes/probes.test.js', PROBES), malPly('push.ref-to-missing-object-refused#not-in-pack-or-repo/art-ply'), semPly('push.ref-to-missing-object-refused#tag-of-missing-object/art-ply')),
690 notes: ['Stock git refuses such a push client side, so only ply (pushPack with a pack of no objects) sends it.'],
691 }),
692 b({
693 id: 'push.size-limits', area: 'push',
694 description: 'A push over the server\'s object or pack size cap is refused with a report ply classifies as limit_exceeded.',
695 ops: [PUSH, PUSH_PACK],
696 tests: [t('test/push-unpack-host.test.js', 'Artifacts 64 MiB cap is limit_exceeded with got/max in bytes, not push_rejected or ambiguous'), t('test/probes/probes.test.js', PROBES)],
697 status: verified(phase2Git('blob_push_ceiling'), compat('large_blob_push_24m/scratch/v2'), hostileWrite('pack/zlib_bomb_40m'), git('test/probes/probes.test.js', PROBES), probePly('push.size-limits#pack-over-cap/art-ply'), probeGit('push.size-limits#pack-over-cap/art-git')),
698 notes: ['A 66 MiB pack against a 64 MiB cap. ply classifies the server\'s stated cap as limit_exceeded; git http-backend (receive.maxInputSize) refuses with `unpacker error`, its reason on band 2 only, which ply reports as push_rejected: an expected difference, src/probe-allow.ts.'],
699 }),
700 b({
701 id: 'push.many-ref-updates', area: 'push',
702 description: 'One push carrying many ref updates.',
703 ops: [PUSH],
704 tests: [t('test/probes/probes.test.js', PROBES)],
705 status: verified(phase2Git('many_refs_5000'), hostileWrite('ref/fifty_updates'), git('test/probes/probes.test.js', PROBES), probePly('push.many-ref-updates#fifty-creates/art-ply'), probeGit('push.many-ref-updates#fifty-creates/art-git')),
706 notes: ['The probe sends 50 creates in one push; no other test sends more than a few.'],
707 }),
708 b({
709 id: 'push.signed-push', area: 'push',
710 description: 'push-cert (signed pushes).',
711 ops: [],
712 tests: [],
713 status: unsupported('ply signs commits (src/sign.ts) but never sends a push certificate.', phase2Git('signed_push')),
714 notes: [],
715 }),
716 b({
717 id: 'push.from-shallow-clone', area: 'push',
718 description: 'A push from a shallow clone: when the server holds the boundary commit the push lands; when it lacks the history below the boundary the push is refused and no ref moves.',
719 ops: [PUSH],
720 tests: [t('test/probes/probes.test.js', PROBES)],
721 status: verified(git('test/probes/probes.test.js', PROBES), probePly('push.from-shallow-clone#boundary-held/art-ply'), probeGit('push.from-shallow-clone#boundary-held/art-git'), probePly('push.from-shallow-clone#history-missing/art-ply'), probeGit('push.from-shallow-clone#shallow-update/art-git')),
722 notes: ['ply keeps no shallow state; its form of the push is the same objects without the history below the boundary.', 'The stock git push into a repository without the boundary history is compared against git http-backend with receive.shallowUpdate=true.'],
723 }),
724 b({
725 id: 'push.from-partial-clone', area: 'push',
726 description: 'A push from a blob:none partial clone sends only the new objects, including a tree that names a blob the client never fetched, and lands.',
727 ops: [FETCH_PACK, PUSH],
728 tests: [t('test/probes/probes.test.js', PROBES)],
729 status: verified(git('test/probes/probes.test.js', PROBES), probePly('push.from-partial-clone#blob-none/art-ply'), probeGit('push.from-partial-clone#blob-none/art-git'), probePly('push.from-partial-clone#reuse-absent-blob/art-ply'), probeGit('push.from-partial-clone#reuse-absent-blob/art-git')),
730 notes: [],
731 }),
732];
734const CONCURRENCY: readonly BehaviourIn<'concurrency'>[] = [
735 b({
736 id: 'concurrency.stale-old-oid', area: 'concurrency',
737 description: 'A push whose old id is no longer the ref\'s value is refused (compare-and-swap) and the ref is unchanged.',
738 ops: [PUSH, PUSH_PACK, EDIT_FILE],
739 tests: [t('test/push.test.js', "'stale-old': t =>"), t('test/push-pack.test.js', 'a stale old oid is cas_conflict, as push reports it'), t('test/custom-exchange.test.js', 'receive-pack refuses a command (stale old id)'), t('test/probes/probes.test.js', PROBES)],
740 status: verified(git('test/push.test.js', "'stale-old': t =>"), git('test/push-pack.test.js', 'a stale old oid is cas_conflict, as push reports it'), phase2Git('force_with_lease_stale'), git('test/probes/probes.test.js', PROBES), probePly('concurrency.stale-old-oid#race/art-ply'), probePly('concurrency.stale-old-oid#direct/art-ply'), probeGit('concurrency.stale-old-oid#race/art-git'), probePly('concurrency.stale-old-oid#delete-vs-update/art-ply'), probeGit('concurrency.stale-old-oid#delete-vs-update/art-git')),
741 notes: ['The validate CAS checks (stale head, stale delete) are refused by ply-web from ls-refs, before any push. The probe run sends the stale old id to Artifacts itself: directly from ply, and from a race (another writer moves the ref while the receive-pack request is held) from ply and stock git.'],
742 }),
743 b({
744 id: 'concurrency.concurrent-writers', area: 'concurrency',
745 description: 'Concurrent writers on one ref: one wins each round, the rest are refused as stale and retry; nothing is lost.',
746 ops: [EDIT_FILE, PUSH],
747 tests: [t('test/probes/probes.test.js', PROBES), t('test/concurrency.test.js', 'concurrent CAS writers converge; conflicts are observed and retried, never lost'), t('test/edit-race-f34.test.js', 'same-file edit race ×1000 attempts: only ok and cas_conflict')],
748 status: verified(git('test/probes/probes.test.js', PROBES), git('test/concurrency.test.js', 'concurrent CAS writers converge; conflicts are observed and retried, never lost'), git('test/edit-race-f34.test.js', 'same-file edit race ×1000 attempts: only ok and cas_conflict'), plyWorker('edit/race_same_file'), plyWorker('edit/race_diff_files'), phase2Git('fetch_push_race'), probePly('concurrency.concurrent-writers#create-vs-create/art-ply'), probeGit('concurrency.concurrent-writers#create-vs-create/art-git'), probePly('concurrency.concurrent-writers#delete-vs-update/art-ply'), probeGit('concurrency.concurrent-writers#delete-vs-update/art-git')),
749 notes: [],
750 }),
751 b({
752 id: 'concurrency.ref-created-between-read-and-push', area: 'concurrency',
753 description: 'Another writer creates the target ref between ply\'s ls-refs and its receive-pack: the create is refused, naming the winner.',
754 ops: [PUSH, CREATE_BRANCH, CREATE_TAG, COMMIT_CHANGES],
755 tests: [t('test/e2e-customer.test.js', 'createBranch and createTag lose a race to a ref made between ls-refs and receive-pack: cas_conflict naming the winner'), t('test/changes-create-race.test.js', 'commitChanges creating a ref from a base'), t('test/probes/probes.test.js', PROBES)],
756 status: verified(git('test/e2e-customer.test.js', 'createBranch and createTag lose a race to a ref made between ls-refs and receive-pack: cas_conflict naming the winner'), git('test/probes/probes.test.js', PROBES), probePly('concurrency.ref-created-between-read-and-push#race/art-ply'), probeGit('concurrency.ref-created-between-read-and-push#race/art-git')),
757 notes: ['validate\'s duplicate-branch check is refused by ply-web from ls-refs, before receive-pack; the probe run\'s race reaches receive-pack.'],
758 }),
759 b({
760 id: 'concurrency.ref-deleted-between-read-and-push', area: 'concurrency',
761 description: 'Another writer deletes the target ref between ply\'s read and its push.',
762 ops: [PUSH, COMMIT_CHANGES],
763 tests: [t('test/changes-delete-race.test.js', 'head pinned to the base: a target deleted mid-call is cas_conflict and stays deleted'), t('test/probes/probes.test.js', PROBES)],
764 status: verified(git('test/changes-delete-race.test.js', 'head pinned to the base: a target deleted mid-call is cas_conflict and stays deleted'), git('test/probes/probes.test.js', PROBES), probePly('concurrency.ref-deleted-between-read-and-push#race/art-ply'), probeGit('concurrency.ref-deleted-between-read-and-push#race/art-git')),
765 notes: [],
766 }),
767 b({
768 id: 'concurrency.read-after-write', area: 'concurrency',
769 description: 'A landed push is visible at once to ls-refs and to fetch (no stale advertisement after a push).',
770 ops: [LS_REFS, READ_FILE, READ_COMMIT],
771 tests: [t('test/transfer.test.js', 'ls-refs that lags a push: settled by reading again, not by sending again')],
772 status: verified(validatePly('freshness: refs-after-write'), validatePly('freshness: read-after-write README'), validatePly('freshness: commit-after-write'), phase2Git('visibility_latency')),
773 notes: ['transfer.test.js emulates a lagging ls-refs with a proxy; the reference server never lags, so there is no reference evidence.'],
774 }),
775 b({
776 id: 'concurrency.empty-report-under-contention', area: 'concurrency',
777 description: 'A receive-pack 200 that carries no report (no unpack or ref lines), whether an empty body or only a band-3 fatal such as the busy refusal Artifacts sends to concurrent same-repo pushes, is ambiguous, never landed; the server applied nothing for it.',
778 ops: [PUSH, CLASSIFY_REPORT],
779 tests: [t('test/push-unpack-host.test.js', 'an empty receive-pack report stays ambiguous (concurrent same-repo 200 with no unpack/ref lines)'), t('test/mutant-kill.test.js', BAND3_NO_REPORT), t('test/probes/probes.test.js', PROBES)],
780 status: verified(git('test/probes/probes.test.js', PROBES), probePly('concurrency.empty-report-under-contention#distinct-refs/art-ply'), probePly('concurrency.empty-report-under-contention#same-ref/art-ply'), probeGit('concurrency.empty-report-under-contention#distinct-refs/art-git'), probeGit('concurrency.empty-report-under-contention#same-ref/art-git'), probePly('concurrency.empty-report-under-contention#retry-after-busy/art-ply'), probeGit('concurrency.empty-report-under-contention#retry-after-busy/art-git')),
781 notes: ['Probed with 8 concurrent pushes to one repository (8 distinct refs; one ref from 8 contenders); every push a client called landed is checked against the refs stock git reads back. Per-check outcomes are in the private run record.', 'Observed shape on Artifacts (probes run probes-20261114t1745-5jxl): HTTP 200 whose body is a single band-3 fatal (busy) and no report-status, for distinct refs as well as one ref; the refs read back show none of those pushes applied. Stock git reports it as the remote hanging up (exit 128).', 'Retry probe (run probes-20261114t1837-53b4): each push that did not land is sent again alone with the same zero old id, which the server would refuse had the first attempt been applied; per-check outcomes are in the private run record.'],
782 }),
783 b({
784 id: 'concurrency.two-transfer-runners', area: 'concurrency',
785 description: 'Two resumable transfers of one plan at once both finish with the planned head; each refused step is settled by reading refs.',
786 ops: [RUN_TRANSFER],
787 tests: [t('test/transfer-outcomes.test.js', 'two runners on one plan at once, 20 times: both end done; the destination is the planned head')],
788 status: verified(git('test/transfer-outcomes.test.js', 'two runners on one plan at once, 20 times: both end done; the destination is the planned head')),
789 notes: ['No Artifacts evidence.'],
790 }),
791];
793const TAG_TEST = 'createTag: lightweight and annotated (as git tag -a writes it), refusals';
795const TAGS: readonly BehaviourIn<'tags'>[] = [
796 b({
797 id: 'tags.lightweight-create', area: 'tags',
798 description: 'A lightweight tag is a ref create under refs/tags pointing at a commit.',
799 ops: [PUSH, CREATE_TAG],
800 tests: [t('test/e2e-customer.test.js', TAG_TEST), t('test/probes/probes.test.js', PROBES)],
801 status: verified(git('test/e2e-customer.test.js', TAG_TEST), validatePly('tag lightweight'), git('test/probes/probes.test.js', PROBES), probePly('tags.lightweight-create#plain/art-ply'), probeGit('tags.lightweight-create#plain/art-git')),
802 notes: [],
803 }),
804 b({
805 id: 'tags.annotated-create', area: 'tags',
806 description: 'An annotated tag pushes a tag object with its ref, byte-equal to git tag -a.',
807 ops: [PUSH, CREATE_TAG],
808 tests: [t('test/e2e-customer.test.js', TAG_TEST), t('test/probes/probes.test.js', PROBES)],
809 status: verified(git('test/e2e-customer.test.js', TAG_TEST), validatePly('tag annotated'), validateGit('git judge: fsck --strict, refs, history'), git('test/probes/probes.test.js', PROBES), probePly('tags.annotated-create#plain/art-ply'), probeGit('tags.annotated-create#plain/art-git')),
810 notes: [],
811 }),
812 b({
813 id: 'tags.delete', area: 'tags',
814 description: 'A tag delete with the expected old id; a stale expected id is refused.',
815 ops: [PUSH, DELETE_TAG],
816 tests: [t('test/e2e-customer.test.js', 'deleteTag'), t('test/probes/probes.test.js', PROBES)],
817 status: verified(git('test/e2e-customer.test.js', 'deleteTag'), validatePly('tag delete (CAS) + stale delete -> 409'), compat('tag_push_delete/scratch/v2'), git('test/probes/probes.test.js', PROBES), probePly('tags.delete#plain/art-ply'), probeGit('tags.delete#plain/art-git'), semPly('tags.delete#annotated/art-ply'), semGit('tags.delete#annotated/art-git')),
818 notes: ['The stale half of the validate check is refused by ply-web from ls-refs, not by Artifacts.'],
819 }),
820 b({
821 id: 'tags.move-existing-tag', area: 'tags',
822 description: 'An existing tag ref moved with its current old id (a non-fast-forward lightweight move, or one annotated tag replaced by another) is an ordinary ref update.',
823 ops: [PUSH],
824 tests: [t('test/probes/probes.test.js', PROBES)],
825 status: verified(git('test/probes/probes.test.js', PROBES), semPly('tags.move-existing-tag#non-fast-forward/art-ply'), semGit('tags.move-existing-tag#non-fast-forward/art-git'), semPly('tags.move-existing-tag#annotated-to-other-tag/art-ply'), semGit('tags.move-existing-tag#annotated-to-other-tag/art-git')),
826 notes: [],
827 }),
828 b({
829 id: 'tags.peel-chain', area: 'tags',
830 description: 'A ref given as an annotated tag (or a tag of a tag) is peeled to its commit for reads and branch creation.',
831 ops: [READ_FILE, CREATE_BRANCH],
832 tests: [t('test/e2e-customer.test.js', 'createBranch from a branch name, a short name, a peeled annotated tag'), t('test/read.test.js', 'readFile bytes == git show <ref>:<path> for every blob path and every ref form'), t('test/probes/probes.test.js', PROBES)],
833 status: verified(git('test/read.test.js', 'readFile bytes == git show <ref>:<path> for every blob path and every ref form'), validatePly('read: tag name resolves (ref=v1)'), git('test/probes/probes.test.js', PROBES), semPly('tags.peel-chain#tag-of-tag/art-ply'), semGit('tags.peel-chain#tag-of-tag/art-git')),
834 notes: [],
835 }),
836 b({
837 id: 'tags.many-tags', area: 'tags',
838 description: 'A repository with many tags: listing, include-tag and fetch stay correct.',
839 ops: [LS_REFS],
840 tests: [t('test/probes/wire.test.js', WIRE_TEST)],
841 status: verified(phase2Git('shape/manytags'), git('test/probes/wire.test.js', WIRE_TEST), w4Ply('refs.ls-refs-listing#two-thousand-refs/art-ply')),
842 notes: ['ply lists a 500-tag repository (2001 refs) in the wire plans; include-tag and fetch across many tags are checked only with stock git.'],
843 }),
844];
846const MERGE_SPACE = 'merge-base outcome space: position × multiplicity × settled × server × op, every cell equal to git';
848const ANCESTRY: readonly BehaviourIn<'ancestry'>[] = [
849 b({
850 id: 'ancestry.merge-base-search', area: 'ancestry',
851 description: 'Merge bases found by shallow windows over the server (deepen), equal to git merge-base --all within the cap.',
852 ops: [MERGE_BASE],
853 tests: [t('test/mergebase-space.test.js', MERGE_SPACE), t('test/space/merge-depth.test.js', 'merge-base cap: every relation × length × cap against git merge-base --all')],
854 status: verified(git('test/mergebase-space.test.js', MERGE_SPACE), git('test/space/merge-depth.test.js', 'merge-base cap: every relation × length × cap against git merge-base --all'), validatePly('merge feat into main (true merge)')),
855 notes: [],
856 }),
857 b({
858 id: 'ancestry.merge-commit-push', area: 'ancestry',
859 description: 'A two-parent merge commit pushed as a fast-forward of the target; history visible to git as a merge.',
860 ops: [PUSH, MERGE_BRANCH],
861 tests: [t('test/merge.test.js', 'outcomes: up-to-date, fast-forward, ff-only refusal, no-ff merge commit, clean merge, conflict'), t('test/probes/probes.test.js', PROBES)],
862 status: verified(git('test/merge.test.js', 'outcomes: up-to-date, fast-forward, ff-only refusal, no-ff merge commit, clean merge, conflict'), validatePly('merge feat into main (true merge)'), plyWorker('merge/true'), plyWorker('merge/verify'), phase2Git('shape/merges'), git('test/probes/probes.test.js', PROBES), probePly('ancestry.merge-commit-push#two-parents/art-ply'), probeGit('ancestry.merge-commit-push#two-parents/art-git')),
863 notes: [],
864 }),
865 b({
866 id: 'ancestry.fast-forward-and-up-to-date', area: 'ancestry',
867 description: 'Merging an ancestor is up to date (no push); merging a descendant fast-forwards the ref.',
868 ops: [MERGE_BRANCH],
869 tests: [t('test/merge.test.js', 'outcomes: up-to-date, fast-forward, ff-only refusal, no-ff merge commit, clean merge, conflict')],
870 status: verified(git('test/merge.test.js', 'outcomes: up-to-date, fast-forward, ff-only refusal, no-ff merge commit, clean merge, conflict'), validatePly('merge again -> up_to_date'), validatePly('merge fast-forward (ff branch)'), plyWorker('merge/ff')),
871 notes: [],
872 }),
873 b({
874 id: 'ancestry.rebase-chain', area: 'ancestry',
875 description: 'A chain of commits replayed onto a moved base, pushed with the old tip as the expected id.',
876 ops: [REBASE_BRANCH],
877 tests: [t('test/rebase.test.js', 'rebase: three commits onto a moved main')],
878 status: verified(git('test/rebase.test.js', 'rebase: three commits onto a moved main'), validatePly('rebase topic onto main')),
879 notes: [],
880 }),
881 b({
882 id: 'ancestry.cherry-pick-revert', area: 'ancestry',
883 description: 'Cherry-pick and revert: one new commit whose tree equals git\'s; empty results stop or keep as git does.',
884 ops: [CHERRY_PICK, REVERT_COMMIT],
885 tests: [t('test/rebase.test.js', 'cherry-pick and revert: trees equal git'), t('test/pick-empty.test.js', 'cherry-pick --keep-redundant-commits and --allow-empty: commit bytes match git, stop writes nothing')],
886 status: verified(git('test/rebase.test.js', 'cherry-pick and revert: trees equal git'), validatePly('cherry-pick f2 onto main'), validatePly('cherry-pick again -> empty noop'), validatePly('revert cherry-pick on main')),
887 notes: [],
888 }),
889 b({
890 id: 'ancestry.log-walk', area: 'ancestry',
891 description: 'First-parent history read in shallow windows equals git log --first-parent.',
892 ops: [READ_LOG],
893 tests: [t('test/log.test.js', 'readLog: server × shape × limit × behaviour, every cell against git')],
894 status: verified(git('test/log.test.js', 'readLog: server × shape × limit × behaviour, every cell against git'), plyWorker('commit/deep')),
895 notes: ['validate\'s log checks go through the viewer, which judges Artifacts history with git log, not readLog.'],
896 }),
897 b({
898 id: 'ancestry.cut-graph', area: 'ancestry',
899 description: 'A server that withholds ancestors without saying shallow: ply fails closed, nothing pushed.',
900 ops: [MERGE_BASE, MERGE_BRANCH],
901 tests: [t('test/adversarial.test.js', '#18 merge base over a cut graph: a server that withholds ancestors without a shallow line fails closed (pack_corrupt), nothing pushed')],
902 status: IMPLEMENTED,
903 notes: ['A proxy cuts the graph; no git or Artifacts server ever behaves this way on purpose.'],
904 }),
905];
907const ERRORS: readonly BehaviourIn<'errors'>[] = [
908 b({
909 id: 'errors.auth-missing-or-wrong', area: 'errors',
910 description: 'A missing or wrong credential is 401 and a typed auth error; nothing lands.',
911 ops: [CREATE_TRANSPORT, LS_REFS, PUSH],
912 tests: [t('test/custom-exchange.test.js', 'wrong credential: auth (401), typed, thrown from the iteration'), t('test/adversarial.test.js', 'I6e the credential product: every source × user × password cell gets its stated header or typed refusal, equal to git where git has the input, and leaks nothing')],
913 status: verified(git('test/adversarial.test.js', 'I6e the credential product: every source × user × password cell gets its stated header or typed refusal, equal to git where git has the input, and leaks nothing'), validatePly('auth: wrong bearer -> 401'), validatePly('auth: revoked Git-Token (auto-minted) -> upstream 403 typed'), plyWorker('err/bad_git_token'), hostile('auth/missing'), hostile('auth/garbage_header'), phase2Git('auth_paths')),
914 notes: ['validate\'s 401 checks are ply-web\'s own bearer; only the revoked Git-Token check reaches Artifacts\' auth through ply.'],
915 }),
916 b({
917 id: 'errors.receive-pack-forbidden', area: 'errors',
918 description: 'A read-only credential pushing: 403 on receive-pack (advertisement or POST) is auth, and no ref moves.',
919 ops: [PUSH],
920 tests: [t('test/adversarial.test.js', 'receive-pack refused for this caller (403 on its POST and on its advertisement) is auth, and the ref did not move (#144)')],
921 status: verified(git('test/adversarial.test.js', 'receive-pack refused for this caller (403 on its POST and on its advertisement) is auth, and the ref did not move (#144)'), validatePly('push rejected path (read-scoped token write)'), phase2Git('read_only_token_push')),
922 notes: [],
923 }),
924 b({
925 id: 'errors.repository-not-found', area: 'errors',
926 description: 'A repository that does not exist: the advertisement answers 404, typed not_found.',
927 ops: [LS_REFS, DISCOVER],
928 tests: [t('test/adversarial.test.js', 'HTTP-level faults at every stage: statuses, non-git bodies, stall, drop, empty')],
929 status: verified(plyWorker('err/no_repo')),
930 notes: ['The 404 class is tested only with injected statuses; git http-backend\'s own 404 for a missing repository is not cited by any test.'],
931 }),
932 b({
933 id: 'errors.http-status-classes', area: 'errors',
934 description: 'Statuses 4xx/5xx/429 at each stage map to ply\'s typed classes, and a refused optional feature is not retried for them.',
935 ops: [CREATE_TRANSPORT, FETCH_PACK, PUSH],
936 tests: [t('test/adversarial.test.js', 'HTTP-level faults at every stage: statuses, non-git bodies, stall, drop, empty'), t('test/fetchobject-deepen-refusal.test.js', 'never asked again: 401, 403, 404, 429 and 500 stand as they are, with no advertisement read')],
937 status: verified(wirePly('errors.http-status-classes#no-credential/art-ply'), wirePly('errors.http-status-classes#bogus-token/art-ply'), wirePly('errors.http-status-classes#revoked-token/art-ply'), wirePly('errors.http-status-classes#missing-repo/art-ply'), wireArt('errors.http-status-classes#no-credential/art-raw'), wireArt('errors.http-status-classes#no-credential/art-curl'), wireGit('errors.http-status-classes#no-credential/art-git'), wireArt('errors.http-status-classes#bogus-token/art-raw'), wireArt('errors.http-status-classes#bogus-token/art-curl'), wireGit('errors.http-status-classes#bogus-token/art-git'), wireArt('errors.http-status-classes#revoked-token/art-raw'), wireArt('errors.http-status-classes#revoked-token/art-curl'), wireGit('errors.http-status-classes#revoked-token/art-git'), wireArt('errors.http-status-classes#missing-repo/art-raw'), wireArt('errors.http-status-classes#missing-repo/art-curl'), wireGit('errors.http-status-classes#missing-repo/art-git')),
938 notes: ['The wire run checks the info/refs GET with no credential, an unminted token, a revoked token and a repository-scoped token on a path it does not cover, from ply, stock git, curl and a raw request. No recorded run checks what Artifacts sends under rate limiting or a 5xx.'],
939 }),
940 b({
941 id: 'errors.err-pkt-line', area: 'errors',
942 description: 'An ERR pkt-line anywhere in a response is a typed remote error carrying the scrubbed message.',
943 ops: [LS_REFS, FETCH_PACK],
944 tests: [t('test/mutant-kill-tree.test.js', 'ERR upload-pack: not our ref x'), t('test/adversarial.test.js', 'I6b a credential echoed by the server reaches no error (any field) and no span: ERR, band 2/3, ng, hook output × 4 auth forms'), t('test/err-pkt-git.test.js', 'real git ERR on a fetch of an id no one holds: the bytes carry ERR, ply says remote_error not_our_ref')],
945 status: verified(git('test/err-pkt-git.test.js', 'real git ERR on a fetch of an id no one holds: the bytes carry ERR, ply says remote_error not_our_ref')),
946 notes: ['Real ERR: git http-backend\'s `ERR upload-pack: not our ref <id>` on a fetch of an unknown id (captured as written; also probe fetch.want-unreachable-or-unknown#phantom), which ply reports as remote_error, reason not_our_ref. ERR at other stages (advertisement, ls-refs) is injected only.'],
947 }),
948 b({
949 id: 'errors.not-git-response', area: 'errors',
950 description: 'A 200 that is not git (HTML, wrong content type) is not_git, never parsed as protocol.',
951 ops: [CREATE_TRANSPORT],
952 tests: [t('test/custom-exchange.test.js', 'a server that is not git (HTML 200) is not_git'), t('test/http-options.test.js', 'the advertisement: its GET asks redirect manual; a foreign content type is not_git')],
953 status: IMPLEMENTED,
954 notes: [],
955 }),
956 b({
957 id: 'errors.malformed-requests-to-server', area: 'errors',
958 description: 'How the server answers malformed requests (bad pkt-line lengths, misplaced delimiters, unknown commands and capabilities).',
959 ops: [],
960 tests: [],
961 status: unsupported('ply only writes well-formed requests; it has no mode that sends malformed ones.', hostile('pkt/nonhex_length'), hostile('pkt/giant_length_claim'), hostile('pkt/missing_flush'), hostile('proto/v2_unknown_command'), hostile('proto/unknown_capability'), wireArt('errors.malformed-requests-to-server#nonhex-length/art-raw'), wireArt('errors.malformed-requests-to-server#nonhex-length/art-curl'), wireArt('errors.malformed-requests-to-server#oversized-length/art-raw'), wireArt('errors.malformed-requests-to-server#oversized-length/art-curl'), wireArt('errors.malformed-requests-to-server#missing-flush/art-raw'), wireArt('errors.malformed-requests-to-server#missing-flush/art-curl'), wireArt('errors.malformed-requests-to-server#unknown-command/art-raw'), wireArt('errors.malformed-requests-to-server#unknown-command/art-curl'), wireArt('errors.malformed-requests-to-server#wrong-content-type/art-raw'), wireArt('errors.malformed-requests-to-server#wrong-content-type/art-curl'), wireArt('errors.malformed-requests-to-server#bad-service/art-raw'), wireArt('errors.malformed-requests-to-server#bad-service/art-curl')),
962 notes: [],
963 }),
964];
966const INTERRUPTED: readonly BehaviourIn<'interrupted'>[] = [
967 b({
968 id: 'interrupted.push-response-lost', area: 'interrupted',
969 description: 'The server applies a push but the response is lost: ply reports ambiguous, the refs show the push, a retry is safe.',
970 ops: [PUSH, RUN_TRANSFER, EDIT_FILE],
971 tests: [t('test/adversarial.test.js', 'ambiguous push (response lost after server applied it): ref == our commit; a naive retry is match_count, content correct'), t('test/transfer-outcomes.test.js', 'a push applied whose response is dropped: the refs show it, the run goes on to done'), t('test/probes/probes.test.js', PROBES)],
972 status: verified(git('test/adversarial.test.js', 'ambiguous push (response lost after server applied it): ref == our commit; a naive retry is match_count, content correct'), git('test/transfer-outcomes.test.js', 'a push applied whose response is dropped: the refs show it, the run goes on to done'), git('test/probes/probes.test.js', PROBES), probePly('interrupted.push-response-lost#cut/art-ply'), probeGit('interrupted.push-response-lost#cut/art-git')),
973 notes: ['Probe: the recording proxy reads the server\'s whole answer, then cuts the connection. Stock git (libcurl) re-sends a POST whose reused connection closed with no answer; on git http-backend the replay is refused by compare-and-swap and git then finds the ref up to date (src/probe-scenarios.ts).'],
974 }),
975 b({
976 id: 'interrupted.push-body-cut', area: 'interrupted',
977 description: 'A push request body that fails midway: nothing lands; failure before the first body pull is definite, after it ambiguous.',
978 ops: [PUSH, PUSH_PACK],
979 tests: [t('test/custom-exchange.test.js', 'a body stream that errors midway: a typed error from the iteration, the span records it, nothing lands'), t('test/push-pack-preabort.test.js', 'push with a pack sent as bytes: a signal already fired is the definite aborted with no request; a rejected fetch stays ambiguous'), t('test/probes/probes.test.js', PROBES)],
980 status: verified(git('test/custom-exchange.test.js', 'a body stream that errors midway: a typed error from the iteration, the span records it, nothing lands'), hostile('http/partial_send_once'), hostile('http/cl_larger_than_body'), git('test/probes/probes.test.js', PROBES), probePly('interrupted.push-body-cut#half/art-ply'), probeGit('interrupted.push-body-cut#half/art-git')),
981 notes: [],
982 }),
983 b({
984 id: 'interrupted.fetch-dropped-mid-response', area: 'interrupted',
985 description: 'A fetch or advertisement response dropped or cut mid-body is a typed network error or pack_corrupt, never a partial result.',
986 ops: [FETCH_PACK, READ_FILE],
987 tests: [t('test/adversarial.test.js', 'HTTP-level faults at every stage: statuses, non-git bodies, stall, drop, empty'), t('test/http-options.test.js', 'a body that fails mid-read is the network error it is'), t('test/probes/probes.test.js', PROBES)],
988 status: verified(git('test/space/pack-cut.test.js', 'cut: every byte offset of every pack is refused, typed, on every path'), git('test/probes/probes.test.js', PROBES), probePly('interrupted.fetch-dropped-mid-response#half/art-ply'), probeGit('interrupted.fetch-dropped-mid-response#half/art-git')),
989 notes: ['The probe proxy drops an upload-pack response halfway, against the reference and Artifacts.'],
990 }),
991 b({
992 id: 'interrupted.stall-timeouts', area: 'interrupted',
993 description: 'A server that stalls before the first byte or mid-body is ended by the first-byte or idle timer, typed timeout.',
994 ops: [EXCHANGE_CLOCK, CREATE_TRANSPORT],
995 tests: [t('test/http-options.test.js', 'the transport reads the parsed timeout: the span carries it and a stalled request ends at it'), t('test/workerd.test.js', 'workerd: first-byte and idle timeouts; a long steady body or upload is not cut'), t('test/probes/probes.test.js', PROBES)],
996 status: verified(git('test/probes/probes.test.js', PROBES), probePly('interrupted.stall-timeouts#push-request-stall/art-ply'), probeGit('interrupted.stall-timeouts#push-request-stall/art-git'), probePly('interrupted.stall-timeouts#push-request-stall-10s/art-ply'), probeGit('interrupted.stall-timeouts#push-request-stall-10s/art-git'), probePly('interrupted.stall-timeouts#push-response-stall/art-ply'), probeGit('interrupted.stall-timeouts#push-response-stall/art-git'), probePly('interrupted.stall-timeouts#fetch-request-stall/art-ply'), probeGit('interrupted.stall-timeouts#fetch-request-stall/art-git'), probePly('interrupted.stall-timeouts#fetch-response-stall/art-ply'), probeGit('interrupted.stall-timeouts#fetch-response-stall/art-git')),
997 notes: ['The probe proxy injects the stalls: request-body stalls of 10 s and 20 s and a response stall against a 1 s client timeout, on push and fetch; each check\'s outcome is kept in the private run record.'],
998 }),
999 b({
1000 id: 'interrupted.abort-during-push', area: 'interrupted',
1001 description: 'An external AbortSignal during a push: aborted if the body was never pulled, ambiguous once sent; git decides what landed.',
1002 ops: [PUSH, PUSH_PACK, RUN_TRANSFER],
1003 tests: [t('test/adversarial.test.js', 'external AbortSignal mid-stream'), t('test/transfer-outcomes.test.js', 'a real AbortSignal fired during the final push: ambiguous once sent, aborted when the body was never pulled; git decides what landed')],
1004 status: verified(git('test/transfer-outcomes.test.js', 'a real AbortSignal fired during the final push: ambiguous once sent, aborted when the body was never pulled; git decides what landed')),
1005 notes: ['No Artifacts evidence.'],
1006 }),
1007 b({
1008 id: 'interrupted.resumable-transfer', area: 'interrupted',
1009 description: 'A multi-step transfer paused or interrupted is resumed from refs, not from local state, and ends at the planned head.',
1010 ops: [RUN_TRANSFER],
1011 tests: [t('test/transfer-outcomes.test.js', 'maxSteps: a push that gets no answer and does not land is ambiguous, never paused; a pause names its last push')],
1012 status: verified(git('test/transfer-outcomes.test.js', 'maxSteps: a push that gets no answer and does not land is ambiguous, never paused; a pause names its last push')),
1013 notes: ['No Artifacts evidence.'],
1014 }),
1015];
1017const HTTP: readonly BehaviourIn<'http'>[] = [
1018 b({
1019 id: 'http.smart-http-discovery', area: 'http',
1020 description: 'GET info/refs?service=… then POST to the service, with Git-Protocol: version=2 on upload-pack only.',
1021 ops: [CREATE_TRANSPORT, DISCOVER],
1022 tests: [t('test/http-options.test.js', 'Git-Protocol: version=2 goes on upload-pack GET and POST, and on neither receive-pack request')],
1023 status: verified(git('test/space/advertisement.test.js', ADV_REAL), validatePly('discover'), plyWorker('discover/small'), phase2Git('http_version/HTTP/1.1'), phase2Git('http_version/HTTP/2')),
1024 notes: [],
1025 }),
1026 b({
1027 id: 'http.redirects', area: 'http',
1028 description: 'A 3xx on the advertisement is followed as git follows it (within policy); a 3xx on a POST is never followed.',
1029 ops: [REDIRECT_POLICY, CREATE_TRANSPORT],
1030 tests: [t('test/redirect.test.js', 'git oracle: origin × auth × follow × kind'), t('test/adversarial.test.js', 'I6c a 3xx is never followed: cross-origin on the GET and the POST')],
1031 status: verified(git('test/redirect.test.js', 'git oracle: origin × auth × follow × kind')),
1032 notes: ['No Artifacts evidence: Artifacts has not been seen to redirect.'],
1033 }),
1034 b({
1035 id: 'http.credential-forms', area: 'http',
1036 description: 'Bearer, Basic and URL-userinfo credentials produce the Authorization header git sends for the same input.',
1037 ops: [CREATE_TRANSPORT],
1038 tests: [t('test/adversarial.test.js', 'I6d URL userinfo authenticates fetch and push with the Authorization git sends for the same URL, byte for byte')],
1039 status: verified(git('test/adversarial.test.js', 'I6d URL userinfo authenticates fetch and push with the Authorization git sends for the same URL, byte for byte'), hostile('auth/basic_empty'), hostile('auth/malformed_scheme')),
1040 notes: [],
1041 }),
1042 b({
1043 id: 'http.chunked-request-body', area: 'http',
1044 description: 'A large push body streamed with chunked transfer-encoding (duplex half).',
1045 ops: [PUSH, PUSH_PACK],
1046 tests: [t('test/push-stream.test.js', 'a pack past INFLATE_CHUNK is streamed: duplex half, redirect error, chunked; git takes it')],
1047 status: verified(git('test/push-stream.test.js', 'a pack past INFLATE_CHUNK is streamed: duplex half, redirect error, chunked; git takes it'), phase2Wire('chunked_push/artifacts')),
1048 notes: ['ply\'s own streamed push to Artifacts is exercised by validate big20m only on the read side.'],
1049 }),
1050 b({
1051 id: 'http.large-response-body', area: 'http',
1052 description: 'A large upload-pack response is streamed under the pack caps.',
1053 ops: [READ_FILE, FETCH_PACK],
1054 tests: [t('test/adversarial.test.js', 'I4 maxPackBytes bounds the streamed body on every path: limit_exceeded within one frame of the cap, not timeout')],
1055 status: verified(git('test/adversarial.test.js', 'I4 maxPackBytes bounds the streamed body on every path: limit_exceeded within one frame of the cap, not timeout'), validatePly('big20m: first + warm n=25'), plyWorker('read/big'), compat('clone_full/big/v2')),
1056 notes: [],
1057 }),
1058 b({
1059 id: 'http.large-request-body', area: 'http',
1060 description: 'A large push request body (tens of MiB) reaches the server whole.',
1061 ops: [EDIT_FILE, PUSH],
1062 tests: [t('test/push-stream.test.js', 'memory: a 32 MiB streamed push holds well under one copy of the object (live arrayBuffers, gc-sampled)'), t('test/workerd.test.js', 'workerd: edit small file, 24 MB file, cache hit on second edit; git-verified')],
1063 status: verified(git('test/push-stream.test.js', 'memory: a 32 MiB streamed push holds well under one copy of the object (live arrayBuffers, gc-sampled)'), compat('large_blob_push_24m/scratch/v2')),
1064 notes: ['No ply push over a few MiB to Artifacts is recorded.'],
1065 }),
1066 b({
1067 id: 'http.sideband-keepalive', area: 'http',
1068 description: 'Empty band-1 keepalives while a hook runs do not end the push read.',
1069 ops: [PUSH],
1070 tests: [t('test/push-report-bound.test.js', '13,000 band-1 keepalives while a hook runs, then the report: landed'), t('test/push-keepalive-git.test.js', 'real git keepalives while a pre-receive hook runs: band-1 empty packets, then the report; ply lands')],
1071 status: verified(git('test/push-keepalive-git.test.js', 'real git keepalives while a pre-receive hook runs: band-1 empty packets, then the report; ply lands')),
1072 notes: ['git http-backend with receive.keepAlive=1 and a 3 s silent pre-receive hook writes empty band-1 packets before the report; the test captures them. Whether Artifacts sends keepalives is unrecorded (it runs no hooks a client can arrange).'],
1073 }),
1074 b({
1075 id: 'http.request-content-encoding', area: 'http',
1076 description: 'A gzip-encoded request body.',
1077 ops: [],
1078 tests: [],
1079 status: unsupported('ply never compresses a request body.', phase2Wire('gzip_request_body'), hostile('http/corrupt_gzip'), wireArt('http.request-content-encoding#gzip-ls-refs/art-raw'), wireArt('http.request-content-encoding#gzip-ls-refs/art-curl'), wireArt('http.request-content-encoding#gzip-receive-pack/art-raw'), wireArt('http.request-content-encoding#gzip-receive-pack/art-curl'), wireArt('http.request-content-encoding#corrupt-gzip/art-raw'), wireArt('http.request-content-encoding#corrupt-gzip/art-curl')),
1080 notes: [],
1081 }),
1082 b({
1083 id: 'http.content-length-framing', area: 'http',
1084 description: 'A request whose Content-Length disagrees with its body.',
1085 ops: [],
1086 tests: [],
1087 status: unsupported('ply\'s fetch sets the length from the body; it cannot misframe one.', hostile('http/cl_smaller_than_body'), hostile('http/cl_larger_than_body'), wireArt('http.content-length-framing#chunked-receive-pack/art-raw'), wireArt('http.content-length-framing#chunked-receive-pack/art-curl'), wireGit('http.content-length-framing#chunked-receive-pack/art-git'), wireArt('http.content-length-framing#length-short/art-raw'), wireArt('http.content-length-framing#length-long/art-raw')),
1088 notes: [],
1089 }),
1090 b({
1091 id: 'http.expect-continue-and-dumb-http', area: 'http',
1092 description: 'Expect: 100-continue, and the dumb HTTP protocol.',
1093 ops: [],
1094 tests: [],
1095 status: unsupported('ply speaks only smart HTTP and never sends Expect.', phase2Wire('expect_100_continue'), phase2Wire('dumb_http'), wireArt('http.expect-continue-and-dumb-http#expect-100-receive-pack/art-raw'), wireArt('http.expect-continue-and-dumb-http#expect-100-receive-pack/art-curl'), w4Art('http.expect-continue-and-dumb-http#dumb-info-refs/art-raw'), w4Git('http.expect-continue-and-dumb-http#dumb-info-refs/art-git'), w4Art('http.expect-continue-and-dumb-http#dumb-head/art-raw'), w4Art('http.expect-continue-and-dumb-http#dumb-objects-info-packs/art-raw')),
1096 notes: [],
1097 }),
1098];
1100export const BEHAVIOURS: readonly Behaviour[] = [
1101 ...REFS, ...CAPS, ...FETCH, ...PACK, ...PUSHES, ...CONCURRENCY, ...TAGS, ...ANCESTRY, ...ERRORS, ...INTERRUPTED, ...HTTP,
1102];
Diagnostics4 git calls · 402 ms
CallStatusSizeTime0402 ms
discover200152 B2 ms
git.upload-pack discover http.response.status_code=200 git.upstream.cf_ray=- git.upstream.phase=ls-refs 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 · 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=145 git.response.cache=HIT git.response.duration_ms=2 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 1020038 KiB · hit2 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=38434 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=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=6 git.pkt.data=4 git.pkt.flush=1 git.pkt.delim=1 git.pkt.bytes=38434 git.pkt.payload.max=38339 git.sideband.band1.bytes=38338 git.sideband.band2.bytes=0 git.sideband.band3.bytes=0 git.pack.objects=63 git.pack.bytes=38338 git.pack.ofs_delta=0 git.pack.ref_delta=8 git.pack.chain.max=8 git.pack.trailer=0bc36ab7adf82d3109177f11f1ea93f1ce071f77 git.pack.full=55Open pack map
fetch20021 KiB398 ms
git.upload-pack fetch http.response.status_code=200 git.upstream.cf_ray=- git.upstream.phase=fetch git.upstream.dur_ms=398 git.response.bytes=21035 git.response.cache=MISS git.response.duration_ms=398 git.fetch.wants=d4cda12e4c0c2addc91410b0d408180c34d85831 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=21035 git.pkt.payload.max=21014 git.sideband.band1.bytes=21013 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.git
- Ref
- refs/heads/main
- Commit
- 19912563f540228593df0c489082e5e2508e21e4
- cf-ray
- a5e302f51dac7929
- Request
- 96b5d42f…
- Protocol
- v2 · sha1
- Agent
- gitty/1.0
- Filter
- advertised
- Fetch
- shallow filter sideband-all
- Capabilities
- agent ls-refs fetch object-format