Skip to content
Myr

Give the web one shell and one look: shared views for refusals, credit trailers, posture, outcomes and stages, on shadcn base-lyra tokens, with PRODUCT.md and DESIGN.md

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

W5 foundation B (issue 511). Every view issue in group A imports these files and edits none of them. - apps/web/src/features/shared/ (views only, props are protocol types): RefusalView (each refusal's `explain` lines verbatim, its tag in the rubric colour, then its `next` as a CommandLine; `headline` heads the block; retryable picks the mark, never the words), CreditTrailers (credit in CreditRole's literal order, each handle linking to /people/<handle>; a `Held-back:` line; `Assisted-by:` apart under "Agents used, disclosed and not credit", spelled as @repo/git's trailer is: `pi:opus-4 (claimed)`), PostureBadge (the given label, `data-posture`), HandleLink, OutcomeView (a sentence per Outcome tag with `data-outcome` and `data-state` waiting|final; Refused delegates to RefusalView), StageStrip (seven cells, `data-stage` and `data-state` passed|current|refused|pending|skipped; `stageStates` exported), When ("in 3 h", "2 d ago", "now"; `now` is a prop), CommandLine (copy through Effect, no timers), PageShell, EmptyState, plus SiteHeader/SiteFooter/pageTitle (layout.tsx) and themeColors (theme.ts, for the theme-color meta and 505's manifest). - __root.tsx: the shell. Header (name, Asks, Today, `<SessionSlot />`), each page's own <main> from PageShell, footer with "Plain git: clone any project" and the CLI install line; head with the stylesheet, `color-scheme`, a theme-color per scheme, the manifest link 505 serves, and the title from Brand.name; TooltipProvider. The platform URL comes from a server function the root loader calls once (`staleTime: Infinity`); pages read it as `getRouteApi("__root__").useLoaderData().platformUrl`. The client build carries no `cloudflare:workers` and no env (checked in dist/client). - features/auth/session-slot.tsx: the placeholder "Sign in" link to /auth/signin; 513 owns it from here. - Tokens (src/styles.css, Tailwind 4 `@theme inline`): roles --landed, --checking, --waiting, --refused, --sealed, --muted, plus paper, ink, surface and hairline, light and dark, each role at least 5:1 on paper and surface in both themes; a fixed type scale (ratio about 1.2); 2 px radius; one motion moment (a landing's stamp settles once) and reduced motion honoured. Dark follows `prefers-color-scheme` (shadcn's `dark:` variant is the media query): no toggle, no script, no flash. Public Sans and JetBrains Mono self-hosted (latin, latin-ext woff2, OFL; licences in LICENSES/). - shadcn: components.json (style base-lyra, lucide, aliases `@/components/ui`, `@/lib`), generated with the pinned shadcn 4.21.2 CLI: button, badge, card, table, tabs, tooltip, separator, skeleton, alert, dialog, textarea, dropdown-menu. The `@/` alias is tsconfig `paths` plus Vite's `resolve.tsconfigPaths` (in vite.config.ts and vitest.config.ts). The 4.21 registry imports `cn` from the `cn` package (shadcn's clsx + tailwind-merge replacement), so the dependencies are `cn` 0.4.0 and `class-variance-authority` 0.7.1, both outside spec §7.2 (pre-approved for this build; listed in the issue's Comments for the integrator). `tw-animate-css` is not added: dialogs and menus open without enter/exit animation, as DESIGN.md's minimal motion wants. - PRODUCT.md and DESIGN.md at the root, written with the impeccable skill loaded: PRODUCT.md (who the web is for, jobs per page, what it never does, tone) and DESIGN.md (the "Test Certificate" world: tokens and roles, type, layout, how refusals, waiting states and credits look, motion, accessibility, do's and don'ts), in GLOSSARY.md's words. The skill's direction round could not reach the user (the decision page went unanswered); its assigned direction was built and its PRODUCT.md facts are marked ASSUMPTION where inferred. - Tests (apps/web/test/shared.test.tsx, 30, rendered with react-dom/server's renderToStaticMarkup), written against empty-bodied placeholders first and red by assertion (25 of 25 failed on expect): RefusalView (every explain line in order, each tag, then each next command starting with Brand.cli; `path:line`; retryable as data); CreditTrailers (Asked-by before Signed-off-by; links; Assisted-by only after the "not credit" label; model spelling; Held-back line; no agents list when none); PostureBadge; HandleLink; OutcomeView (four waiting tags, Landed final with its short sha, Refused through RefusalView); StageStrip (checking at checks, refused at shape, landed with later stages not needed); When; CommandLine; EmptyState; PageShell; the shell (current page marked, footer's two lines); theme colours equal styles.css's paper; and a fence: no file in features/shared imports a transport (@repo/protocol/contracts, effect/rpc|http|reactivity, #backend, surfaces, client/, server/), shown failing by a planted surfaces import. - Checked by hand: a throwaway preview route (not committed) under `vite dev`, captured with Playwright at 360 and 1280 px in light and dark: no horizontal scroll at 360 px, both fonts loaded; impeccable's detector found nothing. - verify green (web 37 tests, config 770; debt at baseline; brand:check clean; web entry 717,684 of 1,665,000, JavaScript 1,175,500 of 2,500,000). - ASSUMPTION: the footer's install line uses the platform's URL (issue 420 serves /install.sh there today); 505 may switch it to the web's origin once the web forwards /install.sh.

authored by oscabriel · committed by oscabriel · parent 7f84530 · Browse files · 40 files+3037 added−8 removed
This commit

State

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

Diff stats

40 files+3037 added−8 removed

  • tests:+448 added−0 removed
  • other:+2589 added−8 removed

40 files+3037 added−8 removed

added:apps/web/src/assets/fonts/jetbrains-mono-latin-ext.woff2binary

A binary file, added.

added:apps/web/src/assets/fonts/jetbrains-mono-latin.woff2binary

A binary file, added.

added:apps/web/src/assets/fonts/public-sans-latin-ext.woff2binary

A binary file, added.

added:apps/web/src/assets/fonts/public-sans-latin.woff2binary

A binary file, added.

added:apps/web/src/components/ui/alert.tsx+78 added
added:apps/web/src/components/ui/badge.tsx+51 added
added:apps/web/src/components/ui/button.tsx+55 added
added:apps/web/src/components/ui/card.tsx+102 added
1import { cn } from "cn";2import * as React from "react";34function Card({5 className,6 size = "default",7 ...props8}: React.ComponentProps<"div"> & { size?: "default" | "sm" }) {9 return (10 <div11 data-slot="card"12 data-size={size}13 className={cn(14 "group/card bg-card text-card-foreground ring-foreground/10 flex flex-col gap-(--card-spacing) overflow-hidden rounded-none py-(--card-spacing) text-xs/relaxed ring-1 [--card-spacing:--spacing(4)] has-data-[slot=card-footer]:pb-0 has-[>img:first-child]:pt-0 data-[size=sm]:[--card-spacing:--spacing(3)] data-[size=sm]:has-data-[slot=card-footer]:pb-0 *:[img:first-child]:rounded-none *:[img:last-child]:rounded-none",15 className16 )}17 {...props}18 />19 );20}2122function CardHeader({ className, ...props }: React.ComponentProps<"div">) {23 return (24 <div25 data-slot="card-header"26 className={cn(27 "group/card-header @container/card-header grid auto-rows-min items-start gap-1 rounded-none px-(--card-spacing) has-data-[slot=card-action]:grid-cols-[1fr_auto] has-data-[slot=card-description]:grid-rows-[auto_auto] [.border-b]:pb-(--card-spacing)",28 className29 )}30 {...props}31 />32 );33}3435function CardTitle({ className, ...props }: React.ComponentProps<"div">) {36 return (37 <div38 data-slot="card-title"39 className={cn(40 "text-sm font-medium group-data-[size=sm]/card:text-sm",41 className42 )}43 {...props}44 />45 );46}4748function CardDescription({ className, ...props }: React.ComponentProps<"div">) {49 return (50 <div51 data-slot="card-description"52 className={cn("text-muted-foreground text-xs/relaxed", className)}53 {...props}54 />55 );56}5758function CardAction({ className, ...props }: React.ComponentProps<"div">) {59 return (60 <div61 data-slot="card-action"62 className={cn(63 "col-start-2 row-span-2 row-start-1 self-start justify-self-end",64 className65 )}66 {...props}67 />68 );69}7071function CardContent({ className, ...props }: React.ComponentProps<"div">) {72 return (73 <div74 data-slot="card-content"75 className={cn("px-(--card-spacing)", className)}76 {...props}77 />78 );79}8081function CardFooter({ className, ...props }: React.ComponentProps<"div">) {82 return (83 <div84 data-slot="card-footer"85 className={cn(86 "flex items-center rounded-none border-t p-(--card-spacing)",87 className88 )}89 {...props}90 />91 );92}9394export {95 Card,96 CardHeader,97 CardFooter,98 CardTitle,99 CardAction,100 CardDescription,101 CardContent,102};
added:apps/web/src/components/ui/dialog.tsx+156 added
1"use client";23import { Dialog as DialogPrimitive } from "@base-ui/react/dialog";4import { cn } from "cn";5import { XIcon } from "lucide-react";6import * as React from "react";78import { Button } from "@/components/ui/button";910function Dialog({ ...props }: DialogPrimitive.Root.Props) {11 return <DialogPrimitive.Root data-slot="dialog" {...props} />;12}1314function DialogTrigger({ ...props }: DialogPrimitive.Trigger.Props) {15 return <DialogPrimitive.Trigger data-slot="dialog-trigger" {...props} />;16}1718function DialogPortal({ ...props }: DialogPrimitive.Portal.Props) {19 return <DialogPrimitive.Portal data-slot="dialog-portal" {...props} />;20}2122function DialogClose({ ...props }: DialogPrimitive.Close.Props) {23 return <DialogPrimitive.Close data-slot="dialog-close" {...props} />;24}2526function DialogOverlay({27 className,28 ...props29}: DialogPrimitive.Backdrop.Props) {30 return (31 <DialogPrimitive.Backdrop32 data-slot="dialog-overlay"33 className={cn(34 "data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0 fixed inset-0 isolate z-50 bg-black/10 duration-100 supports-backdrop-filter:backdrop-blur-xs",35 className36 )}37 {...props}38 />39 );40}4142function DialogContent({43 className,44 children,45 showCloseButton = true,46 ...props47}: DialogPrimitive.Popup.Props & {48 showCloseButton?: boolean;49}) {50 return (51 <DialogPortal>52 <DialogOverlay />53 <DialogPrimitive.Popup54 data-slot="dialog-content"55 className={cn(56 "bg-popover text-popover-foreground ring-foreground/10 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95 fixed top-1/2 left-1/2 z-50 grid w-full max-w-[calc(100%-2rem)] -translate-x-1/2 -translate-y-1/2 gap-4 rounded-none p-4 text-xs/relaxed ring-1 duration-100 outline-none sm:max-w-sm",57 className58 )}59 {...props}60 >61 {children}62 {showCloseButton && (63 <DialogPrimitive.Close64 data-slot="dialog-close"65 render={66 <Button67 variant="ghost"68 className="absolute top-2 right-2"69 size="icon-sm"70 />71 }72 >73 <XIcon />74 <span className="sr-only">Close</span>75 </DialogPrimitive.Close>76 )}77 </DialogPrimitive.Popup>78 </DialogPortal>79 );80}8182function DialogHeader({ className, ...props }: React.ComponentProps<"div">) {83 return (84 <div85 data-slot="dialog-header"86 className={cn("flex flex-col gap-1 text-left", className)}87 {...props}88 />89 );90}9192function DialogFooter({93 className,94 showCloseButton = false,95 children,96 ...props97}: React.ComponentProps<"div"> & {98 showCloseButton?: boolean;99}) {100 return (101 <div102 data-slot="dialog-footer"103 className={cn(104 "flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",105 className106 )}107 {...props}108 >109 {children}110 {showCloseButton && (111 <DialogPrimitive.Close render={<Button variant="outline" />}>112 Close113 </DialogPrimitive.Close>114 )}115 </div>116 );117}118119function DialogTitle({ className, ...props }: DialogPrimitive.Title.Props) {120 return (121 <DialogPrimitive.Title122 data-slot="dialog-title"123 className={cn("text-sm font-medium", className)}124 {...props}125 />126 );127}128129function DialogDescription({130 className,131 ...props132}: DialogPrimitive.Description.Props) {133 return (134 <DialogPrimitive.Description135 data-slot="dialog-description"136 className={cn(137 "text-muted-foreground *:[a]:hover:text-foreground text-xs/relaxed *:[a]:underline *:[a]:underline-offset-3",138 className139 )}140 {...props}141 />142 );143}144145export {146 Dialog,147 DialogClose,148 DialogContent,149 DialogDescription,150 DialogFooter,151 DialogHeader,152 DialogOverlay,153 DialogPortal,154 DialogTitle,155 DialogTrigger,156};
added:apps/web/src/components/ui/dropdown-menu.tsx+269 added
1import { Menu as MenuPrimitive } from "@base-ui/react/menu";2import { cn } from "cn";3import { ChevronRightIcon, CheckIcon } from "lucide-react";4import * as React from "react";56function DropdownMenu({ ...props }: MenuPrimitive.Root.Props) {7 return <MenuPrimitive.Root data-slot="dropdown-menu" {...props} />;8}910function DropdownMenuPortal({ ...props }: MenuPrimitive.Portal.Props) {11 return <MenuPrimitive.Portal data-slot="dropdown-menu-portal" {...props} />;12}1314function DropdownMenuTrigger({ ...props }: MenuPrimitive.Trigger.Props) {15 return <MenuPrimitive.Trigger data-slot="dropdown-menu-trigger" {...props} />;16}1718function DropdownMenuContent({19 align = "start",20 alignOffset = 0,21 side = "bottom",22 sideOffset = 4,23 className,24 ...props25}: MenuPrimitive.Popup.Props &26 Pick<27 MenuPrimitive.Positioner.Props,28 "align" | "alignOffset" | "side" | "sideOffset"29 >) {30 return (31 <MenuPrimitive.Portal>32 <MenuPrimitive.Positioner33 className="isolate z-50 outline-none"34 align={align}35 alignOffset={alignOffset}36 side={side}37 sideOffset={sideOffset}38 >39 <MenuPrimitive.Popup40 data-slot="dropdown-menu-content"41 className={cn(42 "bg-popover text-popover-foreground ring-foreground/10 data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95 z-50 max-h-(--available-height) w-(--anchor-width) min-w-32 origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-none shadow-md ring-1 duration-100 outline-none data-closed:overflow-hidden",43 className44 )}45 {...props}46 />47 </MenuPrimitive.Positioner>48 </MenuPrimitive.Portal>49 );50}5152function DropdownMenuGroup({ ...props }: MenuPrimitive.Group.Props) {53 return <MenuPrimitive.Group data-slot="dropdown-menu-group" {...props} />;54}5556function DropdownMenuLabel({57 className,58 inset,59 ...props60}: MenuPrimitive.GroupLabel.Props & {61 inset?: boolean;62}) {63 return (64 <MenuPrimitive.GroupLabel65 data-slot="dropdown-menu-label"66 data-inset={inset}67 className={cn(68 "text-muted-foreground px-2 py-2 text-xs data-inset:pl-7",69 className70 )}71 {...props}72 />73 );74}7576function DropdownMenuItem({77 className,78 inset,79 variant = "default",80 ...props81}: MenuPrimitive.Item.Props & {82 inset?: boolean;83 variant?: "default" | "destructive";84}) {85 return (86 <MenuPrimitive.Item87 data-slot="dropdown-menu-item"88 data-inset={inset}89 data-variant={variant}90 className={cn(91 "group/dropdown-menu-item focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:*:[svg]:text-destructive relative flex cursor-default items-center gap-2 rounded-none px-2 py-2 text-xs outline-hidden select-none data-disabled:pointer-events-none data-disabled:opacity-50 data-inset:pl-7 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",92 className93 )}94 {...props}95 />96 );97}9899function DropdownMenuSub({ ...props }: MenuPrimitive.SubmenuRoot.Props) {100 return <MenuPrimitive.SubmenuRoot data-slot="dropdown-menu-sub" {...props} />;101}102103function DropdownMenuSubTrigger({104 className,105 inset,106 children,107 ...props108}: MenuPrimitive.SubmenuTrigger.Props & {109 inset?: boolean;110}) {111 return (112 <MenuPrimitive.SubmenuTrigger113 data-slot="dropdown-menu-sub-trigger"114 data-inset={inset}115 className={cn(116 "focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-popup-open:bg-accent data-popup-open:text-accent-foreground data-open:bg-accent data-open:text-accent-foreground flex cursor-default items-center gap-2 rounded-none px-2 py-2 text-xs outline-hidden select-none data-inset:pl-7 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",117 className118 )}119 {...props}120 >121 {children}122 <ChevronRightIcon className="ml-auto" />123 </MenuPrimitive.SubmenuTrigger>124 );125}126127function DropdownMenuSubContent({128 align = "start",129 alignOffset = -3,130 side = "right",131 sideOffset = 0,132 className,133 ...props134}: React.ComponentProps<typeof DropdownMenuContent>) {135 return (136 <DropdownMenuContent137 data-slot="dropdown-menu-sub-content"138 className={cn(139 "bg-popover text-popover-foreground ring-foreground/10 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95 w-auto min-w-[96px] rounded-none shadow-lg ring-1 duration-100",140 className141 )}142 align={align}143 alignOffset={alignOffset}144 side={side}145 sideOffset={sideOffset}146 {...props}147 />148 );149}150151function DropdownMenuCheckboxItem({152 className,153 children,154 checked,155 inset,156 ...props157}: MenuPrimitive.CheckboxItem.Props & {158 inset?: boolean;159}) {160 return (161 <MenuPrimitive.CheckboxItem162 data-slot="dropdown-menu-checkbox-item"163 data-inset={inset}164 className={cn(165 "focus:bg-accent focus:text-accent-foreground focus:**:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-none py-2 pr-8 pl-2 text-xs outline-hidden select-none data-disabled:pointer-events-none data-disabled:opacity-50 data-inset:pl-7 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",166 className167 )}168 checked={checked}169 {...props}170 >171 <span172 className="pointer-events-none absolute right-2 flex items-center justify-center"173 data-slot="dropdown-menu-checkbox-item-indicator"174 >175 <MenuPrimitive.CheckboxItemIndicator>176 <CheckIcon />177 </MenuPrimitive.CheckboxItemIndicator>178 </span>179 {children}180 </MenuPrimitive.CheckboxItem>181 );182}183184function DropdownMenuRadioGroup({ ...props }: MenuPrimitive.RadioGroup.Props) {185 return (186 <MenuPrimitive.RadioGroup187 data-slot="dropdown-menu-radio-group"188 {...props}189 />190 );191}192193function DropdownMenuRadioItem({194 className,195 children,196 inset,197 ...props198}: MenuPrimitive.RadioItem.Props & {199 inset?: boolean;200}) {201 return (202 <MenuPrimitive.RadioItem203 data-slot="dropdown-menu-radio-item"204 data-inset={inset}205 className={cn(206 "focus:bg-accent focus:text-accent-foreground focus:**:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-none py-2 pr-8 pl-2 text-xs outline-hidden select-none data-disabled:pointer-events-none data-disabled:opacity-50 data-inset:pl-7 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",207 className208 )}209 {...props}210 >211 <span212 className="pointer-events-none absolute right-2 flex items-center justify-center"213 data-slot="dropdown-menu-radio-item-indicator"214 >215 <MenuPrimitive.RadioItemIndicator>216 <CheckIcon />217 </MenuPrimitive.RadioItemIndicator>218 </span>219 {children}220 </MenuPrimitive.RadioItem>221 );222}223224function DropdownMenuSeparator({225 className,226 ...props227}: MenuPrimitive.Separator.Props) {228 return (229 <MenuPrimitive.Separator230 data-slot="dropdown-menu-separator"231 className={cn("bg-border -mx-1 h-px", className)}232 {...props}233 />234 );235}236237function DropdownMenuShortcut({238 className,239 ...props240}: React.ComponentProps<"span">) {241 return (242 <span243 data-slot="dropdown-menu-shortcut"244 className={cn(245 "text-muted-foreground group-focus/dropdown-menu-item:text-accent-foreground ml-auto text-xs tracking-widest",246 className247 )}248 {...props}249 />250 );251}252253export {254 DropdownMenu,255 DropdownMenuPortal,256 DropdownMenuTrigger,257 DropdownMenuContent,258 DropdownMenuGroup,259 DropdownMenuLabel,260 DropdownMenuItem,261 DropdownMenuCheckboxItem,262 DropdownMenuRadioGroup,263 DropdownMenuRadioItem,264 DropdownMenuSeparator,265 DropdownMenuShortcut,266 DropdownMenuSub,267 DropdownMenuSubTrigger,268 DropdownMenuSubContent,269};
added:apps/web/src/components/ui/separator.tsx+24 added
added:apps/web/src/components/ui/skeleton.tsx+13 added
added:apps/web/src/components/ui/table.tsx+113 added
1import { cn } from "cn";2import * as React from "react";34function Table({ className, ...props }: React.ComponentProps<"table">) {5 return (6 <div7 data-slot="table-container"8 className="relative w-full overflow-x-auto"9 >10 <table11 data-slot="table"12 className={cn("w-full caption-bottom text-xs", className)}13 {...props}14 />15 </div>16 );17}1819function TableHeader({ className, ...props }: React.ComponentProps<"thead">) {20 return (21 <thead22 data-slot="table-header"23 className={cn("[&_tr]:border-b", className)}24 {...props}25 />26 );27}2829function TableBody({ className, ...props }: React.ComponentProps<"tbody">) {30 return (31 <tbody32 data-slot="table-body"33 className={cn("[&_tr:last-child]:border-0", className)}34 {...props}35 />36 );37}3839function TableFooter({ className, ...props }: React.ComponentProps<"tfoot">) {40 return (41 <tfoot42 data-slot="table-footer"43 className={cn(44 "bg-muted/50 border-t font-medium [&>tr]:last:border-b-0",45 className46 )}47 {...props}48 />49 );50}5152function TableRow({ className, ...props }: React.ComponentProps<"tr">) {53 return (54 <tr55 data-slot="table-row"56 className={cn(57 "hover:bg-muted/50 has-aria-expanded:bg-muted/50 data-[state=selected]:bg-muted border-b transition-colors",58 className59 )}60 {...props}61 />62 );63}6465function TableHead({ className, ...props }: React.ComponentProps<"th">) {66 return (67 <th68 data-slot="table-head"69 className={cn(70 "text-foreground h-10 px-2 text-left align-middle font-medium whitespace-nowrap [&:has([role=checkbox])]:pr-0",71 className72 )}73 {...props}74 />75 );76}7778function TableCell({ className, ...props }: React.ComponentProps<"td">) {79 return (80 <td81 data-slot="table-cell"82 className={cn(83 "p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0",84 className85 )}86 {...props}87 />88 );89}9091function TableCaption({92 className,93 ...props94}: React.ComponentProps<"caption">) {95 return (96 <caption97 data-slot="table-caption"98 className={cn("text-muted-foreground mt-4 text-xs", className)}99 {...props}100 />101 );102}103104export {105 Table,106 TableHeader,107 TableBody,108 TableFooter,109 TableHead,110 TableRow,111 TableCell,112 TableCaption,113};
added:apps/web/src/components/ui/tabs.tsx+81 added
1"use client";23import { Tabs as TabsPrimitive } from "@base-ui/react/tabs";4import { cva, type VariantProps } from "class-variance-authority";5import { cn } from "cn";67function Tabs({8 className,9 orientation = "horizontal",10 ...props11}: TabsPrimitive.Root.Props) {12 return (13 <TabsPrimitive.Root14 data-slot="tabs"15 data-orientation={orientation}16 className={cn(17 "group/tabs flex gap-2 data-horizontal:flex-col",18 className19 )}20 {...props}21 />22 );23}2425const tabsListVariants = cva(26 "group/tabs-list text-muted-foreground inline-flex w-fit items-center justify-center rounded-none p-[3px] group-data-horizontal/tabs:h-8 group-data-vertical/tabs:h-fit group-data-vertical/tabs:flex-col data-[variant=line]:rounded-none",27 {28 variants: {29 variant: {30 default: "bg-muted",31 line: "gap-1 bg-transparent",32 },33 },34 defaultVariants: {35 variant: "default",36 },37 }38);3940function TabsList({41 className,42 variant = "default",43 ...props44}: TabsPrimitive.List.Props & VariantProps<typeof tabsListVariants>) {45 return (46 <TabsPrimitive.List47 data-slot="tabs-list"48 data-variant={variant}49 className={cn(tabsListVariants({ variant }), className)}50 {...props}51 />52 );53}5455function TabsTrigger({ className, ...props }: TabsPrimitive.Tab.Props) {56 return (57 <TabsPrimitive.Tab58 data-slot="tabs-trigger"59 className={cn(60 "text-foreground/60 hover:text-foreground focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:outline-ring dark:text-muted-foreground dark:hover:text-foreground relative inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-none border border-transparent px-1.5 py-0.5 text-xs font-medium whitespace-nowrap transition-all group-data-vertical/tabs:w-full group-data-vertical/tabs:justify-start group-data-vertical/tabs:py-[calc(--spacing(1.25))] focus-visible:ring-[3px] focus-visible:outline-1 disabled:pointer-events-none disabled:opacity-50 has-data-[icon=inline-end]:pr-1 has-data-[icon=inline-start]:pl-1 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",61 "group-data-[variant=line]/tabs-list:bg-transparent group-data-[variant=line]/tabs-list:data-active:bg-transparent dark:group-data-[variant=line]/tabs-list:data-active:border-transparent dark:group-data-[variant=line]/tabs-list:data-active:bg-transparent",62 "data-active:bg-background data-active:text-foreground dark:data-active:border-input dark:data-active:bg-input/30 dark:data-active:text-foreground",63 "after:bg-foreground after:absolute after:opacity-0 after:transition-opacity group-data-horizontal/tabs:after:inset-x-0 group-data-horizontal/tabs:after:bottom-[-5px] group-data-horizontal/tabs:after:h-0.5 group-data-vertical/tabs:after:inset-y-0 group-data-vertical/tabs:after:-right-1 group-data-vertical/tabs:after:w-0.5 group-data-[variant=line]/tabs-list:data-active:after:opacity-100",64 className65 )}66 {...props}67 />68 );69}7071function TabsContent({ className, ...props }: TabsPrimitive.Panel.Props) {72 return (73 <TabsPrimitive.Panel74 data-slot="tabs-content"75 className={cn("flex-1 text-xs/relaxed outline-none", className)}76 {...props}77 />78 );79}8081export { Tabs, TabsList, TabsTrigger, TabsContent, tabsListVariants };
added:apps/web/src/components/ui/textarea.tsx+17 added
added:apps/web/src/components/ui/tooltip.tsx+63 added
added:apps/web/src/features/auth/session-slot.tsx+13 added
added:apps/web/src/features/shared/command.tsx+57 added
1/**2 * A shell line a reader runs next: a refusal's `next`, a clone URL, the3 * install line. The terminal is where work happens, so every page that4 * suggests an action shows its command, whole and copyable, never a form.5 */6import { Effect } from "effect";7import { Check, Copy } from "lucide-react";8import { useState } from "react";910import { Button } from "../../components/ui/button.tsx";1112const copyFor = (command: string, shown: (copied: boolean) => void) =>13 Effect.tryPromise(() => navigator.clipboard.writeText(command)).pipe(14 Effect.andThen(15 Effect.sync(() => {16 shown(true);17 })18 ),19 Effect.andThen(Effect.sleep("2 seconds")),20 Effect.andThen(21 Effect.sync(() => {22 shown(false);23 })24 ),25 Effect.ignore26 );2728export const CommandLine = ({ command }: { readonly command: string }) => {29 const [copied, setCopied] = useState(false);3031 const copy = () => {32 Effect.runFork(copyFor(command, setCopied));33 };3435 return (36 <div className="border-rule bg-surface flex w-fit max-w-full min-w-0 items-start gap-2 border py-1 pr-1 pl-3 font-mono text-[0.8125rem] leading-6">37 <span aria-hidden="true" className="text-muted-foreground select-none">38 $39 </span>40 <code className="min-w-0 flex-1 py-0.5 [overflow-wrap:anywhere] break-words whitespace-pre-wrap select-all">41 {command}42 </code>43 <Button44 className="shrink-0 font-sans"45 onClick={copy}46 size="sm"47 type="button"48 variant="ghost"49 >50 {copied ? <Check aria-hidden="true" /> : <Copy aria-hidden="true" />}51 <span className="sr-only sm:not-sr-only">52 {copied ? "Copied" : "Copy"}53 </span>54 </Button>55 </div>56 );57};
added:apps/web/src/features/shared/credits.tsx+73 added
1/**2 * A landing's trailers, as the commit carries them: credit first, in the3 * order of `CreditRole`'s literals (`Asked-by` before `Signed-off-by`), one4 * `Role: handle` line per person; then the `Held-back:` commitment, if the5 * landing was judged by held-back checks; then, apart and labelled, the6 * agents people worked through. `Assisted-by` is a disclosure, never credit7 * (GLOSSARY.md "Credit").8 */9import { CreditRole } from "@repo/protocol/domain/credit";10import type { AgentTrailer, Credit } from "@repo/protocol/domain/credit";11import { LockKeyhole } from "lucide-react";1213import { HandleLink } from "./handle.tsx";1415const rank = (credit: Credit) => CreditRole.literals.indexOf(credit.role);1617/** Credits in trailer order; people in one role keep the order given. */18export const inTrailerOrder = (credits: readonly Credit[]) =>19 credits.toSorted((one, other) => rank(one) - rank(other));2021/** An `Assisted-by:` value as the landing's trailer spells it: `pi:opus-4 (claimed)`. */22export const assistedValue = ({ harness, model, verified }: AgentTrailer) =>23 `${harness}${model === undefined ? "" : `:${model}`} (${verified ? "verified" : "claimed"})`;2425const LINES = "flex flex-col gap-1 font-mono text-[0.8125rem] leading-6";2627const LABEL = "text-xs font-medium text-muted-foreground";2829export const CreditTrailers = ({30 assisted,31 credits,32 heldBack,33}: {34 readonly assisted: readonly AgentTrailer[];35 readonly credits: readonly Credit[];36 readonly heldBack?: string;37}) => (38 <div className="flex flex-col gap-4">39 {credits.length === 0 ? null : (40 <section className="flex flex-col gap-1.5">41 <h3 className={LABEL}>Credit</h3>42 <ul className={LINES}>43 {inTrailerOrder(credits).map(({ handle, role }) => (44 <li className="[overflow-wrap:anywhere]" key={`${role}:${handle}`}>45 <span className="text-muted-foreground">{role}:</span>{" "}46 <HandleLink handle={handle} />47 </li>48 ))}49 </ul>50 </section>51 )}52 {heldBack === undefined ? null : (53 <p54 className={`${LINES} text-sealed flex-row items-start gap-2 [overflow-wrap:anywhere]`}55 >56 <LockKeyhole aria-hidden="true" className="mt-1 size-3.5 shrink-0" />57 <span>Held-back: {heldBack}</span>58 </p>59 )}60 {assisted.length === 0 ? null : (61 <section className="border-rule flex flex-col gap-1.5 border-t border-dashed pt-3">62 <h3 className={LABEL}>Agents used, disclosed and not credit</h3>63 <ul className={`${LINES} text-muted-foreground`}>64 {assisted.map((agent) => (65 <li className="[overflow-wrap:anywhere]" key={assistedValue(agent)}>66 Assisted-by: {assistedValue(agent)}67 </li>68 ))}69 </ul>70 </section>71 )}72 </div>73);
added:apps/web/src/features/shared/empty.tsx+18 added
1/**2 * An empty list, said plainly, with the command that would fill it: an3 * unfilled field on the report, not a dead end.4 */5import { CommandLine } from "./command.tsx";67export const EmptyState = ({8 command,9 title,10}: {11 readonly command?: string;12 readonly title: string;13}) => (14 <div className="border-rule flex flex-col gap-3 border border-dashed px-4 py-5">15 <p className="text-sm font-medium">{title}</p>16 {command === undefined ? null : <CommandLine command={command} />}17 </div>18);
added:apps/web/src/features/shared/handle.tsx+17 added
1/**2 * A person, by handle, linking to their page of credits. People appear by3 * handle and role only: nothing here ranks or scores them.4 */5import type { Handle } from "@repo/protocol/ids";67/** A person's page: `/people/<handle>` (a handle is URL-safe by its schema). */8export const personPath = (handle: Handle) => `/people/${handle}`;910export const HandleLink = ({ handle }: { readonly handle: Handle }) => (11 <a12 className="decoration-rule font-medium underline hover:decoration-current"13 href={personPath(handle)}14 >15 {handle}16 </a>17);
added:apps/web/src/features/shared/layout.tsx+101 added
1/**2 * The shell every page shares: the site header (front page, Today, the3 * session), one main region per page headed by its title over a double4 * rule, and the footer's two ways in (plain git, and the CLI). The root5 * route composes them (`src/routes/__root.tsx`); a page renders `PageShell`.6 */7import { Brand } from "@repo/brand";8import type { ReactNode } from "react";910import { CommandLine } from "./command.tsx";1112/** The content column every region lines up on. */13const COLUMN = "mx-auto w-full max-w-6xl px-4 sm:px-6";1415/** A page's `<title>`: the page, then the product. */16export const pageTitle = (title: string) => `${title} · ${Brand.name}`;1718export const PageShell = ({19 children,20 title,21}: {22 readonly children: ReactNode;23 readonly title: string;24}) => (25 <main className={`${COLUMN} flex-1 pt-6 pb-16 sm:pt-8`} id="main">26 <h1 className="border-rule-strong border-b-[3px] border-double pb-2 text-2xl font-semibold tracking-[-0.02em] text-balance">27 {title}28 </h1>29 <div className="mt-6 flex flex-col gap-8">{children}</div>30 </main>31);3233const NAV = [34 { href: "/", label: "Asks" },35 { href: "/today", label: "Today" },36] as const;3738/** Whether `href` is the page at `pathname`, or the section it heads. */39const isCurrent = (href: string, pathname: string) =>40 href === "/" ? pathname === "/" : pathname.startsWith(href);4142export const SiteHeader = ({43 pathname,44 session,45}: {46 readonly pathname: string;47 readonly session: ReactNode;48}) => (49 <header className="border-rule border-b">50 <a51 className="focus:bg-background sr-only focus:not-sr-only focus:absolute focus:top-2 focus:left-2 focus:z-50 focus:px-3 focus:py-2"52 href="#main"53 >54 Skip to content55 </a>56 <div className={`${COLUMN} flex h-12 items-center gap-4 sm:gap-6`}>57 <a58 className="text-base font-bold tracking-[-0.02em] no-underline"59 href="/"60 >61 {Brand.name}62 </a>63 <nav aria-label="Main" className="flex h-full items-stretch gap-4">64 {NAV.map(({ href, label }) => (65 <a66 aria-current={isCurrent(href, pathname) ? "page" : undefined}67 className="text-muted-foreground hover:text-foreground aria-[current=page]:border-rule-strong aria-[current=page]:text-foreground flex items-center border-b-2 border-transparent pt-0.5 text-sm no-underline aria-[current=page]:font-medium"68 href={href}69 key={href}70 >71 {label}72 </a>73 ))}74 </nav>75 <div className="ml-auto flex items-center text-sm">{session}</div>76 </div>77 </header>78);7980export const SiteFooter = ({81 platformUrl,82}: {83 readonly platformUrl: string;84}) => (85 <footer className="border-rule border-t">86 <div className={`${COLUMN} grid gap-6 py-8 sm:grid-cols-2`}>87 <section className="flex min-w-0 flex-col gap-2">88 <h2 className="text-muted-foreground text-xs font-medium">89 Plain git: clone any project90 </h2>91 <CommandLine command={`git clone ${platformUrl}/<project>.git`} />92 </section>93 <section className="flex min-w-0 flex-col gap-2">94 <h2 className="text-muted-foreground text-xs font-medium">95 Install the {Brand.cli} CLI96 </h2>97 <CommandLine command={`curl -fsSL ${platformUrl}/install.sh | sh`} />98 </section>99 </div>100 </footer>101);
added:apps/web/src/features/shared/outcome.tsx+262 added
1/**2 * Where an answer stands, read the same on every page that shows one.3 *4 * `OutcomeView` gives the outcome in a sentence: checking, waiting (on a5 * decision, a finish or a parent ask) or landed, each with its state as6 * `data-state` ("waiting" or "final"); a refusal is drawn by `RefusalView`.7 * Waiting is never shown as refusing.8 *9 * `StageStrip` is the gate's results row: one cell per stage, in the order of10 * cost, each marked passed, current, refused, pending or skipped by a mark11 * and a word, colour only third.12 */13import { Outcome, StageName } from "@repo/protocol/domain/outcome";14import { Match } from "effect";15import {16 Check,17 Circle,18 CircleDot,19 Hourglass,20 Minus,21 Stamp,22 X,23} from "lucide-react";24import type { LucideIcon } from "lucide-react";25import type { ReactNode } from "react";2627import { HandleLink } from "./handle.tsx";28import { RefusalView } from "./refusal.tsx";2930/** Each stage as its cell is headed (`label`) and as a sentence names it (`words`). */31const stageNames = Match.type<StageName>().pipe(32 Match.when("parse", () => ({ label: "Parse", words: "parse" })),33 Match.when("shape", () => ({ label: "Shape", words: "shape" })),34 Match.when("merge", () => ({ label: "Merge", words: "merge" })),35 Match.when("cheap", () => ({ label: "Cheap", words: "cheap checks" })),36 Match.when("checks", () => ({ label: "Checks", words: "checks" })),37 Match.when("heldBack", () => ({38 label: "Held-back",39 words: "held-back checks",40 })),41 Match.when("human", () => ({ label: "Decider", words: "decider" })),42 Match.exhaustive43);4445const short = (sha: string) => sha.slice(0, 7);4647const ID = "font-mono text-[0.8125rem]";4849interface Reading {50 readonly icon: LucideIcon;51 /** The role colour, as a text class. */52 readonly tone: string;53 readonly state: "waiting" | "final";54 /** The sentence's first word, set in the role colour. */55 readonly lead: string;56 /** The rest of the sentence, in ink. */57 readonly rest: ReactNode;58 /** Whether the mark settles once, as a landing's stamp does. */59 readonly stamps?: true;60}6162/** An outcome `OutcomeView` reads as a sentence: anything but a refusal. */63type Sentenced = Exclude<Outcome, { readonly _tag: "Refused" }>;6465const reading = Match.typeTags<Sentenced, Reading>()({66 AwaitingDecision: ({ decision }) => ({67 icon: Hourglass,68 lead: "Waiting",69 rest: (70 <>71 {" "}72 on decision <code className={ID}>{decision}</code>73 </>74 ),75 state: "waiting",76 tone: "text-waiting",77 }),78 AwaitingFinish: ({ decider }) => ({79 icon: Hourglass,80 lead: "Passed",81 rest: (82 <>83 , waiting for a decider&apos;s finish84 {decider === undefined ? null : (85 <>86 {" "}87 from <HandleLink handle={decider} />88 </>89 )}90 </>91 ),92 state: "waiting",93 tone: "text-waiting",94 }),95 Checking: ({ stage }) => ({96 icon: CircleDot,97 lead: "Checking",98 rest: <> at the {stageNames(stage).words} stage</>,99 state: "waiting",100 tone: "text-checking",101 }),102 Landed: ({ sha }) => ({103 icon: Stamp,104 lead: "Landed",105 rest: (106 <>107 {" "}108 as <code className={ID}>{short(sha)}</code>109 </>110 ),111 stamps: true,112 state: "final",113 tone: "text-landed",114 }),115 WaitingOnParent: ({ ask }) => ({116 icon: Hourglass,117 lead: "Passed",118 rest: (119 <>120 , waiting for <code className={ID}>{ask}</code> to land first121 </>122 ),123 state: "waiting",124 tone: "text-waiting",125 }),126});127128export const OutcomeView = ({ outcome }: { readonly outcome: Outcome }) => {129 if (Outcome.isAnyOf(["Refused"])(outcome)) {130 return (131 <div data-outcome={outcome._tag} data-state="final">132 <RefusalView refusals={outcome.refusals} />133 </div>134 );135 }136137 const read = reading(outcome);138 const Icon = read.icon;139140 return (141 <p142 className="flex items-start gap-2 text-base"143 data-outcome={outcome._tag}144 data-state={read.state}145 >146 <Icon147 aria-hidden="true"148 className={`mt-1 size-4 shrink-0 ${read.tone} ${read.stamps === true ? "motion-safe:animate-stamp" : ""}`}149 />150 <span className="min-w-0">151 <strong className={`font-semibold ${read.tone}`}>{read.lead}</strong>152 {read.rest}153 </span>154 </p>155 );156};157158/** A stage's place in the strip. */159export type StageState =160 | "passed"161 | "current"162 | "refused"163 | "pending"164 | "skipped";165166/**167 * Each stage's state, given the furthest stage the answer reached and its168 * outcome: stages before it passed; at it, current (checking or waiting),169 * refused, or passed (landed or waiting on its parent); after it, pending,170 * or skipped once the answer landed without them.171 */172export const stageStates = (173 reached: StageName,174 outcome: Outcome175): readonly (readonly [StageName, StageState])[] => {176 const at = StageName.literals.indexOf(reached);177178 const atReached = Outcome.match<StageState>(outcome, {179 AwaitingDecision: () => "current",180 AwaitingFinish: () => "current",181 Checking: () => "current",182 Landed: () => "passed",183 Refused: () => "refused",184 WaitingOnParent: () => "passed",185 });186187 const after: StageState = Outcome.isAnyOf(["Landed"])(outcome)188 ? "skipped"189 : "pending";190191 return StageName.literals.map((stage, index) => {192 if (index < at) {193 return [stage, "passed"] as const;194 }195196 return [stage, index === at ? atReached : after] as const;197 });198};199200const marks = {201 current: { icon: CircleDot, word: "now" },202 passed: { icon: Check, word: "passed" },203 pending: { icon: Circle, word: "not yet" },204 refused: { icon: X, word: "refused" },205 skipped: { icon: Minus, word: "not needed" },206} as const satisfies Record<207 StageState,208 { readonly icon: LucideIcon; readonly word: string }209>;210211export const StageStrip = ({212 outcome,213 stage,214}: {215 readonly outcome: Outcome;216 readonly stage: StageName;217}) => {218 const currentTone = Outcome.isAnyOf(["Checking"])(outcome)219 ? "text-checking"220 : "text-waiting";221222 const tones = {223 current: currentTone,224 passed: "text-landed",225 pending: "text-muted-foreground",226 refused: "text-refused",227 skipped: "text-muted-foreground",228 } as const satisfies Record<StageState, string>;229230 return (231 <ol232 aria-label="Gate stages"233 className="border-rule flex flex-wrap border-t border-l"234 >235 {stageStates(stage, outcome).map(([name, state]) => {236 const { icon: Icon, word } = marks[state];237238 return (239 <li240 aria-current={state === "current" ? "step" : undefined}241 className={`border-rule flex min-w-0 grow basis-1/4 items-start gap-1.5 border-r border-b px-2 py-1.5 sm:basis-0 ${state === "pending" || state === "skipped" ? "text-muted-foreground" : ""}`}242 data-stage={name}243 data-state={state}244 key={name}245 >246 <Icon247 aria-hidden="true"248 className={`mt-0.5 size-3.5 shrink-0 ${tones[state]}`}249 strokeWidth={state === "current" ? 2.5 : 2}250 />251 <span className="flex min-w-0 flex-col leading-tight">252 <span className="truncate text-xs font-medium">253 {stageNames(name).label}254 </span>255 <span className={`text-[0.6875rem] ${tones[state]}`}>{word}</span>256 </span>257 </li>258 );259 })}260 </ol>261 );262};
added:apps/web/src/features/shared/posture.tsx+33 added
1/**2 * A project's posture, as the honest label the platform computes from its3 * visibility config. The posture literal rides as `data-posture`, so tests4 * and styles key on it; the words are the label, never rewritten here.5 */6import type { Posture } from "@repo/protocol/posture";78import { Badge } from "../../components/ui/badge.tsx";910/** Postures that keep something sealed read in the sealed role; the rest in ink. */11const tone = {12 open: "border-rule-strong text-foreground",13 openCore: "border-sealed text-sealed",14 openOnSchedule: "border-sealed text-sealed",15 openWithSealedEvidence: "border-sealed text-sealed",16 sourceAvailable: "border-rule text-muted-foreground",17} as const satisfies Record<Posture, string>;1819export const PostureBadge = ({20 label,21 posture,22}: {23 readonly label: string;24 readonly posture: Posture;25}) => (26 <Badge27 className={`h-auto bg-transparent py-0.5 text-left whitespace-normal ${tone[posture]}`}28 data-posture={posture}29 variant="outline"30 >31 {label}32 </Badge>33);
added:apps/web/src/features/shared/refusal.tsx+74 added
1/**2 * A refusal, as `git push` printed it. The words are `@repo/protocol/render`'s3 * (`headline` and `explain`, the one renderer for git, the CLI, MCP and the4 * web, AGENTS.md principle 3); this view only sets them: each refusal's lines5 * verbatim, its tag in the rubric colour, then its `next` command to copy.6 * Whether retrying can help picks the mark, never the words.7 */8import type { Refusal } from "@repo/protocol/refusal";9import { explain, headline } from "@repo/protocol/render";10import type { Array } from "effect";11import { OctagonX, RotateCcw } from "lucide-react";1213import { CommandLine } from "./command.tsx";1415/** One refusal's lines, with its tag set apart on the first. */16const Lines = ({ refusal }: { readonly refusal: Refusal }) => {17 const prefix = `${refusal._tag}:`;1819 return (20 <samp className="block max-w-[96ch] font-mono text-[0.8125rem] leading-6 [overflow-wrap:anywhere] whitespace-pre-wrap">21 {explain([refusal]).map((line) => (22 <span className="block" key={line}>23 {line.startsWith(prefix) ? (24 <>25 <b className="text-refused font-semibold">{prefix}</b>26 {line.slice(prefix.length)}27 </>28 ) : (29 line30 )}31 </span>32 ))}33 </samp>34 );35};3637export const RefusalView = ({38 refusals,39}: {40 readonly refusals: Array.NonEmptyReadonlyArray<Refusal>;41}) => (42 <section43 aria-label={`Refused: ${headline(refusals)}`}44 className="border-t-refused border-b-rule border-t-2 border-b"45 >46 <h2 className="text-refused flex items-center gap-2 py-2 font-mono text-sm font-semibold">47 <OctagonX aria-hidden="true" className="size-4 shrink-0" />48 {headline(refusals)}49 </h2>50 <ol className="flex flex-col">51 {refusals.map((refusal) => {52 const Mark = refusal.retryable ? RotateCcw : OctagonX;5354 return (55 <li56 className="border-rule flex flex-col gap-2 border-t py-3"57 data-refusal={refusal._tag}58 data-retryable={refusal.retryable}59 key={explain([refusal]).join("\n")}60 >61 <div className="flex items-start gap-2">62 <Mark63 aria-hidden="true"64 className={`mt-1 size-3.5 shrink-0 ${refusal.retryable ? "text-waiting" : "text-refused"}`}65 />66 <Lines refusal={refusal} />67 </div>68 <CommandLine command={refusal.next} />69 </li>70 );71 })}72 </ol>73 </section>74);
added:apps/web/src/features/shared/theme.ts+9 added
1/**2 * The paper colour of each theme, as hex for the places that cannot read a3 * CSS variable: the document's `theme-color` meta and the web app manifest4 * (issue 505). They equal `--background` in `src/styles.css`.5 */6export const themeColors = {7 dark: "#0e1114",8 light: "#f5f8fa",9} as const;
added:apps/web/src/features/shared/time.tsx+50 added
1/**2 * A time as a short distance from now: "in 3 h", "2 d ago". `now` is a prop,3 * so a page and its test say the same thing; the exact time is the4 * element's `dateTime` and its tooltip.5 */6import { DateTime } from "effect";78const MINUTE = 60_000;910const HOUR = 60 * MINUTE;1112const DAY = 24 * HOUR;1314/** The largest whole unit in `millis`, as "5 min", "3 h" or "2 d". */15const span = (millis: number) => {16 if (millis < HOUR) {17 return `${Math.floor(millis / MINUTE)} min`;18 }1920 return millis < DAY21 ? `${Math.floor(millis / HOUR)} h`22 : `${Math.floor(millis / DAY)} d`;23};2425/** How far `at` is from `now`, in words. */26export const distanceInWords = (at: DateTime.Utc, now: DateTime.Utc) => {27 const millis = DateTime.toEpochMillis(at) - DateTime.toEpochMillis(now);2829 if (Math.abs(millis) < MINUTE) {30 return "now";31 }3233 return millis > 0 ? `in ${span(millis)}` : `${span(-millis)} ago`;34};3536export const When = ({37 at,38 now,39}: {40 readonly at: DateTime.Utc;41 readonly now: DateTime.Utc;42}) => {43 const iso = DateTime.formatIso(at);4445 return (46 <time dateTime={iso} title={iso}>47 {distanceInWords(at, now)}48 </time>49 );50};
modified:apps/web/src/routes/__root.tsx+59 added-7 removed
1import { Brand } from "@repo/brand";2import {3 createRootRoute,4 HeadContent,5 Outlet,6 Scripts,7 useLocation,8} from "@tanstack/react-router";9import { createServerFn } from "@tanstack/react-start";10import { env } from "cloudflare:workers";11import type { ReactNode } from "react";129// A minimal document; issue 511 replaces it with the shell and the design.13import { TooltipProvider } from "../components/ui/tooltip.tsx";14import { SessionSlot } from "../features/auth/session-slot.tsx";15import { SiteFooter, SiteHeader } from "../features/shared/layout.tsx";16import { themeColors } from "../features/shared/theme.ts";1718import styles from "../styles.css?url";1920// The shell every page shares (issue 511): the document, the header with21// the front page, Today and the session, each page's own <main> (from22// `PageShell`), and the footer's two ways in. Pages read the site's facts23// from this route's loader data (`getRouteApi("__root__").useLoaderData()`).2425/**26 * What every page may need from the Worker's env: where a browser reaches27 * the platform (its git remotes and the CLI's install line). Read on the28 * server; the loader's data rides into the page with the first render.29 */30const siteFacts = createServerFn({ method: "GET" }).handler(() => ({31 platformUrl: env.PUBLIC_PLATFORM_URL,32}));3334const Document = ({ children }: Readonly<{ children: ReactNode }>) => (35 <html lang="en">36 <head>37 <HeadContent />38 </head>16 <body>39 <body className="flex min-h-dvh flex-col">40 {children}41 <Scripts />42 </body>43 </html>44);4523const Root = () => (24 <Document>25 <Outlet />26 </Document>27);46const Root = () => {47 const { platformUrl } = Route.useLoaderData();48 const { pathname } = useLocation();4950 return (51 <Document>52 <TooltipProvider>53 <SiteHeader pathname={pathname} session={<SessionSlot />} />54 <Outlet />55 <SiteFooter platformUrl={platformUrl} />56 </TooltipProvider>57 </Document>58 );59};6061export const Route = createRootRoute({62 component: Root,63 head: () => ({64 links: [65 { href: styles, rel: "stylesheet" },66 // Served by issue 505 (`public/manifest.webmanifest`).67 { href: "/manifest.webmanifest", rel: "manifest" },68 ],69 meta: [70 { charSet: "utf-8" },71 { content: "width=device-width, initial-scale=1", name: "viewport" },72 { content: "light dark", name: "color-scheme" },73 {74 content: themeColors.light,75 media: "(prefers-color-scheme: light)",76 name: "theme-color",77 },78 {79 content: themeColors.dark,80 media: "(prefers-color-scheme: dark)",81 name: "theme-color",82 },83 { title: Brand.name },84 ],85 }),86 loader: () => siteFacts(),87 // The facts are the stage's, fixed for the Worker's life: fetch them once.88 staleTime: Number.POSITIVE_INFINITY,89});
added:apps/web/src/styles.css+252 added
1@import "tailwindcss";2@import "shadcn/tailwind.css";34/*5 The web's tokens (DESIGN.md names each one and when to use it).67 The world is a test certificate: every page is a report sheet on cool8 bond paper, ruled in one-pixel hairlines, with fields, a results row, and9 signatories (credit) kept apart from the instruments used (agents). Colour10 carries state and nothing else, always beside a word and a mark:1112 --landed the change is on main (a certified result)13 --checking the gate is running a stage now14 --waiting passed or paused, waiting on a person or a parent ask15 --refused a refusal (nonconformance); the one rubric colour16 --sealed held-back checks, layers and sealed evidence17 --muted not reached, not needed, secondary text1819 Light and dark follow the system setting (no toggle, no script, no flash):20 shadcn's `dark:` variant is the media query, not a class.21*/22@custom-variant dark (@media (prefers-color-scheme: dark));2324@font-face {25 font-family: "Public Sans";26 font-style: normal;27 font-weight: 100 900;28 font-display: swap;29 src: url("./assets/fonts/public-sans-latin.woff2") format("woff2");30 unicode-range:31 U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC,32 U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212,33 U+2215, U+FEFF, U+FFFD;34}3536@font-face {37 font-family: "Public Sans";38 font-style: normal;39 font-weight: 100 900;40 font-display: swap;41 src: url("./assets/fonts/public-sans-latin-ext.woff2") format("woff2");42 unicode-range:43 U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304,44 U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB,45 U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;46}4748@font-face {49 font-family: "JetBrains Mono";50 font-style: normal;51 font-weight: 100 800;52 font-display: swap;53 src: url("./assets/fonts/jetbrains-mono-latin.woff2") format("woff2");54 unicode-range:55 U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC,56 U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212,57 U+2215, U+FEFF, U+FFFD;58}5960@font-face {61 font-family: "JetBrains Mono";62 font-style: normal;63 font-weight: 100 800;64 font-display: swap;65 src: url("./assets/fonts/jetbrains-mono-latin-ext.woff2") format("woff2");66 unicode-range:67 U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304,68 U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB,69 U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;70}7172:root {73 color-scheme: light dark;7475 /* Paper, ink and rules. The paper is hex: the theme-color meta and the76 manifest repeat it (src/features/shared/theme.ts, held by a test). */77 --background: #f5f8fa;78 --foreground: oklch(0.21 0.015 258);79 --surface: oklch(0.955 0.005 245);80 --muted: oklch(0.48 0.012 258);81 --rule: oklch(0.86 0.007 255);82 --rule-strong: oklch(0.21 0.015 258);8384 /* State roles: text-safe on paper and on surface (at least 5:1). */85 --landed: oklch(0.47 0.11 155);86 --checking: oklch(0.48 0.13 252);87 --waiting: oklch(0.5 0.1 70);88 --refused: oklch(0.5 0.18 27);89 --sealed: oklch(0.46 0.13 305);9091 /* shadcn's names, mapped onto the roles above. */92 --card: var(--background);93 --card-foreground: var(--foreground);94 --popover: oklch(0.995 0.002 240);95 --popover-foreground: var(--foreground);96 --primary: var(--foreground);97 --primary-foreground: var(--background);98 --secondary: var(--surface);99 --secondary-foreground: var(--foreground);100 --muted-foreground: var(--muted);101 --accent: var(--surface);102 --accent-foreground: var(--foreground);103 --destructive: var(--refused);104 --border: var(--rule);105 --input: var(--rule);106 --ring: var(--foreground);107 --radius: 0.125rem;108}109110@media (prefers-color-scheme: dark) {111 :root {112 --background: #0e1114;113 --foreground: oklch(0.94 0.005 258);114 --surface: oklch(0.215 0.009 258);115 --muted: oklch(0.72 0.01 258);116 --rule: oklch(0.33 0.01 258);117 --rule-strong: oklch(0.94 0.005 258);118119 --landed: oklch(0.78 0.13 155);120 --checking: oklch(0.76 0.11 250);121 --waiting: oklch(0.82 0.12 78);122 --refused: oklch(0.73 0.15 25);123 --sealed: oklch(0.76 0.11 305);124125 --popover: oklch(0.235 0.009 258);126 }127}128129@theme inline {130 --font-sans:131 "Public Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI",132 sans-serif;133 --font-mono:134 "JetBrains Mono", ui-monospace, "SFMono-Regular", "Cascadia Mono", Menlo,135 monospace;136137 /* A fixed scale, ratio about 1.2: product type does not float. */138 --text-xs: 0.75rem;139 --text-xs--line-height: 1.1rem;140 --text-sm: 0.875rem;141 --text-sm--line-height: 1.35rem;142 --text-base: 1rem;143 --text-base--line-height: 1.55rem;144 --text-lg: 1.1875rem;145 --text-lg--line-height: 1.65rem;146 --text-xl: 1.4375rem;147 --text-xl--line-height: 1.9rem;148 --text-2xl: 1.75rem;149 --text-2xl--line-height: 2.2rem;150151 --color-background: var(--background);152 --color-foreground: var(--foreground);153 --color-surface: var(--surface);154 --color-rule: var(--rule);155 --color-rule-strong: var(--rule-strong);156 --color-landed: var(--landed);157 --color-checking: var(--checking);158 --color-waiting: var(--waiting);159 --color-refused: var(--refused);160 --color-sealed: var(--sealed);161 --color-muted: var(--surface);162 --color-muted-foreground: var(--muted-foreground);163164 --color-card: var(--card);165 --color-card-foreground: var(--card-foreground);166 --color-popover: var(--popover);167 --color-popover-foreground: var(--popover-foreground);168 --color-primary: var(--primary);169 --color-primary-foreground: var(--primary-foreground);170 --color-secondary: var(--secondary);171 --color-secondary-foreground: var(--secondary-foreground);172 --color-accent: var(--accent);173 --color-accent-foreground: var(--accent-foreground);174 --color-destructive: var(--destructive);175 --color-border: var(--border);176 --color-input: var(--input);177 --color-ring: var(--ring);178179 --radius-sm: calc(var(--radius) * 0.5);180 --radius-md: var(--radius);181 --radius-lg: calc(var(--radius) * 2);182 --radius-xl: calc(var(--radius) * 3);183184 /* A landing's mark settles once, like a stamp. */185 --animate-stamp: stamp 420ms cubic-bezier(0.16, 1, 0.3, 1) 1 both;186187 @keyframes stamp {188 from {189 opacity: 0;190 transform: scale(1.35);191 }192 to {193 opacity: 1;194 transform: scale(1);195 }196 }197}198199@layer base {200 * {201 @apply border-border outline-ring/50;202 }203204 html {205 -webkit-text-size-adjust: 100%;206 scrollbar-color: var(--rule) transparent;207 text-rendering: optimizeLegibility;208 }209210 body {211 @apply bg-background text-foreground font-sans antialiased;212 caret-color: var(--checking);213 }214215 ::selection {216 background: color-mix(in oklch, var(--checking) 22%, transparent);217 color: var(--foreground);218 }219220 a {221 text-underline-offset: 0.2em;222 text-decoration-thickness: 1px;223 }224225 :focus-visible {226 outline: 2px solid var(--ring);227 outline-offset: 2px;228 }229230 code,231 kbd,232 samp,233 pre {234 font-feature-settings: "calt" 0;235 }236237 time,238 td,239 th {240 font-variant-numeric: tabular-nums;241 }242243 @media (prefers-reduced-motion: reduce) {244 *,245 ::before,246 ::after {247 animation-duration: 0.01ms !important;248 animation-iteration-count: 1 !important;249 transition-duration: 0.01ms !important;250 }251 }252}
added:apps/web/test/shared.test.tsx+448 added
1/**2 * The pieces every page repeats, rendered to HTML with `react-dom/server`3 * (no DOM library): a refusal reads as `git push` printed it, credit4 * trailers read as the landing commit carries them, and an answer's outcome5 * and stages read the same on every page that shows one.6 */7import { describe, expect, it } from "@effect/vitest";8import { Brand } from "@repo/brand";9import { Outcome } from "@repo/protocol/domain/outcome";10import type { StageName } from "@repo/protocol/domain/outcome";11import {12 AskId,13 DecisionId,14 Handle,15 LandedSha,16 RepoPath,17} from "@repo/protocol/ids";18import { OutOfScope, Weakened } from "@repo/protocol/refusal";19import { explain } from "@repo/protocol/render";20import { DateTime, Schema } from "effect";21import type { ReactElement } from "react";22import { renderToStaticMarkup } from "react-dom/server";2324import { CommandLine } from "../src/features/shared/command.tsx";25import { CreditTrailers } from "../src/features/shared/credits.tsx";26import { EmptyState } from "../src/features/shared/empty.tsx";27import { HandleLink } from "../src/features/shared/handle.tsx";28import {29 PageShell,30 SiteFooter,31 SiteHeader,32} from "../src/features/shared/layout.tsx";33import { OutcomeView, StageStrip } from "../src/features/shared/outcome.tsx";34import { PostureBadge } from "../src/features/shared/posture.tsx";35import { RefusalView } from "../src/features/shared/refusal.tsx";36import { themeColors } from "../src/features/shared/theme.ts";37import { When } from "../src/features/shared/time.tsx";3839import styles from "../src/styles.css?raw";4041/** The entities React writes for text, and what each reads as. */42const ENTITIES: ReadonlyMap<string, string> = new Map([43 ["&#x27;", "'"],44 ["&amp;", "&"],45 ["&gt;", ">"],46 ["&lt;", "<"],47 ["&quot;", '"'],48]);4950const markupOf = (element: ReactElement) => renderToStaticMarkup(element);5152/** What a reader sees: the markup without its tags, entities decoded. */53const textOf = (element: ReactElement) =>54 markupOf(element)55 .replaceAll(/<[^>]+>/gu, "")56 .replaceAll(57 /&(?:#x27|amp|gt|lt|quot);/gu,58 (entity) => ENTITIES.get(entity) ?? entity59 );6061/** Where each of `parts` starts in `text`, each searched after the one before; -1 once one is missing. */62const positionsInOrder = (text: string, parts: readonly string[]) => {63 const positions: number[] = [];64 let from = 0;6566 for (const part of parts) {67 const at = from < 0 ? -1 : text.indexOf(part, from);6869 positions.push(at);70 from = at < 0 ? -1 : at + part.length;71 }7273 return positions;74};7576/** Each `<li>` that names a stage, as `[stage, state]`. */77const stagesOf = (element: ReactElement) =>78 [...markupOf(element).matchAll(/<li\b[^>]*>/gu)].flatMap(([tag]) => {79 const stage = /data-stage="(?<value>[^"]+)"/u.exec(tag)?.groups?.value;80 const state = /data-state="(?<value>[^"]+)"/u.exec(tag)?.groups?.value;8182 return stage === undefined || state === undefined ? [] : [[stage, state]];83 });8485const handle = Schema.decodeSync(Handle);8687const repoPath = Schema.decodeSync(RepoPath);8889const outOfScope = new OutOfScope({90 paths: [repoPath("packages/format/src/format.ts"), repoPath("README.md")],91});9293const weakened = new Weakened({94 at: { line: 12, path: repoPath("packages/parse/test/parse.test.ts") },95 weakening: { marker: ".skip(" },96});9798const refusals = [outOfScope, weakened] as const;99100const now = DateTime.makeUnsafe("2026-10-07T12:00:00Z");101102describe(RefusalView, () => {103 it("shows every line explain gives, in order, each refusal's tag, and then its next command", () => {104 const text = textOf(<RefusalView refusals={refusals} />);105106 const expected = refusals.flatMap((refusal) => [107 ...explain([refusal]).map((line) => line.trim()),108 refusal.next,109 ]);110111 expect(112 positionsInOrder(text, expected).every((at) => at >= 0)113 ).toBeTruthy();114 expect(text).toContain("OutOfScope");115 expect(text).toContain("Weakened");116117 for (const refusal of refusals) {118 expect(refusal.next.startsWith(`${Brand.cli} `)).toBeTruthy();119 }120 });121122 it("points at the path and line of a refusal that has one", () => {123 const text = textOf(<RefusalView refusals={[weakened]} />);124125 expect(text).toContain("packages/parse/test/parse.test.ts:12");126 });127128 it("says whether retrying can help, without rewording the refusal", () => {129 const markup = markupOf(<RefusalView refusals={refusals} />);130131 expect(markup).toContain('data-refusal="OutOfScope"');132 expect(markup).toContain('data-retryable="false"');133 });134});135136describe(CreditTrailers, () => {137 const credits = [138 { handle: handle("bram"), role: "Signed-off-by" },139 { handle: handle("ines"), role: "Asked-by" },140 ] as const;141142 const assisted = [{ harness: "claude-code", verified: true }] as const;143144 it("lists credit in the order of the trailer roles, as the landing commit does", () => {145 const text = textOf(146 <CreditTrailers assisted={assisted} credits={credits} />147 );148149 expect(150 positionsInOrder(text, ["Asked-by: ines", "Signed-off-by: bram"]).every(151 (at) => at >= 0152 )153 ).toBeTruthy();154 });155156 it("links each credited person to their page", () => {157 const markup = markupOf(<CreditTrailers assisted={[]} credits={credits} />);158159 expect(markup).toContain('href="/people/ines"');160 expect(markup).toContain('href="/people/bram"');161 });162163 it("shows Assisted-by apart, in a list labelled as not credit", () => {164 const text = textOf(165 <CreditTrailers assisted={assisted} credits={credits} />166 );167168 const label = text.indexOf("not credit");169 const assistedAt = text.indexOf("Assisted-by: claude-code (verified)");170171 expect(label).toBeGreaterThan(text.indexOf("Signed-off-by: bram"));172 expect(assistedAt).toBeGreaterThan(label);173 expect(text.indexOf("Assisted-by")).toBe(assistedAt);174 });175176 it("names an agent's model the way the trailer does", () => {177 const text = textOf(178 <CreditTrailers179 assisted={[{ harness: "pi", model: "opus-4", verified: false }]}180 credits={credits}181 />182 );183184 expect(text).toContain("Assisted-by: pi:opus-4 (claimed)");185 });186187 it("shows a held-back trailer as its own Held-back line", () => {188 const text = textOf(189 <CreditTrailers190 assisted={[]}191 credits={credits}192 heldBack="7/7 @ sha256:4f2a"193 />194 );195196 expect(text).toContain("Held-back: 7/7 @ sha256:4f2a");197 });198199 it("leaves out the agents list when no agent helped", () => {200 const text = textOf(<CreditTrailers assisted={[]} credits={credits} />);201202 expect(text).not.toContain("not credit");203 });204});205206describe(PostureBadge, () => {207 it("shows the label it is given and keeps the posture as a data attribute", () => {208 const element = (209 <PostureBadge210 label="Open · sealed checks in parser"211 posture="openWithSealedEvidence"212 />213 );214215 expect(textOf(element)).toBe("Open · sealed checks in parser");216 expect(markupOf(element)).toContain(217 'data-posture="openWithSealedEvidence"'218 );219 });220});221222describe(HandleLink, () => {223 it("links a handle to that person's page", () => {224 expect(markupOf(<HandleLink handle={handle("ines-v")} />)).toMatch(225 /^<a\b[^>]*\bhref="\/people\/ines-v"[^>]*>ines-v<\/a>$/u226 );227 });228});229230describe(OutcomeView, () => {231 const sha = Schema.decodeSync(LandedSha)(232 "9b1c3e5d7f9a1b3c5d7e9f1a3b5c7d9e1f3a5b7c"233 );234235 const waiting = [236 [Outcome.cases.Checking.make({ stage: "checks" }), "Checking", "checks"],237 [238 Outcome.cases.AwaitingDecision.make({239 decision: Schema.decodeSync(DecisionId)("dec-000001"),240 }),241 "Waiting on decision",242 "dec-000001",243 ],244 [245 Outcome.cases.AwaitingFinish.make({ decider: handle("okonkwo") }),246 "waiting for a decider's finish",247 "okonkwo",248 ],249 [250 Outcome.cases.WaitingOnParent.make({251 ask: Schema.decodeSync(AskId)("split-format"),252 }),253 "waiting for",254 "split-format",255 ],256 ] as const;257258 it.each(waiting)(259 "reads %o as waiting, never as a refusal",260 (outcome, wording, names) => {261 const element = <OutcomeView outcome={outcome} />;262263 expect(markupOf(element)).toContain(`data-outcome="${outcome._tag}"`);264 expect(markupOf(element)).toContain('data-state="waiting"');265 expect(textOf(element)).toContain(wording);266 expect(textOf(element)).toContain(names);267 }268 );269270 it("reads a landing as final, with its short sha", () => {271 const element = (272 <OutcomeView outcome={Outcome.cases.Landed.make({ sha })} />273 );274275 expect(markupOf(element)).toContain('data-state="final"');276 expect(textOf(element)).toContain("Landed as 9b1c3e5");277 });278279 it("shows a refusal through RefusalView", () => {280 const element = (281 <OutcomeView outcome={Outcome.cases.Refused.make({ refusals })} />282 );283284 expect(markupOf(element)).toContain('data-state="final"');285 expect(markupOf(element)).toContain(286 markupOf(<RefusalView refusals={refusals} />)287 );288 });289});290291const strip = (stage: StageName, outcome: Outcome) =>292 stagesOf(<StageStrip outcome={outcome} stage={stage} />);293294describe(StageStrip, () => {295 it("marks the stages before the current one passed, and the rest pending", () => {296 expect(297 strip("checks", Outcome.cases.Checking.make({ stage: "checks" }))298 ).toStrictEqual([299 ["parse", "passed"],300 ["shape", "passed"],301 ["merge", "passed"],302 ["cheap", "passed"],303 ["checks", "current"],304 ["heldBack", "pending"],305 ["human", "pending"],306 ]);307 });308309 it("marks the stage that refused, and leaves the rest unreached", () => {310 expect(311 strip("shape", Outcome.cases.Refused.make({ refusals }))312 ).toStrictEqual([313 ["parse", "passed"],314 ["shape", "refused"],315 ["merge", "pending"],316 ["cheap", "pending"],317 ["checks", "pending"],318 ["heldBack", "pending"],319 ["human", "pending"],320 ]);321 });322323 it("marks a landed answer's later stages as not needed", () => {324 const sha = Schema.decodeSync(LandedSha)(325 "9b1c3e5d7f9a1b3c5d7e9f1a3b5c7d9e1f3a5b7c"326 );327328 expect(strip("checks", Outcome.cases.Landed.make({ sha }))).toStrictEqual([329 ["parse", "passed"],330 ["shape", "passed"],331 ["merge", "passed"],332 ["cheap", "passed"],333 ["checks", "passed"],334 ["heldBack", "skipped"],335 ["human", "skipped"],336 ]);337 });338});339340describe(When, () => {341 it("says how far ahead a time is", () => {342 const at = DateTime.add(now, { hours: 3 });343 const element = <When at={at} now={now} />;344345 expect(textOf(element)).toBe("in 3 h");346 expect(markupOf(element)).toContain('dateTime="2026-10-07T15:00:00.000Z"');347 });348349 it("says how long ago a time was", () => {350 expect(351 textOf(<When at={DateTime.subtract(now, { days: 2 })} now={now} />)352 ).toBe("2 d ago");353 expect(354 textOf(<When at={DateTime.subtract(now, { minutes: 5 })} now={now} />)355 ).toBe("5 min ago");356 });357358 it("says now for anything under a minute either way", () => {359 expect(360 textOf(<When at={DateTime.add(now, { seconds: 20 })} now={now} />)361 ).toBe("now");362 });363});364365describe(CommandLine, () => {366 it("shows the command, with a button that copies it", () => {367 const command = `${Brand.cli} claim fix-week-start`;368 const element = <CommandLine command={command} />;369370 expect(textOf(element)).toContain(command);371 expect(markupOf(element)).toMatch(/<button\b[^>]*>.*Copy.*<\/button>/u);372 });373});374375describe(EmptyState, () => {376 it("says what is empty and the command that would change it", () => {377 const command = `${Brand.cli} ask open`;378 const text = textOf(<EmptyState command={command} title="No open asks" />);379380 expect(text).toContain("No open asks");381 expect(text).toContain(command);382 });383});384385describe(PageShell, () => {386 it("gives a page one main region headed by its title", () => {387 const markup = markupOf(388 <PageShell title="Today">389 <p>Decisions 2 of 5</p>390 </PageShell>391 );392393 expect(markup).toMatch(/<main\b[^>]*>.*<h1\b[^>]*>Today<\/h1>.*<\/main>/u);394 expect(markup).toContain("<p>Decisions 2 of 5</p>");395 });396});397398describe("the shell", () => {399 const platformUrl = "https://platform-test.example.workers.dev";400401 it("marks the page the reader is on in the header", () => {402 const markup = markupOf(403 <SiteHeader404 pathname="/today"405 session={<a href="/auth/signin">Sign in</a>}406 />407 );408409 expect(markup).toMatch(/<a\b[^>]*aria-current="page"[^>]*>Today<\/a>/u);410 expect(markup).not.toMatch(/<a\b[^>]*aria-current="page"[^>]*>Asks<\/a>/u);411 expect(markup).toContain(">Sign in</a>");412 });413414 it("gives the two ways in at the foot of every page: plain git and the CLI", () => {415 const text = textOf(<SiteFooter platformUrl={platformUrl} />);416417 expect(text).toContain("Plain git: clone any project");418 expect(text).toContain(`git clone ${platformUrl}/<project>.git`);419 expect(text).toContain(`curl -fsSL ${platformUrl}/install.sh | sh`);420 });421422 it("names the paper colours the theme-color meta repeats", () => {423 expect(styles).toContain(`--background: ${themeColors.light};`);424 expect(styles).toContain(`--background: ${themeColors.dark};`);425 });426});427428describe("the shared pieces", () => {429 // Views only: props in, markup out. A shared piece that fetched would430 // tie every page that shows it to one transport (src/surfaces.ts).431 const sources: Readonly<Record<string, string>> = import.meta.glob(432 "../src/features/shared/**/*.{ts,tsx}",433 { eager: true, import: "default", query: "?raw" }434 );435436 const transport =437 /from\s+["'](?:@repo\/protocol\/contracts|effect\/(?:rpc|http|reactivity)|#backend|[./]+\/(?:surfaces|client\/[^"']*|server\/[^"']*)(?:\.tsx?)?)["']/u;438439 it("import no transport", () => {440 expect(Object.keys(sources).length).toBeGreaterThan(5);441442 const reaching = Object.entries(sources).flatMap(([path, source]) =>443 transport.test(source) ? [path] : []444 );445446 expect(reaching).toStrictEqual([]);447 });448});
added:apps/web/components.json+24 added
1{2 "$schema": "https://ui.shadcn.com/schema.json",3 "style": "base-lyra",4 "rsc": false,5 "tsx": true,6 "tailwind": {7 "config": "",8 "css": "src/styles.css",9 "baseColor": "neutral",10 "cssVariables": true,11 "prefix": ""12 },13 "iconLibrary": "lucide",14 "aliases": {15 "components": "@/components",16 "utils": "@/lib/utils",17 "ui": "@/components/ui",18 "lib": "@/lib",19 "hooks": "@/hooks"20 },21 "menuColor": "default",22 "menuAccent": "subtle",23 "registries": {}24}
modified:apps/web/package.json+2 added
22 unmodified lines
23 "@repo/brand": "workspace:*",24 "@repo/protocol": "workspace:*",25 "@tanstack/react-router": "1.170.41",26 "@tanstack/react-start": "1.168.60",27 "class-variance-authority": "0.7.1",28 "cn": "0.4.0",29 "effect": "catalog:",30 "lucide-react": "1.52.0",31 "react": "19.3.0",32 "react-dom": "19.3.0",
26 unmodified lines
modified:apps/web/tsconfig.json+3 added
6 unmodified lines
7 // imports without extensions, which NodeNext refuses.8 "module": "ESNext",9 "moduleResolution": "Bundler",10 "lib": ["ES2023", "DOM", "DOM.Iterable"],11 // shadcn's generated components import through this alias12 // (components.json); Vite resolves it from here (`resolve.tsconfigPaths`).13 "paths": { "@/*": ["./src/*"] },14 "types": ["@cloudflare/workers-types", "vite/client"]15 },16 "include": [17 "src/**/*.ts",
8 unmodified lines
modified:apps/web/vite.config.ts+3 added
12 unmodified lines
13 tailwindcss(),14 tanstackStart(),15 viteReact(),16 ],17 // shadcn's components import through `@/` (components.json), which18 // tsconfig.json's `paths` maps to `src/`.19 resolve: { tsconfigPaths: true },20});
modified:apps/web/vitest.config.ts+5 added
7 unmodified lines
8export default mergeConfig(9 preset,10 defineConfig({11 resolve: {12 // shadcn's `@/` imports, as in vite.config.ts.13 tsconfigPaths: true,14 alias: {15 "cloudflare:workers": new URL("test/workers-shim.ts", import.meta.url)16 .pathname,17 },18 },19 test: {20 // The shared tests read styles.css as text (`?raw`); vitest hands21 // every other stylesheet over empty.22 css: { include: [/\/src\/styles\.css/u] },23 include: ["test/**/*.test.tsx"],24 typecheck: {25 enabled: true,26 include: ["test/**/*.test-d.ts"],
5 unmodified lines
added:LICENSES/jetbrains-mono.OFL-1.1.txt+93 added
1Copyright 2020 The JetBrains Mono Project Authors (https://github.com/JetBrains/JetBrainsMono)23This Font Software is licensed under the SIL Open Font License, Version 1.1.4This license is copied below, and is also available with a FAQ at:5https://openfontlicense.org678-----------------------------------------------------------9SIL OPEN FONT LICENSE Version 1.1 - 26 February 200710-----------------------------------------------------------1112PREAMBLE13The goals of the Open Font License (OFL) are to stimulate worldwide14development of collaborative font projects, to support the font creation15efforts of academic and linguistic communities, and to provide a free and16open framework in which fonts may be shared and improved in partnership17with others.1819The OFL allows the licensed fonts to be used, studied, modified and20redistributed freely as long as they are not sold by themselves. The21fonts, including any derivative works, can be bundled, embedded, 22redistributed and/or sold with any software provided that any reserved23names are not used by derivative works. The fonts and derivatives,24however, cannot be released under any other type of license. The25requirement for fonts to remain under this license does not apply26to any document created using the fonts or their derivatives.2728DEFINITIONS29"Font Software" refers to the set of files released by the Copyright30Holder(s) under this license and clearly marked as such. This may31include source files, build scripts and documentation.3233"Reserved Font Name" refers to any names specified as such after the34copyright statement(s).3536"Original Version" refers to the collection of Font Software components as37distributed by the Copyright Holder(s).3839"Modified Version" refers to any derivative made by adding to, deleting,40or substituting -- in part or in whole -- any of the components of the41Original Version, by changing formats or by porting the Font Software to a42new environment.4344"Author" refers to any designer, engineer, programmer, technical45writer or other person who contributed to the Font Software.4647PERMISSION & CONDITIONS48Permission is hereby granted, free of charge, to any person obtaining49a copy of the Font Software, to use, study, copy, merge, embed, modify,50redistribute, and sell modified and unmodified copies of the Font51Software, subject to the following conditions:52531) Neither the Font Software nor any of its individual components,54in Original or Modified Versions, may be sold by itself.55562) Original or Modified Versions of the Font Software may be bundled,57redistributed and/or sold with any software, provided that each copy58contains the above copyright notice and this license. These can be59included either as stand-alone text files, human-readable headers or60in the appropriate machine-readable metadata fields within text or61binary files as long as those fields can be easily viewed by the user.62633) No Modified Version of the Font Software may use the Reserved Font64Name(s) unless explicit written permission is granted by the corresponding65Copyright Holder. This restriction only applies to the primary font name as66presented to the users.67684) The name(s) of the Copyright Holder(s) or the Author(s) of the Font69Software shall not be used to promote, endorse or advertise any70Modified Version, except to acknowledge the contribution(s) of the71Copyright Holder(s) and the Author(s) or with their explicit written72permission.73745) The Font Software, modified or unmodified, in part or in whole,75must be distributed entirely under this license, and must not be76distributed under any other license. The requirement for fonts to77remain under this license does not apply to any document created78using the Font Software.7980TERMINATION81This license becomes null and void if any of the above conditions are82not met.8384DISCLAIMER85THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,86EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF87MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT88OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE89COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,90INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL91DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING92FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM93OTHER DEALINGS IN THE FONT SOFTWARE.
added:LICENSES/public-sans.OFL-1.1.txt+115 added
1This repository is a fork of Libre Franklin: https://github.com/impallari/Libre-Franklin23## License for USWDS’s Modified Version45This repository contains both the original font software for Libre Franklin (the “Original Version”) and font software modifications made by the General Services Administration (GSA). This repository combines the Original Version and these GSA modifications into a piece of font software called Public Sans, which is a “Modified Version” of Libre Franklin.67As a work of the United States Government, the font software modifications made by GSA are not subject to copyright within the United States. Additionally, GSA waives copyright and related rights in its font software modifications worldwide through the [CC0 1.0 Universal public domain dedication](https://creativecommons.org/publicdomain/zero/1.0/).89The Original Version (as defined in the SIL Open Font License, Version 1.1) remains subject to copyright under the SIL Open Font License, Version 1.1.1011This Modified Version (Public Sans) contains both software under the SIL Open Font License, Version 1.1 and software modifications by GSA released as CC0. As a work of the United States Government, the software modifications made by GSA are not subject to copyright within the United States. Additionally, GSA waives copyright and related rights in its software modifications worldwide through the [CC0 1.0 Universal Public Domain Dedication](https://creativecommons.org/publicdomain/zero/1.0/). It is a “joint work” made of the original software and modifications combined into a single work.1213**In practice, users of this Modified Version (Public Sans) should use Public Sans according to the terms of the SIL Open Font License, Version 1.1, below.** This is because this font is a combination of work subject to copyright and work not subject to copyright, so the more restrictive requirements apply to using the combined work.1415## License of project USWDS’s Modified Version is based on1617- Libre Franklin is licensed under the SIL Open Font License, Version 1.1 (<http://scripts.sil.org/OFL>)18- To view the copyright and specific terms and conditions of Libre Franklin, please refer to [OFL.txt](https://github.com/impallari/Libre-Franklin/blob/master/OFL.txt)1920## SIL Open Font License, Version 1.12122Copyright 2015 The Public Sans Project Authors (https://github.com/uswds/public-sans)2324This Font Software is licensed under the SIL Open Font License, Version 1.1.2526This license is copied below, and is also available with a FAQ at http://scripts.sil.org/OFL2728```29-----------------------------------------------------------30SIL OPEN FONT LICENSE Version 1.1 - 26 February 200731-----------------------------------------------------------3233PREAMBLE34The goals of the Open Font License (OFL) are to stimulate worldwide35development of collaborative font projects, to support the font creation36efforts of academic and linguistic communities, and to provide a free and37open framework in which fonts may be shared and improved in partnership38with others.3940The OFL allows the licensed fonts to be used, studied, modified and41redistributed freely as long as they are not sold by themselves. The42fonts, including any derivative works, can be bundled, embedded,43redistributed and/or sold with any software provided that any reserved44names are not used by derivative works. The fonts and derivatives,45however, cannot be released under any other type of license. The46requirement for fonts to remain under this license does not apply47to any document created using the fonts or their derivatives.4849DEFINITIONS50"Font Software" refers to the set of files released by the Copyright51Holder(s) under this license and clearly marked as such. This may52include source files, build scripts and documentation.5354"Reserved Font Name" refers to any names specified as such after the55copyright statement(s).5657"Original Version" refers to the collection of Font Software components as58distributed by the Copyright Holder(s).5960"Modified Version" refers to any derivative made by adding to, deleting,61or substituting -- in part or in whole -- any of the components of the62Original Version, by changing formats or by porting the Font Software to a63new environment.6465"Author" refers to any designer, engineer, programmer, technical66writer or other person who contributed to the Font Software.6768PERMISSION & CONDITIONS69Permission is hereby granted, free of charge, to any person obtaining70a copy of the Font Software, to use, study, copy, merge, embed, modify,71redistribute, and sell modified and unmodified copies of the Font72Software, subject to the following conditions:73741) Neither the Font Software nor any of its individual components,75in Original or Modified Versions, may be sold by itself.76772) Original or Modified Versions of the Font Software may be bundled,78redistributed and/or sold with any software, provided that each copy79contains the above copyright notice and this license. These can be80included either as stand-alone text files, human-readable headers or81in the appropriate machine-readable metadata fields within text or82binary files as long as those fields can be easily viewed by the user.83843) No Modified Version of the Font Software may use the Reserved Font85Name(s) unless explicit written permission is granted by the corresponding86Copyright Holder. This restriction only applies to the primary font name as87presented to the users.88894) The name(s) of the Copyright Holder(s) or the Author(s) of the Font90Software shall not be used to promote, endorse or advertise any91Modified Version, except to acknowledge the contribution(s) of the92Copyright Holder(s) and the Author(s) or with their explicit written93permission.94955) The Font Software, modified or unmodified, in part or in whole,96must be distributed entirely under this license, and must not be97distributed under any other license. The requirement for fonts to98remain under this license does not apply to any document created99using the Font Software.100101TERMINATION102This license becomes null and void if any of the above conditions are103not met.104105DISCLAIMER106THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,107EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF108MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT109OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE110COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,111INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL112DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING113FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM114OTHER DEALINGS IN THE FONT SOFTWARE.115```
modified:bun.lock+11 added-1 removed
109 unmodified lines
110 "@repo/brand": "workspace:*",111 "@repo/protocol": "workspace:*",112 "@tanstack/react-router": "1.170.41",113 "@tanstack/react-start": "1.168.60",114 "class-variance-authority": "0.7.1",115 "cn": "0.4.0",116 "effect": "catalog:",117 "lucide-react": "1.52.0",118 "react": "19.3.0",119 "react-dom": "19.3.0",
1108 unmodified lines
1228 "chokidar": ["chokidar@5.0.0", "", { "dependencies": { "readdirp": "^5.0.0" } }, "sha512-TQMmc3w+5AxjpL8iIiwebF73dRDF4fBIieAqGn9RGCWaEVwQ6Fb2cGe31Yns0RRIzii5goJ1Y7xbMwo1TxMplw=="],12291230 "citty": ["citty@0.2.2", "", {}, "sha512-+6vJA3L98yv+IdfKGZHBNiGW5KHn22e/JwID0Strsz8h4S/csAu/OuICwxrg44k5MRiZHWIo8XXuJgQTriRP4w=="],12311232 "class-variance-authority": ["class-variance-authority@0.7.1", "", { "dependencies": { "clsx": "^2.1.1" } }, "sha512-Ka+9Trutv7G8M6WT6SeiRWz792K5qEqIGEGzXKhAE6xOWAY6pPH8U+9IY3oCMv6kqTmLsv7Xh/2w2RigkePMsg=="],12331234 "clean-git-ref": ["clean-git-ref@2.0.1", "", {}, "sha512-bLSptAy2P0s6hU4PzuIMKmMJJSE6gLXGH1cntDu7bWJUksvuM+7ReOK61mozULErYvP6a15rnYl0zFDef+pyPw=="],12351236 "cli-cursor": ["cli-cursor@5.0.0", "", { "dependencies": { "restore-cursor": "^5.0.0" } }, "sha512-aCj4O5wKyszjMmDT4tZj93kxyydN/K5zPWSCe6/0AV/AA1pqe5ZBIw0a2ZfPQV7lL5/yb5HsUreJ6UFAF1tEQw=="],12371238 "cli-spinners": ["cli-spinners@2.9.2", "", {}, "sha512-ywqV+5MmyL4E7ybXgKys4DugZbX0FC6LnwrhjuykIjnK9k8OQacQ7axGKnjDXWNhns0xot3bZI5h55H8yo9cJg=="],12391240 "cli-truncate": ["cli-truncate@6.1.1", "", { "dependencies": { "slice-ansi": "^9.0.0", "string-width": "^8.2.0" } }, "sha512-06p9vyLahLa4zkGcgsGxU6iEkSOiuI4fhCH6Emhe2lPAcoUv73n72DnODsnHA+5wwXGnV0n9M9/qOQJSjYhFhw=="],12411238 "cn": ["cn@0.2.6", "", { "bin": { "cn": "bin/cn.mjs" } }, "sha512-+i4L0zUGgRcEnhsxueVrP7iBGxBx5iD0WOTYg1MwFEu2ZyCmH5Ov2V1cul2Ht5UchRQQgftCf4be/RxspuW6QQ=="],1242 "clsx": ["clsx@2.1.1", "", {}, "sha512-eYm0QWBtUrBWZWG0d386OGAw16Z995PiOVo2B7bjWSbHedGl5e0ZWaq65kOGgUSNesEIDkB9ISbTg/JK9dhCZA=="],12431244 "cn": ["cn@0.4.0", "", { "bin": { "cn": "bin/cn.mjs" } }, "sha512-qOAeUhPwPzBxx6jaeQdo646XIKliKHc2j1ZF7Ngb1o0pJZKH5gq8FkA0aVdUdPFUDXNXyUCXpCtoJISo6dhizg=="],12451246 "code-block-writer": ["code-block-writer@13.0.3", "", {}, "sha512-Oofo0pq3IKnsFtuHqSF7TqBfr71aeyZDVJ0HpmqB7FBM2qEigL0iPONSCZSO9pE9dZTAxANe5XHG9Uy0YMv8cg=="],12471248 "comma-separated-tokens": ["comma-separated-tokens@2.0.3", "", {}, "sha512-Fu4hJdvzeylCfQPp9SGWidpzrMs7tTrlu6Vb8XGaRGck8QSNZJJp538Wrb60Lax4fPwR64ViY468OIUTbRlGZg=="],1249
870 unmodified lines
2120 "@google/genai/ws": ["ws@8.22.0", "", { "peerDependencies": { "bufferutil": "^4.0.1", "utf-8-validate": ">=5.0.2" }, "optionalPeers": ["bufferutil", "utf-8-validate"] }, "sha512-Ydggc987+RO0AnWtZ/7Wq9FtNvcrL1b/RO0ud9mWjUPgDrsAAwQSF51sm2hm1XofbU/4jkpGEsLFsZZxU+1DOg=="],21212122 "@pierre/diffs/diff": ["diff@9.0.0", "", {}, "sha512-svtcdpS8CgJyqAjEQIXdb3OjhFVVYjzGAPO8WGCmRbrml64SPw/jJD4GoE98aR7r25A0XcgrK3F02yw9R/vhQw=="],21232124 "@shadcn/registry/cn": ["cn@0.2.6", "", { "bin": { "cn": "bin/cn.mjs" } }, "sha512-+i4L0zUGgRcEnhsxueVrP7iBGxBx5iD0WOTYg1MwFEu2ZyCmH5Ov2V1cul2Ht5UchRQQgftCf4be/RxspuW6QQ=="],21252126 "@shadcn/registry/execa": ["execa@9.6.1", "", { "dependencies": { "@sindresorhus/merge-streams": "^4.0.0", "cross-spawn": "^7.0.6", "figures": "^6.1.0", "get-stream": "^9.0.0", "human-signals": "^8.0.1", "is-plain-obj": "^4.1.0", "is-stream": "^4.0.1", "npm-run-path": "^6.0.0", "pretty-ms": "^9.2.0", "signal-exit": "^4.1.0", "strip-final-newline": "^4.0.0", "yoctocolors": "^2.1.1" } }, "sha512-9Be3ZoN4LmYR90tUoVu2te2BsbzHfhJyfEiAVfz7N5/zv+jduIfLrV2xdQXOHbaD6KgpGdO9PRPM1Y4Q9QkPkA=="],21272128 "@shadcn/registry/undici": ["undici@7.29.1", "", {}, "sha512-RYONW2MeafgYlkVOKYKkA/Ag7BmXqgIWCa8t1m0JcxrQg9pI9lEqRhAOruOBCbAohOa/gkCF+iPi9hrgvTzu6Q=="],2129
66 unmodified lines
2196 "rolldown-plugin-dts/obug": ["obug@3.0.0", "", {}, "sha512-5vvB5+W7ePv+p3uqxi+RcW1XAzLW0/hxt3/4X4Lc4qHudzOhmBiBwOY6DRob4WnanAEGvNcLjF+KNOufrUoEQw=="],21972198 "router/path-to-regexp": ["path-to-regexp@8.4.2", "", {}, "sha512-qRcuIdP69NPm4qbACK+aDogI5CBDMi1jKe0ry5rSQJz8JVLsC7jV8XpiJjGRLLol3N+R5ihGYcrPLTno6pAdBA=="],21992200 "shadcn/cn": ["cn@0.2.6", "", { "bin": { "cn": "bin/cn.mjs" } }, "sha512-+i4L0zUGgRcEnhsxueVrP7iBGxBx5iD0WOTYg1MwFEu2ZyCmH5Ov2V1cul2Ht5UchRQQgftCf4be/RxspuW6QQ=="],22012202 "shadcn/commander": ["commander@14.0.3", "", {}, "sha512-H+y0Jo/T1RZ9qPP4Eh1pkcQcLRglraJaSLoyOtHxu6AapkjWVCy2Sit1QQ4x3Dng8qDlSsZEet7g5Pq06MvTgw=="],22032204 "shadcn/execa": ["execa@9.6.1", "", { "dependencies": { "@sindresorhus/merge-streams": "^4.0.0", "cross-spawn": "^7.0.6", "figures": "^6.1.0", "get-stream": "^9.0.0", "human-signals": "^8.0.1", "is-plain-obj": "^4.1.0", "is-stream": "^4.0.1", "npm-run-path": "^6.0.0", "pretty-ms": "^9.2.0", "signal-exit": "^4.1.0", "strip-final-newline": "^4.0.0", "yoctocolors": "^2.1.1" } }, "sha512-9Be3ZoN4LmYR90tUoVu2te2BsbzHfhJyfEiAVfz7N5/zv+jduIfLrV2xdQXOHbaD6KgpGdO9PRPM1Y4Q9QkPkA=="],2205
123 unmodified lines
added:DESIGN.md+222 added
1---2name: Myr web3description: Every page is a signed test report for a change.4colors:5 paper: "#f5f8fa"6 paper-dark: "#0e1114"7 ink: "oklch(0.21 0.015 258)"8 ink-dark: "oklch(0.94 0.005 258)"9 surface: "oklch(0.955 0.005 245)"10 surface-dark: "oklch(0.215 0.009 258)"11 muted: "oklch(0.48 0.012 258)"12 muted-dark: "oklch(0.72 0.01 258)"13 rule: "oklch(0.86 0.007 255)"14 rule-dark: "oklch(0.33 0.01 258)"15 landed: "oklch(0.47 0.11 155)"16 landed-dark: "oklch(0.78 0.13 155)"17 checking: "oklch(0.48 0.13 252)"18 checking-dark: "oklch(0.76 0.11 250)"19 waiting: "oklch(0.5 0.1 70)"20 waiting-dark: "oklch(0.82 0.12 78)"21 refused: "oklch(0.5 0.18 27)"22 refused-dark: "oklch(0.73 0.15 25)"23 sealed: "oklch(0.46 0.13 305)"24 sealed-dark: "oklch(0.76 0.11 305)"25typography:26 headline:27 fontFamily: "Public Sans, ui-sans-serif, system-ui, sans-serif"28 fontSize: "1.75rem"29 fontWeight: 60030 lineHeight: "2.2rem"31 letterSpacing: "-0.02em"32 title:33 fontFamily: "Public Sans, ui-sans-serif, system-ui, sans-serif"34 fontSize: "1.1875rem"35 fontWeight: 60036 lineHeight: "1.65rem"37 body:38 fontFamily: "Public Sans, ui-sans-serif, system-ui, sans-serif"39 fontSize: "1rem"40 fontWeight: 40041 lineHeight: "1.55rem"42 label:43 fontFamily: "Public Sans, ui-sans-serif, system-ui, sans-serif"44 fontSize: "0.75rem"45 fontWeight: 50046 lineHeight: "1.1rem"47 transcript:48 fontFamily: "JetBrains Mono, ui-monospace, monospace"49 fontSize: "0.8125rem"50 fontWeight: 40051 lineHeight: "1.5rem"52rounded:53 none: "0px"54 sm: "1px"55 md: "2px"56spacing:57 cell: "6px 8px"58 gutter: "16px"59 gutter-wide: "24px"60 section: "32px"61components:62 command-line:63 backgroundColor: "{colors.surface}"64 textColor: "{colors.ink}"65 typography: "{typography.transcript}"66 rounded: "{rounded.none}"67 padding: "4px 4px 4px 12px"68 posture-badge:69 textColor: "{colors.sealed}"70 typography: "{typography.label}"71 rounded: "{rounded.none}"72 padding: "2px 8px"73 stage-cell:74 textColor: "{colors.ink}"75 typography: "{typography.label}"76 padding: "{spacing.cell}"77 button-primary:78 backgroundColor: "{colors.ink}"79 textColor: "{colors.paper}"80 rounded: "{rounded.none}"81 height: "32px"82---8384# Design System: the web8586The web's look, for every page issue to start from. Tokens live in `apps/web/src/styles.css`; the shared pieces that draw refusals, credit, posture, outcomes and stages live in `apps/web/src/features/shared/`, and a page uses them rather than drawing its own. Words follow `GLOSSARY.md` and `PRODUCT.md`. Written in W5 (issue 511) from the shell and shared pieces; W7 (issue 713) revises it from the pages that shipped.8788## Overview8990**Creative North Star: "The Test Certificate"**9192Every page is a report sheet for a change: a title over a double rule, fields, a results row for the gate's stages, a nonconformance block when the gate refused, and signatories kept apart from the instruments used. A calibration certificate lists who signed it and, separately, the equipment the test ran on; the web does the same with credit trailers (people) and `Assisted-by` (agents, never credit). Landed is the stamp; held-back checks are the seal.9394The pages are for operating, not persuading. Density is set by a decider clearing Today on a phone and by a contributor reading a refusal beside a terminal. The look carries no decoration that is not a rule, a field or a mark. Colour means state and nothing else, and always sits beside a word and a mark, so a page read in grayscale, by a screen reader or in a terminal says the same thing.9596Rejected on purpose: the developer-forge dashboard (cards in a grid, a blue accent, pill badges everywhere) and its opposite, the terminal costume (green on black, monospace for everything). Monospace appears only where the text is code: commands, refusal transcripts, trailers, SHAs, paths and ids.9798**Key Characteristics:**99100- One-pixel hairline rules part sections; boxes inside boxes never do.101- A page title sits over a double rule (`border-double`, 3 px), the sheet's header.102- State is a mark (check, dot, cross, hollow circle, dash), then a word, then a colour.103- Every action is a command to copy, never a form for something git or the CLI does.104- Light and dark follow the system setting; there is no toggle.105106## Colors107108Cool bond paper and blue-black ink, with five state roles that never appear as decoration.109110### State roles111112Each is text-safe: at least 5:1 on paper and on surface, in both themes.113114- **Landed green** (`--landed`, oklch(0.47 0.11 155); dark oklch(0.78 0.13 155)): the change is on main. The landing's stamp mark, passed stages, a landed outcome's lead word.115- **Checking blue** (`--checking`, oklch(0.48 0.13 252); dark oklch(0.76 0.11 250)): the gate is running a stage now. The current stage while checking, the "Checking" lead word, the text caret, the selection tint.116- **Waiting ochre** (`--waiting`, oklch(0.5 0.1 70); dark oklch(0.82 0.12 78)): passed or paused, waiting on a person or a parent ask (a decision, a finish, a parent landing), and the mark of a retryable refusal. Waiting is never shown in the refused colour.117- **Refused red** (`--refused`, oklch(0.5 0.18 27); dark oklch(0.73 0.15 25)): a refusal. The rubric colour: the nonconformance block's top rule, its headline and each refusal's tag. Nothing else is red.118- **Sealed violet** (`--sealed`, oklch(0.46 0.13 305); dark oklch(0.76 0.11 305)): held-back checks, layers, sealed evidence and the postures that keep something sealed. The `Held-back:` trailer line, the posture badge, the ledger (W6).119- **Muted grey** (`--muted`, oklch(0.48 0.012 258); dark oklch(0.72 0.01 258)): not reached, not needed, secondary text and field labels. Used through Tailwind's `text-muted-foreground`.120121### Neutral122123- **Bond paper** (`--background`, #f5f8fa; dark #0e1114): the page. Hex, because the `theme-color` meta and the web app manifest repeat it (`features/shared/theme.ts`; a test holds the two equal).124- **Blue-black ink** (`--foreground`, oklch(0.21 0.015 258); dark oklch(0.94 0.005 258)): text, the double rule, primary buttons, the focus outline.125- **Field surface** (`--surface`, oklch(0.955 0.005 245); dark oklch(0.215 0.009 258)): command lines and filled fields. shadcn's `bg-muted`, `bg-secondary` and `bg-accent` all resolve here.126- **Hairline** (`--rule`, oklch(0.86 0.007 255); dark oklch(0.33 0.01 258)): every border and rule.127128### Named Rules129130**The Rubric Rule.** Red belongs to refusals. A destructive button, an error toast or a "danger" badge uses the refused role only when it is a refusal.131132**The Word First Rule.** No state is carried by colour alone: every coloured mark has a word beside it (`passed`, `now`, `refused`, `not yet`, `not needed`; "Waiting", "Landed").133134**The No Score Rule.** No colour, size or ordering ever ranks a person. Handles are links in ink; a record is never shown as a number.135136## Typography137138**Body Font:** Public Sans (variable, self-hosted, latin and latin-ext; fallback `ui-sans-serif, system-ui`)139**Mono Font:** JetBrains Mono (variable, self-hosted; fallback `ui-monospace`)140141**Character:** Public Sans was drawn for government forms, a workhorse grotesque that reads as an official document without ceremony. JetBrains Mono sets only what a terminal would print.142143### Hierarchy144145A fixed rem scale, ratio about 1.2; product type does not float with the viewport.146147- **Headline** (600, 1.75rem, 2.2rem, -0.02em, `text-balance`): the page title in `PageShell`, one per page.148- **Title** (600, 1.1875rem): a section of a page.149- **Body** (400, 1rem, 1.55rem): prose and outcome sentences; prose holds to 65–75ch.150- **Small** (0.875rem): nav, secondary lines.151- **Label** (500, 0.75rem, sentence case, muted): field labels ("Credit", "Plain git: clone any project") and stage cells. No uppercase tracking, and never a kicker above a heading.152- **Transcript** (JetBrains Mono 400, 0.8125rem, 1.5rem): refusal lines, command lines, trailers, ids. Refusal transcripts hold to 96ch, about git's width.153154## Layout155156One centred column, `max-w-6xl` (72rem), with a 16 px gutter on phones and 24 px from `sm` (640 px). The header is 48 px: the name, then Asks (the front page) and Today, then the session slot at the end. Every page is `PageShell`: its title over the double rule, then its regions 32 px apart. The footer gives the two ways in, plain git and the CLI install line, in one column on phones and two from `sm`.157158Phone width (360 px) is a first-class layout: nothing scrolls sideways. Long commands and paths wrap anywhere (`overflow-wrap: anywhere`) rather than overflow; the stage strip folds from seven cells in a row to four and three.159160## Elevation & Depth161162Flat. No shadows on the page; depth is rules and the field surface. Overlays (dialog, dropdown, tooltip) are the only raised layers, and they take shadcn's own ring and shadow.163164## Shapes165166Square. The radius is 2 px (`--radius: 0.125rem`), and shadcn's base-lyra components already square most corners (`rounded-none`). Borders are one-pixel hairlines; the page title's double rule is the one heavier line; an empty state's border is dashed, an unfilled field.167168## Components169170### Command line (`CommandLine`)171- **Character:** the line a reader runs next, whole and copyable.172- **Shape:** a field-surface box with a hairline border that hugs its command (`w-fit`, `max-w-full`), a muted `$` that selection skips, the command in mono (`select-all`, so one tap selects it), and a ghost "Copy" button (icon only on phones). Copying shows "Copied" for 2 s.173174### Refusal (`RefusalView`)175- **Character:** the nonconformance block. It reads exactly as `git push` printed it.176- **Shape:** a 2 px refused top rule, then `headline(refusals)` in mono red with an octagon mark, then one row per refusal, parted by hairlines: its `explain` lines verbatim (indentation kept, tag in red), then its `next` command as a `CommandLine`. A retryable refusal's mark is an ochre turn-back arrow; a final one's is the red octagon. The web never rewords a refusal.177178### Outcome (`OutcomeView`) and stage strip (`StageStrip`)179- **Outcome:** one sentence, a mark and a lead word in the role colour, the rest in ink: "Checking at the checks stage", "Passed, waiting for a decider's finish from okonkwo", "Waiting on decision dec-000001", "Landed as 9b1c3e5". A refusal is drawn by `RefusalView`. `data-outcome` and `data-state` (`waiting` or `final`) carry it for tests and styles.180- **Stage strip:** the gate's results row, a ruled table of seven cells in cost order (Parse, Shape, Merge, Cheap, Checks, Held-back, Decider), each with a mark, its label and a state word. `data-stage` and `data-state` (`passed`, `current`, `refused`, `pending`, `skipped`) on each cell; the current cell is `aria-current="step"`.181182### Credit trailers (`CreditTrailers`)183- **Character:** the signatories, then the instruments, as the landing commit carries them.184- **Shape:** a "Credit" label over one mono line per trailer, `Role: handle`, in the order of `CreditRole`'s literals (Asked-by first), each handle a link to `/people/<handle>`. A `Held-back:` line follows in sealed violet with a lock mark. Then, below a dashed rule and labelled "Agents used, disclosed and not credit", one muted `Assisted-by:` line per agent, spelled as the trailer is (`pi:opus-4 (claimed)`).185186### Posture badge (`PostureBadge`)187- **Shape:** a square outline badge with the platform's label, never rewritten; sealed violet for postures that keep something sealed, ink for open, muted for source available. `data-posture` carries the literal.188189### Time (`When`), people (`HandleLink`), empty lists (`EmptyState`)190- **When:** "in 3 h", "2 d ago", "now"; the exact time in `dateTime` and the tooltip.191- **HandleLink:** the handle in medium weight, underlined in hairline colour, ink underline on hover.192- **EmptyState:** a dashed-border block with what is empty and the command that would change it.193194### Buttons and the rest of shadcn195- shadcn 4.21.2, style `base-lyra` on Base UI, in `src/components/ui/` (generated; issue 511 owns them, views ask for more under their issue's Comments). Primary buttons are ink on paper, 32 px high, square; ghost buttons for secondary actions.196197### Navigation198- Text links in muted ink; hover to ink; the current page in ink, medium weight, with a 2 px ink underline at the header's foot (`aria-current="page"`). A skip link to `#main` appears on focus.199200## Motion201202Minimal: motion carries state, never decoration. Transitions are 150–250 ms. One authored moment: a landing's stamp mark settles once (`animate-stamp`, 420 ms, scale 1.35 to 1 with an exponential ease-out). `prefers-reduced-motion` reduces every animation and transition to nothing.203204## Accessibility205206WCAG 2.2 AA. Text contrast at least 5:1 for every role in both themes (body ink is 16:1). Focus is a 2 px ink outline, 2 px out, on every control. Every state is a word as well as a colour and a mark. Icons are `aria-hidden`; their meaning is in the text beside them. The page works at 360 px with no horizontal scroll, and with the system's text size raised.207208## Do's and Don'ts209210### Do:211- **Do** draw refusals, credit, posture, outcomes and stages with the shared components; ask for a change to them under your issue's Comments.212- **Do** show the command for every action, through `CommandLine`.213- **Do** part sections with hairline rules and space (32 px between page regions).214- **Do** take the platform URL from the root route's loader data (`getRouteApi("__root__").useLoaderData().platformUrl`).215216### Don't:217- **Don't** reword a refusal or compute your own explanation of one; render `explain` and `headline`.218- **Don't** show a score, a rank, a count of a person's landings as a measure, or a leaderboard.219- **Don't** put cards in a grid or boxes inside boxes; a section is a heading and rules.220- **Don't** use red for anything but a refusal, or colour without a word.221- **Don't** use monospace for prose or labels.222- **Don't** add a theme toggle or a second component kit.
added:PRODUCT.md+71 added
1# Product23<!-- impeccable:product-schema 1 -->45What the web of Myr is for, and what it never does. Words follow `GLOSSARY.md`: ask, answer, check, refusal, decider, Today, landing. Written in W5 (issue 511) before the pages were built; W7 (issue 713) revises it from what shipped. Facts marked ASSUMPTION were inferred from the build plan, not confirmed by the maintainer.67## Platform89web1011## Users1213Four readers, in the order the web serves them:14151. **A newcomer looking for a first ask.** They arrive from a link or the front page, often on a phone, and want to know what a project wants, whether they may take it, and the three commands that start it. They have no account yet and may never need one: git and the CLI do the work.162. **A contributor checking an answer.** They pushed from a terminal (or their agent did) and open the answer's page to see where it stands: which stage of the gate it reached, which checks ran, and, if it was refused, the same refusal `git push` printed, with its `next` command.173. **A decider spending a daily budget.** They open Today, often on a phone between other work, and take a handful of decisions, each with its evidence and its safe default, in one tap each. A decider who does nothing lets nothing in.184. **Agents fetching Markdown.** A harness reads an ask as Markdown (`Accept: text/markdown` or `.md`), `llms.txt`, and the well-known MCP and skill documents. The HTML pages are for people; the same facts in Markdown are for agents.1920## Product Purpose2122Myr is a whole Git platform on Cloudflare: everything a project ships is public, the contribution process is typed code on main, and a change lands only by passing a typed gate. The terminal and git are where work happens. The web is where people look: at what a project wants, where an answer stands, who is credited for a landing, and what a decider owes today.2324Success: a newcomer goes from the front page to a running `claim` in under a minute; a contributor reads a refusal on the web exactly as git printed it; a decider clears Today on a phone.2526## Positioning2728A refusal is a typed value with a reason, a place, a next command and whether retrying can help; credit is a set of git trailers on the landing commit; a posture is computed from the project's config. The web renders those values as they are. It never re-words a refusal, never invents a score, and never shows a diff to someone who does not decide.2930## Operating Context3132- Work happens in git and the CLI (`Brand.cli` in code). Every page that suggests an action shows the command, copyable, rather than a web form for it. Signing in is only for deciders (Today, decisions, finishing an answer).33- Pages per job:34 - **Front page** (`/`): open asks across projects a viewer may take, filtered by kind and by asks held for newcomers.35 - **Project** (`/$project`): its asks, its posture, its recent landings with their credit trailers, and how to take part (clone, `asks`, `claim`, `check`).36 - **Ask** (`/$project/asks/$ask`): the want, the territory, the check, who may claim, and the commands; also served as Markdown.37 - **Answer** (`/$project/answers/$ask`): the verdict stage by stage, the lanes, held-back results as one bit per area, or the refusal.38 - **Person** (`/people/$handle`): their credits by role and area, never a score.39 - **Today** (`/today`): a decider's decisions with evidence, defaults and expiry, against the budget.40 - **Ledger and env shape** (W6): the public record of layers, commitments and posture changes; the env shape with no values.41- Phone width is a first-class target (Today installs as a PWA). ASSUMPTION: deciders use Today mostly on a phone and the other pages mostly on a laptop beside a terminal.4243## Capabilities and Constraints4445- The web Worker holds no storage binding and no secrets; every read goes through `/rpc` to the platform (AGENTS.md principle 7). It cannot show what the platform does not return.46- Refusal text comes only from `@repo/protocol/render` (`explain`, `headline`), the one renderer for git, the CLI, MCP and the web (principle 3).47- The web never: shows a diff to anyone but a decider finishing an answer; shows a score, rank or count of a person as a measure of quality (a record is for trust rules only); reads a write-only value back; names a held-back path or case to someone outside its layer.48- Undecided: whether the web gets a light or dark default per page (it follows the system setting); a custom domain (H1).4950## Brand Commitments5152- The name lives only in `packages/brand`: code takes it from `Brand.name` and the command from `Brand.cli`.53- Tone: plain, factual, git-native. Sentences say what happened and what to run next. No exclamation marks, no celebration copy, no gamification, no "PR", "issue" (for an ask), "reputation" or "review".54- Credit trailers read as they do on the commit (`Asked-by: ines`), in one order; `Assisted-by` is shown apart because it is a disclosure, never credit.5556## Evidence on Hand5758- The examples `examples/datekit` and `examples/burrow` are fictional projects with fictional people (`ines-v`, `okonkwo`, `okafor`, `lin-h`); pages showing them must not pass them off as real users.59- Measured numbers come only from `bench/results/`. No testimonials, customers or adoption figures exist; none may be invented.6061## Product Principles62631. **The terminal is the workplace; the web is the window.** Every action shows its command; the web adds no second way to land.642. **Render the typed value, not a paraphrase.** Refusals, credits, postures and outcomes look the same on every page because one component draws each.653. **Waiting is not refusing.** Checking, waiting on a parent ask, a finish or a decision each read as waiting, never as an error.664. **No scores.** People appear by handle and role; nothing ranks them.675. **Decisions fit a phone.** Today's density is set by a decider clearing it in a few minutes on a small screen.6869## Accessibility & Inclusion7071WCAG 2.2 AA: text contrast at least 4.5:1, visible focus on every control, every state carried by a word as well as a colour, `prefers-reduced-motion` honoured, and usable at 360 px wide with no horizontal scroll.