Browse / suites / github.com/storytold / study
Case study
What the repeated and abandoned work in github.com/storytold costs, in tokens an agent would spend, and what keeping a fork current costs against it. Figures are estimates: ranges run from low to high assumptions, the mark is the middle one.
Findings
- Adopting beats reimplementing: reviewing an existing pull request, rebasing it onto today's upstream and rebuilding it costs about 28% of the tokens it took to write (range 22% to 41%), and about a tenth when the rebase is clean, as it was for 26% of open PRs. Tests run either way, so they drop out; through Collective they also run sandboxed in the project's Nix environment, which costs compute but adds a safety check. The 1,832 redundant implementations here cost about 3.9B tokens; adopting the first one each time would have cost about 1.1B.
- Of 27,763 pull requests by 2,793 authors, 17,336 merged, 2,566 were closed unmerged and 7,861 are open.
- Merges are fast: half merge within 9 hours and 97% within a week, so a PR still open after a week goes on to merge 18% of the time, and 8% after two weeks.
- Duplicated effort: 1,040 features were implemented by two or more authors (2,872 PRs, 1,832 of them redundant): about 3.9B tokens (range 1.1B to 12.0B), of which 33.8M is the redundant code itself.
- Wasted effort: about 27.2B tokens (range 7.7B to 84.5B) went into PRs that were closed unmerged, superseded by a merged duplicate, or are unlikely ever to merge, including 18,913 rebases of them; the code itself is 172.0M.
- Keeping a change current costs least when it is rebased once, at the end; against that, syncing every 14 days 1.1x, every 7 days 1.5x, every 3 days 2.4x, every day 4.3x, every upstream commit 21.2x as much over a PR's life, because upstream keeps rewriting the same lines and each rewrite is resolved again.
- A fork synced weekly costs about 2.7M tokens a month to keep current; a redundant implementation costs about 2.1M and a wasted PR about 2.8M, so a weekly fork pays for itself if it prevents about 1.3 duplicate implementations a month.
- At weekly syncs, 67% of syncs in these repositories (about 100 upstream commits a day in the busiest) need conflict work; mechanical syncs cost nothing, so the cadence should be set per fork by how often its syncs conflict, starting weekly.
- Caveats: token figures are a model (bytes/4, with stated multipliers), not measured usage; upkeep was simulated on 400 sampled open PRs spanning a median of 8 days, so the cost of forks kept for months is extrapolated; no PR here is older than a month.
Duplicated and wasted effort
Data table
| Effort | Low | Mid | High | PRs |
|---|---|---|---|---|
| Duplicated effort | 1.06B | 3.94B | 12.0B | 2872 |
| Wasted effort | 7.66B | 27.2B | 84.5B | 9840 |
| wasted: closed unmerged | 5.20B | 2127 | ||
| wasted: superseded duplicate | 872M | 543 | ||
| wasted: unlikely to merge | 21.2B | 7170 |
Chance a pull request merges
Data table
| Days open | Chance it merges eventually |
|---|---|
| 0 | 67.5% |
| 1 | 45.2% |
| 2 | 37.3% |
| 3 | 31.9% |
| 4 | 28.2% |
| 5 | 24.6% |
| 6 | 21.1% |
| 7 | 17.5% |
| 8 | 15.1% |
| 9 | 12.5% |
| 10 | 10.5% |
| 11 | 9.4% |
| 12 | 8.6% |
| 13 | 8.0% |
| 14 | 7.7% |
| 15 | 7.4% |
| 16 | 6.9% |
| 17 | 6.4% |
| 18 | 5.9% |
| 19 | 5.9% |
| 20 | 5.9% |
| 21 | 4.9% |
| 22 | 4.9% |
| 23 | 4.9% |
| 24 | 3.3% |
| 25 | 3.4% |
| 26 | 3.4% |
| 27 | 3.5% |
| 28 | 3.5% |
| 29 | 1.8% |
| 30 | 1.8% |
Upkeep of a fork against what it avoids
upkeep per fork-month, mid with low to high
Data table
| Sync every (days) | Syncs per month | Syncs that conflict | Conflict lines per month | Tokens per fork-month (low / mid / high) | Fork-months to equal duplicated + wasted |
|---|---|---|---|---|---|
| 1 | 30.0 | 41% | 20.1k | 2.07M / 5.72M / 18.5M | 5456 |
| 3 | 10.0 | 55% | 18.7k | 1.32M / 3.52M / 11.2M | 8865 |
| 7 | 4.3 | 67% | 17.9k | 1.05M / 2.73M / 8.60M | 11420 |
| 14 | 2.1 | 79% | 17.5k | 935k / 2.38M / 7.46M | 13083 |
Duplicated + wasted effort, mid: 31.2B tokens.
Effort by repository
duplicated, midwasted, mid
Data table
| Repository | Open PRs | Duplicated, mid | Wasted, mid |
|---|---|---|---|
| photocraft | 1123 | 738M | 4.64B |
| pdfcraft | 1007 | 675M | 4.45B |
| wordcraft | 904 | 715M | 4.15B |
| lightcraft | 731 | 256M | 3.85B |
| filmcraft | 831 | 325M | 1.72B |
| gridcraft | 660 | 201M | 1.71B |
| designcraft | 338 | 253M | 1.24B |
| cadcraft | 540 | 166M | 1.05B |
| vectorcraft | 232 | 114M | 1.06B |
| deckcraft | 276 | 206M | 790M |
| effectcraft | 378 | 96.6M | 846M |
| figcraft | 67 | 45.9M | 475M |
| soundcraft | 236 | 59.2M | 397M |
| craft-libs | 121 | 25.4M | 312M |
| craft-launcher | 165 | 43.4M | 255M |
| artcraft | 118 | 11.2M | 157M |
| craft-repo-status-app | 21 | 0 | 48.0M |
| craft-i18n | 18 | 0 | 28.9M |
| craft-fonts | 33 | 7.10M | 14.9M |
| artcraft-services | 21 | 177k | 21.4M |
| craft-ai-integrations | 5 | 0 | 9.40M |
| indd-utils | 6 | 0 | 9.29M |
| craft-common-actions | 11 | 0 | 5.17M |
| photocraft-corpus | 4 | 459k | 3.35M |
| craft-contrib | 12 | 0 | 286k |
| artcraftx | 3 | 0 | 105k |
Token model
Tokens ~ bytes/4. Work set W = bytes of files a PR modifies at its merge base + its diff. Development = T reads of W + O writes of the added code; each rebase (force push or merge of upstream into the branch) = R reads of W; a conflicted sync also reads and rewrites its conflict lines. Multipliers are assumptions bracketing agentic sessions, not measurements.
Assumptions
{
"O_dev": [
1,
2,
4
],
"R_sync": [
1,
3,
10
],
"T_dev": [
5,
20,
60
],
"chars_per_token": 4,
"conflict_line_tokens": 12,
"max_pass_tokens": 200000
}