Skip to content
TypeScript

Add CI (GitHub Actions) + GitHub Pages report gallery

Claude2ddfc36eccd6
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
new file mode 100644
index 0000000..fa76ca6
--- /dev/null
+++ b/.github/workflows/ci.yml
@@ -0,0 +1,26 @@
+name: CI
+
+on:
+ push:
+ branches: [main, "claude/**"]
+ pull_request:
+
+jobs:
+ check:
+ name: typecheck · lint · test · build
+ runs-on: ubuntu-latest
+ strategy:
+ fail-fast: false
+ matrix:
+ node: [20, 22]
+ steps:
+ - uses: actions/checkout@v4
+ - uses: actions/setup-node@v4
+ with:
+ node-version: ${{ matrix.node }}
+ cache: npm
+ - run: npm ci
+ - run: npm run typecheck
+ - run: npm run lint
+ - run: npm test
+ - run: npm run build
diff --git a/.github/workflows/pages.yml b/.github/workflows/pages.yml
new file mode 100644
index 0000000..2f9d6d9
--- /dev/null
+++ b/.github/workflows/pages.yml
@@ -0,0 +1,41 @@
+name: Pages
+
+on:
+ push:
+ branches: [main]
+ workflow_dispatch:
+
+permissions:
+ contents: read
+ pages: write
+ id-token: write
+
+concurrency:
+ group: pages
+ cancel-in-progress: true
+
+jobs:
+ build:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v4
+ - uses: actions/setup-node@v4
+ with:
+ node-version: 22
+ cache: npm
+ - run: npm ci
+ - run: npm run build:site
+ - uses: actions/configure-pages@v5
+ - uses: actions/upload-pages-artifact@v3
+ with:
+ path: site
+
+ deploy:
+ needs: build
+ runs-on: ubuntu-latest
+ environment:
+ name: github-pages
+ url: ${{ steps.deployment.outputs.page_url }}
+ steps:
+ - id: deployment
+ uses: actions/deploy-pages@v4
diff --git a/.gitignore b/.gitignore
index e515f2f..1104e04 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,6 +1,7 @@
node_modules/
dist/
runs/
+site/
coverage/
*.log
.DS_Store
diff --git a/README.md b/README.md
index 378590a..c9c0772 100644
--- a/README.md
+++ b/README.md
@@ -8,8 +8,15 @@
# theseus
+[![CI](https://github.com/olympusresearch/theseus/actions/workflows/ci.yml/badge.svg)](https://github.com/olympusresearch/theseus/actions/workflows/ci.yml)
+[![Pages](https://github.com/olympusresearch/theseus/actions/workflows/pages.yml/badge.svg)](https://github.com/olympusresearch/theseus/actions/workflows/pages.yml)
+![node](https://img.shields.io/badge/node-%E2%89%A520-339933?logo=node.js&logoColor=white)
+![license](https://img.shields.io/badge/license-see%20LICENSE-blue)
+
> **Swap the model, the agent, the harness — plank by plank. The ship is still yours.
> theseus shows you which planks actually change the voyage.**
+>
+> 📊 **[Live demo gallery](https://olympusresearch.github.io/theseus/)** (mock run, regenerated by CI)
theseus is a comparison CLI (a TypeScript reimplementation of the **dike** product spec). It runs the
**same task subset** across **model (L0) × agent (L1) × harness (L2)** combinations and lays out, side by
diff --git a/package.json b/package.json
index 9ff1d93..bec2657 100644
--- a/package.json
+++ b/package.json
@@ -14,10 +14,11 @@
},
"scripts": {
"build": "tsup",
+ "build:site": "tsx scripts/build-site.ts",
"dev": "tsx src/cli.ts",
"typecheck": "tsc --noEmit",
- "lint": "biome check src tests",
- "format": "biome format --write src tests",
+ "lint": "biome check src tests scripts",
+ "format": "biome format --write src tests scripts",
"test": "vitest run",
"test:cov": "vitest run --coverage"
},
diff --git a/scripts/build-site.ts b/scripts/build-site.ts
new file mode 100644
index 0000000..08c0e36
--- /dev/null
+++ b/scripts/build-site.ts
@@ -0,0 +1,103 @@
+/**
+ * GitHub Pages 사이트 빌드 (report gallery).
+ * mock 데모 비교를 1회 실행 → 생성된 self-contained report.html/graph.html 을 site/ 로 복사하고,
+ * 항해 테마의 index.html(랜딩 + 갤러리)을 만든다. 외부 리소스 0(브랜딩 인라인).
+ * 실행: `npm run build:site` (tsx scripts/build-site.ts).
+ */
+import { copyFileSync, mkdirSync, rmSync, writeFileSync } from "node:fs";
+import { mkdtempSync } from "node:fs";
+import { tmpdir } from "node:os";
+import { join } from "node:path";
+import { PHILOSOPHY, TAGLINE, THEME, svgWordmark } from "../src/brand";
+import { execute } from "../src/orchestrator";
+
+const SITE = "site";
+const REPO = "https://github.com/olympusresearch/theseus";
+
+async function main(): Promise<void> {
+ rmSync(SITE, { recursive: true, force: true });
+ mkdirSync(SITE, { recursive: true });
+
+ const out = mkdtempSync(join(tmpdir(), "theseus-site-"));
+ const res = await execute({
+ models: ["opus4.8", "gpt5.5"],
+ agents: ["cc", "opencode", "codex"],
+ harnesses: ["none", "omc", "omo", "ponytail"],
+ bench: "subagent",
+ tasks: 6,
+ runs: 1,
+ seed: 7,
+ runner: "mock",
+ concurrency: 4,
+ timeoutS: 30,
+ outDir: out,
+ judge: "none",
+ score: true,
+ balanced: false,
+ language: "en",
+ });
+
+ copyFileSync(res.reportPath, join(SITE, "report.html"));
+ copyFileSync(res.graphPath, join(SITE, "graph.html"));
+ writeFileSync(join(SITE, ".nojekyll"), "");
+ writeFileSync(join(SITE, "index.html"), indexHtml());
+ // 보기 좋은 로그
+ process.stdout.write(`site built → ${SITE}/ (report.html, graph.html, index.html)\n`);
+}
+
+function card(href: string, title: string, body: string): string {
+ return `<a class="card" href="${href}">
+ <h2>${title}</h2>
+ <p>${body}</p>
+ <span class="go">open →</span>
+ </a>`;
+}
+
+function indexHtml(): string {
+ return `<!doctype html><html lang="en"><head><meta charset="utf-8">
+<meta name="viewport" content="width=device-width,initial-scale=1">
+<title>theseus — compare model × agent × harness</title>
+<style>
+:root{color-scheme:dark}
+body{font-family:ui-sans-serif,system-ui,sans-serif;background:${THEME.sea};color:${THEME.sail};margin:0;padding:0;line-height:1.5}
+.wrap{max-width:860px;margin:0 auto;padding:40px 24px 64px}
+header{display:flex;align-items:center;gap:16px;margin-bottom:8px}
+.tag{opacity:.85}
+.phil{color:${THEME.foam};font-style:italic;margin:18px 0 28px;border-left:3px solid ${THEME.rope};padding-left:14px}
+.cards{display:grid;grid-template-columns:1fr 1fr;gap:16px}
+@media(max-width:620px){.cards{grid-template-columns:1fr}}
+.card{display:block;background:${THEME.hull};border:1px solid rgba(255,255,255,.08);border-radius:14px;padding:18px 20px;text-decoration:none;color:${THEME.sail};transition:.15s}
+.card:hover{border-color:${THEME.rope};transform:translateY(-2px)}
+.card h2{margin:0 0 6px;font-size:17px}
+.card p{margin:0 0 10px;font-size:13px;opacity:.85}
+.go{color:${THEME.rope};font-weight:700;font-size:13px}
+.banner{background:rgba(245,158,11,.15);border:1px solid ${THEME.rope};color:${THEME.sail};padding:9px 13px;border-radius:9px;font-size:13px;margin:24px 0}
+.links{margin-top:28px;font-size:13px}
+.links a{color:${THEME.rope};text-decoration:none;font-weight:600}
+.foot{margin-top:40px;color:${THEME.mist};font-size:12px}
+code{font-family:ui-monospace,monospace;background:rgba(255,255,255,.06);padding:1px 6px;border-radius:5px}
+</style></head><body><div class="wrap">
+<header>${svgWordmark()}<span class="tag">${TAGLINE.en}</span></header>
+<p class="phil">⚓ ${PHILOSOPHY.en}</p>
+
+<div class="banner">This gallery is a <b>mock</b> (offline, deterministic) demo run — synthetic numbers, not real measurements. Run it yourself with <code>theseus --runner mock …</code>.</div>
+
+<div class="cards">
+ ${card("./report.html", "📊 Comparison report", "Accuracy, efficiency, cost/accuracy Pareto frontier, task pass/fail matrix, failure causes — one self-contained page.")}
+ ${card("./graph.html", "🌳 Subagent flow graph", "Per-combo call-flow card tree: main loop → subagents, depth, tokens, cost, with expandable per-node detail.")}
+</div>
+
+<div class="links">
+ → <a href="${REPO}">Source &amp; docs on GitHub</a>
+ &nbsp;·&nbsp; <a href="${REPO}/blob/main/docs/visualization.md">Visualization modes</a>
+ &nbsp;·&nbsp; <a href="${REPO}/blob/main/docs/brand.md">Philosophy</a>
+</div>
+
+<p class="foot">Generated by <code>npm run build:site</code> · regenerated by CI on every push to <code>main</code>.</p>
+</div></body></html>`;
+}
+
+main().catch((e) => {
+ process.stderr.write(`build-site failed: ${(e as Error).message}\n`);
+ process.exitCode = 1;
+});
diff --git a/tsconfig.json b/tsconfig.json
index 07ae51b..4fc5489 100644
--- a/tsconfig.json
+++ b/tsconfig.json
@@ -19,6 +19,6 @@
"rootDir": ".",
"noEmit": true
},
- "include": ["src", "tests"],
+ "include": ["src", "tests", "scripts"],
"exclude": ["node_modules", "dist"]
}