Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
82 commits
Select commit Hold shift + click to select a range
d865448
perf(index): blame head files in batches of at most 256 MB
devchaudhary24k Oct 26, 2026
0dd64c0
perf(site): keep Cards in colours outside the swatches in memory
devchaudhary24k Oct 26, 2026
50c64f7
perf(builder): keep caches apart from clones and run the engine one a…
devchaudhary24k Oct 26, 2026
3fddd5e
perf(builder): measure a kept folder again only once it was used
devchaudhary24k Oct 26, 2026
7a22732
perf(server): keep each commit's Lines Changed in a narrow table
devchaudhary24k Oct 26, 2026
6da100f
perf: send only the Mainline that moved and the lines counted since t…
devchaudhary24k Oct 26, 2026
e6e4796
perf(builder): skip Builds whose head did not move
devchaudhary24k Oct 26, 2026
c3c28bc
perf(index): keep the commit graph and bring the Mainline up to date …
devchaudhary24k Oct 26, 2026
967dba5
perf: make the Atlas once per pack in the Builder
devchaudhary24k Oct 26, 2026
62faa17
feat(builder): keep each repository's Repo State in R2 as well as on …
devchaudhary24k Oct 26, 2026
3fdedbe
feat: count everyone's Surviving Lines from the head's ownership of l…
devchaudhary24k Oct 27, 2026
76505c8
docs: ADR-0030, the Builder keeps a Repo State and works out only wha…
devchaudhary24k Oct 27, 2026
85e586c
perf(builder): read a lean clone once a repository's lines and Surviv…
devchaudhary24k Oct 27, 2026
09bd688
perf: search the Commit List's words in the engine service
devchaudhary24k Oct 27, 2026
b20ea07
perf(site): stop serving the whole history as one file
devchaudhary24k Oct 27, 2026
66f1d85
docs: how to deploy the Repo State release, and where the Commit List…
devchaudhary24k Oct 27, 2026
3969cf6
fix(builder): keep the whole answer of a count of everyone's Survivin…
devchaudhary24k Oct 27, 2026
6a887cc
docs: STATE.md points at ADR-0030 as the latest decision
devchaudhary24k Oct 27, 2026
8feb73c
docs: what MAX_REPOSITORY_MB can be, measured on next.js and linux
devchaudhary24k Oct 27, 2026
d041522
refactor(core): give the Index's records fixed layouts and its long a…
devchaudhary24k Oct 27, 2026
1129d22
perf(index): read the Index in place from mapped columns kept beside …
devchaudhary24k Oct 27, 2026
c814247
perf(index): size git's object and delta caches for a small box
devchaudhary24k Oct 27, 2026
10dafd6
perf(report): count the Report's people without whole-history buffers
devchaudhary24k Oct 27, 2026
2d80d20
perf(index): keep the Ownership of lines in a file read in place
devchaudhary24k Oct 27, 2026
c370105
perf(engine): map packs instead of decoding them
devchaudhary24k Oct 27, 2026
b87206c
perf(metrics): count the code map's owners per folder and person
devchaudhary24k Oct 27, 2026
4adcb26
perf: store each head's standard screens with its Report and send the…
devchaudhary24k Oct 27, 2026
fb6dc77
ci: deploy the engine service before the Builder
devchaudhary24k Oct 27, 2026
2137525
docs: mapped columns, pack format 3 and stored screens
devchaudhary24k Oct 27, 2026
d90fa0c
perf(index): blame in 16 MB batches, and find moves without file text
devchaudhary24k Oct 27, 2026
88e917d
perf(index): walk history 32,768 commits at a time
devchaudhary24k Oct 27, 2026
be0c742
perf(index): build a cold Index through files in its cache folder
devchaudhary24k Oct 27, 2026
c5dc6e4
perf(index): make the commit graph from sorted edges
devchaudhary24k Oct 27, 2026
010b3be
docs: ADR-0031, the Repo State and packs are read in place
devchaudhary24k Oct 27, 2026
5382777
fix(builder): hold a repository's cache while its State is saved or r…
devchaudhary24k Oct 27, 2026
64b0cab
perf(builder): cut the Repo State's files by their content
devchaudhary24k Oct 27, 2026
bd10c18
fix(builder): build Reports from an earlier release again
devchaudhary24k Oct 27, 2026
6aad874
fix: offline means offline, even in a blobless clone
devchaudhary24k Oct 27, 2026
7b6270c
fix(builder): a lean clone never counts what it cannot read
devchaudhary24k Oct 27, 2026
c7eba17
fix(builder): fetch public repositories with the Builder's own token
devchaudhary24k Oct 27, 2026
740df67
feat(builder): let runs of the engine in by the memory they take
devchaudhary24k Oct 27, 2026
cbe775b
perf: a fork counts only its own commits' lines
devchaudhary24k Oct 27, 2026
f63b5e0
perf: give large freed blocks back to the system
devchaudhary24k Oct 27, 2026
fd62f16
perf(surviving): count lines from the kept columns
devchaudhary24k Oct 27, 2026
79ed93c
perf(surviving): rename detection keeps no file text
devchaudhary24k Oct 27, 2026
1e5ef2e
perf(surviving): smaller tables beside the walk and the count
devchaudhary24k Oct 27, 2026
f71e12a
perf(builder): reserve for Surviving Lines what a count now takes
devchaudhary24k Oct 27, 2026
415dca1
perf(surviving): hand the walk's memory back before the count
devchaudhary24k Oct 27, 2026
859856e
docs: memory measured after the second round
devchaudhary24k Oct 27, 2026
f7921a8
fix: name stored screens by their pack
devchaudhary24k Oct 27, 2026
2b219ca
fix(builder): no git upkeep in the middle of a Build
devchaudhary24k Oct 27, 2026
b770460
fix: one hold per repository, from the Builder down to the cache
devchaudhary24k Oct 27, 2026
db8b047
fix(builder): a new branch or tag is a change too
devchaudhary24k Oct 27, 2026
0718a60
fix: a fork never takes its parent's left-out files as having no lines
devchaudhary24k Oct 27, 2026
6eddb22
fix: a file kept again has its lines counted again
devchaudhary24k Oct 27, 2026
df9806b
perf: make the Atlas in Rust from the pack
devchaudhary24k Oct 27, 2026
4505674
perf: memory outside the Builder's gate, inside it
devchaudhary24k Oct 27, 2026
c7db404
perf: the quick publish leaves the Atlas and the screens to the full one
devchaudhary24k Oct 27, 2026
f1e9831
perf(builder): move State chunks four at a time
devchaudhary24k Oct 27, 2026
7291464
perf(server): one read of an R2 answer for every reader waiting on it
devchaudhary24k Oct 27, 2026
ffeae5b
perf: the engine service answers stored screens from beside the pack
devchaudhary24k Oct 27, 2026
3ad87a0
perf(site): add up the answer caches' sizes as values come and go
devchaudhary24k Oct 27, 2026
9146f30
fix(index): say so when a mapped history is copied into memory
devchaudhary24k Oct 27, 2026
3bfca07
docs: memory per server, and what stays for this release only
devchaudhary24k Oct 27, 2026
a4a2360
fix: a cache from an older State never appends onto another's rows
devchaudhary24k Oct 27, 2026
ba9eca6
fix: the CLI builds and runs on Windows again
devchaudhary24k Oct 27, 2026
f1477da
fix: a Report changes only when its new pack is published
devchaudhary24k Oct 27, 2026
7ea5462
fix: the Site never makes an Atlas
devchaudhary24k Oct 27, 2026
92ceba8
fix(builder): tidy never holds a Build lane, nor prunes a held reposi…
devchaudhary24k Oct 27, 2026
f8e4e16
fix(builder): reserve what the first Build after the upgrade takes
devchaudhary24k Oct 27, 2026
89769e4
fix(builder): fewer clones of the same repository
devchaudhary24k Oct 27, 2026
75083b0
fix: the Builder writes only packs its engine service reads
devchaudhary24k Oct 27, 2026
34feb8b
docs(adr): name the release each upgrade-only reader goes in
devchaudhary24k Oct 27, 2026
e2bcaae
fix: the Builder learns the engine service's pack formats from R2
devchaudhary24k Oct 27, 2026
9ec55af
fix: lines of exported commits are sent again when the files left out…
devchaudhary24k Oct 27, 2026
1bc0fbd
fix(index): a file once left out has its lines counted wherever it moved
devchaudhary24k Oct 27, 2026
645ae05
fix(index): a cache classified by new rules starts a new lineage
devchaudhary24k Oct 27, 2026
3e24777
test(builder): the Repo State tests delete their folders
devchaudhary24k Oct 27, 2026
9de794f
test: builds after random histories write what a clean build writes
devchaudhary24k Oct 27, 2026
29b9cf0
fix(deps): update better-auth to 1.7.13
devchaudhary24k Oct 28, 2026
7ca9bf9
test: let the test clones' git serve filters on every platform
devchaudhary24k Oct 28, 2026
a1b46e9
test: run the blobless clone tests where the Builder runs
devchaudhary24k Oct 28, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ jobs:
SITE: ${{ secrets.DOKPLOY_SITE_WEBHOOK }}
ENGINE: ${{ secrets.DOKPLOY_ENGINE_WEBHOOK }}
run: |
for app in BUILDER ENGINE SITE; do
for app in ENGINE BUILDER SITE; do
hook="${!app}"
if [ -z "$hook" ]; then
echo "::notice::DOKPLOY_${app}_WEBHOOK is not set: not deployed."
Expand Down
20 changes: 14 additions & 6 deletions CONTEXT.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,11 @@ A repository's Index as the Site keeps it, in Postgres: every commit with its Ch
_Avoid_: index tables, commit store.

**Pack**:
A repository's Index at one head as the engine service reads it, with its people already resolved to their GitHub logins and colours, its Mainline, and no email address. Each publish of a Build writes a new one, which never changes; the Stored Index names the current one.
A repository's Index at one head as the engine service reads it, with its people already resolved to their GitHub logins and colours, its Mainline, and no email address. Each publish of a Build writes a new one, which never changes; the Stored Index names the current one. Compressed in R2; the engine service unpacks it once onto its disk and reads its columns in place.
_Avoid_: snapshot, bundle, cache, export.

**Mainline**:
The commits of a Stored Index that the default branch holds: every commit reachable from HEAD, and among them the first-parent line, the commits HEAD itself went through. The Stored Index also holds commits only other branches and tags reach, which never reached the default branch; the Mainline tells them apart. A Build works it out again each time, since a merge brings older commits into it.
The commits of a Stored Index that the default branch holds: every commit reachable from HEAD, and among them the first-parent line, the commits HEAD itself went through. The Stored Index also holds commits only other branches and tags reach, which never reached the default branch; the Mainline tells them apart. A Build brings it up to date from the commits added since, walking only the new part of the first-parent line, and works it out again whole when that line no longer runs through the head it was last worked out for, since a merge can bring older commits into it.
_Avoid_: main branch, trunk, reachable commits.

**Main Arrival**:
Expand Down Expand Up @@ -135,7 +135,7 @@ A Card placed in a README or elsewhere by its address, served from a stored copy
_Avoid_: badge, widget, stats image.

**Report**:
A repository's story told screen by screen (the Overview, Activity, People, a person, the Map, a file) for a Window. On the Site the engine service answers each screen from the repository's Pack, for any Window, and its Commit List is rows in the Stored Index. A Shared Report carries every screen's answer for its Windows, written ahead of time on someone's machine, and answers only what it was written with.
A repository's story told screen by screen (the Overview, Activity, People, a person, the Map, a file) for a Window. On the Site the standard screens of the Windows all, 1y and 90d are worked out from the repository's Pack once per head and stored with the Report; the engine service answers every other screen from the Pack, for any dates, and its Commit List is rows in the Stored Index. A Shared Report carries every screen's answer for its Windows, written ahead of time on someone's machine, and answers only what it was written with.
_Avoid_: export, snapshot, dump.

**Shared Report**:
Expand Down Expand Up @@ -163,7 +163,7 @@ The repository's whole default-branch history as a map to explore: one hex for e
_Avoid_: galaxy, 3D view, city.

**Atlas**:
The compact binary history the Universe is made from: the files, folders and people of a Pack and every commit on the Mainline by when it arrived, Merge Commits left out. It is made once per Pack.
The compact binary history the Universe is made from: the files, folders and people of a Pack and every commit on the Mainline by when it arrived, Merge Commits left out. The Builder makes it once per Pack, from rows the Build writes beside it, and stores it before the Pack is published; the Site only sends it, and makes it itself only for a Pack the Builder did not.
_Avoid_: payload, snapshot, graph.

**Branch state**:
Expand Down Expand Up @@ -192,12 +192,16 @@ _Avoid_: dashboard, cloud, platform, web app.
The public page that says what commitscape is and leads to signing in: a static page apart from the Site, holding no data. Its Cards are the Site's.
_Avoid_: home page, marketing site.

**Repo State**:
What the Builder keeps of a repository between its Builds so the next one reads only what is new: the engine cache, which holds its Index, the Lines Changed already counted and its HEAD's files. It lives on the Builder's disk for days and, sealed with a key only the Builder has, in R2 for months; a Build whose disk lost it brings it back from R2, and only one without either reads the whole history again.
_Avoid_: cache (the folder it lives in), snapshot, checkpoint.

**Builder**:
What reads a repository's history for the Site: it clones the repository, runs the same engine the CLI runs, loads the Stored Index into Postgres and stores the Pack in R2. The Site never runs git.
_Avoid_: worker, backend, crawler.

**Build**:
One run of the Builder for one repository, from clone to published Pack, in two phases at once: a clone without old file contents gives a Report without Lines Changed, shown at once, while a full clone counts them, the Mainline first, and replaces it. Quiet Builds that follow count the lines left. A repository's Report is rebuilt when someone asks for it and it is more than a day old, or after a push where commitscape's GitHub App is installed.
One run of the Builder for one repository, from clone to published Pack, in two phases at once: a clone without old file contents gives a Report without Lines Changed, shown at once, while a full clone counts them, the Mainline first, and replaces it. Quiet Builds that follow count the lines left. Once every line and its Surviving Lines are counted, a repository's Builds read a clone without file contents and fetch only the file versions they read. A repository's Report is rebuilt when someone asks for it and it is more than a day old, or after a push where commitscape's GitHub App is installed. A Build whose Report is whole (every line counted, built within a week) ends at once when the default branch's head has not moved since, and the Report counts as current from then. A seed repository is built again when its head moved and someone viewed it since its last Build, and at least weekly.
_Avoid_: job, scan, analysis, refresh.

**Engine service**:
Expand All @@ -219,9 +223,13 @@ Said of a Profile whose person chose to stay out of comparisons: it appears in n
_Avoid_: private profile, opted out.

**Surviving Lines**:
The lines at a repository's head that blame attributes to a person, passing through Bulk Commits and ignored revisions, leaving out Generated Files, Prose Files and files over a megabyte (ADR-0022). Passing through gives a changed line to the commit before only when the two are the same once whitespace is removed; any other line a reformat changed stays with the reformat. Counted per person on request; "not counted" when over its time budget, never an estimate.
The lines at a repository's head that blame attributes to a person, passing through Bulk Commits and ignored revisions, leaving out Generated Files, Prose Files and files over a megabyte (ADR-0022). Passing through gives a changed line to the commit before only when the two are the same once whitespace is removed; any other line a reformat changed stays with the reformat. Counted for everyone at once, once per head, as a sum over the head's Ownership of lines; "counting" until that is whole, "not counted" when it is over its time budget, never an estimate.
_Avoid_: lines owned, code alive, impact.

**Ownership of lines**:
Which commit each line of a head's Source files came from, as blame says, kept per head in the Repo State as runs of lines. A new head that went forward along the first-parent line keeps it for every file whose path no first-parent commit since changed, and works out the rest, stopping wherever a walk reaches the earlier head. Surviving Lines are summed from it. Not to be confused with Ownership, which counts commits.
_Avoid_: blame cache, attribution.

**Survival**:
A person's Surviving Lines as a share of the lines they added in that repository (their Lines Changed). Shown only when both are known and it is at most 100%: an import left out of Lines Changed as a Bulk Commit can keep more lines than were counted as added.
_Avoid_: retention, survival rate, code quality.
Expand Down
53 changes: 53 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ members = [
"crates/commitscape-core",
"crates/commitscape-forge",
"crates/commitscape-index",
"crates/commitscape-map",
"crates/commitscape-metrics",
"crates/commitscape-report",
"crates/commitscape",
Expand All @@ -23,6 +24,7 @@ homepage = "https://github.com/pixelactstudio/commitscape"
commitscape-core = { path = "crates/commitscape-core", version = "0.4.0" }
commitscape-forge = { path = "crates/commitscape-forge", version = "0.4.0" }
commitscape-index = { path = "crates/commitscape-index", version = "0.4.0" }
commitscape-map = { path = "crates/commitscape-map", version = "0.4.0" }
commitscape-metrics = { path = "crates/commitscape-metrics", version = "0.4.0" }
commitscape-report = { path = "crates/commitscape-report", version = "0.4.0" }

Expand Down
Loading
Loading