Skip to content

Utopia commits: message only, the newest 200, new ones on push - #2801

Merged
gedaiu merged 2 commits into
mainfrom
utopia/commits-message-only
Oct 17, 2026
Merged

gedaiu merged 2 commits into
mainfrom
utopia/commits-message-only

Conversation

@gedaiu

@gedaiu gedaiu commented Oct 16, 2026

Copy link
Copy Markdown
Collaborator

A commit item named every file the commit changed, so a forty-file commit made Utopia resolve forty entities against the whole knowledge base. On 2026-10-17 Utopia's queue grew about twice as fast as its database could drain it, even after it was sized up to four CPUs (#2799). The weekly backfill would then have walked up to 2,000 commits for each of the 14 repos on Sunday.

  • A commit item is message only. It carries the commit's subject and body, author, time, parents, and the pull request it merges with that PR's issues and Lore task. No file names. It always fits one push, so the split logic goes.
  • A walk takes the newest 200 commits above the cursor, read from GitHub's commit listing alone. There is no getCommit per commit and no .lore/ingest.yml read. A repo's history in Utopia starts 200 commits before its first walk, and later commits arrive through the push handler as they land. Webhook: a repo's hook carries push events #2796 put push on the webhook's required events; the hooks get it with one ensure per repo after this deploys.
  • changes stays declared in ontology v4, pushed by no item. Removing it would force a re-import of every base now, and Utopia's imports only add, so it would stay in the live bases anyway.

Spec FR12.2–FR12.7 and the intro are rewritten; ADR-052 gains a revision. Locally the shared, lore-api and stations suites, tsc and the repo-wide eslint all pass.

Related: #2790 (the commit mirror), #2796 (push events), #2799 (database sizing).

🤖 Generated with Claude Code

A commit item named every file the commit changed, and Utopia resolves each
named entity against the whole base: a forty-file commit cost forty
resolutions, and on 2026-10-17 Utopia's queue grew faster than its database
could drain it. A commit item now carries the commit's words, author, time,
parents and its pull request, issues and task. A walk takes the newest 200
commits above the cursor from GitHub's commit listing alone, with no read per
commit, so a repo's history starts 200 commits back and later commits arrive
through the push handler. changes stays declared in the ontology, unpushed.
@lore-agent

lore-agent Bot commented Oct 16, 2026

Copy link
Copy Markdown
Contributor

Lore is reviewing this PR — 65f38f1a-ee93-4e9d-9d94-71e0a1961c61.

Submit a review that requests changes to have Lore push a fix for it. Comment @lore review to re-run the review.

@github-actions

Copy link
Copy Markdown

🔍 Lore Spec Impact — advisory

This PR touches 66 statement(s) across 9 spec(s), and 34 of them have validating tests this PR does not change.

Feature Specification: The spec-to-code chain mirrored in Utopia · 30 statement(s)

specs/utopia-graph-mirror/spec.md

Backfill
✓ this PR also changes the tests that validate it

FR7.1 — The documents backfilled are the ones CI ingests (isDocOfKind in apps/lore-code-trace/docs.go): a .md fil…

validated by apps/lore-api/src/work/utopia/utopia-backfill.test.ts:103

Backfill
✓ this PR also changes the tests that validate it

FR7.3 — A document that throws, or one of whose items fails, is named under failed as <path>: <message> and the res…

validated by apps/lore-api/src/work/utopia/utopia-backfill.test.ts:103

The ontology
⚠ the tests that validate it are not touched by this PR

only its test links changed — the statement text itself is unchanged

FR1.1 — The Lore ontology is one turtle file, libs/shared/src/domain/lore-ontology.ttl, read beside the module that n…

validated by libs/shared/src/domain/lore-ontology.test.ts:57

The ontology
⚠ the tests that validate it are not touched by this PR

only its test links changed — the statement text itself is unchanged

FR1.3 — Version 2 declares the text attribute, a string on Section and Statement, and adds Document to the domain of …

validated by libs/shared/src/domain/lore-ontology.test.ts:57

The ontology
⚠ the tests that validate it are not touched by this PR

only its test links changed — the statement text itself is unchanged

FR1.4 — Version 3 declares what a test run says: violated_by from Statement to Test, outcome a string on Test, Test…

validated by libs/shared/src/domain/lore-ontology.test.ts:57

The push
⚠ the tests that validate it are not touched by this PR

only its test links changed — the statement text itself is unchanged

FR3.1 — An item is posted to POST /api/v1/sources/{source}/statements under the source's own key, as external_id, `…

validated by libs/shared/src/outbound/utopia/utopia-client.test.ts:130

The push
⚠ the tests that validate it are not touched by this PR

only its test links changed — the statement text itself is unchanged

FR3.2 — A tombstone is external_id plus deleted: true, answered marked_missing.

validated by libs/shared/src/outbound/utopia/utopia-client.test.ts:130

The push
⚠ the tests that validate it are not touched by this PR

- … any other refusal, throws a `UtopiaPushEr…
+ … any other refusal, throws a `UtopiaError`…

validated by libs/shared/src/outbound/utopia/utopia-client.test.ts:130

The ingest
⚠ the tests that validate it are not touched by this PR

only its test links changed — the statement text itself is unchanged

FR4.1 — The deployment reaches Utopia through UTOPIA_API_URL (utopia.enabled in the lore-api chart, from `enable_ut…

validated by libs/shared/src/outbound/utopia/utopia-client.test.ts:130

The ingest
⚠ the tests that validate it are not touched by this PR

only its test links changed — the statement text itself is unchanged

FR4.3 — After the delta route has projected a specs or adrs delta into the graph, each file is mirrored as a spec o…

validated by apps/lore-api/src/transport/routes/ingest/ingest-delta.test.ts:711

…and 28 more statement(s).

Weaker signals (28) — linked by a spec, not proven by a test run

Feature Specification: The spec-to-code chain mirrored in Utopia · 1 statement(s)

specs/utopia-graph-mirror/spec.md

Backfill
✓ this PR also changes the tests that validate it

FR7.2 — Every such file is read at the head commit of the repo's default branch and mirrored through the ingest's mirro…

validated by apps/lore-api/src/work/utopia/utopia-backfill.test.ts:103, libs/shared/src/outbound/project/lib/platform-github.test.ts:796
via changed file apps/lore-api/src/work/utopia/utopia-backfill.test.ts

Feature Specification: Shared Utilities · 3 statement(s)

specs/shared-utilities/spec.md

Functional Requirements
✓ this PR also changes the tests that validate it

FR — PlatformGitHub: throws a clear config error when neither App creds nor a token are set, exposes the port name …

validated by libs/shared/src/outbound/project/lib/platform-github.test.ts:796
via changed file libs/shared/src/outbound/project/lib/platform-github.test.ts

Functional Requirements
✓ this PR also changes the tests that validate it

FR — PlatformGitHub CI reads for a branch (added 2026-09-12): listBranchCommits returns a branch's newest commi…

validated by libs/shared/src/outbound/project/lib/platform-github.test.ts:796
via changed file libs/shared/src/outbound/project/lib/platform-github.test.ts

Functional Requirements
✓ this PR also changes the tests that validate it

FR — PlatformGitHub installation tokens: getInstallationToken always mints a fresh token rather than returning oc…

validated by libs/shared/src/outbound/project/lib/platform-github.test.ts:796
via changed file libs/shared/src/outbound/project/lib/platform-github.test.ts

Feature Specification: Autonomous Review Loop · 7 statement(s)

specs/auto-review-loop/spec.md

libs/shared/src/outbound/project/lib/platform-github.test.ts
✓ this PR also changes the tests that validate it

exposes the github port name.

validated by libs/shared/src/outbound/project/lib/platform-github.test.ts:796
via changed file libs/shared/src/outbound/project/lib/platform-github.test.ts

libs/shared/src/outbound/project/lib/platform-github.test.ts
✓ this PR also changes the tests that validate it

createLabels swallows a 422 (already exists) and continues.

validated by libs/shared/src/outbound/project/lib/platform-github.test.ts:796
via changed file libs/shared/src/outbound/project/lib/platform-github.test.ts

libs/shared/src/outbound/project/lib/platform-github.test.ts
✓ this PR also changes the tests that validate it

createLabels rethrows a non-422 error.

validated by libs/shared/src/outbound/project/lib/platform-github.test.ts:796
via changed file libs/shared/src/outbound/project/lib/platform-github.test.ts

libs/shared/src/outbound/project/lib/platform-github.test.ts
✓ this PR also changes the tests that validate it

createReview posts one review with the mapped comments array.

validated by libs/shared/src/outbound/project/lib/platform-github.test.ts:796
via changed file libs/shared/src/outbound/project/lib/platform-github.test.ts

libs/shared/src/outbound/project/lib/platform-github.test.ts
✓ this PR also changes the tests that validate it

get exposes the PR head sha as headSha.

validated by libs/shared/src/outbound/project/lib/platform-github.test.ts:796
via changed file libs/shared/src/outbound/project/lib/platform-github.test.ts

libs/shared/src/outbound/project/lib/platform-github.test.ts
✓ this PR also changes the tests that validate it

listReviewThreads maps GraphQL thread nodes (id, resolution, outdated flag, comment databaseIds) and stitches pages pas…

validated by libs/shared/src/outbound/project/lib/platform-github.test.ts:796
via changed file libs/shared/src/outbound/project/lib/platform-github.test.ts

…and 18 more statement(s).

2 changed statement(s) had no validating test, so no coverage broke. 309 new statement(s) have no test link yet.

Deterministic · graph @ 54e00aa (projected 2026-10-07) · 20 file(s) skipped: changed since the graph last saw them, so their line numbers no longer line up · no tests run by this check

