Merge build/1109 into main
Before adoption: this commit came in with the history the project adopted, so no landing records it.
authored by oscabriel · committed by oscabriel · parents 0ac60f3, 674e39b · Browse files · 2 files·+60 added−4 removed
This commit
State
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Diff stats
2 files+60 added−4 removed
- tests:+46 added−1 removed
- other:+14 added−3 removed
Provenance
- Commit
1a26053- Tree
37f9795- Author
oscabriel <oscarhernandeziv@gmail.com>- Committer
oscabriel <oscarhernandeziv@gmail.com>- Parent 1
0ac60f3- Parent 2
674e39b
2 files changed+60 added−4 removed
modified:apps/web/src/features/answer/answer-page.tsx+14 added-3 removed
2 unmodified lines3 * was judged (head, base, merged tree, patch id, check version, when), the4 * gate's stages in a strip with the outcome under it (a refusal reads as5 * `git push` printed it), each lane's result and time, the held-back checks6 * as one line per area, and, once it landed, the landing's credit trailers7- * and its commit.7+ * and its commit. The base and the landing link their commit pages; the8+ * head and the merged tree stay plain, since they live in the claim's fork,9+ * which the code browser never reads (ADR 0019).10 *11 * Held-back checks show only what `HeldBackResult` carries: an area, how12 * many passed of how many, and the suite's root. A lane's log is13 * never shown here; a refusal that needs it names it, with the command26 unmodified lines40 TableRow,41 } from "../../components/ui/table.tsx";42 import { askPath } from "../ask/ask-page.tsx";43 import { CODE, Field, Fields, LINK, Region } from "../ask/fields.tsx";44+import { commitHref } from "../code/paths.ts";45 import { CommandLine } from "../shared/command.tsx";46 import { CreditTrailers } from "../shared/credits.tsx";47 import { EmptyState } from "../shared/empty.tsx";48 import { OutcomeView, StageStrip } from "../shared/outcome.tsx";150 unmodified lines199 <Field label="Head">200 <Sha sha={verdict.head} />201 </Field>202 <Field label="Base">203+ <a className={LINK} href={commitHref(verdict.project, verdict.base)}>200- <Sha sha={verdict.base} />204+ <Sha sha={verdict.base} />205+ </a>206 </Field>207 <Field label="Merged tree">208 <Sha sha={verdict.tree} />209 </Field>32 unmodified lines242 {...(landing.heldBackTrailer === undefined243 ? {}244 : { heldBack: landing.heldBackTrailer })}245 />246+ <a247+ className={`${LINK} self-start text-sm font-medium`}248+ href={commitHref(landing.project, landing.sha)}249+ >250+ The landing commit251+ </a>252 <div className="flex min-w-0 flex-col gap-1.5">253 <span className="text-muted-foreground text-xs font-medium">243- The landing commit, in a clone of {landing.project}254+ In a clone of {landing.project}255 </span>256 <CommandLine command={`git show ${landing.sha}`} />257 </div>258 </Region>4 unmodified linesmodified:apps/web/test/answer.test.tsx+46 added-1 removed
1 unmodified line2 * The answer page: the latest verdict on an ask's answer, stage by stage.3 * The gate's stages in a strip, each lane's result and time, held-back4 * checks only as one line per area (its counts and suite root, nothing5 * more), the outcome, and a refusal as `git push` printed it. A landed6- * answer shows its landing's credit trailers and the commit.6+ * answer shows its landing's credit trailers and the commit. The base and7+ * the landing link their commit pages; the head and the merged tree, which8+ * live in the claim's fork, do not.9 */10 import { describe, expect, it } from "@effect/vitest";11 import { Brand } from "@repo/brand";12 import { Client, Contracts } from "@repo/protocol/contracts";61 unmodified lines74 75 return lane === undefined || result === undefined ? [] : [[lane, result]];76 });77 78+/** Each link to a commit page, in page order, as `[href, text]`. */79+const commitLinksOf = (markup: string) =>80+ [81+ ...markup.matchAll(82+ /<a\b[^>]*href="(?<href>[^"]*\/commit\/[^"]*)"[^>]*>(?<inner>.*?)<\/a>/gu83+ ),84+ ].flatMap(({ groups }) =>85+ groups?.href === undefined || groups.inner === undefined86+ ? []87+ : [[groups.href, plainText(groups.inner).trim()]]88+ );89+90 describe(AnswerView, () => {91 const page = <AnswerView now={now} verdict={refused} />;92 93 it("shows the stages the answer passed, the one that refused it, and the ones it never reached", () => {72 unmodified lines166 expect(text).toContain(`Held-back: export 7/7 @ ${suite}`);167 expect(text).toContain("Assisted-by: claude-code:opus-5 (verified)");168 expect(text).toContain(`git show ${landedSha}`);169 });170+171+ it("links a landed answer's landing and its base to their commit pages, and keeps the git show command", () => {172+ const landed = verdictOf(Outcome.cases.Landed.make({ sha: landedSha }));173+174+ const markup = markupOf(175+ <AnswerView landing={landing} now={now} verdict={landed} />176+ );177+178+ expect(commitLinksOf(markup)).toStrictEqual([179+ [`/${project}/commit/${landed.base}`, landed.base.slice(0, 7)],180+ [`/${project}/commit/${landedSha}`, "The landing commit"],181+ ]);182+ expect(markup).toContain(`git show ${landedSha}`);183+ });184+185+ it("links neither the head nor the merged tree: they live in the claim's fork", () => {186+ const landed = verdictOf(Outcome.cases.Landed.make({ sha: landedSha }));187+188+ const markup = markupOf(189+ <AnswerView landing={landing} now={now} verdict={landed} />190+ );191+192+ expect(markup).not.toContain(`/commit/${landed.head}`);193+ expect(markup).not.toContain(`/commit/${landed.tree}`);194+ });195+196+ it("links the base and no landing when the answer has not landed", () => {197+ expect(commitLinksOf(markupOf(page))).toStrictEqual([198+ [`/${project}/commit/${refused.base}`, refused.base.slice(0, 7)],199+ ]);200+ });201 });202 203 describe(LaneTable, () => {204 it("gives each lane's command and how long it ran", () => {176 unmodified lines