mirror of
https://github.com/bitbaum/loki.git
synced 2026-12-04 11:48:24 +01:00
* fix(cold-start): the starter ships a lockfile, so its first Deploy can install selfhost-deploy.yml refuses to install without a lockfile and installs with --frozen-lockfile; the Next starter declared pnpm and shipped no lock, so every fresh site failed before building. The lock is resolved once by scripts/templates/refresh-starter-lock.ts into a generated asset and seeded with the starter (one Git tree call, no pnpm on the app box). scripts/test/starter-lock.ts fails on drift, missing standalone output, a missing packageManager, or starter docs that point at npm. Seeding failures are recoverable: provision on a linked but bare repo re-seeds it instead of refusing with 409. The starter embeds the project-scoped feedback widget from its first commit. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0118cLNxoB3dt2w74vU1PH6w * fix(cold-start): liveUrl means a Deploy on the current commit and a public 200 Registration persisted liveUrl because register-site.sh exited 0 with --no-deploy. Now: strict setup, then a workflow dispatch; GET reports pending/failed/live and the UI polls it. describeSiteDeployment (pure, tested) treats a queued run or a just-sent dispatch as starting, closing the race where the first poll after dispatch read as "no deployment exists". A status the client cannot read is shown as a failure, not swallowed. The deploy workflow resolves a freshly registered slug from the box register and proves the checkout belongs to the caller; deploy.sh builds with the same package manager that installed; register-site.sh runs release siblings, locks the register, fails without a deploy secret, and seeds a runtime env. check:deploy-ready no longer reads a box-registered checkout as laptop drift. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0118cLNxoB3dt2w74vU1PH6w * fix(feedback): Implement addresses the project id, never a same-named tab Feedback and kickoff dispatch resolve user_projects by stable entity id; a renamed project or a same-named sibling can no longer redirect a run, and the hosted fallback is off for actions tied to a tracked run. Batch Implement only advances when a run was accepted. Fix prompts require the normal ship path and live evidence; Resolve stays with the operator. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0118cLNxoB3dt2w74vU1PH6w * docs: FleetCrown builds independently; tab names are transport, not identity Product copy and agent docs describe FleetCrown as an independent product with optional OrangeCat linking that is not publication consent. Control drops the Focus terminal chip (Open terminal stays). Adds the cold-start handoff. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0118cLNxoB3dt2w74vU1PH6w --------- Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
70 lines
3.0 KiB
TypeScript
70 lines
3.0 KiB
TypeScript
// The nextjs-tailwind starter must be deployable on its first push through
|
|
// selfhost-deploy.yml, which (1) refuses to install without a lockfile,
|
|
// (2) installs with --frozen-lockfile, (3) resolves the toolchain from
|
|
// package.json#packageManager, and (4) needs Next's standalone output.
|
|
// A starter that drifts from any of these ships a repo whose first Deploy
|
|
// fails — the dogfood site's exact failure. Run: npx tsx scripts/test/starter-lock.ts
|
|
import assert from "node:assert/strict";
|
|
import { renderTemplate, TEMPLATES } from "@/lib/project-templates";
|
|
import { STARTER_LOCK_FILE, STARTER_LOCK_TEMPLATE } from "@/lib/starter-locks/config";
|
|
|
|
const starter = TEMPLATES[STARTER_LOCK_TEMPLATE];
|
|
const values = {
|
|
name: 'Zoë\'s "Bäckerei" `x` ${y}',
|
|
description: 'with "quotes" and ${templates}',
|
|
};
|
|
const rendered = Object.fromEntries(
|
|
Object.entries(starter.files).map(([p, body]) => [p, renderTemplate(body, values)]),
|
|
);
|
|
|
|
const lock = rendered[STARTER_LOCK_FILE];
|
|
assert.ok(lock && lock.length > 1000, "starter ships a resolved pnpm lockfile");
|
|
assert.equal(lock, starter.files[STARTER_LOCK_FILE], "rendering never touches the lockfile");
|
|
assert.match(lock, /^lockfileVersion: '9\.0'$/m, "pnpm 9+ lockfile format");
|
|
|
|
const pkg = JSON.parse(rendered["package.json"]) as {
|
|
name: string;
|
|
packageManager?: string;
|
|
dependencies: Record<string, string>;
|
|
devDependencies: Record<string, string>;
|
|
};
|
|
assert.match(
|
|
pkg.packageManager ?? "",
|
|
/^pnpm@\d+\.\d+\.\d+$/,
|
|
"declares the pnpm toolchain corepack should use",
|
|
);
|
|
assert.equal(
|
|
pkg.name,
|
|
"zo-s-b-ckerei-x-y",
|
|
"package name is a valid slug even for a hostile project name",
|
|
);
|
|
|
|
// Every declared dependency must appear in the lock with the same specifier —
|
|
// that is what --frozen-lockfile checks before it refuses to install.
|
|
for (const [name, spec] of Object.entries({ ...pkg.dependencies, ...pkg.devDependencies })) {
|
|
const esc = (s: string) => s.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
assert.match(
|
|
lock,
|
|
// pnpm quotes scoped names ('@types/node':) in YAML.
|
|
new RegExp(`^ '?${esc(name)}'?:\\n specifier: ${esc(spec)}$`, "m"),
|
|
`lockfile resolves ${name}@${spec} — run scripts/templates/refresh-starter-lock.ts`,
|
|
);
|
|
}
|
|
|
|
assert.match(
|
|
rendered["next.config.ts"],
|
|
/output:\s*"standalone"/,
|
|
"deploy.sh requires standalone output",
|
|
);
|
|
assert.doesNotMatch(rendered["package.json"], /next lint/, "next lint was removed in Next 16");
|
|
// The rendered TSX/metadata must survive quotes, backticks and ${} in the brief.
|
|
assert.match(rendered["src/app/layout.tsx"], /title: "Zoë's \\"Bäckerei\\" `x` \$\{y\}"/);
|
|
assert.match(rendered["src/app/page.tsx"], /\{ "Zoë's \\"Bäckerei\\" `x` \$\{y\}" \}/);
|
|
// Docs inside the starter must not tell the agent to use a different manager
|
|
// than the one the lockfile was resolved for.
|
|
for (const text of [rendered["README.md"], starter.firstTask, ...starter.infra]) {
|
|
assert.doesNotMatch(text, /\bnpm (install|run|ci)\b/, "starter docs point at pnpm, not npm");
|
|
}
|
|
|
|
console.log("✓ starter-lock tests passed");
|