Skip to content

Document tests with comments for scope and cost#33

Merged
marcleblanc2 merged 5 commits into
mainfrom
tests-yaml-affects-comments
Jun 12, 2026
Merged

Document tests with comments for scope and cost#33
marcleblanc2 merged 5 commits into
mainfrom
tests-yaml-affects-comments

Conversation

@marcleblanc2

Copy link
Copy Markdown
Collaborator

No description provided.

marcleblanc2 and others added 5 commits June 12, 2026 09:21
Each case in tests/tests.yaml now carries an '# Affects:' comment with
the net state change between before.json and after.json: distinct users
whose grants change, repos whose grant lists change, and grant
additions+removals. Counts computed by diffing each fixture pair.

Amp-Thread-ID: https://ampcode.com/threads/T-019ebc69-17c5-743a-abd7-3683073e282d
Co-authored-by: Amp <amp@ampcode.com>
Each case now carries a '# Cost:' comment alongside '# Affects:',
counting the reads that drive runtime (user-metadata fetches, repo
fetches, and per-user explicit-grant scans — the ~400 s dominant cost at
10k users) plus mutation writes, with a complexity class (O(1), O(U),
O(R), O(U+R), O(U·scan)). Derived from the command read paths in
permissions/{command,full_set,restore,snapshot}.py and orgs/sync.py,
against the live instance scale in tests/setup.yaml (10k users, 50k
repos).

Amp-Thread-ID: https://ampcode.com/threads/T-019ebc69-17c5-743a-abd7-3683073e282d
Co-authored-by: Amp <amp@ampcode.com>
The affects/cost comments in tests.yaml are now YAML-style maps instead
of single lines: affects is a one-line flow map, and cost is a block map
whose first field is bigO, so the complexity class is visible without
scanning to the end of a line. Trivial O(1) cases keep a one-line cost
map.

Amp-Thread-ID: https://ampcode.com/threads/T-019ebc69-17c5-743a-abd7-3683073e282d
Co-authored-by: Amp <amp@ampcode.com>
Every case's affects and cost comment is now a block map — one field
per line, bigO first — including the O(1) cases that previously used
one-line flow maps.

Amp-Thread-ID: https://ampcode.com/threads/T-019ebc69-17c5-743a-abd7-3683073e282d
Co-authored-by: Amp <amp@ampcode.com>
@marcleblanc2 marcleblanc2 merged commit 29ba9e7 into main Jun 12, 2026
6 checks passed
@marcleblanc2 marcleblanc2 deleted the tests-yaml-affects-comments branch June 12, 2026 22:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant