Skip to content
Myr

One keepLanding hears every landing kept in the project service; a quiet project is listed, its first push heard once

Before adoption: this commit came in with the history the project adopted, so no landing records it.

From review: the adoption, an opening and a bookkeeping landing share keepLanding, so a landing kept and not heard cannot be written again. The front page over D1 lists a project only made and first pushed; a first push recorded twice is heard once. GLOSSARY names the adoption a landing, and the Landed line no longer calls it the first event.

authored by oscabriel · committed by oscabriel · parent 6bf50e8 · Browse files · 7 files+98 added−29 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

7 files+98 added−29 removed

  • tests:+64 added−3 removed
  • other:+34 added−26 removed

7 files+98 added−29 removed

modified:apps/platform/test/front-page.test.ts+28 added
168 unmodified lines
169 /** A client of the contracts over HTTP at `/rpc`, as anyone. */170 readonly anyone: Client["Service"];171 /** bob's answer to `parse-iso` landed, as his claim, push and submission make it. */172 readonly landAnswer: Effect.Effect<void>;173 /** quietkit made and first pushed, and nothing else: no ask, no policy evaluated. */174 readonly makeQuiet: Effect.Effect<void>;175}176177const frontPageWorld: Effect.Effect<FrontPageWorld, never, Scope.Scope> =178 Effect.gen(function* () {
82 unmodified lines
261 forget: Effect.sync(() => {262 calls.length = 0;263 }),264 landAnswer,265 makeQuiet: seeded(aProject({ name: "quietkit" })).pipe(266 Effect.provideContext(ports)267 ),268 };269 });270271describe("the project list and credits over the platform's /rpc", () => {272 it.effect(273 "lists a project that was only made and first pushed, its adoption the one event it has",274 () =>275 Effect.gen(function* () {276 yield* advanceTo(noon);277278 const world = yield* frontPageWorld;279280 yield* world.makeQuiet;281282 const { projects } = yield* world.anyone.listProjects({});283284 expect(285 projects.find(({ project: listed }) => listed === "quietkit")286 ).toStrictEqual({287 landedAt: at(noon),288 openAsks: 0,289 posture: "open",290 project: "quietkit",291 });292 }).pipe(Effect.scoped)293 );294295 it.effect(296 "after a landing, lists the project from D1, asking it only its posture and only once, and its people's credits without calling a project",297 () =>298 Effect.gen(function* () {299 yield* advanceTo(noon);
42 unmodified lines
modified:packages/agent-kit/src/llms-sections.ts+1 added-1 removed
modified:packages/agent-kit/test/golden/full-llms.txt+1 added-1 removed
159 unmodified lines
160- `AskOpened`: A new ask opened.161- `Claimed`: Someone claimed an ask.162- `Decided`: A decider took a decision.163- `Judged`: An answer was checked, with the outcome its verdict holds.164- `Landed`: A landing reached `main`; the first is the project's adopted `main`, from its first push or its import.164- `Landed`: A landing reached `main`, a project's adoption (its first push or its import) among them.165- `Lapsed`: A claim lapsed: no push for too long.166- `LedgerAppended`: The project's public ledger gained an entry.167- `ProposalDrafted`: A proposal's draft settled: ready for a decider, or failed.168- `ProposalOpened`: A proposal opened.
26 unmodified lines
modified:packages/project/src/project.ts+32 added-24 removed
1174 unmodified lines
1175 writes.ratchets.size,1176 ].every((count) => count === 0);11771178/** A row's key in its table, as the store keys it. */1179/**1180 * Keeps `landing` and hears it as `Landed`: every landing that moves main1181 * is heard, so a watcher and the front page see it (a project's row is1182 * written on its first event).1183 */1184const keepLanding = (1185 writes: Writes,1186 landing: LandingView,1187 now: DateTime.Utc1188) => {1189 writes.landings.push(landing);1190 writes.events.push(ProjectEventInput.Landed({ at: now, landing }));1191};11921193const keyIn = <A>(table: Table<A>, row: A) => {1194 const columns = table.columns(row);11951196 return JSON.stringify(table.key.map((name) => columns[name]));
1541 unmodified lines
2738 };27392740 const moved = yield* withPolicyAt({ ...row, landed: sha }, sha, now);27412728 writes.landings.push(view);2729 writes.events.push(2730 ProjectEventInput.Landed({ at: now, landing: view })2731 );2742 keepLanding(writes, view, now);2743 writes.project.set("row", moved);2744 });27452746 /**
1050 unmodified lines
3797 // ------------------------------------------------------------ writes37983799 /**3800 * The first adoption as a landing: the initializer's first push, or an3790 * import's tip. It answers no ask and has no parent; its row lets3791 * `landing` (and so OnPush) know the commit as the platform's own.3801 * import's tip. It answers no ask, has no parent and credits no one;3802 * its row lets `landing` (and so OnPush) know the commit as the3803 * platform's own, and its event lists the project on the front page3804 * even when no policy evaluates and nothing else happens in it.3805 */3793 /**3794 * The project's first landing, its adopted `main`: kept, and heard as3795 * every landing is, so the front page lists the project even when no3796 * policy evaluates and nothing else happens in it. It credits no one.3797 */3806 const landAdoption = (3807 writes: Writes,3808 author: Handle,3809 sha: LandedSha,3810 now: DateTime.Utc3811 ) => {3804 const landing: LandingView = {3805 assisted: [],3806 author,3807 credits: [],3808 landedAt: now,3809 project: name,3810 sha,3811 };38123813 writes.landings.push(landing);3814 writes.events.push(ProjectEventInput.Landed({ at: now, landing }));3812 keepLanding(3813 writes,3814 {3815 assisted: [],3816 author,3817 credits: [],3818 landedAt: now,3819 project: name,3820 sha,3821 },3822 now3823 );3824 };38253826 const initBody =3827 (
611 unmodified lines
4439 requestId: landed.requestId,4440 sha: landed.sha,4441 };44424434 writes.landings.push(landing);4443 // Heard as every landing is (main moved), so a list of landings4444 // shows the opening; it answers no ask, so it credits nothing.4437 writes.events.push(ProjectEventInput.Landed({ at: now, landing }));4445 keepLanding(writes, landing, now);4446 writes.project.set(4447 "row",4448 yield* withPolicyAt({ ...row, landed: landed.sha }, landed.sha, now)4449 );
1413 unmodified lines
modified:packages/project/test/import.test.ts+32 added-1 removed
1/**2 * A project adopted from a public repo, whatever its default branch, and3 * adopted again by a retry when the first import died after Artifacts made4 * the repo.4 * the repo; and each adoption, an import's or a first push's, heard once5 * as a landing.6 */7import { describe, expect, it } from "@effect/vitest";8import { RefName, RepoHost } from "@repo/artifacts/repo-host";9import { memoryFs } from "@repo/artifacts/repo-host/memory-fs";
183 unmodified lines
193 ).toStrictEqual(new ProjectExists({ project }));194 }).pipe(Effect.provide(worldOf(scenario, "memory")))195 );196});197198describe("a first push", () => {199 it.effect(200 "is heard once as the adoption's landing, however often it is recorded",201 () =>202 Effect.gen(function* () {203 yield* advanceTo("2026-10-08T12:00:00Z");204205 const api = yield* projectService(project);206 const client = yield* gitClient(memoryFs());207208 const first = yield* client.commit("Start", [209 ["README.md", "# start\n"],210 ]);211212 yield* api.initProject(alice, {});213 yield* (yield* RepoHost)214 .push(repo, client.source, [215 { from: Option.none(), ref: mainRef, to: first },216 ])217 .pipe(Effect.orDie);218 yield* api.recordFirstPush(alice, first);219 yield* api.recordFirstPush(alice, first);220221 const heard = yield* api.events(0, 10);222223 expect(heard.map(({ event }) => event._tag)).toStrictEqual(["Landed"]);224 }).pipe(Effect.provide(worldOf(scenario, "memory")))225 );226});
modified:packages/project/test/project.test.ts+3 added-1 removed
1223 unmodified lines
1224 alarm: Option.some(DateTime.add(noon, { seconds: 1 })),1225 fork: false,1226 outbox: ["MakeFork", "Projected"],1227 });1228 // The adoption's landing is the event refused; the alarm projects it.1228 // The adoption's landing is the event refused; the alarm projects it1229 // again, after the later events (the memory projection keeps no1230 // cursor).1231 expect(after).toStrictEqual({1232 fork: true,1233 outbox: [],1234 projected: ["AskOpened", "Landed", "Claimed", "Landed"],
215 unmodified lines
modified:GLOSSARY.md+1 added-1 removed
71 unmodified lines
72The cost-ordered chain of stages that narrows a push to a checked tree or a refusal.73_Avoid_: CI, pipeline, merge queue7475**Landing**:76The platform's commit of a checked tree to main, written by the platform with credit trailers. An ask's opening is a landing too: it opens an ask and answers none.76The platform's commit of a checked tree to main, written by the platform with credit trailers. An ask's opening is a landing too: it opens an ask and answers none. So is a project's adoption, its first `main` from the initializer's first push or an import: it answers no ask, has no parent and credits no one.77_Avoid_: merge, ship7879**Landed SHA**:80The commit the platform itself last landed on main; the only commit a project's rules are read from.
139 unmodified lines