Skip to content

Commit f521111

Browse files
committed
checkpoint
1 parent c71da31 commit f521111

9 files changed

Lines changed: 52 additions & 40 deletions

.dagger/src/birmel.ts

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,20 @@
11
import type { Directory, Container, Secret } from "@dagger.io/dagger";
2+
import { dag } from "@dagger.io/dagger";
23
import {
34
getBaseBunDebianContainer,
45
installMonorepoWorkspaceDeps,
56
} from "./lib-monorepo-workspace.ts";
67
import type { WorkspaceEntry } from "./lib-monorepo-workspace.ts";
8+
import versions from "./lib-versions.ts";
9+
10+
const PLAYWRIGHT_VERSION = versions.playwright;
711

812
/**
913
* Birmel-specific base container with voice/build dependencies.
1014
* Adds ffmpeg, build tools, GitHub CLI, and Claude CLI on top of the shared base.
1115
*/
1216
function getBirmelBaseContainer(): Container {
13-
return getBaseBunDebianContainer({
17+
const base = getBaseBunDebianContainer({
1418
extraAptPackages: ["ffmpeg", "make", "g++", "libtool-bin", "curl", "git"],
1519
postAptSetup: (container) =>
1620
container
@@ -27,6 +31,14 @@ function getBirmelBaseContainer(): Container {
2731
"curl -fsSL https://claude.ai/install.sh | bash && ln -sf /root/.local/bin/claude /usr/local/bin/claude",
2832
]),
2933
});
34+
35+
// Playwright only needed by birmel (browser automation feature)
36+
return base
37+
.withMountedCache(
38+
"/root/.cache/ms-playwright",
39+
dag.cacheVolume(`playwright-browsers-${PLAYWRIGHT_VERSION}`),
40+
)
41+
.withExec(["bunx", "playwright", "install", "--with-deps", "chromium"]);
3042
}
3143

3244
/**

.dagger/src/index-ci-helpers.ts

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -166,18 +166,13 @@ export async function buildClauderonWeb(
166166
): Promise<{ container: Container; frontendDist: Directory; outputs: string[] }> {
167167
const outputs: string[] = [];
168168

169-
await rustContainer.sync();
170-
outputs.push("✓ TypeScript types generated");
171-
172169
const generatedTypes = rustContainer.directory(
173170
"/workspace/web/shared/src/generated",
174171
);
175172
let c = container.withDirectory(
176173
"/workspace/packages/clauderon/web/shared/src/generated",
177174
generatedTypes,
178175
);
179-
await c.sync();
180-
outputs.push("✓ Types copied to workspace");
181176

182177
c = c
183178
.withWorkdir("/workspace/packages/clauderon/web/shared")
@@ -188,7 +183,7 @@ export async function buildClauderonWeb(
188183
.withExec(["bun", "run", "build"])
189184
.withWorkdir("/workspace");
190185
await c.sync();
191-
outputs.push("✓ Web packages built");
186+
outputs.push("✓ TypeScript types generated and web packages built");
192187

193188
const frontendDist = c.directory(
194189
"/workspace/packages/clauderon/web/frontend/dist",

.dagger/src/index-infra.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,8 @@ export function getRustContainer(
7575
)
7676
.withMountedCache("/usr/local/cargo/git", dag.cacheVolume("cargo-git"))
7777
.withMountedCache("/workspace/target", dag.cacheVolume("clauderon-target"))
78+
.withMountedCache("/root/.cargo-tools/bin", dag.cacheVolume("cargo-tools-bin"))
79+
.withEnvVariable("PATH", "/root/.cargo-tools/bin:/usr/local/cargo/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin")
7880
.withMountedDirectory("/workspace", source.directory("packages/clauderon"))
7981
.withExec(["rustup", "component", "add", "rustfmt", "clippy"]);
8082

.dagger/src/index-platform-ci.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ export async function runClauderonCi(
8282
const [fmtResult, denyResult] = await Promise.allSettled([
8383
base.withExec(["cargo", "fmt", "--check"]).sync(),
8484
base
85-
.withExec(["cargo", "install", "cargo-deny", "--locked"])
85+
.withExec(["cargo", "install", "cargo-deny", "--locked", "--root", "/root/.cargo-tools"])
8686
.withExec(["cargo", "deny", "check", "advisories", "bans", "sources"])
8787
.sync(),
8888
]);
@@ -115,7 +115,7 @@ export async function runClauderonCi(
115115
// Phase 3: Coverage (non-blocking, independent)
116116
try {
117117
await base
118-
.withExec(["cargo", "install", "cargo-llvm-cov", "--locked"])
118+
.withExec(["cargo", "install", "cargo-llvm-cov", "--locked", "--root", "/root/.cargo-tools"])
119119
.withExec(["cargo", "llvm-cov", "--fail-under-lines", "40"])
120120
.sync();
121121
outputs.push("✓ Coverage threshold met");

.dagger/src/index.ts

Lines changed: 26 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ export class Monorepo {
114114
// ========================================================================
115115
const typeSharePromise = withTiming("TypeShare generation", async () => {
116116
const rc = getRustContainer(source, undefined, s3AccessKeyId, s3SecretAccessKey)
117-
.withExec(["cargo", "install", "typeshare-cli", "--locked"])
117+
.withExec(["cargo", "install", "typeshare-cli", "--locked", "--root", "/root/.cargo-tools"])
118118
.withExec(["typeshare", ".", "--lang=typescript", "--output-file=web/shared/src/generated/index.ts"]);
119119
await rc.sync();
120120
return rc;
@@ -185,28 +185,37 @@ export class Monorepo {
185185

186186
// ========================================================================
187187
// TIER 3: knipCheck (needs fully-built container) + collect tier 0
188+
// Run in parallel — knip shouldn't block tier 0 collection
188189
// ========================================================================
189-
try {
190-
await knipCheck(container).sync();
190+
const [knipResult, tier0Result] = await Promise.allSettled([
191+
knipCheck(container).sync(),
192+
collectTier0Results({
193+
compliance: tier0Compliance,
194+
mobile: tier0Mobile,
195+
birmel: tier0Birmel,
196+
packages: tier0Packages,
197+
quality: tier0Quality,
198+
}),
199+
]);
200+
201+
// Handle knip (non-blocking)
202+
if (knipResult.status === "fulfilled") {
191203
outputs.push("✓ Knip");
192-
} catch (error) {
193-
const msg = error instanceof Error ? error.message : String(error);
204+
} else {
205+
const msg = knipResult.reason instanceof Error ? knipResult.reason.message : String(knipResult.reason);
194206
outputs.push(`::warning title=Knip::${msg.slice(0, 200)}`);
195207
outputs.push(`⚠ Knip (non-blocking): ${msg}`);
196208
}
197209

198-
// Collect TIER 0 results (have been running throughout critical path)
199-
// Each step is try-caught so one failure doesn't prevent collecting others
200-
const tier0Result = await collectTier0Results({
201-
compliance: tier0Compliance,
202-
mobile: tier0Mobile,
203-
birmel: tier0Birmel,
204-
packages: tier0Packages,
205-
quality: tier0Quality,
206-
});
207-
outputs.push(...tier0Result.outputs);
208-
if (tier0Result.errors.length > 0) {
209-
throw new Error(`Tier 0 failures:\n${tier0Result.errors.join("\n")}`);
210+
// Handle tier 0 results (blocking)
211+
if (tier0Result.status === "fulfilled") {
212+
outputs.push(...tier0Result.value.outputs);
213+
if (tier0Result.value.errors.length > 0) {
214+
throw new Error(`Tier 0 failures:\n${tier0Result.value.errors.join("\n")}`);
215+
}
216+
} else {
217+
const reason: unknown = tier0Result.reason;
218+
throw reason instanceof Error ? reason : new Error(String(reason));
210219
}
211220

212221
// RELEASE PHASE

.dagger/src/lib-monorepo-workspace.ts

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ import { dag } from "@dagger.io/dagger";
1010
import versions from "./lib-versions.ts";
1111

1212
const BUN_VERSION = versions.bun;
13-
const PLAYWRIGHT_VERSION = versions.playwright;
1413

1514
/**
1615
* Configuration for the base bun-debian container.
@@ -26,8 +25,8 @@ export type BaseContainerConfig = {
2625
* Creates a base oven/bun container with system dependencies and caching.
2726
* LAYER ORDERING: System deps and caches are set up BEFORE any source files.
2827
*
29-
* Includes: APT caching, python3, bun cache, playwright + chromium,
30-
* eslint cache, and TypeScript build cache.
28+
* Includes: APT caching, python3, bun cache, eslint cache,
29+
* and TypeScript build cache.
3130
*
3231
* @param config Optional configuration for extra packages and setup steps
3332
* @returns A configured base container
@@ -64,13 +63,6 @@ export function getBaseBunDebianContainer(
6463
"/root/.bun/install/cache",
6564
dag.cacheVolume("bun-cache"),
6665
)
67-
// Cache Playwright browsers (version in key for invalidation)
68-
.withMountedCache(
69-
"/root/.cache/ms-playwright",
70-
dag.cacheVolume(`playwright-browsers-${PLAYWRIGHT_VERSION}`),
71-
)
72-
// Install Playwright Chromium and dependencies for browser automation
73-
.withExec(["bunx", "playwright", "install", "--with-deps", "chromium"])
7466
// Cache ESLint (incremental linting)
7567
.withMountedCache(
7668
"/workspace/.eslintcache",

.dagger/src/scout-for-lol-desktop.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ export function installDesktopDeps(
159159
container = installBunInRustContainer(container);
160160
container = container.withMountedCache(
161161
"/root/.bun/install/cache",
162-
dag.cacheVolume("bun-install-cache"),
162+
dag.cacheVolume("bun-cache"),
163163
);
164164

165165
if (target === "windows-gnu") {

.dagger/src/scout-for-lol-helpers.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ export function installWorkspaceDeps(
3939

4040
container = container.withMountedCache(
4141
"/root/.bun/install/cache",
42-
dag.cacheVolume("bun-install-cache"),
42+
dag.cacheVolume("bun-cache"),
4343
);
4444
container = container.withMountedCache(
4545
"/workspace/.eslintcache",
@@ -187,7 +187,7 @@ function getMountedWorkspace(
187187

188188
container = container.withMountedCache(
189189
"/root/.bun/install/cache",
190-
dag.cacheVolume("bun-install-cache"),
190+
dag.cacheVolume("bun-cache"),
191191
);
192192
container = container.withMountedCache(
193193
"/workspace/.eslintcache",

.dagger/src/update-readme.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,10 @@ git remote set-url origin "https://x-access-token:\${GH_TOKEN}@github.com/$REPO.
4444
# Keep tools local to this repo run.
4545
python3 -m pip install --break-system-packages cogapp >/tmp/pip.log 2>&1
4646
47+
# Clear cached summaries so every run regenerates from current prompt/rules.
48+
git rm -f --ignore-unmatch -- "packages/*/_summary.md" "practice/*/_summary.md" "archive/*/_summary.md"
49+
4750
# Regenerate README content (cog blocks call Codex CLI).
48-
# Existing _summary.md files are kept as cache; only missing ones are generated.
4951
python3 -m cogapp -r README.md practice/README.md archive/README.md
5052
5153
if git diff --quiet; then

0 commit comments

Comments
 (0)