diff --git a/.gitea/workflows/deploy.yml b/.gitea/workflows/deploy.yml index e051308..796f2b8 100644 --- a/.gitea/workflows/deploy.yml +++ b/.gitea/workflows/deploy.yml @@ -16,6 +16,7 @@ on: jobs: deploy: + if: github.ref == 'refs/heads/main' runs-on: ces-control timeout-minutes: 60 steps: diff --git a/.gitea/workflows/validate.yml b/.gitea/workflows/validate.yml new file mode 100644 index 0000000..e6f225f --- /dev/null +++ b/.gitea/workflows/validate.yml @@ -0,0 +1,27 @@ +name: Validate +on: + push: + branches-ignore: [main] + paths-ignore: + - '**/*.md' + - 'docs/**' + +jobs: + validate: + runs-on: ces-control + timeout-minutes: 30 + steps: + - name: Checkout + run: | + git init -q . + git remote add origin "$GITHUB_SERVER_URL/$GITHUB_REPOSITORY.git" + git -c http.extraHeader="Authorization: token ${{ github.token }}" fetch -q --depth 1 origin "$GITHUB_SHA" + git checkout -q --detach FETCH_HEAD + - name: Install dependencies + run: npm ci --no-audit --no-fund + - name: Type check + run: npm run typecheck + - name: Build + env: + NEXT_TELEMETRY_DISABLED: '1' + run: npm run build diff --git a/README.md b/README.md index a985821..8c2afa2 100644 --- a/README.md +++ b/README.md @@ -1,35 +1,57 @@ -# LLM Research Survey 2026 +# ATLAS -Next.js (pages router) + React + TypeScript site for browsing 2026 NLP/ML conference papers, backed by SQLite (FTS5 search) and a keyword-scored topic taxonomy. +**AI Taxonomy, Literature Analysis & Survey** — a research atlas for discovering AI papers, exploring their taxonomy and reading structured analyses. The website brand is **AI-tlas**; the repository name is `ai-taxonomy-literature-analysis-survey`. -## Run -```bash -npm install -npm run dev # http://localhost:3000 (uses the bundled data/papers.db) +## Explore + +- `/`: landing page with paper search, live collection counts and topic entry points. +- `/overview`: venue coverage, conference dates and topic counts (the former homepage). +- `/papers` and `/papers/[id]`: search/filter papers and read their analyses. +- `/landscape`: topic taxonomy, work types and research landscape. +- `/contents`: surveys and analysis groups, including tools of agents and Lean theorem proving. +- `/work-types/[slug]`, `/benchmarks/[id]`, `/conferences/[slug]`: detailed research views. + +The current collection focuses on available 2026 NLP/ML venue lists. Sources include ICLR/ICML through papercopilot/paperlists and ACL-family venues through ACL Anthology. Availability depends on upstream sources; this is not a complete index of all AI research. + +## Stack and storage + +Next.js Pages Router, React, TypeScript and PostgreSQL (`pg`). Runtime requires `DATABASE_URL`; `lib/db.ts` uses `search_path=live`. + +- **`live`**: 14 imported tables for conferences, papers, taxonomies, work types, labels, benchmarks, results and reviews. Loading builds a temporary `next` schema, verifies row counts and atomically replaces `live`. Treat these tables as replaceable imported data. +- **`analysis`**: persistent editorial content. `page_block` stores ordered typed JSONB blocks keyed by `paper//` or `content/`. Tool categories, paper tools and category mappings also live here. Legacy article/section/block/link tables remain for migration; current pages render page blocks. Rebuilding `live` does not replace `analysis`. +- **Repository data**: `data/labels/o*.jsonl` contains 2,678 paper labels; `data/labels/type_notes.json` contains per-type syntheses. These are still tracked import sources, not database-only content. `scripts/worktypes.json`, `scripts/taxonomy.py`, `lib/content-tree.ts` and `lib/content-defaults.ts` define vocabulary, classification rules, content navigation and initial blocks. +- **Files and media**: raw downloads, staging SQLite databases and exports are ignored by Git. Deployment caches raw sources and JSONL exports under `/opt/llm-survey/cache/`. Figure blocks store a source URL, alt text and caption, not image bytes. Charts and Mermaid are rendered by components. No image storage/upload service is implemented. + +Schema definitions: `scripts/load-pg.js` (`live`) and `lib/analysis-schema.ts` (`analysis`). Use production database catalogs to verify actual deployed structure. + +## Data quality + +Topic assignment uses keyword scoring: title ×3, keywords ×2, abstract ×1. Agent-paper labels use titles and abstracts; other papers use rule-based labels. Scores are those stated in abstracts. Labels, summaries and inferred classifications should be checked against the original papers. + +## CI/CD and daily refresh + +Gitea Actions configuration: `.gitea/workflows/deploy.yml`; deployment: `scripts/deploy.sh`. + +- Pushes to `main` trigger deployment, except documentation-only changes (`**/*.md`, `docs/**`). +- A job-level branch guard restricts deployment to `refs/heads/main`, including manual dispatches. Feature branches and PRs do not deploy. +- A scheduled run at **03:17 Asia/Shanghai daily** (`19:17 UTC`) requests fresh upstream data, rebuilds the data export, loads PostgreSQL when changed, builds the site and restarts/checks the service. The schedule runs from the default branch; keep that branch set to `main`. +- Manual dispatch supports `refresh_data`: false reuses cached data where possible; true downloads and rebuilds data. +- Feature-branch pushes run type checking and a production build on `ces-control` via `.gitea/workflows/validate.yml`; validation never deploys or imports data. +- The deployment runner is **`ces-control`**. Building and deployment occur there, not on a developer's local machine. Scheduler/runner availability determines whether a scheduled run actually succeeds; inspect Gitea Actions logs for results. +- Production service remains `llm-survey`, under `/opt/llm-survey`, with database `llm_survey`, environment `/etc/llm-survey/db.env`, and default port `18231`. These infrastructure identifiers are intentionally stable across the branding change. + +The deployment cache reuses unchanged exports, dependencies and Next.js compilation cache. A changed export replaces `live`; persistent page blocks and tool annotations in `analysis` are retained. Back up both schemas before changing data ownership or migrations. + +## Remote development and validation + +Install dependencies and run `npm run typecheck` / `npm run build` only in the approved remote execution environment. For an isolated remote preview, set `DATABASE_URL` and run `npm run dev`; do not point a feature-branch deployment at the production service. + +Data pipeline commands (remote runner only): + +```sh +npm run data:fetch +npm run data:build +npm run data:load ``` -## Rebuild the database -```bash -npm run data:fetch # ICLR/ICML lists + ACL Anthology XML -> data/raw -npm run data:build # python3 scripts/ingest.py -> data/papers.db -``` -Sources: ICLR 2026 and ICML 2026 via papercopilot/paperlists (OpenReview); ACL 2026 (+Findings), EACL, LREC, CoNLL, SIGDIAL, TACL, CL via acl-org/acl-anthology. -Not yet loaded: EMNLP, AACL, COLM, NeurIPS, AAAI 2026 (add a loader in scripts/ingest.py). - -## Types of work -A type of work = research area x role (what a paper contributes, and what it holds fixed vs varies). Vocabulary: `scripts/worktypes.json`. -- `data/labels/o*.jsonl`: per-paper labels for the 2,678 agent-related papers (types, fixes/varies, benchmarks, workflow, abstract-stated scores), produced by LLM reading of title+abstract. -- `data/labels/type_notes.json`: per-type synthesis (why members are one type, sub-variants, benchmark story, typical workflow). -- All other LLM papers get rule-based roles (marked `rule`). -```bash -npm run data:build # base tables -npm run data:worktypes # work-type tables (run on a local disk copy if your filesystem rejects SQLite locks) -``` -Limits: labels use titles+abstracts only (no intro/related work/result tables); time order is by venue date; scores are only those stated in abstracts. - -## Pages -/ overview · /papers search + filters + taxonomy sidebar · /papers/[id] · /work-types (area x role matrix) · /work-types/[slug] (timeline, why-same, benchmarks, workflow, scores, papers) · /benchmarks · /taxonomy tree · /conferences/[slug] - -## Taxonomy -Defined in scripts/taxonomy.py (13 branches, ~48 leaves); edit patterns and re-run data:build. -Heuristic: title x3, keywords x2, abstract x1. ML-venue papers with no language-model signal go to "Other ML". +`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. diff --git a/components/Layout.tsx b/components/Layout.tsx index c3a9ffa..26df5cd 100644 --- a/components/Layout.tsx +++ b/components/Layout.tsx @@ -4,7 +4,8 @@ import { useRouter } from 'next/router'; import { ReactNode } from 'react'; const LINKS = [ - { href: '/', label: 'Overview' }, + { href: '/', label: 'Home' }, + { href: '/overview', label: 'Overview' }, { href: '/papers', label: 'Papers' }, { href: '/landscape', label: 'Landscape' }, { href: '/contents', label: 'Contents' }, @@ -15,11 +16,12 @@ export default function Layout({ title, children }: { title?: string; children: return ( <> - {title ? `${title} · LLM Survey 2026` : 'LLM Research Survey 2026'} + {title ? `${title} · AI-tlas` : 'AI-tlas · AI Taxonomy, Literature Analysis & Survey'} +