@lore-agent lore-agent Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lore review — Approved

Drops per-file changes statements and per-commit GitHub detail calls from the Utopia commit mirror, capping walks to the newest 200 commits from the branch listing.

Must fix (0) · Consider (1) · Nits (1)

Reviewed by gemini-4-argon

Submit a review that requests changes to have Lore push a fix for it. Comment @lore review to re-run the review.

Posted by floor, visit 1773a964-f607-44d9-9235-a6fdb058a7e6.

Comment thread specs/utopia-graph-mirror/spec.md Outdated
Comment thread libs/shared/src/outbound/project/lib/github-port.ts Outdated

@lore-agent lore-agent Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lore review — Approved

Comment and spec wording updates accurately reflect that changed files are read from the repository and an absent cursor takes the newest limit commits.

Must fix (0) · Consider (0) · Nits (0)

Reviewed by gemini-4-argon

Submit a review that requests changes to have Lore push a fix for it. Comment @lore review to re-run the review.

Posted by floor, visit 2462cb9d-f515-4643-9adc-7c21b2daf912.

@gedaiu
gedaiu merged commit 2cfd540 into main Oct 17, 2026
30 checks passed
gedaiu added a commit that referenced this pull request Oct 17, 2026
…5) (#2802)

Utopia held each repo's default-branch commits, but a pull request or an
issue appeared only as a number and a link, taken from a squash-merge's
commit message, and releases and tags not at all. This PR mirrors
GitHub's own record of every issue, pull request, tag and published
release into the repo's knowledge base (`specs/utopia-graph-mirror` FR14
and FR15, ADR-052 amendment of 2026-10-17).

**Issues and pull requests.** GitHub's issues listing returns pull
requests too, with their merge time, so a single walk covers both. It
reads oldest update first from a new cursor,
`settings.utopia.tracker_since`, and pushes `pull:<n>` and `issue:<n>`
items. Each item holds title, state (open, closed or merged), the login
that opened it, labels, the open, close and merge times, and the
description. A pull request's `Closes`/`Refs`/`Lore-Task:` lines link it
to its issues and task, stated through a module the commit mirror now
shares, so both mirrors say the same thing about the same entity. The
walk takes up to 2,000 entries per run, moves the cursor past each one
that lands, and stops at the first failure.

**Tags and releases.** A `tag:<name>` item points to the commit the
commit mirror names, and a `release:<tag>` item (title, author, publish
time, notes) publishes its tag. That way a release reaches the pull
requests behind it. A repo has few of these, so every push sends them
all, with no cursor: an unchanged item answers unchanged, and a refused
one is sent again next time. Drafts are skipped.

**When it runs.**
- A changed issue or pull request emits `github.tracker.changed`; a
published or edited release, or a created tag, emits
`github.release.changed`. Both come from the same delivery under its own
dedupe key (`github:<id>:utopia`).
- The stations answer by posting `POST
/api/repos/{owner}/{repo}/utopia/tracker` or `/releases`.
- The weekly backfill runs both after the commits.
- A repo's hook now requires the `release` and `create` events. An
existing hook gets them when the ensure step runs for that repo, as
`push` did in #2796.
- The commit, tracker and release walks share one loop and one per-repo
queue (`cursor-walk.ts`).

This branch is rebased onto #2801: commit items carry no file names, and
the commit walk takes the newest 200.

**Ontology version 5.** Version 5 adds `Release` and `Tag`, `points_to`
and `publishes`, and the tracker attributes. Once it deploys, every base
below 5 re-imports the ontology on its next push. If re.8 is not live by
then, those bases store 5 with every relation typed as a state, so after
the apply the reset is `5 → 4`, not `4 → 3`.

Out of scope: reviews, review comments, conversation comments, and
tombstoning deleted issues, releases or tags.

Checks run locally: vitest across libs/shared, apps/lore-api and
apps/stations; `tsc --noEmit` on every package that imports shared;
`eslint .` with 0 errors; `prettier --check`.

Generated with [Claude Code](https://claude.com/claude-code)
gedaiu added a commit that referenced this pull request Oct 17, 2026
The first tracker walk on lore, run right after #2802 deployed, pushed
nothing. Its first item, `pull:1`, timed out after 30 seconds: Utopia's
database was at its 4-core limit, with connections waiting 2 to 6
seconds. One walk pushes up to 2,000 items, and each is a job that
database has to work through, so a first walk of a repo with a long
history piles onto an already busy queue.

This PR caps a walk at 200 entries, as #2801 did for commits. A long
backlog now arrives in batches of 200, each resuming from
`tracker_since`. A walk runs for every changed issue or pull request and
once in the weekly backfill, so a busy repo like lore catches up within
a day, and a quiet one over a few Sundays.

Spec FR14.4 and the ADR-052 amendment now say 200.

Generated with [Claude Code](https://claude.com/claude-code)
@lore-agent lore-agent Bot mentioned this pull request Oct 22, 2026
1 task
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