diff --git a/README.md b/README.md index 59addaf..4a69e41 100644 --- a/README.md +++ b/README.md @@ -83,25 +83,6 @@ Test-first; see [`docs/SPEC.md`](./docs/SPEC.md) §7. ### Updating skills -`renderinc/skills` is the source of truth. Copybara mirrors its distributable files to -[`render-oss/skills`](https://github.com/render-oss/skills), and this repository syncs from that -public mirror. `.github/workflows/sync-skills.yml` checks daily at 06:00 UTC and can also be run -manually; it verifies changes before opening a `skills-sync` pull request. - -Run the same sync locally: - -```bash -npm run sync-skills -npm run sync-skills -- --ref -npm run sync-skills -- --repo ../../skills --ref main # local source-of-truth clone -npm run verify -``` - -The script applies the public mirror's source-only eval exclusions and records the resolved source, -ref, and commit in `skills/.sync-source`. Never edit vendored skills by hand. Keep auto-merge -disabled unless the repository requires the verify check; then set the -`SKILLS_SYNC_AUTOMERGE=true` repository Actions variable to allow squash auto-merge. - -The public mirror is the release input. Public contributions can temporarily lead the internal -clone until their reverse-Copybara PR is merged, so compare local-clone output with -`render-oss/skills` before using it in a release. +This repository is published automatically. Don't edit it directly; vendored skills in `skills/` +match [`render-oss/skills`](https://github.com/render-oss/skills), and `skills/.sync-source` +records the release they came from. Report problems as issues. diff --git a/package.json b/package.json index 801c925..22c0914 100644 --- a/package.json +++ b/package.json @@ -21,6 +21,7 @@ "files": [ "src", "skills", + "shared/references", "README.md", "LICENSE", "CHANGELOG.md" @@ -38,8 +39,7 @@ "lint": "biome check .", "format": "biome format --write .", "test": "vitest run", - "verify": "npm run typecheck && npm run lint && npm run test", - "sync-skills": "bash scripts/sync-skills.sh" + "verify": "npm run typecheck && npm run lint && npm run test" }, "dependencies": { "pi-mcp-adapter": "2.19.0" diff --git a/tests/package/lockfile.test.ts b/tests/package/lockfile.test.ts index 09482b1..4f1a18a 100644 --- a/tests/package/lockfile.test.ts +++ b/tests/package/lockfile.test.ts @@ -10,19 +10,15 @@ import { describe, expect, it } from "vitest"; * a lockfile that does not already satisfy package.json instead of resolving the difference. * * The npm major matters too. A lockfile written by npm 11 can be unusable by the npm 10 bundled - * with the `engines` floor, so `.nvmrc` pins the floor and both workflows read it — that is what - * makes CI exercise the oldest supported npm. The dry run below only covers whatever npm is - * running it, which is why the pin is asserted rather than assumed. + * with the `engines` floor, so `.nvmrc` pins the floor and CI reads it — that is what makes CI + * exercise the oldest supported npm. The dry run below only covers whatever npm is running it, + * which is why the pin is asserted rather than assumed. */ const repoRoot = fileURLToPath(new URL("../..", import.meta.url)); const pkg = JSON.parse(readFileSync(join(repoRoot, "package.json"), "utf8")) as { engines?: { node?: string }; }; const nvmrc = readFileSync(join(repoRoot, ".nvmrc"), "utf8").trim(); -const workflows = ["verify.yml", "sync-skills.yml"].map((name) => ({ - name, - body: readFileSync(join(repoRoot, ".github/workflows", name), "utf8"), -})); describe("dependency lockfile", () => { it("is installable by npm ci, not just npm install", () => { @@ -38,13 +34,4 @@ describe("dependency lockfile", () => { it("pins the toolchain to the engines floor so CI installs on the oldest supported npm", () => { expect(pkg.engines?.node).toBe(`>=${nvmrc}`); }); - - it("makes every workflow resolve Node from the single .nvmrc pin", () => { - for (const { name, body } of workflows) { - expect(body, `${name} must read node-version-file`).toContain("node-version-file: .nvmrc"); - expect(body, `${name} must not pin node-version separately`).not.toMatch( - /node-version:\s*\d/, - ); - } - }); }); diff --git a/tests/package/manifest.test.ts b/tests/package/manifest.test.ts index 103a92e..419dab3 100644 --- a/tests/package/manifest.test.ts +++ b/tests/package/manifest.test.ts @@ -94,6 +94,7 @@ describe("package manifest", () => { expect(pkg.files, `${excluded} must not be in files`).not.toContain(excluded); } for (const rel of pkg.files ?? []) { + if (rel === "shared/references") continue; // Generated only when skills share references. expect(existsSync(join(repoRoot, rel)), `files entry missing: ${rel}`).toBe(true); } }); @@ -105,9 +106,9 @@ describe("package manifest", () => { } }); - it("carries the metadata for the v0.2.0 GitHub release", () => { + it("carries the metadata for a versioned GitHub release", () => { expect(pkg.name).toBe("@render/pi-render"); - expect(pkg.version).toBe("0.2.0"); + expect(pkg.version).toMatch(/^\d+\.\d+\.\d+$/); expect(pkg.license).toBe("MIT"); expect(readFileSync(join(repoRoot, "LICENSE"), "utf8")).toContain("MIT License"); expect(pkg.description?.length ?? 0).toBeGreaterThan(20); diff --git a/tests/package/pack.test.ts b/tests/package/pack.test.ts index 197a546..775aec8 100644 --- a/tests/package/pack.test.ts +++ b/tests/package/pack.test.ts @@ -1,5 +1,5 @@ import { execFileSync } from "node:child_process"; -import { readdirSync, statSync } from "node:fs"; +import { existsSync, readdirSync, statSync } from "node:fs"; import { join } from "node:path"; import { fileURLToPath } from "node:url"; import { beforeAll, describe, expect, it } from "vitest"; @@ -57,6 +57,13 @@ describe("npm pack tarball", () => { expect(assets.length).toBeGreaterThan(0); }); + it("includes every generated shared reference", () => { + const shared = join(repoRoot, "shared/references"); + if (existsSync(shared)) { + for (const name of readdirSync(shared)) expect(packed).toContain(`shared/references/${name}`); + } + }); + it("records the vendored-skill provenance", () => { expect(packed).toContain("skills/.sync-source"); }); diff --git a/tests/package/skills.test.ts b/tests/package/skills.test.ts index a7ca573..d79daea 100644 --- a/tests/package/skills.test.ts +++ b/tests/package/skills.test.ts @@ -107,7 +107,7 @@ describe("vendored Render skills", () => { for (const file of markdownFiles(root)) { const text = readFileSync(file, "utf8"); const links = text.matchAll( - /(?:\]\(|`)(?:\.\/)?((?:references|assets)\/[A-Za-z0-9._\-/]+\.(?:md|ya?ml|json))/g, + /(?:\]\(|`)(?:\.\/)?((?:(?:\.\.\/)+shared\/references|references|assets)\/[A-Za-z0-9._\-/]+\.(?:md|ya?ml|json))/g, ); for (const [, target] of links) { checked++; @@ -143,7 +143,7 @@ describe("vendored Render skills", () => { const commit = record.match(/^commit: ([0-9a-f]{40})$/m)?.[1]; expect(source).toBe("https://github.com/render-oss/skills"); - expect(ref).toMatch(/^(main|skills-v\d+\.\d+\.\d+)$/); + expect(ref).toMatch(/^([0-9a-f]{40}|main|skills-v\d+\.\d+\.\d+)$/); expect(commit, "no 40-char commit recorded in .sync-source").toBeDefined(); expect(record).not.toMatch(/^synced:/m); });