Fix skill capability metadata and publish the bounded repair comparison

Regenerate both capability inventories for the early issue-document recipe and reject stale derived manifests before stock-harness provider admission. Preserve the eight measured repair results, automatic recovery cost, and OpenCode delivery diagnosis.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
DottaandPaperclip committed 2026-10-02 16:30:31 -05:00
1 parent 19b22b907a
commit b85668c406
16 files changed
+1510 -198

No files matched your search

+10 -2
View File
@@ -40,10 +40,10 @@ export const stockHarnessGates = [
required: ["renders standard assignment wake with task authority", "renders scoped planning wake authority"] },
{ id: "SH-eval", name: "Independent oracle and qualification admission", cwd: ".",
config: "tests/runner-e2e/vitest.config.ts",
files: ["tests/runner-e2e/paperclip-document.test.ts", "tests/runner-e2e/stock-harness.test.ts", "tests/runner-e2e/stock-harness-checks.test.mjs",
files: ["tests/runner-e2e/stock-harness-manifest.test.ts", "tests/runner-e2e/paperclip-document.test.ts", "tests/runner-e2e/stock-harness.test.ts", "tests/runner-e2e/stock-harness-checks.test.mjs",
"tests/runner-e2e/stock-harness-admission.test.ts", "tests/runner-e2e/stock-harness-digest.test.ts",
"tests/runner-e2e/select-rerun-artifacts.test.ts"],
required: ["rejects old SHA before providers", "allows toolchain paths and excludes every present or future credential",
required: ["requires generated capability manifests for the current skill sources", "rejects old SHA before providers", "allows toolchain paths and excludes every present or future credential",
"changes when the evaluated server/src/onboarding-assets/default/AGENTS.md changes",
"changes when the evaluated packages/adapter-utils/src/server-utils.ts changes",
"changes when the evaluated packages/shared/src/connection-intent-guidance.ts changes",
@@ -71,6 +71,14 @@ export function sourceFingerprint() {
"tests/runner-e2e/stock-harness.ts", "tests/runner-e2e/stock-harness-checks.mjs", "tests/runner-e2e/catalog.ts",
"tests/runner-e2e/stock-harness-admission.ts", "tests/runner-e2e/launch.ts", "tests/runner-e2e/runner.spec.ts",
"tests/runner-e2e/context-integrity-cases.ts", "tests/runner-e2e/context-integrity-flow.ts", "tests/runner-e2e/context-integrity-scoring.ts",
"tests/runner-e2e/stock-harness-manifest.ts", "packages/paperclip-runner/scripts/generate-capability-contract.mjs",
"packages/paperclip-runner/spec/capability/source-contract.json",
"packages/paperclip-runner/scripts/check-capability-inventory.mjs", "packages/paperclip-runner/scripts/lib/capability-inventory.mjs",
"packages/paperclip-runner/spec/capability/capabilities.yaml", "packages/paperclip-runner/spec/capability/eval-traceability.yaml",
"packages/paperclip-runner/spec/capability/mcp-tool-map.yaml", "packages/paperclip-runner/spec/capability/inventory.schema.json",
"packages/paperclip-runner/src/generated/capability-contract.ts", "packages/paperclip-runner/docs/capability-contract.md",
...["capabilities.yaml", "mcp-tool-map.yaml", "eval-traceability.yaml", "capability-contract.md", "downstream-handoff.md"]
.map(file => `packages/paperclip-runner/generated/capability/${file}`),
"packages/adapter-utils/src/server-utils.ts", "packages/shared/src/connection-intent-guidance.ts",
"server/src/onboarding-assets/default/AGENTS.md", "server/src/routes/agents.ts", "scripts/ensure-plugin-build-deps.mjs",
"packages/paperclip-runner/src/drivers/codex/codex-app-server-driver-impl.ts",
@@ -5,7 +5,7 @@ import { stockHarnessSourceDigest, stockHarnessSkillSources } from "./stock-harn
vi.mock("node:fs", async importOriginal => ({ ...await importOriginal<typeof import("node:fs")>(), readFileSync: vi.fn() }));
describe("stock harness instruction revision", () => {
it.each(["server/src/onboarding-assets/default/AGENTS.md", "packages/adapter-utils/src/server-utils.ts", "packages/shared/src/connection-intent-guidance.ts", "skills/paperclip/SKILL.md", "skills/paperclip/references/issue-documents.md"])(
it.each(["server/src/onboarding-assets/default/AGENTS.md", "packages/adapter-utils/src/server-utils.ts", "packages/shared/src/connection-intent-guidance.ts", "skills/paperclip/SKILL.md", "skills/paperclip/references/issue-documents.md", "packages/paperclip-runner/generated/capability/capabilities.yaml", "packages/paperclip-runner/spec/capability/capabilities.yaml", "tests/runner-e2e/stock-harness-manifest.ts"])(
"changes when the evaluated %s changes", source => {
vi.mocked(readFileSync).mockImplementation(() => Buffer.from("unchanged"));
const original = stockHarnessSourceDigest();
@@ -0,0 +1,21 @@
import { describe, expect, it } from "vitest";
import { readFileSync } from "node:fs";
import { verifyCapabilityManifest } from "./stock-harness-manifest.js";
describe("stock harness generated instruction metadata", () => {
it("requires generated capability manifests for the current skill sources", async () => {
expect(await verifyCapabilityManifest()).toBe(true);
});
it("rejects a stale manifest before provider admission", async () => {
await expect(verifyCapabilityManifest(path => path.endsWith("capabilities.yaml")
? "stale skill anchors" : readFileSync(path, "utf8"))).rejects.toThrow("manifest drift");
});
it("rejects unavailable generated evidence", async () => {
await expect(verifyCapabilityManifest(() => { throw new Error("missing generated evidence"); }))
.rejects.toThrow("missing generated evidence");
});
it("rejects a stale source inventory before provider admission", async () => {
await expect(verifyCapabilityManifest(undefined, () => { throw new Error("source inventory drift"); }))
.rejects.toThrow("source inventory drift");
});
});
@@ -0,0 +1,19 @@
import { readFileSync } from "node:fs";
import { execFileSync } from "node:child_process";
import { fileURLToPath } from "node:url";
import { buildContract } from "../../packages/paperclip-runner/scripts/generate-capability-contract.mjs";
/** Canonical derived metadata must match the instruction sources before providers. */
export async function verifyCapabilityManifest(
read = (path: string) => readFileSync(path, "utf8"),
checkInventory = () => execFileSync(process.execPath, [fileURLToPath(new URL(
"../../packages/paperclip-runner/scripts/check-capability-inventory.mjs", import.meta.url,
))], { stdio: "pipe" }),
) {
const expected = await buildContract();
for (const [path, content] of Object.entries(expected)) {
if (read(path) !== content) throw new Error(`Generated capability manifest drift: ${path}`);
}
checkInventory();
return true;
}
+13 -1
View File
@@ -123,7 +123,19 @@ export function stockHarnessSourceDigest() {
for (const source of [
"stock-harness.ts", "context-integrity-cases.ts", "context-integrity-scoring.ts",
"context-integrity-flow.ts", "chat-cases.ts", "chat-flow.ts", "live-fixtures.ts", "runner.spec.ts",
"stock-harness-checks.mjs", "stock-harness-admission.ts",
"stock-harness-checks.mjs", "stock-harness-admission.ts", "stock-harness-manifest.ts",
"../../packages/paperclip-runner/scripts/generate-capability-contract.mjs",
"../../packages/paperclip-runner/scripts/check-capability-inventory.mjs",
"../../packages/paperclip-runner/scripts/lib/capability-inventory.mjs",
"../../packages/paperclip-runner/spec/capability/source-contract.json",
"../../packages/paperclip-runner/spec/capability/capabilities.yaml",
"../../packages/paperclip-runner/spec/capability/eval-traceability.yaml",
"../../packages/paperclip-runner/spec/capability/mcp-tool-map.yaml",
"../../packages/paperclip-runner/spec/capability/inventory.schema.json",
"../../packages/paperclip-runner/src/generated/capability-contract.ts",
"../../packages/paperclip-runner/docs/capability-contract.md",
...["capabilities.yaml", "mcp-tool-map.yaml", "eval-traceability.yaml", "capability-contract.md", "downstream-handoff.md"]
.map(file => `../../packages/paperclip-runner/generated/capability/${file}`),
"../../server/src/onboarding-assets/default/AGENTS.md",
"../../packages/adapter-utils/src/server-utils.ts",
"../../packages/shared/src/connection-intent-guidance.ts",