6 Commits

Author SHA1 Message Date
codex-bot d252093ef6 Keep incomplete structured drafts editable and add block ordering
Validate / validate (push) Successful in 3m37s
2026-10-30 20:12:01 +08:00
codex-bot c3cc8eff28 Verify authenticator codes against RFC 6238 test vectors
Validate / validate (push) Successful in 3m31s
2026-10-30 20:08:23 +08:00
codex-bot 7368317a10 Prepare runner-only provisioning for approved editor secrets
Validate / validate (push) Successful in 3m46s
2026-10-30 20:07:53 +08:00
codex-bot 8c794980c8 Add text-first block writing controls and tighten mutation origin checks
Validate / validate (push) Successful in 3m50s
2026-10-30 20:07:06 +08:00
codex-bot 712046e86f Reframe AI-tlas as a public research journal with authenticator-protected editorial workspace
Validate / validate (push) Successful in 3m15s
2026-10-30 20:02:22 +08:00
Zayden-Jung b5de41501b Merge pull request 'Introduce AI-tlas landing page and document ATLAS operations' (#1) from codex/atlas-landing into main
Deploy / deploy (push) Successful in 2m34s
Reviewed-on: #1
2026-10-30 10:46:45 +00:00
21 changed files with 510 additions and 69 deletions
+3
View File
@@ -40,5 +40,8 @@ jobs:
if: steps.checkout.outputs.skip != '1'
env:
APP_PORT: ${{ vars.APP_PORT }}
EDITOR_TOTP_SECRET: ${{ secrets.EDITOR_TOTP_SECRET }}
EDITOR_SESSION_SECRET: ${{ secrets.EDITOR_SESSION_SECRET }}
EDITOR_ORIGIN: http://8.211.154.134:18231
REFRESH_DATA: ${{ github.event_name == 'schedule' || github.event.inputs.refresh_data == 'true' }}
run: sh scripts/deploy.sh "$GITHUB_SHA"
+4
View File
@@ -19,9 +19,13 @@ jobs:
git checkout -q --detach FETCH_HEAD
- name: Install dependencies
run: npm ci --no-audit --no-fund
- name: Editor access tests
run: node scripts/test-editor.cjs
- name: Type check
run: npm run typecheck
- name: Build
env:
NEXT_TELEMETRY_DISABLED: '1'
run: npm run build
- name: Access boundary smoke test
run: node scripts/editor-smoke.cjs
+46
View File
@@ -55,3 +55,49 @@ npm run data:load
```
`data:build` stages SQLite under `build/` and exports JSONL; `data:load` imports into PostgreSQL and replaces `live`. These commands change data and are not read-only validation.
## Public journal and editorial access
The public site now presents only the two initial studies at
`/contents/lean-theorem-proving` and `/contents/tools-of-agents`. `/` retains live
collection counts, and `/contents` lists those studies. Other paper, benchmark,
conference and landscape routes require an editor session. Their database rows
are preserved; this change does not delete or reimport content.
- `/editor/login`: a six-digit authenticator TOTP code (no password).
- `/editor`: editorial desk and private archive entry.
- `/editor/contents/<study>`: edit text blocks directly (JSON mode for structured content), preview a draft,
then explicitly publish. Preview resolves dynamic blocks without saving.
Publishing replaces the study's blocks immediately; this first editor has no
durable drafts or per-editor accounts. Coordinate edits to avoid overwrites.
- All content and taxonomy APIs, including GET/list endpoints, require the signed
editor cookie. Mutations require the configured Origin. API clients must sign
in through the same authenticator flow; there is no anonymous write fallback.
Configure these secrets in `/etc/llm-survey/db.env` through your server secret
management process, never in Git or CI logs:
- `EDITOR_ORIGIN`: the exact browser origin, including port (no trailing slash).
Use HTTPS for internet-facing editorial access; HTTPS enables Secure cookies.
- `EDITOR_TOTP_SECRET`: a random base32 authenticator secret (at least 32 base32
characters), enrolled privately in the editor's authenticator. TOTP uses SHA-1,
30-second periods and six digits; server time must be synchronized.
- `EDITOR_SESSION_SECRET`: at least 32 random characters for HMAC-SHA256 sessions.
Rotating this value revokes all sessions.
Sessions expire after eight hours, are HttpOnly and SameSite=Strict, and can be
ended from the desk. Login attempts are globally limited to ten per five minutes
in persistent `analysis.editor_auth`; accepted TOTP time steps cannot be reused.
Missing configuration leaves editing closed while public studies remain readable.
This is a single shared editorial identity; secret rotation is the recovery
procedure. The existing HTTP public URL can continue serving readers; configure
TLS and the editor secrets before using editorial login over the internet.
The authenticator QR is provisioned once and delivered privately in chat, never
committed. TOTP-only login is a single possession factor, as requested.
The deployment job can provision `EDITOR_TOTP_SECRET` and `EDITOR_SESSION_SECRET`
from repository Actions secrets after explicit operator authorization. It writes
them atomically to the existing environment file with mode 0600. Missing secrets
preserve the server configuration. Update `EDITOR_ORIGIN` in the deployment job
when moving editorial access to a TLS domain.
+4 -15
View File
@@ -1,18 +1,9 @@
import Head from 'next/head';
import Link from 'next/link';
import { useRouter } from 'next/router';
import { ReactNode } from 'react';
const LINKS = [
{ href: '/', label: 'Home' },
{ href: '/overview', label: 'Overview' },
{ href: '/papers', label: 'Papers' },
{ href: '/landscape', label: 'Landscape' },
{ href: '/contents', label: 'Contents' },
];
export default function Layout({ title, children }: { title?: string; children: ReactNode }) {
const { pathname } = useRouter();
return (
<>
<Head>
@@ -22,11 +13,9 @@ export default function Layout({ title, children }: { title?: string; children:
</Head>
<nav className="nav">
<Link href="/" className="brand">AI-tlas</Link>
{LINKS.map((l) => (
<Link key={l.href} href={l.href} className={(l.href === '/' ? pathname === '/' : pathname.startsWith(l.href)) ? 'active' : ''}>
{l.label}
</Link>
))}
<Link href="/#studies">Research</Link>
<Link href="/contents">Studies</Link>
<Link href="/editor" className="nav-editor">Editorial desk ↗</Link>
</nav>
<main className="wrap">{children}</main>
</>
+4
View File
@@ -1,4 +1,5 @@
import type { NextApiRequest, NextApiResponse } from 'next';
import { COOKIE, validSession } from './editor-session';
export class HttpError extends Error {
constructor(public status: number, message: string) { super(message); }
@@ -10,6 +11,9 @@ type Handler = (req: NextApiRequest) => Promise<unknown>;
/** Dispatch by HTTP method; a handler returns the JSON to send, or throws HttpError. */
export function route(handlers: Partial<Record<Method, Handler>>) {
return async (req: NextApiRequest, res: NextApiResponse) => {
res.setHeader('Cache-Control', 'private, no-store');
if (!await validSession(req.cookies[COOKIE])) return res.status(401).json({ error: 'Editor authentication required' });
if (req.method !== 'GET' && (!process.env.EDITOR_ORIGIN || req.headers.origin !== process.env.EDITOR_ORIGIN)) return res.status(403).json({ error: 'Invalid origin' });
const h = handlers[req.method as Method];
if (!h) {
res.setHeader('Allow', Object.keys(handlers).join(', '));
+21
View File
@@ -0,0 +1,21 @@
// Shared with Edge middleware. Only signed, expiring sessions grant editor access.
export const COOKIE = 'atlas_editor';
const enc = new TextEncoder();
async function key() {
const secret = process.env.EDITOR_SESSION_SECRET;
if (!secret || secret.length < 32) throw new Error('Editor session secret is not configured');
return crypto.subtle.importKey('raw', enc.encode(secret), { name: 'HMAC', hash: 'SHA-256' }, false, ['sign', 'verify']);
}
export async function signSession(value: string) {
return Array.from(new Uint8Array(await crypto.subtle.sign('HMAC', await key(), enc.encode(value)))).map(b => b.toString(16).padStart(2, '0')).join('');
}
export async function validSession(token?: string) {
if (!token) return false;
const [expires, nonce, signature, extra] = token.split('.');
if (extra || !/^\d+$/.test(expires) || !/^[a-f0-9]{32}$/.test(nonce) || !/^[a-f0-9]{64}$/.test(signature)) return false;
if (Number(expires) < Date.now() || Number(expires) > Date.now() + 8 * 3600_000) return false;
try {
const bytes = new Uint8Array(signature.match(/../g)!.map(h => parseInt(h, 16)));
return await crypto.subtle.verify('HMAC', await key(), bytes, enc.encode(`${expires}.${nonce}`));
} catch { return false; }
}
+12
View File
@@ -0,0 +1,12 @@
import { createHmac } from 'crypto';
export function totp(secret: string, step: number) {
let bits = ''; for (const c of secret.toUpperCase().replace(/=|\s/g, '')) {
const n = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ234567'.indexOf(c); if (n < 0) throw new Error('Invalid TOTP secret');
bits += n.toString(2).padStart(5, '0');
}
const key = Buffer.from(bits.match(/.{8}/g)!.map(b => parseInt(b, 2)));
const counter = Buffer.alloc(8); counter.writeBigUInt64BE(BigInt(step));
const hash = createHmac('sha1', key).update(counter).digest(); const offset = hash[19] & 15;
return String((hash.readUInt32BE(offset) & 0x7fffffff) % 1000000).padStart(6, '0');
}
+23
View File
@@ -0,0 +1,23 @@
import { NextRequest, NextResponse } from 'next/server';
import { COOKIE, validSession } from './lib/editor-session';
export async function middleware(req: NextRequest) {
const path = req.nextUrl.pathname;
if (path === '/editor/login' || path === '/api/editor/login') return NextResponse.next();
const publicPage = path === '/' || path === '/contents' || /^\/contents\/(lean-theorem-proving|tools-of-agents)$/.test(path);
if (publicPage) return NextResponse.next();
if (!await validSession(req.cookies.get(COOKIE)?.value)) {
if (path.startsWith('/api/')) return NextResponse.json({ error: 'Editor authentication required' }, { status: 401 });
if (!path.startsWith('/editor')) return new NextResponse('Not found', { status: 404 });
const url = req.nextUrl.clone(); url.pathname = '/editor/login'; url.search = '';
return NextResponse.redirect(url);
}
if (req.method !== 'GET' && req.method !== 'HEAD' && req.headers.get('origin') !== (process.env.EDITOR_ORIGIN || req.nextUrl.origin)) {
return NextResponse.json({ error: 'Invalid request origin' }, { status: 403 });
}
const response = NextResponse.next();
response.headers.set('Cache-Control', 'private, no-store');
response.headers.set('X-Robots-Tag', 'noindex, nofollow');
return response;
}
export const config = { matcher: ['/((?!_next/static|_next/image|favicon.ico).*)'] };
+31
View File
@@ -0,0 +1,31 @@
import type { NextApiRequest, NextApiResponse } from 'next';
import { randomBytes, timingSafeEqual } from 'crypto';
import { totp } from '../../../lib/totp';
import { query } from '../../../lib/db';
import { COOKIE, signSession } from '../../../lib/editor-session';
export default async function login(req: NextApiRequest, res: NextApiResponse) {
res.setHeader('Cache-Control', 'no-store');
if (req.method !== 'POST') return res.status(405).end();
if (!process.env.EDITOR_ORIGIN || req.headers.origin !== process.env.EDITOR_ORIGIN) return res.status(403).json({ error: 'Invalid origin' });
const { code } = req.body || {};
const secret = process.env.EDITOR_TOTP_SECRET;
if (!secret || !process.env.EDITOR_ORIGIN || (process.env.EDITOR_SESSION_SECRET?.length || 0) < 32) return res.status(503).json({ error: 'Editor access has not been configured on the server.' });
if (typeof code !== 'string' || !/^\d{6}$/.test(code)) return res.status(401).json({ error: 'Check your authenticator code.' });
try {
// A database-backed global limit works across processes; never trust spoofable forwarding headers.
await query(`CREATE SCHEMA IF NOT EXISTS analysis`);
await query(`CREATE TABLE IF NOT EXISTS analysis.editor_auth (id integer PRIMARY KEY, attempts integer NOT NULL, window_start timestamptz NOT NULL, last_step bigint NOT NULL DEFAULT -1)`);
await query(`INSERT INTO analysis.editor_auth (id, attempts, window_start) VALUES (1,0,now()) ON CONFLICT DO NOTHING`);
const limit = await query<{attempts:number}>(`UPDATE analysis.editor_auth SET attempts = CASE WHEN window_start < now() - interval '5 minutes' THEN 1 ELSE attempts + 1 END, window_start = CASE WHEN window_start < now() - interval '5 minutes' THEN now() ELSE window_start END WHERE id=1 RETURNING attempts`);
if (limit[0].attempts > 10) return res.status(429).json({ error: 'Too many attempts. Try again in five minutes.' });
const step = Math.floor(Date.now() / 30000);
const accepted = [step - 1, step, step + 1].find(s => timingSafeEqual(Buffer.from(totp(secret, s)), Buffer.from(code)));
if (accepted === undefined) return res.status(401).json({ error: 'Check your authenticator code.' });
const used = await query(`UPDATE analysis.editor_auth SET last_step=? WHERE id=1 AND last_step < ? RETURNING id`, [accepted, accepted]);
if (!used.length) return res.status(401).json({ error: 'Use a fresh authenticator code.' });
const value = `${Date.now() + 8 * 3600_000}.${randomBytes(16).toString('hex')}`;
res.setHeader('Set-Cookie', `${COOKIE}=${value}.${await signSession(value)}; HttpOnly; SameSite=Strict; Path=/; Max-Age=28800${process.env.EDITOR_ORIGIN.startsWith('https://') ? '; Secure' : ''}`);
return res.json({ ok: true });
} catch { return res.status(503).json({ error: 'Authentication service unavailable.' }); }
}
+7
View File
@@ -0,0 +1,7 @@
import type { NextApiRequest, NextApiResponse } from 'next';
import { COOKIE } from '../../../lib/editor-session';
export default function logout(req: NextApiRequest, res: NextApiResponse) {
if (req.method !== 'POST') return res.status(405).end();
res.setHeader('Set-Cookie', `${COOKIE}=; Path=/; HttpOnly; SameSite=Strict; Max-Age=0`);
res.status(200).json({ ok: true });
}
+13
View File
@@ -0,0 +1,13 @@
import { route, bodyObject, HttpError } from '../../../lib/api';
import { validateBlock } from '../../../lib/block-store';
import { resolveBlocks } from '../../../lib/block-resolve';
import type { Block, PageBlock } from '../../../lib/blocks';
export default route({ POST: async req => {
const blocks = bodyObject(req).blocks;
if (!Array.isArray(blocks) || blocks.length > 200) throw new HttpError(400, 'Provide at most 200 blocks');
const page: PageBlock[] = blocks.map((block: Block, i: number) => {
validateBlock(block?.type, block?.data, `block ${i + 1}`);
return { id: -(i + 1), position: i, revision: 0, updatedAt: 'draft', block };
});
return { blocks: await resolveBlocks(page) };
} });
+1
View File
@@ -13,6 +13,7 @@ interface Props { node: { id: string; title: string; blurb: string }; blocks: Pa
export const getServerSideProps: GetServerSideProps<Props> = async ({ params }) => {
const node = findNode(String(params?.node));
if (!node || node.id === 'root') return { notFound: true };
if (!['lean-theorem-proving', 'tools-of-agents'].includes(node.id)) return { notFound: true };
const page = `content/${node.id}`;
let blocks = await getBlocks(page);
if (!blocks.length) { await seedPage(page, defaultBlocks(node)); blocks = await getBlocks(page); }
+132
View File
@@ -0,0 +1,132 @@
import type { GetServerSideProps } from 'next';
import { useEffect, useRef, useState } from 'react';
import Link from 'next/link';
import Layout from '../../../components/Layout';
import Blocks from '../../../components/Blocks';
import { findNode } from '../../../lib/content-tree';
import { getBlocks, seedPage } from '../../../lib/block-store';
import { defaultBlocks } from '../../../lib/content-defaults';
import { resolveBlocks } from '../../../lib/block-resolve';
import type { Block, PageBlock } from '../../../lib/blocks';
export const getServerSideProps: GetServerSideProps = async ({ params }) => {
const node = findNode(String(params?.node));
if (!node || node.id === 'root') return { notFound: true };
const page = `content/${node.id}`;
let blocks = await getBlocks(page);
if (!blocks.length) { await seedPage(page, defaultBlocks(node)); blocks = await getBlocks(page); }
return { props: { node: node.id, title: node.title, blocks: await resolveBlocks(blocks) } };
};
const serialize = (value: unknown) => JSON.stringify(value, null, 2);
function parseBlock(source: string): Block | null {
try {
const value = JSON.parse(source);
return value && typeof value.type === 'string' && value.data && typeof value.data === 'object' ? value : null;
} catch { return null; }
}
export default function Workspace({ node, title, blocks }: { node: string; title: string; blocks: PageBlock[] }) {
// Keep each block as source text so incomplete structured edits remain editable.
const [drafts, setDrafts] = useState(() => blocks.map(b => serialize(b.block)));
const [rawSource, setRawSource] = useState<string | null>(null);
const [preview, setPreview] = useState(blocks);
const [message, setMessage] = useState('');
const [busy, setBusy] = useState(false);
const published = useRef(false);
const initial = serialize(blocks.map(b => b.block));
const dirty = rawSource !== null ? rawSource !== initial : serialize(drafts.map(source => {
try { return JSON.parse(source); } catch { return source; }
})) !== initial;
useEffect(() => {
if (!dirty) return;
const warn = (event: BeforeUnloadEvent) => { if (published.current) return; event.preventDefault(); event.returnValue = ''; };
window.addEventListener('beforeunload', warn);
// A normal browser navigation receives the same unsaved-draft warning.
return () => window.removeEventListener('beforeunload', warn);
}, [dirty]);
function draftBlocks(): Block[] {
const value = rawSource !== null ? JSON.parse(rawSource) : drafts.map(source => JSON.parse(source));
if (!Array.isArray(value) || !value.length) throw new Error('A study needs at least one content block.');
if (value.some(block => !block || typeof block.type !== 'string' || !block.data || typeof block.data !== 'object')) {
throw new Error('Each block needs a type and a data object.');
}
return value;
}
function switchMode() {
try {
const value = draftBlocks();
if (rawSource === null) setRawSource(serialize(value));
else { setDrafts(value.map(serialize)); setRawSource(null); }
setMessage('');
} catch (error) { setMessage((error as Error).message); }
}
function update(index: number, value: string) {
setDrafts(current => current.map((source, i) => i === index ? value : source));
}
function move(index: number, offset: number) {
setDrafts(current => {
const next = [...current];
[next[index], next[index + offset]] = [next[index + offset], next[index]];
return next;
});
}
async function request(previewOnly: boolean) {
setBusy(true); setMessage('');
try {
const value = draftBlocks();
const response = await fetch(previewOnly ? '/api/editor/preview' : `/api/blocks?page=${encodeURIComponent(`content/${node}`)}`, {
method: previewOnly ? 'POST' : 'PUT',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ blocks: value }),
});
const result = await response.json();
if (!response.ok) throw new Error(result.error);
if (previewOnly) { setPreview(result.blocks); setMessage('Draft preview updated. Nothing has been published.'); }
else { published.current = true; window.location.reload(); }
} catch (error) { setMessage((error as Error).message); }
finally { setBusy(false); }
}
return <Layout title={`Edit ${title}`}>
<Link href="/editor">← Editorial desk</Link>
<h1>{title}</h1>
<p>Write and arrange your research notes, then preview your draft. Unsaved changes are lost when you leave. Publishing updates the public study immediately.</p>
<div className="editor-split">
<section aria-label="Write content">
<div className="editor-toolbar">
<button disabled={busy} onClick={switchMode}>{rawSource !== null ? 'Writing mode' : 'JSON mode'}</button>
{rawSource === null && <button disabled={busy} onClick={() => setDrafts(current => [...current, serialize({ type: 'markdown', data: { text: '' } })])}>Add paragraph</button>}
</div>
{rawSource !== null ? <>
<label htmlFor="blocks">Content blocks (JSON)</label>
<textarea id="blocks" value={rawSource} onChange={event => setRawSource(event.target.value)} spellCheck={false} />
</> : drafts.map((source, index) => {
const block = parseBlock(source);
const textBlock = block && ['markdown', 'callout', 'code'].includes(block.type) && 'text' in block.data;
return <div className="editor-block" key={index}>
<label htmlFor={`block-${index}`}>Block {index + 1} · {block?.type || 'Structured content'}</label>
<textarea id={`block-${index}`} value={textBlock ? String((block!.data as { text: string }).text) : source}
spellCheck={!!textBlock} onChange={event => update(index, textBlock ? serialize({ ...block, data: { ...block!.data, text: event.target.value } }) : event.target.value)} />
<div className="editor-toolbar">
<button disabled={busy || index === 0} aria-label={`Move block ${index + 1} up`} onClick={() => move(index, -1)}>↑</button>
<button disabled={busy || index === drafts.length - 1} aria-label={`Move block ${index + 1} down`} onClick={() => move(index, 1)}>↓</button>
<button disabled={busy || drafts.length === 1} onClick={() => setDrafts(current => current.filter((_, i) => i !== index))}>Remove block</button>
</div>
</div>;
})}
<div className="editor-toolbar">
<button disabled={busy} onClick={() => request(true)}>Preview draft</button>
<button disabled={busy} onClick={() => request(false)}>{busy ? 'Working…' : 'Publish changes'}</button>
</div>
<p role="status" aria-live="polite">{message}</p>
</section>
<section aria-label="Preview content">
<p>Preview · <Link target="_blank" href={`/contents/${node}`}>Open public page ↗</Link></p>
<Blocks blocks={preview} />
</section>
</div>
</Layout>;
}
+6
View File
@@ -0,0 +1,6 @@
import Link from 'next/link';
import Layout from '../../components/Layout';
import { CONTENT_TREE } from '../../lib/content-tree';
export default function Editor() {
return <Layout title="Editorial desk"><p className="landing-kicker">EDITORIAL DESK</p><h1>Research in progress.</h1><p>Open a study to write and preview it alongside the published page.</p><div className="cards">{CONTENT_TREE.children.map(n => <Link className="card" key={n.id} href={`/editor/contents/${n.id}`}><h2>{n.title}</h2><p>{n.blurb}</p><span>Open workspace →</span></Link>)}</div><p><Link href="/papers">Browse the private paper archive →</Link></p><button onClick={async () => { await fetch('/api/editor/logout', {method:'POST'}); window.location.assign('/'); }}>Sign out</button></Layout>;
}
+15
View File
@@ -0,0 +1,15 @@
import { FormEvent, useState } from 'react';
import Layout from '../../components/Layout';
export default function Login() {
const [error, setError] = useState(''); const [busy, setBusy] = useState(false);
async function submit(event: FormEvent<HTMLFormElement>) {
event.preventDefault(); setBusy(true); setError('');
const data = new FormData(event.currentTarget);
try {
const response = await fetch('/api/editor/login', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify(Object.fromEntries(data)) });
const result = await response.json(); if (!response.ok) throw new Error(result.error);
window.location.assign('/editor');
} catch (e) { setError((e as Error).message); } finally { setBusy(false); }
}
return <Layout title="Editor sign in"><form className="editor-login" onSubmit={submit}><p className="landing-kicker">AI-TLAS / EDITORIAL</p><h1>A space to work.</h1><p>Enter the current code from your authenticator.</p><label>Authenticator code<input name="code" inputMode="numeric" pattern="[0-9]{6}" maxLength={6} autoComplete="one-time-code" required /></label><button disabled={busy}>{busy ? 'Verifying…' : 'Open editor →'}</button><p role="alert">{error}</p></form></Layout>;
}
+15 -52
View File
@@ -1,58 +1,21 @@
import type { GetServerSideProps } from 'next';
import Link from 'next/link';
import Layout from '../components/Layout';
import { getConferences, getStats, getTaxonomyTree } from '../lib/queries';
import type { TaxNode } from '../lib/types';
interface Props { papers: number; llm: number; venues: number; topics: TaxNode[] }
import { getConferences, getStats } from '../lib/queries';
interface Props { papers: number; llm: number; venues: number }
export const getServerSideProps: GetServerSideProps<Props> = async () => {
const [stats, conferences, topics] = await Promise.all([getStats(), getConferences(), getTaxonomyTree({ llm: true })]);
return { props: { ...stats, venues: conferences.filter(c => c.paper_count > 0).length, topics: topics.filter(t => t.id !== 'other' && t.count > 0) } };
const [stats, conferences] = await Promise.all([getStats(), getConferences()]);
return { props: { ...stats, venues: conferences.filter(c => c.paper_count > 0).length } };
};
export default function Home({ papers, llm, venues, topics }: Props) {
return <Layout>
<div className="landing">
<section className="landing-hero" aria-labelledby="hero-title">
<div>
<p className="landing-kicker">AI Taxonomy, Literature Analysis &amp; Survey</p>
<h1 id="hero-title">Find the papers.<br />See the landscape.</h1>
<p className="landing-intro">AI-tlas connects AI papers, research taxonomies and in-depth surveys. Start with a question, find its place in the field, and follow the evidence.</p>
<form action="/papers" method="get" className="landing-search" role="search">
<label className="sr-only" htmlFor="paper-search">Search AI papers</label>
<input id="paper-search" name="q" type="search" placeholder="Search papers, methods or benchmarks" required />
<button type="submit">Find papers →</button>
</form>
<div className="landing-actions"><Link href="/papers">Browse all papers ↗</Link><Link href="/contents">Read the surveys ↗</Link></div>
</div>
<aside className="landing-map" aria-label="Three connected ways to explore research">
<span className="landing-map-label">YOUR RESEARCH ATLAS</span>
<Link href="/papers"><span>01 / DISCOVER</span><strong>Papers</strong><small>Questions · methods · evidence</small></Link>
<Link href="/landscape#taxonomy"><span>02 / CONNECT</span><strong>Taxonomy</strong><small>Topics · contributions · relationships</small></Link>
<Link href="/contents"><span>03 / UNDERSTAND</span><strong>Surveys</strong><small>Tools · comparisons · research stories</small></Link>
<span className="landing-map-foot">From individual results to a connected field.</span>
</aside>
</section>
<dl className="landing-stats">
<div><dt>{papers.toLocaleString('en-US')}</dt><dd>indexed papers</dd></div>
<div><dt>{llm.toLocaleString('en-US')}</dt><dd>language-model related</dd></div>
<div><dt>{venues.toLocaleString('en-US')}</dt><dd>venues with available papers</dd></div>
</dl>
<section className="landing-section" aria-labelledby="explore-title">
<p className="landing-kicker">CHOOSE A STARTING POINT</p>
<h2 id="explore-title">A field is more than a list of papers.</h2>
<div className="landing-paths">
<Link href="/papers"><span>01</span><h3>Find your next paper ↗</h3><p>Search titles, abstracts and authors. Narrow the results by venue, topic and track.</p></Link>
<Link href="/landscape"><span>02</span><h3>Map the research ↗</h3><p>Explore topic families and the kinds of contributions papers make, from methods to benchmarks.</p></Link>
<Link href="/contents"><span>03</span><h3>Read across papers ↗</h3><p>Explore tools of agents and Lean theorem proving through structured analyses and comparisons.</p></Link>
</div>
</section>
<section className="landing-section" aria-labelledby="topics-title">
<div className="landing-section-heading"><div><p className="landing-kicker">FOLLOW A THREAD</p><h2 id="topics-title">Explore language-model research.</h2></div><Link href="/landscape#taxonomy">Full taxonomy →</Link></div>
<div className="landing-topics">{topics.map(t => <Link key={t.id} href={`/papers?node=${encodeURIComponent(t.id)}&llm=1`}><span>{t.label}</span><small>{t.count.toLocaleString('en-US')} papers ↗</small></Link>)}</div>
</section>
<section className="landing-note"><div><p className="landing-kicker">SCOPE &amp; SOURCES</p><h2>A growing map, with visible limits.</h2><p>The current collection covers available 2026 NLP and ML venue lists. Topic assignments include keyword rules; some paper labels use titles and abstracts only. Coverage and classifications are a starting point for reading, not a complete account of the field.</p></div><Link href="/overview">View venues &amp; coverage →</Link></section>
<footer className="landing-footer"><strong>AI-tlas</strong><span>AI Taxonomy, Literature Analysis &amp; Survey</span></footer>
</div>
</Layout>;
export default function Home({ papers, llm, venues }: Props) {
return <Layout><div className="journal-home">
<section className="journal-hero"><p className="landing-kicker"><span className="live-dot"/> AN INDEPENDENT RESEARCH NOTEBOOK</p><h1>Research takes shape.<br/><em>One question at a time.</em></h1><p className="journal-intro">Reading, connecting, and writing about AI.<br/>An open notebook for ideas worth understanding deeply.</p><Link className="journal-cta" href="#studies">Explore the research <span>↘</span></Link><span className="hero-margin">AI / SCIENCE / IDEAS</span></section>
<section id="studies" className="journal-studies"><div className="journal-heading"><p className="landing-kicker">ON THE DESK</p><span>Two questions. An evolving body of work.</span></div><div className="study-grid">
<Link href="/contents/lean-theorem-proving" className="study-card"><div className="study-art proof-art" aria-hidden="true"><span className="art-label">01 / FORMAL REASONING</span><span className="proof-line">a question</span><span className="proof-arrow">↓</span><span className="proof-line">a conjecture</span><span className="proof-arrow">↓</span><span className="proof-result">a verified proof <b>✓</b></span><span className="art-foot">Lean 4 · Mathlib · AI</span></div><div className="study-copy"><p className="landing-kicker">MATHEMATICS × MACHINE INTELLIGENCE</p><h2>When AI learns to prove.</h2><p>Exploring Lean, formal verification, and the path from a mathematical idea to a proof we can check.</p><span className="study-read">Read the study <b>↗</b></span></div></Link>
<Link href="/contents/tools-of-agents" className="study-card"><div className="study-art agent-art" aria-hidden="true"><span className="art-label">02 / AGENT SYSTEMS</span><div className="agent-diagram"><span>reason</span><i>↔</i><strong>agent</strong><i>↔</i><span>act</span></div><div className="tool-chips"><span>function calls</span><span>MCP</span><span>APIs</span></div><span className="art-foot">From language to action</span></div><div className="study-copy"><p className="landing-kicker">TOOLS × AUTONOMOUS SYSTEMS</p><h2>Beyond the conversation.</h2><p>How agents reach into the world through tools. A closer look at the interfaces that turn reasoning into action.</p><span className="study-read">Read the study <b>↗</b></span></div></Link>
</div></section>
<section className="journal-evidence"><div className="journal-heading"><p className="landing-kicker">GROUNDED IN THE LITERATURE</p><span>A growing collection behind the research.</span></div><dl className="landing-stats"><div><dt>{papers.toLocaleString('en-US')}</dt><dd>indexed papers</dd></div><div><dt>{llm.toLocaleString('en-US')}</dt><dd>language-model related</dd></div><div><dt>{venues.toLocaleString('en-US')}</dt><dd>venues with available papers</dd></div></dl><p className="evidence-note">Available 2026 NLP and ML venue lists. Coverage is partial; classifications are a starting point for reading.</p></section>
<section className="journal-manifesto"><p className="landing-kicker">A NOTE ON THE PROCESS</p><h2>Read widely.<br/>Connect carefully.<br/><em>Write to understand.</em></h2><p>AI-tlas is a place to work through research in public. We follow the papers, compare the approaches, and turn scattered results into studies you can explore.</p></section>
<footer className="journal-footer"><Link href="/" className="brand">AI-tlas<span>AI Taxonomy, Literature Analysis &amp; Survey</span></Link><Link href="/editor">Editorial desk ↗</Link></footer>
</div></Layout>;
}
+32
View File
@@ -0,0 +1,32 @@
"""Runner-only: persist optional Actions editor secrets without logging values."""
import os
from pathlib import Path
import re
import sys
import tempfile
path = Path(sys.argv[1])
values = {key: os.environ.get(key, '') for key in
('EDITOR_TOTP_SECRET', 'EDITOR_SESSION_SECRET', 'EDITOR_ORIGIN')}
# Missing Actions configuration preserves the current server configuration.
if values['EDITOR_TOTP_SECRET'] and values['EDITOR_SESSION_SECRET']:
if not re.fullmatch(r'[A-Z2-7]{32,}', values['EDITOR_TOTP_SECRET']):
raise SystemExit('Invalid editor authenticator configuration')
if not re.fullmatch(r'[A-Za-z0-9_-]{32,}', values['EDITOR_SESSION_SECRET']):
raise SystemExit('Invalid editor session configuration')
if not values['EDITOR_ORIGIN']:
raise SystemExit('Editor origin is required when provisioning secrets')
if not re.fullmatch(r'https?://[A-Za-z0-9.:-]+', values['EDITOR_ORIGIN']):
raise SystemExit('Invalid editor origin')
lines = [line for line in path.read_text().splitlines()
if not any(line.startswith(key + '=') for key in values)]
lines += [f'{key}={value}' for key, value in values.items()]
fd, temp = tempfile.mkstemp(dir=path.parent, prefix='.editor-env-')
try:
with os.fdopen(fd, 'w') as output:
output.write('\n'.join(lines) + '\n')
os.chmod(temp, 0o600)
os.replace(temp, path)
finally:
if os.path.exists(temp):
os.unlink(temp)
+3 -2
View File
@@ -41,7 +41,7 @@ if [ ! -s "$ENVF" ]; then
umask 077
printf 'DATABASE_URL=postgres://%s:%s@127.0.0.1:%s/%s\n' "$DB" "$PW" "$PGPORT" "$DB" > "$ENVF"
fi
PW=$(sed -E 's#^DATABASE_URL=postgres://[^:]+:([^@]+)@.*#\1#' "$ENVF")
PW=$(sed -nE 's#^DATABASE_URL=postgres://[^:]+:([^@]+)@.*#\1#p' "$ENVF")
# keep the role password and the env file in sync; create role/db only when missing
if [ "$(psql_admin "-c \"select 1 from pg_roles where rolname='$DB'\"")" = 1 ]; then
psql_admin "-c \"alter role $DB with login password '$PW'\"" >/dev/null
@@ -50,6 +50,7 @@ else
fi
[ "$(psql_admin "-c \"select 1 from pg_database where datname='$DB'\"")" = 1 ] || psql_admin "-c \"create database $DB owner $DB\"" >/dev/null
chmod 600 "$ENVF"
python3 scripts/configure-editor.py "$ENVF"
set -a; . "$ENVF"; set +a
PGPASSWORD=$PW psql -h 127.0.0.1 -p "$PGPORT" -U "$DB" -d "$DB" -qtAc 'select 1' >/dev/null || { echo "cannot log in to postgres as $DB" >&2; exit 1; }
@@ -132,7 +133,7 @@ systemctl enable "$APP" >/dev/null 2>&1
systemctl restart "$APP"
ok=0
for i in 1 2 3 4 5 6 7 8 9 10; do
if curl -fsS -o /dev/null "http://127.0.0.1:$PORT/" && curl -fsS -o /dev/null "http://127.0.0.1:$PORT/papers?q=agent"; then ok=1; break; fi
if curl -fsS -o /dev/null "http://127.0.0.1:$PORT/" && curl -fsS -o /dev/null "http://127.0.0.1:$PORT/contents"; then ok=1; break; fi
sleep 2
done
[ "$ok" = 1 ] || { journalctl -u "$APP" -n 60 --no-pager; exit 1; }
+17
View File
@@ -0,0 +1,17 @@
const { spawn } = require('node:child_process');
const assert = require('node:assert/strict');
const server = spawn(process.execPath, ['node_modules/next/dist/bin/next','start','-p','19381','-H','127.0.0.1'], {env:{...process.env,EDITOR_SESSION_SECRET:'test-only-secret-that-is-at-least-32-characters',EDITOR_ORIGIN:'http://127.0.0.1:19381'},stdio:['ignore','pipe','pipe']});
(async()=>{
const origin='http://127.0.0.1:19381'; let ready=false;
for(let i=0;i<60;i++) {try {const r=await fetch(origin+'/editor/login');if(r.ok){ready=true;break;}}catch{}await new Promise(r=>setTimeout(r,500));}
assert(ready,'Next server did not become ready');
for(const path of ['/api/blocks','/api/tool-taxonomy','/api/blocks?page=content/tools-of-agents']) {
for(const headers of [{},{'x-middleware-subrequest':'middleware:middleware:middleware:middleware:middleware'}]) {
const r=await fetch(origin+path,{headers});assert.equal(r.status,401,path);
}
}
for(const path of ['/papers','/papers/11702','/overview','/landscape','/contents/unpublished'])assert.equal((await fetch(origin+path)).status,404,path);
for(const path of ['/editor','/editor/contents/tools-of-agents']) {const r=await fetch(origin+path,{redirect:'manual'});assert.equal(r.status,307,path);assert(r.headers.get('location').endsWith('/editor/login'));}
const csrf=await fetch(origin+'/api/editor/login',{method:'POST',headers:{'Content-Type':'application/json',Origin:'https://other.invalid'},body:JSON.stringify({code:'123456'})});assert.equal(csrf.status,403);
console.log('Anonymous route, middleware bypass and CSRF smoke checks: passed');
})().catch(e=>{console.error(e);process.exitCode=1;}).finally(()=>server.kill());
+31
View File
@@ -0,0 +1,31 @@
// Remote-runner tests: transpile only into memory, never emit artifacts.
const assert = require('node:assert/strict');
const vm = require('node:vm');
const fs = require('node:fs');
const ts = require('typescript');
const { webcrypto } = require('node:crypto');
const context = { exports: {}, crypto: webcrypto, TextEncoder, Uint8Array, Date, process: { env: { EDITOR_SESSION_SECRET: 'test-only-secret-with-at-least-32-characters' } } };
vm.runInNewContext(ts.transpileModule(fs.readFileSync('lib/editor-session.ts','utf8'), {compilerOptions:{module:ts.ModuleKind.CommonJS,target:ts.ScriptTarget.ES2020}}).outputText, context);
(async () => {
const {signSession,validSession} = context.exports;
const payload = `${Date.now()+60_000}.${'a'.repeat(32)}`;
const token = `${payload}.${await signSession(payload)}`;
assert.equal(await validSession(token),true);
for (const value of [undefined,'',token+'x',token+'.extra',token.replace(/^./,'0')]) assert.equal(await validSession(value),false);
const expired = `${Date.now()-1000}.${'a'.repeat(32)}`;
assert.equal(await validSession(`${expired}.${await signSession(expired)}`),false);
const future = `${Date.now()+9*3600_000}.${'a'.repeat(32)}`;
assert.equal(await validSession(`${future}.${await signSession(future)}`),false);
context.process.env.EDITOR_SESSION_SECRET = 'rotated-secret-with-at-least-32-characters';
assert.equal(await validSession(token),false);
context.process.env.EDITOR_SESSION_SECRET = '';
assert.equal(await validSession(token),false);
const totpContext = {exports:{},require,Buffer};
vm.runInNewContext(ts.transpileModule(fs.readFileSync('lib/totp.ts','utf8'), {compilerOptions:{module:ts.ModuleKind.CommonJS,target:ts.ScriptTarget.ES2020}}).outputText, totpContext);
const rfcSecret = 'GEZDGNBVGY3TQOJQGEZDGNBVGY3TQOJQ';
for (const [time,expected] of [[59,'287082'],[1111111109,'081804'],[1111111111,'050471'],[1234567890,'005924'],[2000000000,'279037'],[20000000000,'353130']]) {
assert.equal(totpContext.exports.totp(rfcSecret,Math.floor(time/30)),expected);
}
console.log('RFC 6238 TOTP vectors: passed');
console.log('Editor session validation: passed');
})().catch(error => { console.error(error); process.exitCode=1; });
+90
View File
@@ -148,3 +148,93 @@ a:focus-visible,button:focus-visible,input:focus-visible{outline:3px solid var(-
@media(prefers-color-scheme:dark){.landing{--atlas-green:#80ba9c;--atlas-paper:#202f28;--atlas-ink:#dce8df}.landing-map{border-color:#3c5141}.landing-map a{border-color:#3c5141}.landing-search button{color:#14291e}}
@media(max-width:800px){.nav{flex-wrap:wrap;gap:10px 18px;padding:12px 16px}.landing-hero{grid-template-columns:1fr;gap:28px;padding:32px 0}.landing-map{transform:none}.landing-paths{grid-template-columns:1fr;gap:4px}.landing-topics{grid-template-columns:1fr}.landing-note{flex-direction:column;align-items:flex-start}.landing-stats div{padding:0 12px}.landing-stats dt{font-size:26px}.landing-stats dd{font-size:11px}.landing-footer{flex-direction:column;gap:8px}}
@media(max-width:480px){.landing-search{flex-direction:column}.landing-section-heading{display:block;margin-bottom:20px}.landing-topics a{align-items:flex-start}.landing-stats dt{font-size:23px}.landing-note{padding:20px}}
/* The public research journal. */
.nav{padding:20px max(24px,calc((100vw - 1180px)/2));gap:30px;background:var(--bg)}
.nav .brand{font-size:24px;letter-spacing:-1.2px;margin-right:auto}
.nav a{color:var(--fg);font-size:13px}
.nav .brand{font-size:24px}
.nav-editor{border:1px solid var(--line);padding:8px 14px;border-radius:6px}
.wrap:has(.journal-home){max-width:1180px;padding:0 24px}
.journal-home{--journal-green:#315c49}
.journal-hero{position:relative;padding:100px 0 90px;border-bottom:1px solid var(--line)}
.journal-hero h1{font-size:clamp(42px,6.4vw,78px);line-height:1.08;letter-spacing:-3.8px;font-weight:500;margin:25px 0}
.journal-home em{font-family:Georgia,serif;font-weight:400;color:var(--journal-green)}
.landing-kicker{font-size:10px;letter-spacing:1.9px;font-weight:600;color:var(--muted)}
.live-dot{display:inline-block;width:7px;height:7px;background:#56836b;border-radius:50%;margin-right:9px}
.journal-intro{font-size:18px;color:var(--muted);line-height:1.7;margin-bottom:32px}
.journal-cta{display:inline-flex;gap:48px;padding:14px 20px;background:var(--fg);color:var(--bg);border-radius:5px;font-size:14px}
.hero-margin{position:absolute;right:0;bottom:45px;font-size:10px;letter-spacing:2px;color:var(--muted)}
.journal-studies{padding:35px 0 64px;scroll-margin-top:100px}
.journal-heading{display:flex;justify-content:space-between;align-items:center;gap:20px;margin-bottom:24px}
.journal-heading>span{font-size:12px;color:var(--muted)}
.study-grid{display:grid;grid-template-columns:1fr 1fr;gap:28px}
.study-card{color:var(--fg);border:1px solid var(--line);border-radius:8px;overflow:hidden;background:var(--card)}
.study-card:hover{text-decoration:none;border-color:var(--journal-green)}
.study-art{height:300px;position:relative;display:flex;flex-direction:column;align-items:center;justify-content:center;overflow:hidden}
.proof-art{background:#e8eee7;color:#345342;background-image:radial-gradient(#34534225 .7px,transparent .7px);background-size:16px 16px}
.agent-art{background:#eeeaf3;color:#59456d;background-image:linear-gradient(#59456d0b 1px,transparent 1px),linear-gradient(90deg,#59456d0b 1px,transparent 1px);background-size:28px 28px}
.art-label,.art-foot{position:absolute;left:24px;font-size:9px;letter-spacing:1.7px}
.art-label{top:22px}
.art-foot{bottom:20px}
.proof-line{font:italic 22px Georgia,serif}
.proof-arrow{font-size:18px;opacity:.5;margin:5px}
.proof-result{font:italic 22px Georgia,serif;border:1px solid #34534255;padding:9px 18px;background:#f6f9f2}
.proof-result b{margin-left:18px;font:16px system-ui}
.agent-diagram{display:flex;align-items:center;gap:14px}
.agent-diagram span{font:italic 20px Georgia,serif}
.agent-diagram strong{padding:25px 17px;border:1px solid #59456d66;border-radius:50%;background:#f8f5fc;font:italic 24px Georgia,serif}
.agent-diagram i{font-style:normal;opacity:.45}
.tool-chips{display:flex;gap:8px;margin-top:24px}
.tool-chips span{font-size:10px;border:1px solid #59456d30;padding:5px 10px;border-radius:4px;background:#f8f5fc}
.study-copy{padding:28px}
.study-copy h2{font-size:29px;font-weight:500;letter-spacing:-1px;margin:14px 0}
.study-copy>p:not(.landing-kicker){font-size:14px;color:var(--muted);line-height:1.8;min-height:76px}
.study-read{display:flex;justify-content:space-between;border-top:1px solid var(--line);padding-top:18px;font-size:13px}
.study-read b{font-size:18px;font-weight:400}
.journal-evidence{border-top:1px solid var(--line);padding:35px 0}
.journal-evidence .landing-stats{margin:0;border:0;padding:12px 0 25px}
.journal-evidence dt{font-size:44px;font-weight:500;letter-spacing:-2px}
.evidence-note{color:var(--muted);font-size:11px}
.journal-manifesto{margin-top:45px;border-top:1px solid var(--line);padding:60px 0 90px;display:grid;grid-template-columns:1fr 1fr;gap:15px 70px}
.journal-manifesto>.landing-kicker{grid-column:1/-1}
.journal-manifesto h2{font-size:46px;line-height:1.2;letter-spacing:-1.8px;font-weight:500;margin:10px 0}
.journal-manifesto>p:last-child{align-self:center;color:var(--muted);font-size:16px;line-height:1.9;max-width:380px}
.journal-footer{border-top:1px solid var(--line);padding:30px 0;display:flex;justify-content:space-between;align-items:center}
.journal-footer a{color:var(--fg);font-size:12px}
.journal-footer .brand{font-size:24px;font-weight:600;letter-spacing:-1px}
.journal-footer .brand span{display:block;font-size:10px;font-weight:400;letter-spacing:0;color:var(--muted);margin-top:6px}
.editor-login{max-width:420px;margin:70px auto}
.editor-login label{display:block;margin:20px 0}
.editor-login input{display:block;width:100%;padding:12px;margin-top:7px;background:var(--card);color:var(--fg);border:1px solid var(--line);border-radius:5px;font:inherit}
.editor-split{display:grid;grid-template-columns:1fr 1fr;gap:24px}
.editor-split section{min-width:0;overflow:auto}
.editor-split textarea{width:100%;height:65vh;display:block;margin:12px 0;padding:16px;background:var(--card);color:var(--fg);border:1px solid var(--line);font:12px/1.6 monospace}
.editor-split .blocks{max-height:70vh;overflow:auto}
button:disabled{opacity:.55;cursor:wait}
a:focus-visible,button:focus-visible,input:focus-visible,textarea:focus-visible{outline:3px solid var(--accent);outline-offset:4px}
@media(prefers-color-scheme:dark){.journal-home{--journal-green:#a1c6ac}
.proof-art{background-color:#25382c;color:#d5e2d3}
.agent-art{background-color:#342e40;color:#e0d4eb}
.proof-result,.tool-chips span,.agent-diagram strong{background:#ffffff12}
}
@media(max-width:680px){.nav{gap:16px;padding:16px}
.nav-editor{padding:6px!important;font-size:10px!important}
.wrap:has(.journal-home){padding:0 20px}
.journal-hero{padding:65px 0 75px}
.journal-hero h1{letter-spacing:-2px}
.hero-margin{bottom:25px}
.study-grid,.journal-manifesto,.editor-split{grid-template-columns:1fr}
.journal-heading{align-items:flex-start;flex-direction:column;gap:0}
.study-art{height:260px}
.journal-evidence dt{font-size:32px}
.journal-manifesto{padding:40px 0}
.journal-manifesto h2{font-size:40px}
.journal-footer{gap:20px}
.journal-footer .brand span{max-width:180px}
}
.editor-block{padding:16px 0;border-bottom:1px solid var(--line);margin-bottom:16px}.editor-block textarea{height:180px;font:14px/1.7 system-ui}.editor-block label{font-size:12px;color:var(--muted)}
.editor-toolbar{display:flex;flex-wrap:wrap;gap:8px;margin:12px 0}