Public: anyone can read this; the crew can change it.
A child forge's proposal carries its own check verdict and tree id, and the parent's pull shows them beside its own check #13676
Check · Review · Land · Live done — Landed and live in production.
scout/forge:scout/13645-a-child-forge-s-proposal-carries-its-own → main 11 commits fork 5 threads · 5 unresolved
docs/features/README.md +1
| @@ -385,6 +385,7 @@ Read with the guide page [Bring your own AI](../guide-own-ai.md). | ||
| 385 | 385 | - [](child-model-egress.md) |
| 386 | 386 | - [](no-model-key.md) |
| 387 | 387 | - [](child-credit.md) |
| 388 | - [](child-attestation.md) | |
| 388 | 389 | - [](org-model-grant.md) |
| 389 | 390 | - [](cost-ledger.md) |
| 390 | 391 | - [](cost-days.md) |
docs/features/child-attestation.md added +13
| @@ -0,0 +1,13 @@ | ||
| 1 | # A child's proposal says what the child proved | |
| 2 | ||
| 3 | When a child forge proposes a change to its parent, it also sends what its own check found on that commit (#13645). The parent shows this beside its own check. It never decides anything on it. | |
| 4 | ||
| 5 | 1. **On the child**, land a change on main and press **Propose**. The proposal (`src/actions/upstream.ts`) sends `attestation: { verdict, tree }`. The verdict is the child's own check of the tip (`green`, `red`, `pending` or `none`) and the tree is the tip's tree id. | |
| 6 | 2. **On the parent**, open the pull, on either tab. After *proposed by child* it reads `proven on <child>: green at 1a2b3c4d`. In the terminal, the pull screen's head line has the same line after *proposed by child*. | |
| 7 | 3. If the pull's head tree is not the tree the child proved, the line ends `· tree differs`. That happens when someone pushed on top of the proposal or main was combined into it. In that case the child's verdict is about a different tree. | |
| 8 | ||
| 9 | The boundary (`src/http/api.ts`, `parseAttestation` in `src/core/attestation.ts`) accepts only a verdict from that set and a 40- or 64-character lowercase hex tree id. Anything else is refused with `422 invalid_attestation`. Only a proposal may carry one. The API's pull answer echoes it under `proposal.attestation`. | |
| 10 | ||
| 11 | Every view reads it with `pullProposalAt` (`src/core/proposal_token.ts`): the page head (`changeHead`), the conflicts page and the terminal's local source. It reads the head's tree only when the child attested one. Nothing gates or ranks on the child's verdict. The parent's own check is still the one that lands a pull. | |
| 12 | ||
| 13 | Test: `test/attestation.test.ts` (the verdict mapping and the line), `test/proposal-token.test.ts` (accepted, refused, shown on both tabs and in the terminal, tree differs) and `test/upstream-forge.test.ts` (the child sends `none` with no check, and `green` when its check of the tip passed). |
src/actions/upstream.ts +12 −1
| @@ -16,7 +16,9 @@ import { | ||
| 16 | 16 | } from "../core/repos.ts"; |
| 17 | 17 | import { listPulls, mergedPullsForRepos, type Pull } from "../core/pulls.ts"; |
| 18 | 18 | import type { User } from "../core/users.ts"; |
| 19 | import { aheadOids, resolveOid } from "../git/merge.ts"; | |
| 19 | import { aheadOids, resolveOid, treeOf } from "../git/merge.ts"; | |
| 20 | import { commitCheck } from "../checks/commit_check.ts"; | |
| 21 | import { verdictOfCheck, type Attestation } from "../core/attestation.ts"; | |
| 20 | 22 | import { repoDir } from "../git/repos.ts"; |
| 21 | 23 | import { basicHeader, gitAuthEnv, redact, secretsIn } from "../origins/credentials.ts"; |
| 22 | 24 | import { MIRROR_UNRESOLVED, pushToOrigin } from "../origins/git-mirror.ts"; |
| @@ -253,6 +255,14 @@ export async function proposeToParentForge( | ||
| 253 | 255 | : { kind: "refused", reason: reason.slice(0, 200) }); |
| 254 | 256 | } |
| 255 | 257 | |
| 258 | // What this forge proved of the tip it proposes (#13645): its own check's verdict on it and | |
| 259 | // its tree id. The parent shows it beside its own check and decides nothing on it. | |
| 260 | const tree = await treeOf(dir, tip); | |
| 261 | const attestation: Attestation | undefined = | |
| 262 | tree === undefined | |
| 263 | ? undefined | |
| 264 | : { verdict: verdictOfCheck(commitCheck(app.db, repo.id, repo.defaultBranch, tip).state), tree }; | |
| 265 | ||
| 256 | 266 | let res: Response; |
| 257 | 267 | try { |
| 258 | 268 | res = await fetch(apiUrl(cred, ""), { |
| @@ -264,6 +274,7 @@ export async function proposeToParentForge( | ||
| 264 | 274 | body: `Proposed by child ${cred.child}${here === "" ? "" : ` (${here})`}: ${source}.`, |
| 265 | 275 | base: repo.defaultBranch, |
| 266 | 276 | head, |
| 277 | ...(attestation === undefined ? {} : { attestation }), | |
| 267 | 278 | }), |
| 268 | 279 | signal: AbortSignal.timeout(ASK_TIMEOUT_MS), |
| 269 | 280 | }); |
src/contract/openapi/routes/postApiV1ReposOwnerNamePulls.ts +1 −1
| @@ -6,5 +6,5 @@ export const route: Route = { | ||
| 6 | 6 | summary: "Offer a change as a pull", |
| 7 | 7 | auth: true, |
| 8 | 8 | role: "member", |
| 9 | body: { title: "string", head: "string", headRepo: "string" }, | |
| 9 | body: { title: "string", head: "string", headRepo: "string", attestation: "object" }, | |
| 10 | 10 | }; |
src/core/attestation.ts added +48
| @@ -0,0 +1,48 @@ | ||
| 1 | /** | |
| 2 | * What a child forge says of the commit it proposes: its own check's verdict | |
| 3 | * on that commit and the commit's tree id (#13645). Information only: the | |
| 4 | * parent's gate still runs on the pull, and nothing here admits or lands | |
| 5 | * anything. It is read from the proposal's body at the boundary — a verdict | |
| 6 | * from a fixed set and a hex tree id, or nothing — and said beside the pull | |
| 7 | * as one line, with `tree differs` when the pull's head is not the tree the | |
| 8 | * child proved. | |
| 9 | */ | |
| 10 | ||
| 11 | export type AttestedVerdict = "green" | "red" | "pending" | "none"; | |
| 12 | ||
| 13 | export interface Attestation { | |
| 14 | readonly verdict: AttestedVerdict; | |
| 15 | readonly tree: string; | |
| 16 | } | |
| 17 | ||
| 18 | const VERDICTS: readonly AttestedVerdict[] = ["green", "red", "pending", "none"]; | |
| 19 | ||
| 20 | /** A tree id: SHA-1 or SHA-256 hex, lowercase. */ | |
| 21 | export const isTreeId = (s: string): boolean => /^(?:[0-9a-f]{40}|[0-9a-f]{64})$/.test(s); | |
| 22 | ||
| 23 | /** | |
| 24 | * The attestation in a proposal's body. `undefined` when none was sent; | |
| 25 | * `"invalid"` when one was sent but is not a verdict and a tree id. | |
| 26 | */ | |
| 27 | export function parseAttestation(raw: unknown): Attestation | undefined | "invalid" { | |
| 28 | if (raw === undefined || raw === null) return undefined; | |
| 29 | if (typeof raw !== "object" || Array.isArray(raw)) return "invalid"; | |
| 30 | const { verdict, tree } = raw as { verdict?: unknown; tree?: unknown }; | |
| 31 | if (typeof verdict !== "string" || !VERDICTS.includes(verdict as AttestedVerdict)) return "invalid"; | |
| 32 | if (typeof tree !== "string" || !isTreeId(tree)) return "invalid"; | |
| 33 | return { verdict: verdict as AttestedVerdict, tree }; | |
| 34 | } | |
| 35 | ||
| 36 | /** A child's own check state of a commit, in the words it attests with. */ | |
| 37 | export const verdictOfCheck = (state: string): AttestedVerdict => | |
Medium. Tests: this mapping is untested. Add a unit test for ok, failed, pending and anything else (superseded) to none. The behaviour is the child's verdict, and no test fails if it is wrong. |
||
| 38 | state === "ok" ? "green" : state === "failed" ? "red" : state === "pending" ? "pending" : "none"; | |
| 39 | ||
| 40 | /** Whether the pull's head tree is not the one the child proved. */ | |
| 41 | export const treeDiffers = (a: Attestation, headTree: string | undefined): boolean => | |
| 42 | headTree !== a.tree; | |
| 43 | ||
| 44 | /** | |
| 45 | * The one line the pull says: `proven on kid: green at 1a2b3c4d`, `· tree differs` when it does. | |
| 46 | */ | |
| 47 | export const attestationLine = (child: string, a: Attestation, headTree: string | undefined): string => | |
| 48 | `proven on ${child}: ${a.verdict} at ${a.tree.slice(0, 8)}${treeDiffers(a, headTree) ? " · tree differs" : ""}`; |
src/core/migration-pins/20261115150000-pull-proposal-attestation.pin added +1
| @@ -0,0 +1,1 @@ | ||
| 1 | 8d03f37f56a9a1cd0e239eba14ed407181132788fb74815fb0084cf40a89a127 |
src/core/migrations/20261115150000-pull-proposal-attestation.ts added +7
| @@ -0,0 +1,7 @@ | ||
| 1 | // A child forge's proposal carries what it proved (#13645): its own check's verdict on the | |
| 2 | // proposed commit and that commit's tree id, kept beside the pull's child and origin. Both | |
| 3 | // NULL for a proposal that sent none. Information only; nothing admits on them. Additive. | |
| 4 | export default ` | |
| 5 | ALTER TABLE pull_proposal ADD COLUMN attested_verdict TEXT; | |
| 6 | ALTER TABLE pull_proposal ADD COLUMN attested_tree TEXT; | |
| 7 | `; |
src/core/proposal_token.ts +42 −6
| @@ -7,8 +7,10 @@ | ||
| 7 | 7 | * the data and the rules about names; it decides nothing about requests. |
| 8 | 8 | */ |
| 9 | 9 | |
| 10 | import { parseAttestation, type Attestation } from "./attestation.ts"; | |
| 10 | 11 | import type { Database } from "bun:sqlite"; |
| 11 | 12 | import { isSafeRef } from "../git/guard.ts"; |
| 13 | import { treeOf } from "../git/merge.ts"; | |
| 12 | 14 | import { err, ok, type Result } from "../kernel/result.ts"; |
| 13 | 15 | import { createToken } from "./tokens.ts"; |
| 14 | 16 | import { foldsIn } from "./trusted_sources.ts"; |
| @@ -187,22 +189,56 @@ export function recordPullProposal( | ||
| 187 | 189 | db: Database, |
| 188 | 190 | issueId: string, |
| 189 | 191 | p: Pick<Proposal, "child" | "origin">, |
| 192 | attestation?: Attestation, | |
| 190 | 193 | ): void { |
| 191 | 194 | db.query( |
| 192 | "INSERT OR REPLACE INTO pull_proposal (issue_id, child, origin) VALUES (?1, ?2, ?3)", | |
| 193 | ).run(issueId, p.child, p.origin); | |
| 195 | "INSERT OR REPLACE INTO pull_proposal (issue_id, child, origin, attested_verdict, attested_tree) VALUES (?1, ?2, ?3, ?4, ?5)", | |
| 196 | ).run(issueId, p.child, p.origin, attestation?.verdict ?? null, attestation?.tree ?? null); | |
| 194 | 197 | } |
| 195 | 198 | |
| 196 | 199 | export function pullProposalOf( |
| 197 | 200 | db: Database, |
| 198 | 201 | issueId: string, |
| 199 | ): { child: string; origin: string; folds: boolean } | undefined { | |
| 202 | ): { child: string; origin: string; folds: boolean; attestation?: Attestation } | undefined { | |
| 200 | 203 | const row = db |
| 201 | .query<{ child: string; origin: string }, [string]>( | |
| 202 | "SELECT child, origin FROM pull_proposal WHERE issue_id = ?1", | |
| 204 | .query<{ child: string; origin: string; attested_verdict: string | null; attested_tree: string | null }, [string]>( | |
| 205 | "SELECT child, origin, attested_verdict, attested_tree FROM pull_proposal WHERE issue_id = ?1", | |
| 203 | 206 | ) |
| 204 | 207 | .get(issueId); |
| 205 | return row === null ? undefined : { ...row, folds: foldsIn(db, issueId) }; | |
| 208 | if (row === null) return undefined; | |
| 209 | // Read back through the same rule it was written by: a row that is not a verdict and a tree says | |
| 210 | // nothing. | |
| 211 | const attested = parseAttestation( | |
| 212 | row.attested_tree === null ? undefined : { verdict: row.attested_verdict, tree: row.attested_tree }, | |
| 213 | ); | |
| 214 | return { | |
| 215 | child: row.child, | |
| 216 | origin: row.origin, | |
| 217 | folds: foldsIn(db, issueId), | |
| 218 | ...(typeof attested === "object" ? { attestation: attested } : {}), | |
| 219 | }; | |
| 220 | } | |
| 221 | ||
| 222 | /** | |
| 223 | * A pull's proposal with the tree of the head it is shown at, so its attestation line can say | |
| 224 | * `tree differs`. | |
| 225 | */ | |
| 226 | export type PullProposalAt = NonNullable<ReturnType<typeof pullProposalOf>> & { readonly headTree?: string }; | |
| 227 | ||
| 228 | /** | |
| 229 | * The proposal and, only when a child attested one, the tree of `headOid` in `dir` (#13645): one | |
| 230 | * read for the page head and the terminal alike, and no git read for any other pull. | |
| 231 | */ | |
| 232 | export async function pullProposalAt( | |
| 233 | db: Database, | |
| 234 | issueId: string, | |
| 235 | dir: string, | |
| 236 | headOid: string, | |
| 237 | ): Promise<PullProposalAt | undefined> { | |
| 238 | const p = pullProposalOf(db, issueId); | |
| 239 | if (p?.attestation === undefined) return p; | |
| 240 | const headTree = await treeOf(dir, headOid); | |
| 241 | return headTree === undefined ? p : { ...p, headTree }; | |
| 206 | 242 | } |
| 207 | 243 | |
| 208 | 244 | export interface ProposalTokenInfo { |
src/http/api.ts +14 −2
| @@ -8,6 +8,7 @@ | ||
| 8 | 8 | * back to continue); errors are `{ error, message }`. |
| 9 | 9 | */ |
| 10 | 10 | |
| 11 | import { parseAttestation } from "../core/attestation.ts"; | |
| 11 | 12 | import { listAppReleases } from "../core/app_releases.ts"; |
| 12 | 13 | import { openapiHandler } from "../contract/served.ts"; |
| 13 | 14 | import { CHECK_ASKED } from "../actions/pull_ask_words.ts"; |
| @@ -2763,6 +2764,15 @@ export function apiRoutes(router: Router<Handler>): void { | ||
| 2763 | 2764 | 422, |
| 2764 | 2765 | `a proposal pull comes from a child/${proposal.child}/… branch of this repository`, |
| 2765 | 2766 | ); |
| 2767 | // What the child says it proved: a verdict and a tree id, or nothing. Shown beside the | |
| 2768 | // pull, never admitted on (#13645); only a proposal may send one. | |
| 2769 | const attested = proposal === undefined ? undefined : parseAttestation(input.attestation); | |
| 2770 | if (attested === "invalid") | |
| 2771 | return apiError( | |
| 2772 | "invalid_attestation", | |
| 2773 | 422, | |
| 2774 | "an attestation is { verdict: green|red|pending|none, tree: <40 or 64 hex> }", | |
| 2775 | ); | |
| 2766 | 2776 | // `headRepo: "owner/name"` proposes a fork's branch into this base. |
| 2767 | 2777 | let headRepo: Repo | undefined; |
| 2768 | 2778 | const headSpec = str(input.headRepo); |
| @@ -2816,12 +2826,14 @@ export function apiRoutes(router: Router<Handler>): void { | ||
| 2816 | 2826 | ? originAware(created.error) |
| 2817 | 2827 | : respondAccess(created.error, 422); |
| 2818 | 2828 | if (proposal !== undefined) |
| 2819 | recordPullProposal(ctx.app.db, created.value.id, proposal); | |
| 2829 | recordPullProposal(ctx.app.db, created.value.id, proposal, attested); | |
| 2820 | 2830 | return json( |
| 2821 | 2831 | { |
| 2822 | 2832 | ...withLabels(ctx, created.value), |
| 2823 | 2833 | variantSiblings: variantSiblings(ctx.app.db, [created.value])[0] ?? [], |
| 2824 | ...(proposal ? { proposal: { child: proposal.child, origin: proposal.origin } } : {}), | |
| 2834 | ...(proposal | |
| 2835 | ? { proposal: { child: proposal.child, origin: proposal.origin, ...(attested ? { attestation: attested } : {}) } } | |
| 2836 | : {}), | |
| 2825 | 2837 | }, |
| 2826 | 2838 | 201, |
| 2827 | 2839 | ); |
src/spawn/preview-seed.ts +25
| @@ -37,6 +37,10 @@ import { backBet } from "../actions/bets.ts"; | ||
| 37 | 37 | import { openIssue, setIssueState } from "../actions/issues.ts"; |
| 38 | 38 | import { pinBuild } from "../actions/builds.ts"; |
| 39 | 39 | import { addReview, mergePull, openPull } from "../actions/pulls.ts"; |
| 40 | import { pullProposalOf, recordPullProposal } from "../core/proposal_token.ts"; | |
| 41 | import { getPull } from "../core/pulls.ts"; | |
| 42 | import { treeOf } from "../git/merge.ts"; | |
| 43 | import { repoDir } from "../git/repos.ts"; | |
| 40 | 44 | import { commitToBranch, createRepo, forkRepo, updateRepoSettings } from "../actions/repos.ts"; |
| 41 | 45 | import { reviewGate } from "../actions/gate_review.ts"; |
| 42 | 46 | import { forgeHttp } from "../http/server.ts"; |
| @@ -433,6 +437,8 @@ export async function seedPreview( | ||
| 433 | 437 | seedGrace(app); |
| 434 | 438 | const inventory = seedInventory(app, admin); |
| 435 | 439 | if (!inventory.ok) return inventory; |
| 440 | const attested = await seedAttestedPull(app, admin); | |
| 441 | if (!attested.ok) return attested; | |
| 436 | 442 | return ok({ seeded: false }); |
| 437 | 443 | } |
| 438 | 444 | const world = await seedWorld(app, admin); |
| @@ -455,9 +461,28 @@ export async function seedPreview( | ||
| 455 | 461 | seedGrace(app); |
| 456 | 462 | const inventory = seedInventory(app, admin); |
| 457 | 463 | if (!inventory.ok) return inventory; |
| 464 | const attested = await seedAttestedPull(app, admin); | |
| 465 | if (!attested.ok) return attested; | |
| 458 | 466 | return ok({ seeded: true }); |
| 459 | 467 | } |
| 460 | 468 | |
| 469 | /** | |
| 470 | * The sample pull, proposed by a child that attests its own green check on the head's tree, so | |
| 471 | * the pull's page draws the attestation line its look pictures (#13645). A row only; no child | |
| 472 | * exists. Every boot, so a preview seeded before it gains the row; a row already there is kept. | |
| 473 | */ | |
| 474 | async function seedAttestedPull(app: App, admin: User): Promise<Result<void, string>> { | |
| 475 | const repo = getRepo(app.db, admin.username, PREVIEW_REPO); | |
| 476 | if (repo === undefined) return err("the sample repository is gone"); | |
| 477 | const pull = getPull(app.db, repo.id, PREVIEW_PULL); | |
| 478 | if (pull === undefined) return err(`the sample pull #${String(PREVIEW_PULL)} is gone`); | |
| 479 | if (pullProposalOf(app.db, pull.id)?.attestation !== undefined) return ok(); | |
| 480 | const tree = await treeOf(repoDir(app.reposRoot, repo.ownerName, repo.name), pull.headOid); | |
| 481 | if (tree === undefined) return err("the sample pull's head tree"); | |
| 482 | recordPullProposal(app.db, pull.id, { child: "kid", origin: "https://kid.example" }, { verdict: "green", tree }); | |
| 483 | return ok(); | |
| 484 | } | |
| 485 | ||
| 461 | 486 | /** The client forge the preview's operator view shows in grace. */ |
| 462 | 487 | export const PREVIEW_GRACE_CLIENT = "preview-grace-client"; |
| 463 | 488 |
src/tui/screens/pull.ts +2 −1
| @@ -59,6 +59,7 @@ import { | ||
| 59 | 59 | type EnvState, |
| 60 | 60 | type EnvStatus, envsFor } from "../../apps/runtime.ts"; |
| 61 | 61 | import { proposedByText } from "../../core/proposal_token.ts"; |
| 62 | import { attestationLine } from "../../core/attestation.ts"; | |
| 62 | 63 | import { getAppByRepo } from "../../core/apps.ts"; |
| 63 | 64 | import { teamsHolding, teamVerdicts, type TeamVerdict } from "../../core/issue_teams.ts"; |
| 64 | 65 | import { getIssue, type Issue } from "../../core/issues.ts"; |
| @@ -1281,7 +1282,7 @@ export function pullScreen( | ||
| 1281 | 1282 | x1, |
| 1282 | 1283 | head!.y + 1, |
| 1283 | 1284 | truncate( |
| 1284 | ` ${facts?.mergedAt != null ? "merged" : issue.state} · opened by ${who(issue.authorName, issue.originAuthor)} ${ago(issue.createdAt)}${guestWaiting() ? ` · ${isContribHead(facts?.headBranch ?? "") ? OUTSIDE_NOTE : repo !== undefined && crewFilters(repo) ? GUEST_NOTE_FILTERED : GUEST_NOTE}` : ""}${assignedText(issueRow, ctx.icons)}${facts?.proposal ? ` · ${proposedByText(facts.proposal)}` : ""}${hold === undefined ? "" : ` · held by ${hold.heldByName}: ${hold.why}`}${step === null ? "" : ` · step: ${stepLine(step)}`}${landing === null ? "" : ` · ${landing}`}${next === null ? "" : ` · next: ${next.who}, ${next.why}`}${ledgerLine === "" ? "" : ` · ${ledgerLine}`}`, | |
| 1285 | ` ${facts?.mergedAt != null ? "merged" : issue.state} · opened by ${who(issue.authorName, issue.originAuthor)} ${ago(issue.createdAt)}${guestWaiting() ? ` · ${isContribHead(facts?.headBranch ?? "") ? OUTSIDE_NOTE : repo !== undefined && crewFilters(repo) ? GUEST_NOTE_FILTERED : GUEST_NOTE}` : ""}${assignedText(issueRow, ctx.icons)}${facts?.proposal ? ` · ${proposedByText(facts.proposal)}` : ""}${facts?.proposal?.attestation ? ` · ${attestationLine(facts.proposal.child, facts.proposal.attestation, facts.proposal.headTree)}` : ""}${hold === undefined ? "" : ` · held by ${hold.heldByName}: ${hold.why}`}${step === null ? "" : ` · step: ${stepLine(step)}`}${landing === null ? "" : ` · ${landing}`}${next === null ? "" : ` · next: ${next.who}, ${next.why}`}${ledgerLine === "" ? "" : ` · ${ledgerLine}`}`, | |
| 1285 | 1286 | Math.max(0, edge - x1), |
| 1286 | 1287 | ), |
| 1287 | 1288 | style(c.mutedFg, c.bg), |
src/view/local.ts +4 −6
| @@ -9,7 +9,7 @@ | ||
| 9 | 9 | */ |
| 10 | 10 | |
| 11 | 11 | import { STL_LIMIT } from "../web/render/stl.ts"; |
| 12 | import { pullProposalOf } from "../core/proposal_token.ts"; | |
| 12 | import { pullProposalAt } from "../core/proposal_token.ts"; | |
| 13 | 13 | import { mayView, sealedScope } from "../core/sealed.ts"; |
| 14 | 14 | import type { App } from "../app.ts"; |
| 15 | 15 | import { |
| @@ -311,10 +311,8 @@ export function localSource( | ||
| 311 | 311 | if (issue.kind === "pull") { |
| 312 | 312 | const row = getPull(app.db, repo.id, number); |
| 313 | 313 | if (row !== undefined) { |
| 314 | const { status, diff } = await pullDiff( | |
| 315 | await pullDir(app.db, app.reposRoot, repo, row), | |
| 316 | row, | |
| 317 | ); | |
| 314 | const dir = await pullDir(app.db, app.reposRoot, repo, row); | |
| 315 | const { status, diff } = await pullDiff(dir, row); | |
| 318 | 316 | pull = { |
| 319 | 317 | baseBranch: row.baseBranch, |
| 320 | 318 | headBranch: row.headBranch, |
| @@ -325,7 +323,7 @@ export function localSource( | ||
| 325 | 323 | diff, |
| 326 | 324 | mergeable: status.mergeable, |
| 327 | 325 | conflicts: status.conflicts, |
| 328 | proposal: pullProposalOf(app.db, row.id) ?? null, | |
| 326 | proposal: (await pullProposalAt(app.db, row.id, dir, status.headOid)) ?? null, | |
| 329 | 327 | reviews: listReviews(app.db, row.id).map((review) => ({ |
| 330 | 328 | author: review.originAuthor ?? review.authorName, |
| 331 | 329 | state: review.state, |
src/view/source.ts +9 −2
| @@ -28,6 +28,7 @@ | ||
| 28 | 28 | * (invariant 9). |
| 29 | 29 | */ |
| 30 | 30 | |
| 31 | import type { Attestation } from "../core/attestation.ts"; | |
| 31 | 32 | import type { Label } from "../core/issues.ts"; |
| 32 | 33 | import { getOriginFor } from "../core/origins.ts"; |
| 33 | 34 | import { canRead, getRepo, type Repo } from "../core/repos.ts"; |
| @@ -195,8 +196,14 @@ export interface PullFacts { | ||
| 195 | 196 | readonly conflicts: readonly string[]; |
| 196 | 197 | /** Every verdict, newest last. Empty when nobody has reviewed. */ |
| 197 | 198 | readonly reviews: readonly ReviewFact[]; |
| 198 | /** The child and origin a proposal token opened this pull for, if one did. */ | |
| 199 | readonly proposal: { readonly child: string; readonly origin: string } | null; | |
| 199 | /** The child and origin a proposal token opened this pull for, if one did, with what the | |
| 200 | * child attested of it and the head's tree (#13645). */ | |
| 201 | readonly proposal: { | |
| 202 | readonly child: string; | |
| 203 | readonly origin: string; | |
| 204 | readonly attestation?: Attestation; | |
| 205 | readonly headTree?: string; | |
| 206 | } | null; | |
| 200 | 207 | } |
| 201 | 208 | |
| 202 | 209 | export interface IssueDetail { |
src/web/pages/conflicts.ts +4 −2
| @@ -7,6 +7,7 @@ | ||
| 7 | 7 | * running count and the merged file beneath. Writers only. |
| 8 | 8 | */ |
| 9 | 9 | |
| 10 | import { pullProposalAt } from "../../core/proposal_token.ts"; | |
| 10 | 11 | import { canWrite, getRepoById, type Repo } from "../../core/repos.ts"; |
| 11 | 12 | import { pullDir, pullStatus, type Pull } from "../../core/pulls.ts"; |
| 12 | 13 | import { activeRunFor } from "../../core/runs.ts"; |
| @@ -171,6 +172,7 @@ export async function conflictsPage(ctx: Ctx): Promise<Response> { | ||
| 171 | 172 | ); |
| 172 | 173 | const status = await timePhaseAsync(req, "status", () => pullStatus(dir, pull)); |
| 173 | 174 | const files = status.conflicts; |
| 175 | const proposal = await pullProposalAt(ctx.app.db, pull.id, dir, status.headOid); | |
| 174 | 176 | const asked = ctx.url.searchParams.get("file") ?? ""; |
| 175 | 177 | // Only a path git itself named is read; the rest of the world is a 404. |
| 176 | 178 | const file = asked === "" ? files[0] : files.find((f) => f === asked); |
| @@ -184,7 +186,7 @@ export async function conflictsPage(ctx: Ctx): Promise<Response> { | ||
| 184 | 186 | crumbs: crumbsFor(repo), |
| 185 | 187 | palette: repoPalette(ctx, repo), |
| 186 | 188 | body: html`${repoHeader(ctx, repo, "pulls", { compact: true, ownTitle: true })} |
| 187 | ${changeHead(ctx, repo, pull)}${changeTabs(repo, pull, "files")} | |
| 189 | ${changeHead(ctx, repo, pull, null, proposal)}${changeTabs(repo, pull, "files")} | |
| 188 | 190 | <p class="mt">${unknown && pull.state === "open" |
| 189 | 191 | ? "No conflict in that file." |
| 190 | 192 | : "This pull has no conflicts."} |
| @@ -237,7 +239,7 @@ export async function conflictsPage(ctx: Ctx): Promise<Response> { | ||
| 237 | 239 | }); |
| 238 | 240 | |
| 239 | 241 | const body = html`${repoHeader(ctx, repo, "pulls", { compact: true, ownTitle: true })} |
| 240 | ${changeHead(ctx, repo, pull)}${changeTabs(repo, pull, "files")} | |
| 242 | ${changeHead(ctx, repo, pull, null, proposal)}${changeTabs(repo, pull, "files")} | |
| 241 | 243 | <p class="muted small mt"> |
| 242 | 244 | <a href="${back}">← Files</a> · <span class="mono">${file}</span> · |
| 243 | 245 | <strong id="rs-count">${done} of ${total} resolved</strong> |
src/web/pages/pull.ts +2 −1
| @@ -8,6 +8,7 @@ | ||
| 8 | 8 | * it needs. |
| 9 | 9 | */ |
| 10 | 10 | |
| 11 | import { pullProposalAt } from "../../core/proposal_token.ts"; | |
| 11 | 12 | import { returnTo, withReturn } from "../return_to.ts"; |
| 12 | 13 | import { pullRoster } from "../studio/pull_roster.ts"; |
| 13 | 14 | import { originCheckLead, originCheckOf } from "../../origins/pull-check.ts"; |
| @@ -1143,7 +1144,7 @@ export async function pullFilesPage(ctx: Ctx): Promise<Response> { | ||
| 1143 | 1144 | compact: true, |
| 1144 | 1145 | ownTitle: true, |
| 1145 | 1146 | })} |
| 1146 | ${changeHead(ctx, repo, pull, { headOid: status.headOid, conflicts: status.conflicts.length })} | |
| 1147 | ${changeHead(ctx, repo, pull, { headOid: status.headOid, conflicts: status.conflicts.length }, await pullProposalAt(ctx.app.db, pull.id, dir, status.headOid))} | |
| 1147 | 1148 | ${changeTabs(repo, pull, "files")} |
| 1148 | 1149 | ${verdictLine(verdict)} |
| 1149 | 1150 | ${verdict.tone === "success" && mayMerge && check.state === "ok" && !stale |
src/web/studio/change.ts +13 −5
| @@ -12,7 +12,8 @@ | ||
| 12 | 12 | import { pausedSentence } from "../../crew/paused_now.ts"; |
| 13 | 13 | import { notePhase, takeSessionTime } from "../../core/route_timing.ts"; |
| 14 | 14 | import { cardPath } from "../og/path.ts"; |
| 15 | import { pullProposalOf } from "../../core/proposal_token.ts"; | |
| 15 | import { pullProposalAt, type PullProposalAt } from "../../core/proposal_token.ts"; | |
| 16 | import { attestationLine } from "../../core/attestation.ts"; | |
| 16 | 17 | import { getIssueById } from "../../core/issues.ts"; |
| 17 | 18 | import { mayEditIssue } from "../../actions/issues.ts"; |
| 18 | 19 | import { marksByName, type Mark } from "../../core/marks.ts"; |
| @@ -252,7 +253,10 @@ export function changeHead( | ||
| 252 | 253 | ctx: Ctx, |
| 253 | 254 | repo: Repo, |
| 254 | 255 | pull: Pull, |
| 255 | live: { readonly headOid: string; readonly conflicts: number } | null = null, | |
| 256 | live: { readonly headOid: string; readonly conflicts: number } | null, | |
| 257 | // The child's proposal, if one opened this pull, read by the caller with `pullProposalAt` | |
| 258 | // (async: it reads the head's tree when the child attested one, #13645). | |
| 259 | proposal: PullProposalAt | undefined, | |
| 256 | 260 | ): Html { |
outdated
Low. changeHead now has two paths: |
||
| 257 | 261 | const next = live === null ? null : nextOfPull(ctx.app.db, pull, live, repo); |
| 258 | 262 | const step = |
| @@ -288,11 +292,14 @@ export function changeHead( | ||
| 288 | 292 | >`, |
| 289 | 293 | )} |
| 290 | 294 | ${workSpent(ctx, repo, pull, "pull")}${when( |
| 291 | pullProposalOf(ctx.app.db, pull.id), | |
| 295 | proposal, | |
| 292 | 296 | (p) => |
| 293 | 297 | html`<span class="proposed-by" |
| 294 | 298 | >proposed by child <span class="mono">${p.child}</span> from |
| 295 | <span class="mono">${p.origin}</span></span | |
| 299 | <span class="mono">${p.origin}</span>${when( | |
| 300 | p.attestation, | |
| 301 | (a) => html` · <span class="mono">${attestationLine(p.child, a, p.headTree)}</span>`, | |
| 302 | )}</span | |
| 296 | 303 | >`, |
| 297 | 304 | )} |
outdated
Low. |
||
| 298 | 305 | </div> |
| @@ -678,13 +685,14 @@ async function changeConversation( | ||
| 678 | 685 | spent.decide += performance.now() - decideAt; |
| 679 | 686 | const glyph = originGlyph(repo); |
| 680 | 687 | const headOid = status?.headOid ?? pull.headOid; |
| 688 | const proposal = await pullProposalAt(db, pull.id, wordCtx.dir, headOid); | |
| 681 | 689 | const pageHead = tick(spent, "head", () => ({ |
| 682 | 690 | top: html`${repoHeader(ctx, repo, "pulls", { |
| 683 | 691 | compact: true, |
| 684 | 692 | ownTitle: true, |
| 685 | 693 | quiet: true, |
| 686 | 694 | })} |
| 687 | ${changeHead(ctx, repo, pull, status === undefined ? null : { headOid, conflicts: status.conflicts.length })} | |
| 695 | ${changeHead(ctx, repo, pull, status === undefined ? null : { headOid, conflicts: status.conflicts.length }, proposal)} | |
| 688 | 696 | ${changeTabs(repo, pull, "change")}`, |
| 689 | 697 | crumbs: crumbsFor(repo), |
| 690 | 698 | palette: [ |
test/attestation.test.ts added +61
| @@ -0,0 +1,61 @@ | ||
| 1 | /** The words a child attests with, and the one line the pull says (#13645). */ | |
| 2 | import { expect, test } from "bun:test"; | |
| 3 | import { attestationLine, parseAttestation, verdictOfCheck } from "../src/core/attestation.ts"; | |
| 4 | ||
| 5 | test("a child's check state maps to its attested verdict", () => { | |
| 6 | expect(verdictOfCheck("ok")).toBe("green"); | |
| 7 | expect(verdictOfCheck("failed")).toBe("red"); | |
| 8 | expect(verdictOfCheck("pending")).toBe("pending"); | |
| 9 | for (const other of ["none", "superseded", "running", "", "OK"]) expect(verdictOfCheck(other)).toBe("none"); | |
| 10 | }); | |
| 11 | ||
| 12 | test("only a known verdict and a lowercase hex tree id are an attestation", () => { | |
| 13 | const tree = "1a2b3c4d".repeat(5); | |
| 14 | expect(parseAttestation(undefined)).toBeUndefined(); | |
| 15 | expect(parseAttestation({ verdict: "red", tree })).toEqual({ verdict: "red", tree }); | |
| 16 | expect(parseAttestation({ verdict: "red", tree: tree.toUpperCase() })).toBe("invalid"); | |
| 17 | expect(parseAttestation({ verdict: "ok", tree })).toBe("invalid"); | |
| 18 | expect(parseAttestation([tree])).toBe("invalid"); | |
| 19 | }); | |
| 20 | ||
| 21 | test("the line names the child, the verdict and the short tree, and says when the head differs", () => { | |
| 22 | const a = { verdict: "green" as const, tree: "1a2b3c4d".repeat(5) }; | |
| 23 | expect(attestationLine("kid", a, a.tree)).toBe("proven on kid: green at 1a2b3c4d"); | |
| 24 | expect(attestationLine("kid", a, "f".repeat(40))).toBe("proven on kid: green at 1a2b3c4d · tree differs"); | |
| 25 | expect(attestationLine("kid", a, undefined)).toBe("proven on kid: green at 1a2b3c4d · tree differs"); | |
| 26 | }); | |
| 27 | ||
| 28 | test("the preview's sample pull is proposed by a child that attests its head's own tree", async () => { | |
| 29 | const { mkdtemp, rm } = await import("node:fs/promises"); | |
| 30 | const { tmpdir } = await import("node:os"); | |
| 31 | const { join } = await import("node:path"); | |
| 32 | const { createApp } = await import("../src/app.ts"); | |
| 33 | const { seedPreview } = await import("../src/spawn/preview-seed.ts"); | |
| 34 | const { PREVIEW_PULL_PAGE } = await import("../src/spawn/preview-looks.ts"); | |
| 35 | const { pullProposalAt } = await import("../src/core/proposal_token.ts"); | |
| 36 | const { repoDir } = await import("../src/git/repos.ts"); | |
| 37 | const dir = await mkdtemp(join(tmpdir(), "forge-attest-seed-")); | |
| 38 | const app = createApp({ dataDir: dir, port: 0, previewIdentityKey: "attest-seed-key" }); | |
| 39 | try { | |
| 40 | const seeded = await seedPreview(app, { FORGE_APP_ENV: "preview" }); | |
| 41 | if (!seeded.ok) throw new Error(seeded.error); | |
| 42 | const [, owner, name, , number] = PREVIEW_PULL_PAGE.split("/"); | |
| 43 | const pull = app.db | |
| 44 | .query("SELECT p.issue_id AS id, p.head_oid AS head FROM pull p JOIN issue i ON i.id = p.issue_id WHERE i.number = ?1") | |
| 45 | .get(Number(number)) as { id: string; head: string }; | |
| 46 | const p = await pullProposalAt(app.db, pull.id, repoDir(app.reposRoot, owner!, name!), pull.head); | |
| 47 | expect(p?.attestation?.verdict).toBe("green"); | |
| 48 | expect(attestationLine(p!.child, p!.attestation!, p!.headTree)).toMatch(/^proven on kid: green at [0-9a-f]{8}$/); | |
| 49 | ||
| 50 | // A preview seeded before the attestation existed has no row: the next boot adds it. | |
| 51 | app.db.query("DELETE FROM pull_proposal WHERE issue_id = ?1").run(pull.id); | |
| 52 | const again = await seedPreview(app, { FORGE_APP_ENV: "preview" }); | |
| 53 | if (!again.ok) throw new Error(again.error); | |
| 54 | expect(again.value.seeded).toBe(false); | |
| 55 | const back = await pullProposalAt(app.db, pull.id, repoDir(app.reposRoot, owner!, name!), pull.head); | |
| 56 | expect(back?.attestation).toEqual(p!.attestation); | |
| 57 | } finally { | |
| 58 | app.close(); | |
| 59 | await rm(dir, { recursive: true, force: true }); | |
| 60 | } | |
| 61 | }, 30_000); |
test/number-retired.test.ts +5 −2
| @@ -1,4 +1,7 @@ | ||
| 1 | /** An issue's or pull's number in a heading draws from base's `.num`; `.number` left the stylesheet (#5253). */ | |
| 1 | /** | |
| 2 | * An issue's or pull's number in a heading draws from base's `.num`; `.number` left the stylesheet | |
| 3 | * (#5253). | |
| 4 | */ | |
| 2 | 5 | import { afterAll, beforeAll, expect, test } from "bun:test"; |
| 3 | 6 | import { mkdtemp, rm } from "node:fs/promises"; |
| 4 | 7 | import { tmpdir } from "node:os"; |
| @@ -74,7 +77,7 @@ test("the pull heading marks its number with .num", () => { | ||
| 74 | 77 | revertsPullId: null, |
| 75 | 78 | variantGroup: null, |
| 76 | 79 | }; |
| 77 | const head = String(changeHead({ app, auth: { user: undefined, scope: undefined, via: "none" } } as Ctx, repo, pull)); | |
| 80 | const head = String(changeHead({ app, auth: { user: undefined, scope: undefined, via: "none" } } as Ctx, repo, pull, null, undefined)); | |
| 78 | 81 | expect(head).toContain('<h1>a pull <span class="num">#2</span></h1>'); |
| 79 | 82 | expect(head).not.toContain('class="number"'); |
| 80 | 83 | }); |
test/proposal-token.test.ts +59
| @@ -302,6 +302,65 @@ describe("over HTTP", () => { | ||
| 302 | 302 | } |
| 303 | 303 | }); |
| 304 | 304 | |
| 305 | test("a proposal carries what the child proved, and the pull says when its tree differs (#13645)", async () => { | |
| 306 | // Many pushes and pulls in one test: the per-token limit is another test's subject. | |
| 307 | proposalLimiter(app).setLimits({ perMinute: 1000, adminPerMinute: 1000, enabled: true }); | |
| 308 | const tree = (await git(["rev-parse", "HEAD^{tree}"])).out.trim(); | |
| 309 | expect(tree).toMatch(/^[0-9a-f]{40}$/); | |
| 310 | const open = async (head: string, attestation: unknown) => { | |
| 311 | expect((await push(`refs/heads/${head}`)).code).toBe(0); | |
| 312 | return api("/api/v1/repos/alice/lib/pulls", { | |
| 313 | method: "POST", | |
| 314 | body: JSON.stringify({ title: `Proven ${head}`, base: "main", head, attestation }), | |
| 315 | }); | |
| 316 | }; | |
| 317 | // Refused at the boundary: not a verdict, not a hex tree id. | |
| 318 | for (const bad of [{ verdict: "green", tree: "nope" }, { verdict: "great", tree }, "green"]) { | |
| 319 | const refused = await open("child/kid/bad", bad); | |
| 320 | expect(refused.status).toBe(422); | |
| 321 | expect(((await refused.json()) as { error: string }).error).toBe("invalid_attestation"); | |
| 322 | } | |
| 323 | ||
| 324 | const same = await open("child/kid/proven", { verdict: "green", tree }); | |
| 325 | expect(same.status).toBe(201); | |
| 326 | const made = (await same.json()) as { number: number; proposal: { attestation: unknown } }; | |
| 327 | expect(made.proposal.attestation).toEqual({ verdict: "green", tree }); | |
| 328 | const page = await (await fetch(`${servers.url}/alice/lib/pulls/${made.number}`)).text(); | |
| 329 | expect(page).toContain(`proven on kid: green at ${tree.slice(0, 8)}`); | |
| 330 | expect(page).not.toContain("tree differs"); | |
| 331 | ||
| 332 | const other = "a".repeat(40); | |
| 333 | const differs = await open("child/kid/elsewhere", { verdict: "green", tree: other }); | |
| 334 | const n = ((await differs.json()) as { number: number }).number; | |
| 335 | const text = await (await fetch(`${servers.url}/alice/lib/pulls/${n}`)).text(); | |
| 336 | expect(text).toContain(`proven on kid: green at aaaaaaaa · tree differs`); | |
| 337 | // The files tab says it too: every caller of the head reads the proposal the same way. | |
| 338 | const files = await (await fetch(`${servers.url}/alice/lib/pulls/${n}/files`)).text(); | |
| 339 | expect(files).toContain(`proven on kid: green at aaaaaaaa · tree differs`); | |
| 340 | ||
| 341 | // The terminal's pull screen says the same line beside "proposed by child" (both doors). | |
| 342 | const terminal = headlessTerminal(240, 44); | |
| 343 | const { app: tui, session } = createForgeApp( | |
| 344 | app, | |
| 345 | { sshUsername: "alice", remoteAddress: "127.0.0.1", fingerprint: "SHA256:a", user: alice }, | |
| 346 | { terminal, exitHooks: false }, | |
| 347 | ); | |
| 348 | tui.start(); | |
| 349 | try { | |
| 350 | tui.ctx.push(pullScreen(session, tui.ctx, local(session, lib), made.number)); | |
| 351 | await settleApp(tui); | |
| 352 | const shown = tui.screen.toText(); | |
| 353 | expect(shown).toContain(`proposed by child kid from ${ORIGIN}`); | |
| 354 | expect(shown).toContain(`proven on kid: green at ${tree.slice(0, 8)}`); | |
| 355 | expect(shown).not.toContain("tree differs"); | |
| 356 | } finally { | |
| 357 | tui.stop(); | |
| 358 | } | |
| 359 | // Information only: the parent's own gate still holds the proposal. | |
| 360 | const pull = getPull(app.db, lib.id, n)!; | |
| 361 | expect(pullMayRun(app.db, lib, pull, pull.headOid)).toBe(false); | |
| 362 | }); | |
| 363 | ||
| 305 | 364 | test("a proposed pull runs nothing until a writer approves that exact head", async () => { |
| 306 | 365 | const pull = getPull(app.db, lib.id, proposedNumber)!; |
| 307 | 366 | const head = pull.headOid; |
test/upstream-forge.test.ts +28 −1
| @@ -17,8 +17,9 @@ import { | ||
| 17 | 17 | STATE_TTL_MS, |
| 18 | 18 | } from "../src/actions/upstream.ts"; |
| 19 | 19 | import { createApp, type App } from "../src/app.ts"; |
| 20 | import { mintProposalToken } from "../src/core/proposal_token.ts"; | |
| 20 | import { mintProposalToken, pullProposalOf } from "../src/core/proposal_token.ts"; | |
| 21 | 21 | import { getPull } from "../src/core/pulls.ts"; |
| 22 | import { claimRun, createRun, finishRun } from "../src/core/runs.ts"; | |
| 22 | 23 | import { getRepo, type Repo } from "../src/core/repos.ts"; |
| 23 | 24 | import { createSession } from "../src/core/sessions.ts"; |
| 24 | 25 | import { createToken } from "../src/core/tokens.ts"; |
| @@ -174,6 +175,11 @@ describe("a child forge proposes to its parent forge", () => { | ||
| 174 | 175 | expect(pull.headBranch).toBe(`child/kid/${made.value.branch}`); |
| 175 | 176 | expect(pull.body).toContain(`kid/forge#${landed.number}`); |
| 176 | 177 | expect(pull.body).toContain("Proposed by child kid"); |
| 178 | // It carries what the child proved: its check's word on the tip (none ran here) and the | |
| 179 | // tip's tree, which is the pull's own head tree on the parent (#13645). | |
| 180 | const tip = (await runGit(["rev-parse", "refs/heads/main^{tree}"], { cwd: repoDir(child.reposRoot, "kid", "forge") })); | |
outdated
Medium. This only asserts verdict 'none'. Add a case where the child's check on the tip is ok and the parent stores 'green'. Without it, the child's side could send a constant and this test would pass. |
||
| 181 | if (!tip.ok) throw new Error("no tree"); | |
| 182 | expect(pullProposalOf(parent.db, pull.id)?.attestation).toEqual({ verdict: "none", tree: tip.value.trim() }); | |
| 177 | 183 | |
| 178 | 184 | // Asking again for the same tip does not double it. |
| 179 | 185 | const again = await proposeToParentForge(child, kid, forge); |
| @@ -385,6 +391,27 @@ describe("a child forge proposes to its parent forge", () => { | ||
| 385 | 391 | } |
| 386 | 392 | }); |
| 387 | 393 | |
| 394 | test("the child's green check on the tip reaches the parent as green (#13645)", async () => { | |
| 395 | await land("proven", "Add proven"); | |
| 396 | const dir = repoDir(child.reposRoot, "kid", "forge"); | |
| 397 | const tip = await runGit(["rev-parse", "refs/heads/main"], { cwd: dir }); | |
| 398 | const tree = await runGit(["rev-parse", "refs/heads/main^{tree}"], { cwd: dir }); | |
| 399 | if (!tip.ok || !tree.ok) throw new Error("no tip"); | |
| 400 | // The child's own check of its main at this tip, and an older failed one on another commit | |
| 401 | // that must not be the one sent. | |
| 402 | const older = createRun(child.db, { repoId: forge.id, kind: "check", env: "main", commitOid: "b".repeat(40) }); | |
| 403 | claimRun(child.db, older.id); | |
| 404 | finishRun(child.db, older.id, { state: "failed", summary: "red" }); | |
| 405 | const run = createRun(child.db, { repoId: forge.id, kind: "check", env: "main", commitOid: tip.value.trim() }); | |
| 406 | claimRun(child.db, run.id); | |
| 407 | finishRun(child.db, run.id, { state: "ok", summary: "all green" }); | |
| 408 | ||
| 409 | const made = await proposeToParentForge(child, kid, forge); | |
| 410 | if (!made.ok) throw new Error(JSON.stringify(made.error)); | |
| 411 | const pull = parentPull(made.value.number); | |
| 412 | expect(pullProposalOf(parent.db, pull.id)?.attestation).toEqual({ verdict: "green", tree: tree.value.trim() }); | |
| 413 | }); | |
| 414 | ||
| 388 | 415 | test("an unreachable parent degrades to one line, not an error page", async () => { |
| 389 | 416 | await land("second", "Add second"); |
| 390 | 417 | const made = await proposeToParentForge(child, kid, forge); |
Medium. Both doors: the terminal's pull screen should show this line. A 'Not yet' gap fails the both-doors rule. Add it under src/tui/ with the pull screen's entry as AGENTS.md says.