mirror of
https://github.com/hanzo-apps/hanzo.ai.git
synced 2026-10-28 07:32:52 +00:00
The index, its boards and the shelf's pages wrap their prose: server pages with <T>, the boards and the library with t(), and copy held in data with phrase(). Figures read from the runs are values, and the fields lib/kai, lib/tools, lib/coding and lib/tally hand a board are drawn through t(), so they translate once those files emit keys. The shared parts (Chapter, Fold, Stat, Tile, Panel, Mark) translate a string where they draw it and take a node from a server page. figures.spec lets the index import @hanzo/i18n: words in, words out, never a figure.
111 lines
4.3 KiB
TypeScript
111 lines
4.3 KiB
TypeScript
'use client'
|
||
|
||
import { BENCH, LEVEL, ahead, gains, range, short, times, type Coding as Data, type Side } from '@/lib/coding'
|
||
import { useI18n } from '@hanzo/i18n/react'
|
||
import { useCoding } from '@/hooks/useCoding'
|
||
import { Block, Foot, H2, Note, P, Part, Stat, Table, Td, Th, Tr, n1 } from './kit'
|
||
|
||
/**
|
||
* Hanzo Dev against Claude Code on single-fault repairs (lib/coding). The page
|
||
* renders the build-time snapshot (INDEX.coding in lib/bench-data) and `useCoding`
|
||
* swaps in what the research API holds when it answers. The speed is said over
|
||
* the tasks both solved; the paths drawn are the resolved gains, and both solved
|
||
* counts stand beside the speed only while Hanzo Dev solved more (lib/coding
|
||
* `gains`, `ahead`). This file is layout, and e2e/unit/figures.spec.ts fails on a
|
||
* digit in it.
|
||
*/
|
||
export function Coding({ initial }: { initial: Data | null }) {
|
||
const { t } = useI18n()
|
||
const c = useCoding(initial)
|
||
if (!c) return null
|
||
const sides: Side[] = [c.base, c.ours]
|
||
const solved = ahead(c)
|
||
return (
|
||
<Part id="coding-agent">
|
||
<H2>{t('Verified coding-agent performance')}</H2>
|
||
<P>
|
||
{t(
|
||
'Hanzo Dev, with Kai and Enso Flash on api.hanzo.ai, against native Claude Code on held-out repository repairs. Each task is one fault its visible test fails on, and counts as solved only when a hidden verifier passes. Speed is the paired wall time over the tasks both solved.',
|
||
)}
|
||
</P>
|
||
<Stat
|
||
figure={times(c.speed)}
|
||
label={t('faster on the {n} tasks both solved', { n: String(c.speed.n) })}
|
||
note={
|
||
solved
|
||
? t('Hanzo Dev solved {ours} of {oursOf}; Claude Code {base} of {baseOf}. {level} interval {range}.', {
|
||
ours: c.ours.solved,
|
||
oursOf: c.ours.of,
|
||
base: c.base.solved,
|
||
baseOf: c.base.of,
|
||
level: LEVEL,
|
||
range: range(c.speed),
|
||
})
|
||
: t('{level} interval {range}.', { level: LEVEL, range: range(c.speed) })
|
||
}
|
||
href="#coding-agent"
|
||
/>
|
||
<Block id="kai-coding-agent">
|
||
<Table>
|
||
<thead>
|
||
<tr>
|
||
<Th left>{t('Tasks both solved, by how Hanzo Dev settled them')}</Th>
|
||
<Th>{t('Tasks')}</Th>
|
||
<Th>{t('Speed')}</Th>
|
||
<Th>{t('{level} interval', { level: LEVEL })}</Th>
|
||
</tr>
|
||
</thead>
|
||
<tbody>
|
||
{[c.speed, ...gains(c.paths)].map((s) => (
|
||
<Tr key={s.label} dim={!s.resolved}>
|
||
<Td left wrap>
|
||
{t(s.label)}
|
||
</Td>
|
||
<Td>{s.n ?? '–'}</Td>
|
||
<Td tone={s.gain ? 'ours' : 'plain'}>{times(s)}</Td>
|
||
<Td>{range(s)}</Td>
|
||
</Tr>
|
||
))}
|
||
</tbody>
|
||
</Table>
|
||
<Table>
|
||
<thead>
|
||
<tr>
|
||
<Th left>{t('Agent')}</Th>
|
||
{solved ? <Th>{t('Solved')}</Th> : null}
|
||
<Th>{t('Median seconds')}</Th>
|
||
<Th>{t('Model calls a task')}</Th>
|
||
</tr>
|
||
</thead>
|
||
<tbody>
|
||
{sides.map((s) => (
|
||
<Tr key={s.system}>
|
||
<Td left wrap>
|
||
{s.system === 'claude-code' ? `Claude Code, ${s.version}` : `Hanzo Dev, ${s.version}`}
|
||
</Td>
|
||
{solved ? <Td>{`${s.solved} / ${s.of}`}</Td> : null}
|
||
<Td>{n1(s.median)}</Td>
|
||
<Td>{n1(s.calls)}</Td>
|
||
</Tr>
|
||
))}
|
||
</tbody>
|
||
</Table>
|
||
<Note>
|
||
{t(
|
||
'The fastest tasks are settled by a search with no model call: it tries single-token edits of the kinds these faults are drawn from against the visible test alone, and never reads a hidden test or the fault. These results are specific to this benchmark, one attempt a task; they are not a claim about general-purpose coding.',
|
||
)}
|
||
</Note>
|
||
<Foot>
|
||
{t('Research runs of {bench} on split {split}, ended {ended}, harness commit {commit}: {request}.', {
|
||
bench: BENCH,
|
||
split: c.split,
|
||
ended: c.ended,
|
||
commit: short(c.commit),
|
||
request: `GET /v1/research/runs?benchmark=${BENCH}`,
|
||
})}
|
||
</Foot>
|
||
</Block>
|
||
</Part>
|
||
)
|
||
}
|