Add reviews view, work-type UI updates, and permanent deploy workflow (ces-control)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FbMbJPadPzVwvt9rU9GBNo
This commit is contained in:
2026-10-22 14:50:03 +00:00
parent 0a8c7fd4de
commit f5d014a022
10 changed files with 535 additions and 108 deletions
+21
View File
@@ -0,0 +1,21 @@
name: Deploy
on:
push:
branches: [main]
workflow_dispatch: {}
jobs:
deploy:
runs-on: ces-control
timeout-minutes: 30
steps:
- name: Checkout
run: |
git init .
git remote add origin "$GITHUB_SERVER_URL/$GITHUB_REPOSITORY.git"
git -c http.extraHeader="Authorization: token ${{ github.token }}" fetch --depth 1 origin "$GITHUB_SHA"
git checkout --detach FETCH_HEAD
- name: Deploy (systemd service, permanent)
env:
APP_PORT: ${{ vars.APP_PORT }}
run: sh scripts/deploy.sh "$GITHUB_SHA"
+116
View File
@@ -0,0 +1,116 @@
import Link from 'next/link';
import Layout from './Layout';
import { ScoreBars, ScoreScatter, TimelineBars } from './SvgCharts';
import { typeSlug } from '../lib/slug';
import type { getWorkType } from '../lib/worktypes';
type Data = NonNullable<ReturnType<typeof getWorkType>>;
const sc = (d: string) => (d.length > 140 ? d.slice(0, 138) + '…' : d);
export default function LegacyTypeView({ data, page, llm, slug }: { data: Data; page: number; llm: boolean; slug: string }) {
const { type, area, role, members, timeline, benchmarks, results, siblings, sameRole, note, workflows, total, pageSize } = data;
const pages = Math.max(1, Math.ceil(total / pageSize));
const href = (p: number, src = llm) => `/work-types/${slug}?${[src ? 'src=llm' : '', p > 1 ? `page=${p}` : ''].filter(Boolean).join('&')}`;
const withScores = results.length > 0;
return (
<Layout title={`${area.label} · ${role.label}`}>
<p><Link href="/work-types">← All types of work</Link></p>
<h1>{role.label}</h1>
<p className="sub">in <b>{area.label}</b> · {type.n_papers.toLocaleString()} papers ({type.n_llm_labeled} labelled in detail)</p>
<h2>1. Time order</h2>
<div className="card">
<TimelineBars items={timeline} />
<p className="sub" style={{ margin: '6px 0 0' }}>Papers placed by venue date; the table below lists them in the same order. Exact submission dates need arXiv access.</p>
</div>
<h2>2. How it is classified, and why different papers are the same type</h2>
<div className="card">
<p><b>Definition.</b> {role.descr}</p>
<p><b>Holds fixed:</b> {role.fixes || '—'} &nbsp; <b>Varies:</b> {role.varies || '—'}</p>
{note?.why_same && <p><b>What these papers share:</b> {note.why_same}</p>}
{note?.narrative && <p>{note.narrative}</p>}
<p><b>How this type differs from neighbours in the same area</b></p>
<table>
<thead><tr><th>Role (same area)</th><th>Fixes</th><th>Varies</th><th>Papers</th></tr></thead>
<tbody>
{siblings.map((s) => (
<tr key={s.id} style={s.id === type.id ? { fontWeight: 700 } : undefined}>
<td>{s.id === type.id ? s.label : <Link href={`/work-types/${typeSlug(s.id)}`}>{s.label}</Link>}</td><td>{s.fixes || '—'}</td><td>{s.varies || '—'}</td><td>{s.n_papers}</td>
</tr>
))}
</tbody>
</table>
{sameRole.length > 0 && (
<p style={{ marginTop: 10 }}><b>Same role in other areas:</b>{' '}
{sameRole.map((s) => <Link key={s.id} className="badge" href={`/work-types/${typeSlug(s.id)}`}>{s.label.slice(0, 40)} {s.n_papers}</Link>)}
</p>
)}
</div>
<h2>3. Benchmarks usually used, and what they are used to show</h2>
{benchmarks.length ? (
<table>
<thead><tr><th>Benchmark</th><th>Papers</th><th>Introduced here</th><th>Used to show</th></tr></thead>
<tbody>
{benchmarks.map((b) => (
<tr key={b.id}><td><Link href={`/benchmarks/${b.id}`}>{b.name}</Link></td><td>{b.n}</td><td>{b.n_new || ''}</td><td>{b.purposes ?? '—'}</td></tr>
))}
</tbody>
</table>
) : <p className="sub">No benchmark named in these papers’ abstracts yet.</p>}
{note?.bench_summary && <p>{note.bench_summary}</p>}
<h2>4. Workflow</h2>
<div className="card">
{note && note.workflow.length > 0 && (
<ol style={{ margin: '0 0 10px', paddingLeft: 20 }}>{note.workflow.map((s, i) => <li key={i}>{s}</li>)}</ol>
)}
{workflows.length > 0 ? workflows.map((w) => (
<p key={w.id} style={{ margin: '6px 0', fontSize: 14 }}>
<Link href={`/papers/${w.id}`}>{w.title.slice(0, 60)}</Link>: {w.steps.join(' → ')}
</p>
)) : <span className="sub">Workflows are extracted for papers that were read in detail.</span>}
</div>
<h2>5. Scores</h2>
<div className="card">
{withScores ? (
<>
<ScoreScatter points={results.map((r) => ({ date: r.date, score: r.score, series: r.setting ?? 'reported', label: `${r.system ?? '?'} on ${r.bench}`, unit: r.unit }))} />
<h3 style={{ fontSize: 14 }}>Best reported score per system</h3>
<ScoreBars rows={results.map((r) => ({ label: `${r.system ?? '?'} · ${r.bench}`, score: r.score, series: r.setting ?? 'reported' }))} />
</>
) : (
<p className="sub" style={{ margin: 0 }}>
No numeric scores are stated in the abstracts of this type’s papers. Scores sit in result tables, which need the full text (arXiv / OpenReview / ACL Anthology). The chart renders automatically once results are loaded.
</p>
)}
</div>
<h2>Papers in time order</h2>
<div className="filters">
<Link className={`btn ${llm ? 'ghost' : ''}`} href={href(1, false)}>All labels</Link>
<Link className={`btn ${llm ? '' : 'ghost'}`} href={href(1, true)}>Detailed (LLM-read) only</Link>
</div>
<table>
<thead><tr><th>Date</th><th>Paper</th><th>What it varies / holds fixed</th><th>Why this type</th></tr></thead>
<tbody>
{members.map((m) => (
<tr key={m.id}>
<td style={{ whiteSpace: 'nowrap' }}>{m.date.slice(0, 7)}<div className="sub" style={{ margin: 0, fontSize: 12 }}>{m.conf_short}{m.track ? ` · ${m.track}` : ''}</div></td>
<td><Link href={`/papers/${m.id}`}>{m.title}</Link>{m.source === 'rule' && <span className="badge" title="rule-based label">rule</span>}{m.summary && <div className="sub" style={{ margin: 0, fontSize: 13 }}>{sc(m.summary)}</div>}</td>
<td style={{ fontSize: 13 }}>{m.varies.length ? <>varies: {m.varies.join('; ')}</> : '—'}{m.fixes.length ? <><br />fixes: {m.fixes.join('; ')}</> : null}</td>
<td style={{ fontSize: 13 }}>{m.why || '—'}</td>
</tr>
))}
</tbody>
</table>
<div className="pager">
<Link className={`btn ghost ${page <= 1 ? 'dis' : ''}`} href={href(page - 1)}>← Prev</Link>
<span>Page {page} / {pages}</span>
<Link className={`btn ghost ${page >= pages ? 'dis' : ''}`} href={href(page + 1)}>Next →</Link>
</div>
</Layout>
);
}
+48
View File
@@ -0,0 +1,48 @@
import Link from 'next/link';
import { Fragment, ReactNode } from 'react';
/** Minimal, safe markdown: paragraphs, ###/#### headings, -/1. lists, **bold**, *italic*, `code`, citations [#id] / [#a, #b]. */
export default function Markdown({ text, cite }: { text: string; cite: Record<number, number> }) {
const blocks = (text ?? '').replace(/\r/g, '').split(/\n{2,}/);
return <>{blocks.map((b, i) => <Block key={i} src={b.trim()} cite={cite} />)}</>;
}
function Block({ src, cite }: { src: string; cite: Record<number, number> }) {
if (!src) return null;
const h = src.match(/^(#{2,4})\s+(.*)$/);
if (h && !src.includes('\n')) {
const lvl = h[1].length;
return lvl <= 3 ? <h3 className="md-h">{inline(h[2], cite)}</h3> : <h4 className="md-h">{inline(h[2], cite)}</h4>;
}
const lines = src.split('\n');
if (lines.every((l) => /^\s*[-*]\s+/.test(l))) return <ul>{lines.map((l, i) => <li key={i}>{inline(l.replace(/^\s*[-*]\s+/, ''), cite)}</li>)}</ul>;
if (lines.every((l) => /^\s*\d+[.)]\s+/.test(l))) return <ol>{lines.map((l, i) => <li key={i}>{inline(l.replace(/^\s*\d+[.)]\s+/, ''), cite)}</li>)}</ol>;
return <p>{inline(lines.join(' '), cite)}</p>;
}
export function inline(s: string, cite: Record<number, number>): ReactNode[] {
const out: ReactNode[] = [];
const re = /(\[#\d+(?:\s*[,;]\s*#?\d+)*\])|(\*\*[^*]+\*\*)|(\*[^*\s][^*]*\*)|(`[^`]+`)/g;
let last = 0; let m: RegExpExecArray | null; let k = 0;
while ((m = re.exec(s))) {
if (m.index > last) out.push(s.slice(last, m.index));
const t = m[0];
if (m[1]) {
const ids = [...t.matchAll(/(\d+)/g)].map((x) => Number(x[1]));
out.push(<sup key={k++} className="cite">[{ids.map((id, j) => (
<Fragment key={id}>{j > 0 && ','}<a href={`#ref-${id}`} title={`paper ${id}`}>{cite[id] ?? '?'}</a></Fragment>
))}]</sup>);
} else if (m[2]) out.push(<strong key={k++}>{t.slice(2, -2)}</strong>);
else if (m[3]) out.push(<em key={k++}>{t.slice(1, -1)}</em>);
else out.push(<code key={k++}>{t.slice(1, -1)}</code>);
last = m.index + t.length;
}
if (last < s.length) out.push(s.slice(last));
return out;
}
/** Inline list of citation chips for id arrays (tables). */
export function Cites({ ids, cite }: { ids: number[]; cite: Record<number, number> }) {
return <>{ids.map((id) => <a key={id} className="cite-chip" href={`#ref-${id}`}>[{cite[id] ?? '?'}]</a>)}</>;
}
export { Link };
+49
View File
@@ -0,0 +1,49 @@
const PALETTE = ['#2f5bea', '#e0702b', '#1b9e77', '#a14b9c', '#c9a227', '#d6336c', '#37a0d6', '#6b8e23'];
/** Swimlane: one lane per subfield, papers as dots on a venue-date axis. */
export function SubfieldTimeline({ lanes, cite }: { lanes: { name: string; papers: { id: number; date: string; title: string }[] }[]; cite: Record<number, number> }) {
const all = lanes.flatMap((l) => l.papers);
if (!all.length) return null;
const ts = (d: string) => new Date(d + (d.length === 7 ? '-15' : '') + 'T00:00:00Z').getTime();
const lo = Math.min(...all.map((p) => ts(p.date))) - 25 * 864e5, hi = Math.max(...all.map((p) => ts(p.date))) + 25 * 864e5;
const W = 760, L = 210, R = 16, laneH = 34, top = 8, H = top + lanes.length * laneH + 30;
const X = (t: number) => L + ((t - lo) / (hi - lo || 1)) * (W - L - R);
const months: number[] = [];
for (let d = new Date(lo); d.getTime() <= hi; d.setUTCMonth(d.getUTCMonth() + 1)) months.push(Date.UTC(d.getUTCFullYear(), d.getUTCMonth(), 1));
return (
<svg viewBox={`0 0 ${W} ${H}`} width="100%" role="img" aria-label="papers per subfield over time">
{months.map((m) => (<g key={m}><line x1={X(m)} x2={X(m)} y1={top} y2={H - 26} stroke="currentColor" opacity=".08" /><text x={X(m)} y={H - 10} fontSize="10" textAnchor="middle" fill="currentColor" opacity=".6">{new Date(m).toISOString().slice(0, 7)}</text></g>))}
{lanes.map((l, i) => {
const y = top + i * laneH + laneH / 2;
const byDate: Record<string, number> = {};
return (
<g key={l.name}>
<text x={L - 8} y={y + 4} fontSize="11" textAnchor="end" fill="currentColor">{l.name.length > 32 ? l.name.slice(0, 31) + '…' : l.name}</text>
<line x1={L} x2={W - R} y1={y} y2={y} stroke="currentColor" opacity=".15" />
{l.papers.map((p) => {
const k = (byDate[p.date] = (byDate[p.date] ?? 0) + 1);
const dx = ((k - 1) % 6) * 7 - 17, dy = Math.floor((k - 1) / 6) * 7 - 5;
return (
<a key={p.id} href={`#ref-${p.id}`}>
<circle cx={X(ts(p.date)) + dx} cy={y + dy} r="4.5" fill={PALETTE[i % PALETTE.length]} opacity=".85"><title>{`[${cite[p.id]}] ${p.title} (${p.date})`}</title></circle>
</a>
);
})}
</g>
);
})}
</svg>
);
}
/** Horizontal workflow: boxes with arrows, wrapping. */
export function WorkflowFlow({ steps }: { steps: string[] }) {
if (!steps.length) return null;
return (
<div className="flow">
{steps.map((s, i) => (
<div key={i} className="flow-step"><span className="flow-n">{i + 1}</span>{s}{i < steps.length - 1 && <span className="flow-arrow">→</span>}</div>
))}
</div>
);
}
+53
View File
@@ -0,0 +1,53 @@
import { db } from './db';
export interface Review {
type_id: string; title: string; abstract: string;
perspective: { options: { name: string; pros: string; cons: string }[]; chosen: string; why: string };
outline: { section: string; purpose: string; words: number }[];
subfields: { name: string; description: string; focus: string; key_paper_ids: number[]; paper_ids: number[]; relations: string }[];
evolution: { pioneering: { id: number; why: string }[]; paths: { name: string; paper_ids: number[]; narrative: string }[]; gaps: string[]; connections: string[]; reading_order: number[] };
papers: { id: number; question: string; innovation: string; method: string; findings: string; contribution: string; limitations: string; summary: string; subfield: string }[];
methods: { families: { name: string; description: string; paper_ids: number[]; pros: string; cons: string; trend: string }[]; trends: string; suggested_new_methods: string[] };
key_data: { rows: { id: number; subject: string; metric: string; data: string; conclusion: string }[]; patterns: string; contradictions: string; missing: string };
sections: { introduction: string; body: { title: string; subfield: string; content: string }[]; comparative: string; challenges: string; future: string; conclusion: string };
novel_perspective: string;
quality: { checks: { issue: string; status: string; note: string }[]; limitations_of_this_review: string };
}
export interface RefMeta { id: number; title: string; authors: string; venue: string; date: string; url: string | null }
const CITE = /\[#(\d+)(?:\s*[,;]\s*#?(\d+))*\]/g;
/** Order of first citation across the article -> reference numbers. */
function citationOrder(r: Review): number[] {
const parts = [r.sections.introduction, ...r.sections.body.map((b) => b.content), r.sections.comparative, r.sections.challenges, r.sections.future, r.sections.conclusion];
const seen: number[] = [];
for (const t of parts) for (const m of (t ?? '').matchAll(/#(\d+)/g)) {
const id = Number(m[1]); if (!seen.includes(id)) seen.push(id);
}
return seen;
}
export function getReview(typeId: string) {
let row: { json: string } | undefined;
try { row = db().prepare('SELECT json FROM type_reviews WHERE type_id = ?').get(typeId) as { json: string } | undefined; } catch { return null; }
if (!row) return null;
const review = JSON.parse(row.json) as Review;
const memberIds = review.papers.map((p) => p.id);
const order = citationOrder(review).filter((id) => memberIds.includes(id));
const all = [...order, ...memberIds.filter((id) => !order.includes(id))];
const stmt = db().prepare(`SELECT p.id, p.title, p.authors, c.short || ' 2026' AS venue, COALESCE(c.start_date,'2026-06-01') AS date, p.url FROM papers p JOIN conferences c ON c.slug = p.conf WHERE p.id = ?`);
const refs: RefMeta[] = all.map((id) => stmt.get(id) as RefMeta).filter(Boolean).map((r) => {
const a = (r.authors ?? '').split(', ');
return { ...r, authors: a[0] ? a[0] + (a.length > 1 ? ' et al.' : '') : '' };
});
return { review, refs, citeNum: Object.fromEntries(all.map((id, i) => [id, i + 1])) as Record<number, number> };
}
export function listReviews() {
try {
return db().prepare(`SELECT r.type_id, json_extract(r.json,'$.title') AS title, json_extract(r.json,'$.abstract') AS abstract, w.n_llm_labeled AS n, w.area, w.role
FROM type_reviews r JOIN work_types w ON w.id = r.type_id ORDER BY w.area, w.n_llm_labeled DESC`).all() as { type_id: string; title: string; abstract: string; n: number; area: string; role: string }[];
} catch { return []; }
}
export { CITE };
+151 -104
View File
@@ -1,126 +1,173 @@
import type { GetServerSideProps } from 'next';
import Link from 'next/link';
import Layout from '../../components/Layout';
import { ScoreBars, ScoreScatter, TimelineBars } from '../../components/SvgCharts';
import { getWorkType } from '../../lib/worktypes';
import LegacyTypeView from '../../components/LegacyTypeView';
import Markdown, { Cites, inline } from '../../components/Markdown';
import { SubfieldTimeline, WorkflowFlow } from '../../components/ReviewCharts';
import { ScoreBars, ScoreScatter } from '../../components/SvgCharts';
import { getReview } from '../../lib/reviews';
import { typeIdFromSlug, typeSlug } from '../../lib/slug';
import { getWorkType } from '../../lib/worktypes';
type Data = NonNullable<ReturnType<typeof getWorkType>>;
interface Props { data: Data; page: number; llm: boolean; slug: string }
type Rev = NonNullable<ReturnType<typeof getReview>>;
interface Props { data: Data; rev: Rev | null; page: number; llm: boolean; slug: string }
export const getServerSideProps: GetServerSideProps<Props> = async ({ params, query }) => {
const slug = String(params?.slug);
const page = Math.max(1, parseInt(String(query.page ?? '1'), 10) || 1);
const llm = query.src === 'llm';
const data = getWorkType(typeIdFromSlug(slug), page, llm);
return data ? { props: { data, page, llm, slug } } : { notFound: true };
const id = typeIdFromSlug(slug);
const data = getWorkType(id, page, llm);
if (!data) return { notFound: true };
return { props: { data, rev: query.view === 'data' ? null : getReview(id), page, llm, slug } };
};
const sc = (d: string) => (d.length > 140 ? d.slice(0, 138) + '…' : d);
export default function WorkTypePage({ data, page, llm, slug }: Props) {
const { type, area, role, members, timeline, benchmarks, results, siblings, sameRole, note, workflows, total, pageSize } = data;
const pages = Math.max(1, Math.ceil(total / pageSize));
const href = (p: number, src = llm) => `/work-types/${slug}?${[src ? 'src=llm' : '', p > 1 ? `page=${p}` : ''].filter(Boolean).join('&')}`;
const withScores = results.length > 0;
export default function WorkTypePage(props: Props) {
if (!props.rev) return <LegacyTypeView data={props.data} page={props.page} llm={props.llm} slug={props.slug} />;
const { data, rev, slug } = props;
const { review: r, refs, citeNum: c } = rev;
const refById = Object.fromEntries(refs.map((x) => [x.id, x]));
const lanes = r.subfields.map((s) => ({ name: s.name, papers: s.paper_ids.map((id) => refById[id]).filter(Boolean).map((p) => ({ id: p.id, date: p.date.slice(0, 7), title: p.title })) }));
const bodyStart = 5;
const n = (k: number) => bodyStart + 1 + k; // section number after the body
const toc: { id: string; label: string; sub?: boolean }[] = [
{ id: 'intro', label: '1 Introduction' }, { id: 'scope', label: '2 Definition and scope' }, { id: 'perspective', label: '3 How this review is organised' },
{ id: 'landscape', label: '4 Landscape: subfields and evolution' }, { id: 'body', label: '5 Research directions' },
...r.sections.body.map((b, i) => ({ id: `body-${i}`, label: `5.${i + 1} ${b.title}`, sub: true })),
{ id: 'methods', label: `${n(0)} Methods` }, { id: 'data', label: `${n(1)} Benchmarks and key data` }, { id: 'workflow', label: `${n(2)} Typical workflow` },
{ id: 'compare', label: `${n(3)} Comparative analysis` }, { id: 'challenges', label: `${n(4)} Problems and challenges` }, { id: 'future', label: `${n(5)} Future directions` },
{ id: 'conclusion', label: `${n(6)} Conclusion` }, { id: 'lens', label: `${n(7)} A new lens` },
{ id: 'appendix-papers', label: 'A Paper-by-paper extraction' }, { id: 'appendix-qa', label: 'B Quality assurance' }, { id: 'refs', label: 'References' },
];
const wf = data.note?.workflow ?? [];
return (
<Layout title={`${area.label} · ${role.label}`}>
<p><Link href="/work-types">← All types of work</Link></p>
<h1>{role.label}</h1>
<p className="sub">in <b>{area.label}</b> · {type.n_papers.toLocaleString()} papers ({type.n_llm_labeled} labelled in detail)</p>
<Layout title={r.title}>
<p><Link href="/work-types">← All types of work</Link> · <Link href={`/work-types/${slug}?view=data`}>data view</Link></p>
<div className="article-grid">
<nav className="toc">{toc.map((t) => <a key={t.id} href={`#${t.id}`} className={t.sub ? 'sub-toc' : ''}>{t.label}</a>)}</nav>
<article className="article">
<p className="sub" style={{ margin: 0 }}>{data.area.label} · {data.role.label}</p>
<h1 style={{ fontSize: 28, lineHeight: 1.25 }}>{r.title}</h1>
<p className="sub">A review of {r.papers.length} accepted 2026 papers. Written from titles and abstracts; dates are venue dates.</p>
<div className="abstract-box"><b>Abstract.</b> {inline(r.abstract, c)}</div>
<h2>1. Time order</h2>
<div className="card">
<TimelineBars items={timeline} />
<p className="sub" style={{ margin: '6px 0 0' }}>Papers placed by venue date; the table below lists them in the same order. Exact submission dates need arXiv access.</p>
</div>
<h2 id="intro">1 Introduction</h2>
<Markdown text={r.sections.introduction} cite={c} />
<h2>2. How it is classified, and why different papers are the same type</h2>
<div className="card">
<p><b>Definition.</b> {role.descr}</p>
<p><b>Holds fixed:</b> {role.fixes || '—'} &nbsp; <b>Varies:</b> {role.varies || '—'}</p>
{note?.why_same && <p><b>What these papers share:</b> {note.why_same}</p>}
{note?.narrative && <p>{note.narrative}</p>}
<p><b>How this type differs from neighbours in the same area</b></p>
<table>
<thead><tr><th>Role (same area)</th><th>Fixes</th><th>Varies</th><th>Papers</th></tr></thead>
<tbody>
{siblings.map((s) => (
<tr key={s.id} style={s.id === type.id ? { fontWeight: 700 } : undefined}>
<td>{s.id === type.id ? s.label : <Link href={`/work-types/${typeSlug(s.id)}`}>{s.label}</Link>}</td><td>{s.fixes || '—'}</td><td>{s.varies || '—'}</td><td>{s.n_papers}</td>
</tr>
))}
</tbody>
</table>
{sameRole.length > 0 && (
<p style={{ marginTop: 10 }}><b>Same role in other areas:</b>{' '}
{sameRole.map((s) => <Link key={s.id} className="badge" href={`/work-types/${typeSlug(s.id)}`}>{s.label.slice(0, 40)} {s.n_papers}</Link>)}
</p>
)}
</div>
<h2 id="scope">2 Definition and scope</h2>
<div className="def-box">
<p style={{ margin: '0 0 6px' }}><b>Type of work:</b> {data.role.label} in {data.area.label}.</p>
<p style={{ margin: '0 0 6px' }}>{data.role.descr}</p>
<p style={{ margin: 0 }}><b>Holds fixed:</b> {data.role.fixes || '—'} · <b>Varies:</b> {data.role.varies || '—'}</p>
</div>
{data.note?.why_same && <p>{data.note.why_same}</p>}
<p>Neighbouring types in the same area differ in what they hold fixed and what they vary:</p>
<table><thead><tr><th>Role in {data.area.label.split(',')[0]}</th><th>Fixes</th><th>Varies</th><th>Papers</th></tr></thead>
<tbody>{data.siblings.map((s) => (
<tr key={s.id} style={s.id === data.type.id ? { fontWeight: 700 } : undefined}>
<td>{s.id === data.type.id ? s.label : <Link href={`/work-types/${typeSlug(s.id)}`}>{s.label}</Link>}</td><td>{s.fixes || '—'}</td><td>{s.varies || '—'}</td><td>{s.n_papers}</td>
</tr>))}</tbody></table>
<h2>3. Benchmarks usually used, and what they are used to show</h2>
{benchmarks.length ? (
<table>
<thead><tr><th>Benchmark</th><th>Papers</th><th>Introduced here</th><th>Used to show</th></tr></thead>
<tbody>
{benchmarks.map((b) => (
<tr key={b.id}><td><Link href={`/benchmarks/${b.id}`}>{b.name}</Link></td><td>{b.n}</td><td>{b.n_new || ''}</td><td>{b.purposes ?? '—'}</td></tr>
))}
</tbody>
</table>
) : <p className="sub">No benchmark named in these papers’ abstracts yet.</p>}
{note?.bench_summary && <p>{note.bench_summary}</p>}
<h2 id="perspective">3 How this review is organised</h2>
<table><thead><tr><th>Possible organisation</th><th>Pros</th><th>Cons</th></tr></thead>
<tbody>{r.perspective.options.map((o) => <tr key={o.name} style={o.name === r.perspective.chosen ? { fontWeight: 600 } : undefined}><td>{o.name}</td><td>{o.pros}</td><td>{o.cons}</td></tr>)}</tbody></table>
<p><b>Chosen: {r.perspective.chosen}.</b> {r.perspective.why}</p>
<table><thead><tr><th>Section</th><th>Purpose</th><th>≈ words</th></tr></thead>
<tbody>{r.outline.map((o) => <tr key={o.section}><td>{o.section}</td><td>{o.purpose}</td><td>{o.words}</td></tr>)}</tbody></table>
<h2>4. Workflow</h2>
<div className="card">
{note && note.workflow.length > 0 && (
<ol style={{ margin: '0 0 10px', paddingLeft: 20 }}>{note.workflow.map((s, i) => <li key={i}>{s}</li>)}</ol>
)}
{workflows.length > 0 ? workflows.map((w) => (
<p key={w.id} style={{ margin: '6px 0', fontSize: 14 }}>
<Link href={`/papers/${w.id}`}>{w.title.slice(0, 60)}</Link>: {w.steps.join(' → ')}
</p>
)) : <span className="sub">Workflows are extracted for papers that were read in detail.</span>}
</div>
<h2>5. Scores</h2>
<div className="card">
{withScores ? (
<>
<ScoreScatter points={results.map((r) => ({ date: r.date, score: r.score, series: r.setting ?? 'reported', label: `${r.system ?? '?'} on ${r.bench}`, unit: r.unit }))} />
<h3 style={{ fontSize: 14 }}>Best reported score per system</h3>
<ScoreBars rows={results.map((r) => ({ label: `${r.system ?? '?'} · ${r.bench}`, score: r.score, series: r.setting ?? 'reported' }))} />
</>
) : (
<p className="sub" style={{ margin: 0 }}>
No numeric scores are stated in the abstracts of this type’s papers. Scores sit in result tables, which need the full text (arXiv / OpenReview / ACL Anthology). The chart renders automatically once results are loaded.
</p>
)}
</div>
<h2>Papers in time order</h2>
<div className="filters">
<Link className={`btn ${llm ? 'ghost' : ''}`} href={href(1, false)}>All labels</Link>
<Link className={`btn ${llm ? '' : 'ghost'}`} href={href(1, true)}>Detailed (LLM-read) only</Link>
</div>
<table>
<thead><tr><th>Date</th><th>Paper</th><th>What it varies / holds fixed</th><th>Why this type</th></tr></thead>
<tbody>
{members.map((m) => (
<tr key={m.id}>
<td style={{ whiteSpace: 'nowrap' }}>{m.date.slice(0, 7)}<div className="sub" style={{ margin: 0, fontSize: 12 }}>{m.conf_short}{m.track ? ` · ${m.track}` : ''}</div></td>
<td><Link href={`/papers/${m.id}`}>{m.title}</Link>{m.source === 'rule' && <span className="badge" title="rule-based label">rule</span>}{m.summary && <div className="sub" style={{ margin: 0, fontSize: 13 }}>{sc(m.summary)}</div>}</td>
<td style={{ fontSize: 13 }}>{m.varies.length ? <>varies: {m.varies.join('; ')}</> : '—'}{m.fixes.length ? <><br />fixes: {m.fixes.join('; ')}</> : null}</td>
<td style={{ fontSize: 13 }}>{m.why || '—'}</td>
</tr>
<h2 id="landscape">4 Landscape: subfields and evolution</h2>
<table><thead><tr><th>Subfield</th><th>Key papers</th><th>#</th><th>Main focus</th><th>Relationship with other subfields</th></tr></thead>
<tbody>{r.subfields.map((s) => (
<tr key={s.name}><td><b>{s.name}</b><div className="sub" style={{ margin: 0, fontSize: 12.5 }}>{s.description}</div></td>
<td><Cites ids={s.key_paper_ids} cite={c} /></td><td>{s.paper_ids.length}</td><td>{s.focus}</td><td>{s.relations}</td></tr>))}</tbody></table>
<h3>Papers over time, by subfield</h3>
<div className="card"><SubfieldTimeline lanes={lanes} cite={c} /></div>
<h3>Representative and pioneering work</h3>
<ul>{r.evolution.pioneering.map((p) => <li key={p.id}><a href={`#ref-${p.id}`}>[{c[p.id]}] {refById[p.id]?.title}</a> — {p.why}</li>)}</ul>
<h3>Evolutionary paths</h3>
{r.evolution.paths.map((p) => (
<div key={p.name} style={{ marginBottom: 12 }}>
<b>{p.name}</b>: <span style={{ fontSize: 14 }}>{p.paper_ids.map((id, i) => <span key={id}>{i > 0 && ' → '}<a href={`#ref-${id}`} title={refById[id]?.title}>[{c[id]}]</a></span>)}</span>
<p style={{ margin: '4px 0 0' }}>{inline(p.narrative, c)}</p>
</div>
))}
</tbody>
</table>
<div className="pager">
<Link className={`btn ghost ${page <= 1 ? 'dis' : ''}`} href={href(page - 1)}>← Prev</Link>
<span>Page {page} / {pages}</span>
<Link className={`btn ghost ${page >= pages ? 'dis' : ''}`} href={href(page + 1)}>Next →</Link>
<h3>Connections and gaps</h3>
<ul>{r.evolution.connections.map((x, i) => <li key={i}>{inline(x, c)}</li>)}</ul>
<ul>{r.evolution.gaps.map((x, i) => <li key={i}><b>Gap:</b> {inline(x, c)}</li>)}</ul>
<h2 id="body">5 Research directions</h2>
{r.sections.body.map((b, i) => (
<section key={i}>
<h3 id={`body-${i}`}>5.{i + 1} {b.title}</h3>
<Markdown text={b.content} cite={c} />
</section>
))}
<h2 id="methods">{n(0)} Methods</h2>
<table><thead><tr><th>Method family</th><th>Papers</th><th>Pros</th><th>Cons</th><th>Trend</th></tr></thead>
<tbody>{r.methods.families.map((m) => (
<tr key={m.name}><td><b>{m.name}</b><div className="sub" style={{ margin: 0, fontSize: 12.5 }}>{m.description}</div></td>
<td><Cites ids={m.paper_ids} cite={c} /> <span className="sub">({m.paper_ids.length})</span></td><td>{m.pros}</td><td>{m.cons}</td><td>{m.trend}</td></tr>))}</tbody></table>
<p>{inline(r.methods.trends, c)}</p>
{r.methods.suggested_new_methods.length > 0 && <><p><b>Methods worth trying next:</b></p><ul>{r.methods.suggested_new_methods.map((x, i) => <li key={i}>{inline(x, c)}</li>)}</ul></>}
<h2 id="data">{n(1)} Benchmarks and key data</h2>
<h3>Benchmarks used, and what they are used to show</h3>
{data.benchmarks.length ? (
<table><thead><tr><th>Benchmark</th><th>Papers</th><th>Introduced here</th><th>Used to show</th></tr></thead>
<tbody>{data.benchmarks.map((b) => <tr key={b.id}><td><Link href={`/benchmarks/${b.id}`}>{b.name}</Link></td><td>{b.n}</td><td>{b.n_new || ''}</td><td>{b.purposes ?? '—'}</td></tr>)}</tbody></table>
) : <p className="sub">No benchmark is named in these abstracts.</p>}
{data.note?.bench_summary && <p>{data.note.bench_summary}</p>}
<h3>Key data reported in abstracts</h3>
{r.key_data.rows.length ? (
<table><thead><tr><th>Paper</th><th>Subject</th><th>Metric</th><th>Data</th><th>Conclusion</th></tr></thead>
<tbody>{r.key_data.rows.map((k, i) => <tr key={i}><td><a href={`#ref-${k.id}`}>[{c[k.id]}]</a></td><td>{k.subject}</td><td>{k.metric}</td><td>{k.data}</td><td>{k.conclusion}</td></tr>)}</tbody></table>
) : <p className="sub">No concrete numbers are stated in these abstracts.</p>}
<p><b>Patterns.</b> {inline(r.key_data.patterns, c)}</p>
<p><b>Contradictions.</b> {inline(r.key_data.contradictions, c)}</p>
<p><b>Missing data.</b> {inline(r.key_data.missing, c)}</p>
{data.results.length > 0 && (
<div className="card">
<b>Scores over time (abstract-reported)</b>
<ScoreScatter points={data.results.map((x) => ({ date: x.date, score: x.score, series: x.setting ?? 'reported', label: `${x.system ?? '?'} on ${x.bench}`, unit: x.unit }))} />
<ScoreBars rows={data.results.map((x) => ({ label: `${x.system ?? '?'} · ${x.bench}`, score: x.score, series: x.setting ?? 'reported' }))} />
</div>
)}
<h2 id="workflow">{n(2)} Typical workflow</h2>
{wf.length ? <WorkflowFlow steps={wf} /> : <p className="sub">No common workflow recorded.</p>}
<h2 id="compare">{n(3)} Comparative analysis</h2>
<Markdown text={r.sections.comparative} cite={c} />
<h2 id="challenges">{n(4)} Problems and challenges</h2>
<Markdown text={r.sections.challenges} cite={c} />
<h2 id="future">{n(5)} Future directions</h2>
<Markdown text={r.sections.future} cite={c} />
<h2 id="conclusion">{n(6)} Conclusion</h2>
<Markdown text={r.sections.conclusion} cite={c} />
<h2 id="lens">{n(7)} A new lens on this work</h2>
<div className="abstract-box">{inline(r.novel_perspective, c)}</div>
<h2 id="appendix-papers">Appendix A · Paper-by-paper extraction</h2>
<details className="extract" open={false}>
<summary>Show the core-information table for all {r.papers.length} papers</summary>
<table><thead><tr><th>Paper</th><th>Research question</th><th>Method</th><th>Key findings</th><th>Innovation</th><th>Limitations</th></tr></thead>
<tbody>{[...r.papers].sort((a, b) => (c[a.id] ?? 0) - (c[b.id] ?? 0)).map((p) => (
<tr key={p.id}><td><a href={`#ref-${p.id}`}>[{c[p.id]}]</a> <Link href={`/papers/${p.id}`}>{refById[p.id]?.title.slice(0, 60)}</Link><div className="sub" style={{ margin: 0, fontSize: 12 }}>{p.subfield}</div></td>
<td>{p.question}</td><td>{p.method}</td><td>{p.findings}</td><td>{p.innovation}</td><td>{p.limitations}</td></tr>))}</tbody></table>
</details>
<h2 id="appendix-qa">Appendix B · Quality assurance</h2>
<table><thead><tr><th>Check</th><th>Status</th><th>Note</th></tr></thead>
<tbody>{r.quality.checks.map((q, i) => <tr key={i}><td>{q.issue}</td><td className={q.status === 'fixed' ? 'qa-fixed' : 'qa-ok'}>{q.status}</td><td>{q.note}</td></tr>)}</tbody></table>
<p><b>Limitations of this review.</b> {r.quality.limitations_of_this_review}</p>
<h2 id="refs">References</h2>
<ol className="refs">{refs.map((x) => (
<li key={x.id} id={`ref-${x.id}`}>{x.authors ? `${x.authors}. ` : ''}<Link href={`/papers/${x.id}`}>{x.title}</Link>. <i>{x.venue}</i>.{x.url && <> <a href={x.url} target="_blank" rel="noreferrer">↗</a></>}</li>
))}</ol>
</article>
</div>
</Layout>
);
+19 -3
View File
@@ -3,15 +3,16 @@ import Link from 'next/link';
import Layout from '../../components/Layout';
import { Area, Role, getMatrix } from '../../lib/worktypes';
import { typeSlug } from '../../lib/slug';
import { listReviews } from '../../lib/reviews';
interface Props { roles: Role[]; areas: Area[]; cells: Record<string, number>; src: 'llm' | 'all' }
interface Props { roles: Role[]; areas: Area[]; cells: Record<string, number>; src: 'llm' | 'all'; reviews: ReturnType<typeof listReviews> }
export const getServerSideProps: GetServerSideProps<Props> = async ({ query }) => {
const src = query.src === 'llm' ? 'llm' : 'all';
return { props: { ...getMatrix({ src }), src } };
return { props: { ...getMatrix({ src }), src, reviews: listReviews() } };
};
export default function WorkTypes({ roles, areas, cells, src }: Props) {
export default function WorkTypes({ roles, areas, cells, src, reviews }: Props) {
const max = Math.max(1, ...Object.values(cells));
const groups: ('agent' | 'general')[] = ['agent', 'general'];
return (
@@ -21,6 +22,21 @@ export default function WorkTypes({ roles, areas, cells, src }: Props) {
A type of work = research <b>area</b> × <b>role</b>. The role says what a paper contributes and what it holds fixed versus varies, so two papers on the same benchmark land in different types when one
fixes the agent and changes the environment while the other does the opposite. A paper can belong to several types.
</p>
{reviews.length > 0 && (
<>
<h2>Reviews ({reviews.length})</h2>
<div className="cards">
{reviews.map((r) => (
<Link key={r.type_id} href={`/work-types/${typeSlug(r.type_id)}`} className="card" style={{ color: 'inherit', textDecoration: 'none' }}>
<div className="sub" style={{ margin: 0, fontSize: 12 }}>{areas.find((a) => a.id === r.area)?.label ?? r.area} · {roles.find((x) => x.id === r.role)?.label ?? r.role}</div>
<b style={{ color: 'var(--accent)' }}>{r.title}</b>
<div className="sub" style={{ margin: '4px 0 0', fontSize: 13 }}>{r.n} papers · {(r.abstract ?? '').slice(0, 160)}…</div>
</Link>
))}
</div>
<h2>All types (area × role)</h2>
</>
)}
<div className="filters">
<Link className={`btn ${src === 'all' ? '' : 'ghost'}`} href="/work-types">All papers (LLM labels + rules)</Link>
<Link className={`btn ${src === 'llm' ? '' : 'ghost'}`} href="/work-types?src=llm">Detailed labels only (agent-related, read by LLM)</Link>
+6 -1
View File
@@ -17,7 +17,7 @@ ROLES, AGENT_AREAS, GEN_AREAS = W["roles"], W["agent_areas"], W["general_areas"]
SCHEMA = """
DROP TABLE IF EXISTS roles; DROP TABLE IF EXISTS areas; DROP TABLE IF EXISTS work_types; DROP TABLE IF EXISTS paper_work_types;
DROP TABLE IF EXISTS paper_meta; DROP TABLE IF EXISTS benchmarks; DROP TABLE IF EXISTS paper_benchmarks; DROP TABLE IF EXISTS results; DROP TABLE IF EXISTS type_notes;
DROP TABLE IF EXISTS paper_meta; DROP TABLE IF EXISTS benchmarks; DROP TABLE IF EXISTS paper_benchmarks; DROP TABLE IF EXISTS results; DROP TABLE IF EXISTS type_notes; DROP TABLE IF EXISTS type_reviews;
CREATE TABLE roles(id TEXT PRIMARY KEY, label TEXT, descr TEXT, fixes TEXT, varies TEXT, pattern TEXT, sort INT);
CREATE TABLE areas(id TEXT PRIMARY KEY, label TEXT, kind TEXT, sort INT);
CREATE TABLE work_types(id TEXT PRIMARY KEY, area TEXT REFERENCES areas(id), role TEXT REFERENCES roles(id), n_papers INT, n_llm_labeled INT);
@@ -26,6 +26,7 @@ CREATE TABLE paper_meta(paper_id INTEGER PRIMARY KEY, summary TEXT, fixes TEXT,
CREATE TABLE benchmarks(id INTEGER PRIMARY KEY, key TEXT UNIQUE, name TEXT, n_papers INT, n_new INT);
CREATE TABLE paper_benchmarks(paper_id INT, bench_id INT, purpose TEXT, is_new INT, source TEXT, PRIMARY KEY(paper_id, bench_id));
CREATE TABLE results(id INTEGER PRIMARY KEY, paper_id INT, bench_id INT, system TEXT, base_model TEXT, setting TEXT, metric TEXT, score REAL, unit TEXT);
CREATE TABLE type_reviews(type_id TEXT PRIMARY KEY, json TEXT);
CREATE TABLE type_notes(type_id TEXT PRIMARY KEY, why_same TEXT, workflow TEXT, bench_summary TEXT, narrative TEXT);
CREATE INDEX idx_pwt_type ON paper_work_types(type_id);
CREATE INDEX idx_pb_bench ON paper_benchmarks(bench_id);
@@ -149,7 +150,11 @@ def main():
if os.path.exists(nf):
for tid, n in json.load(open(nf)).items():
db.execute("INSERT OR REPLACE INTO type_notes VALUES(?,?,?,?,?)", (tid, n.get("why_same", ""), json.dumps(n.get("workflow", [])), n.get("bench_summary", ""), n.get("narrative", "")))
for f in sorted(glob.glob(os.path.join(ROOT, "data", "reviews", "*.json"))):
r = json.load(open(f))
db.execute("INSERT OR REPLACE INTO type_reviews VALUES(?,?)", (r["type_id"], json.dumps(r, ensure_ascii=False)))
db.commit()
print("reviews:", db.execute("SELECT COUNT(*) FROM type_reviews").fetchone()[0])
print("llm-labelled:", len(labelled), " rule-labelled:", n_rule, " work types:", db.execute("SELECT COUNT(*) FROM work_types").fetchone()[0],
" benchmarks:", db.execute("SELECT COUNT(*) FROM benchmarks").fetchone()[0], " results:", db.execute("SELECT COUNT(*) FROM results").fetchone()[0])
db.execute("VACUUM"); db.close()
+50
View File
@@ -0,0 +1,50 @@
#!/bin/sh
# Permanent deploy on the ces-control host: /opt/llm-survey/releases/<sha>, `current` symlink,
# systemd unit `llm-survey`. Port is never 3000 or 18131 (taken).
set -eu
SHA="${1:?usage: deploy.sh <git-sha>}"
APP=llm-survey
ROOT=/opt/$APP
PORT="${APP_PORT:-18231}"
case "$PORT" in 3000|18131) echo "refusing reserved port $PORT" >&2; exit 1;; esac
command -v node >/dev/null || { echo "node is not installed on this host" >&2; exit 1; }
node -e 'process.exit(+process.versions.node.split(".")[0] >= 18 ? 0 : 1)' || { echo "need node >= 18" >&2; exit 1; }
# port must be free, or held by our own service
if ss -ltnH "sport = :$PORT" | grep -q . && ! systemctl is-active --quiet "$APP"; then
echo "port $PORT is in use by another process" >&2; exit 1
fi
REL="$ROOT/releases/$SHA"
mkdir -p "$ROOT/releases"
rm -rf "$REL"; mkdir -p "$REL"
tar --exclude=.git --exclude=node_modules --exclude=.next -cf - . | tar -xf - -C "$REL"
cd "$REL"
test -s data/papers.db || { echo "data/papers.db missing or empty" >&2; exit 1; }
npm ci --no-audit --no-fund
npm run build
node -e 'const D=require("better-sqlite3");const d=new D("data/papers.db",{readonly:true});console.log("papers:",d.prepare("select count(*) c from papers").get().c)'
ln -sfn "$REL" "$ROOT/current.new" && mv -T "$ROOT/current.new" "$ROOT/current"
cat > /etc/systemd/system/$APP.service <<UNIT
[Unit]
Description=LLM research survey (Next.js)
After=network.target
[Service]
WorkingDirectory=$ROOT/current
Environment=NODE_ENV=production PORT=$PORT
ExecStart=$(command -v node) node_modules/next/dist/bin/next start -p $PORT -H 0.0.0.0
Restart=always
RestartSec=3
[Install]
WantedBy=multi-user.target
UNIT
systemctl daemon-reload
systemctl enable "$APP" >/dev/null 2>&1
systemctl restart "$APP"
for i in 1 2 3 4 5 6 7 8 9 10; do
curl -fsS -o /dev/null "http://127.0.0.1:$PORT/" && { echo "healthy on :$PORT ($SHA)"; ok=1; break; }; sleep 2
done
[ "${ok:-0}" = 1 ] || { journalctl -u "$APP" -n 40 --no-pager; exit 1; }
ls -1dt "$ROOT"/releases/* | tail -n +4 | xargs -r rm -rf
+22
View File
@@ -42,3 +42,25 @@ button,.btn{padding:7px 14px;border:1px solid var(--accent);background:var(--acc
.pager .dis{opacity:.4;pointer-events:none}
.bar{height:8px;background:var(--accent);border-radius:4px}
.abs{white-space:pre-wrap}
/* review article */
.article-grid{display:grid;grid-template-columns:230px minmax(0,1fr);gap:28px}
@media(max-width:900px){.article-grid{grid-template-columns:1fr}.toc{display:none}}
.toc{position:sticky;top:64px;align-self:start;max-height:calc(100vh - 80px);overflow:auto;font-size:13px;border-left:2px solid var(--line);padding-left:12px}
.toc a{display:block;color:var(--muted);padding:3px 0}.toc a:hover{color:var(--accent)}
.toc .sub-toc{padding-left:10px}
.article{max-width:820px;font-size:16px;line-height:1.7}
.article h2{font-size:21px;margin:40px 0 12px;padding-top:8px;border-top:1px solid var(--line)}
.article h3.md-h,.article h3{font-size:17px;margin:22px 0 8px}
.article p{margin:0 0 14px}
.abstract-box{background:var(--card);border:1px solid var(--line);border-left:4px solid var(--accent);border-radius:8px;padding:14px 18px;margin:16px 0}
.def-box{background:var(--accent-bg);border-radius:8px;padding:12px 16px;margin:12px 0;font-size:15px}
sup.cite{font-size:11px;margin-left:1px}sup.cite a{text-decoration:none}
.cite-chip{font-size:12px;margin-right:3px}
.article table{font-size:13.5px;line-height:1.5;margin:10px 0 18px}
.flow{display:flex;flex-wrap:wrap;gap:6px;align-items:center;margin:10px 0}
.flow-step{background:var(--card);border:1px solid var(--line);border-radius:8px;padding:8px 12px;font-size:14px;position:relative;margin-right:22px}
.flow-n{display:inline-block;width:20px;height:20px;border-radius:10px;background:var(--accent);color:#fff;font-size:11px;text-align:center;line-height:20px;margin-right:6px}
.flow-arrow{position:absolute;right:-19px;top:50%;transform:translateY(-50%);color:var(--muted)}
.refs{font-size:13.5px;padding-left:28px}.refs li{margin:4px 0}.refs li:target{background:var(--accent-bg)}
.qa-ok{color:#1b9e77;font-weight:600}.qa-fixed{color:#e0702b;font-weight:600}
details.extract summary{cursor:pointer;font-weight:600;margin:8px 0}