Document tests with comments for scope and cost#33
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.