From 53008e561b98cc5304f3e46f60187529d5f46d63 Mon Sep 17 00:00:00 2001 From: Anthony Ettinger Date: Sat, 29 Aug 2026 10:22:44 +0000 Subject: [PATCH] Register PRD 0004, and stop the fixtures looking like real secrets MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Two CI failures, both mine. `prd/README.md` is generated by `logicsrc prd index --write` and the scaffold test asserts it is current, so adding a PRD without regenerating it leaves the repo's own conformance check failing. Regenerated. The MCP test asserts the next free PRD id against the live prd/ directory — its comment says it advances with every PRD added — so it moves to 0005. ThreatCrush flagged three of the example strings: a PEM header in the item-model docs and in the conformance fixture, and an `sk_live_` prefixed token. All placeholders, none real, but the finding is the scanner working. A fixture only has to exercise the field, and a real-looking private key header or live-key prefix sitting in the tree trains both the scanner and the people reading its output to shrug at exactly the shape that matters. Replaced with obvious placeholders rather than suppressing the rule. Co-Authored-By: Claude Opus 5 (1M context) Claude-Session: https://claude.ai/code/session_01QRQrfuwuYKKV5UB9kLHuX5 --- docs/opencreds/item-model.md | 4 ++-- packages/logicsrc-mcp/src/standards.test.ts | 2 +- packages/opencreds/src/cli.test.ts | 8 ++++---- packages/opencreds/src/conformance.ts | 9 +++++++-- prd/README.md | 1 + 5 files changed, 15 insertions(+), 9 deletions(-) diff --git a/docs/opencreds/item-model.md b/docs/opencreds/item-model.md index b985e898..2ed48731 100644 --- a/docs/opencreds/item-model.md +++ b/docs/opencreds/item-model.md @@ -152,7 +152,7 @@ An SSH deploy key: "key": { "keyType": "ssh", "algorithm": "ed25519", "publicKey": "ssh-ed25519 AAAAC3Nza… deploy@railway", - "privateKey": "-----BEGIN OPENSSH PRIVATE KEY-----\n…\n-----END OPENSSH PRIVATE KEY-----\n", + "privateKey": "", "passphrase": "", "fingerprint": "SHA256:9Vt…", "path": "~/.ssh/id_ed25519_railway", "mode": "0600", "expiresAt": "" }, @@ -170,7 +170,7 @@ A connected account: "account": { "provider": "stripe", "accountId": "acct_1P…", "handle": "profullstack", "email": "billing@profullstack.com", - "accessToken": "sk_live_…", "refreshToken": "", "tokenType": "bearer", + "accessToken": "", "refreshToken": "", "tokenType": "bearer", "scopes": ["charges:write", "customers:read"], "expiresAt": "", "environment": "production" }, diff --git a/packages/logicsrc-mcp/src/standards.test.ts b/packages/logicsrc-mcp/src/standards.test.ts index f6c5ad6f..50340e82 100644 --- a/packages/logicsrc-mcp/src/standards.test.ts +++ b/packages/logicsrc-mcp/src/standards.test.ts @@ -203,7 +203,7 @@ describe("MCP: OpenPRD", () => { it("reports the next free id and the allowed lifecycle moves", async () => { const client = await connect(); // Asserted against the live prd/ directory, so this advances with every PRD added. - expect(toolText(await client.callTool({ name: "prd_next_id", arguments: {} }))).toBe("0004"); + expect(toolText(await client.callTool({ name: "prd_next_id", arguments: {} }))).toBe("0005"); const moves = await client.callTool({ name: "prd_next_statuses", arguments: { ref: "0001" } }); const payload = JSON.parse(toolText(moves)) as { status: string; allowedNext: string[] }; diff --git a/packages/opencreds/src/cli.test.ts b/packages/opencreds/src/cli.test.ts index 639e297f..ba707414 100644 --- a/packages/opencreds/src/cli.test.ts +++ b/packages/opencreds/src/cli.test.ts @@ -94,8 +94,8 @@ describe("items", () => { await authed(["add", "card", "--name", "Visa", "--number", "4242424242424242", "--code", "123"]), await authed(["add", "identity", "--name", "Me", "--first-name", "Anthony", "--ssn", "000-00-0000"]), await authed(["add", "note", "--name", "WiFi", "--notes", "on the router"]), - await authed(["add", "key", "--name", "deploy", "--key-type", "ssh", "--private-key", "-----BEGIN-----", "--mode", "0600"]), - await authed(["add", "account", "--name", "Stripe", "--provider", "stripe", "--access-token", "sk_live_x", "--scope", "charges:write"]), + await authed(["add", "key", "--name", "deploy", "--key-type", "ssh", "--private-key", "", "--mode", "0600"]), + await authed(["add", "account", "--name", "Stripe", "--provider", "stripe", "--access-token", "", "--scope", "charges:write"]), ]; for (const result of added) expect(result.code, result.stderr).toBe(0); @@ -113,7 +113,7 @@ describe("items", () => { const json = await authed(["list", "--json"]); expect(json.stdout).not.toContain("hunter2"); expect(json.stdout).not.toContain("4242424242424242"); - expect(json.stdout).not.toContain("sk_live_x"); + expect(json.stdout).not.toContain(""); expect(json.stdout).not.toContain("000-00-0000"); // Non-secret fields are still there, or the output would be useless. expect(json.stdout).toContain("anthony"); @@ -227,7 +227,7 @@ describe("export and import", () => { csv, [ "folder,favorite,type,name,notes,login_uri,login_username,login_password,login_totp", - "Imported,1,login,GitLab,,https://gitlab.com,anthony,glpat-xxx,", + "Imported,1,login,GitLab,,https://gitlab.com,anthony,,", ",,,,,,,,", "", ].join("\n"), diff --git a/packages/opencreds/src/conformance.ts b/packages/opencreds/src/conformance.ts index 0502871a..84ea4eb3 100644 --- a/packages/opencreds/src/conformance.ts +++ b/packages/opencreds/src/conformance.ts @@ -119,13 +119,18 @@ export function fixturePayload(): DatabasePayload { identity: { firstName: "Anthony", lastName: "Ettinger", ssn: "000-00-0000" }, } as Partial), createItem("note", { name: "WiFi", notes: "the password is on the router" }), + // The secret-shaped fields hold obvious placeholders rather than + // realistic-looking values. A fixture only has to exercise the field, and + // a real-looking PEM header or `sk_live_` prefix in the tree trains both + // credential scanners and the people reading their output to shrug at the + // shape that matters. createItem("key", { name: "deploy@railway", - key: { keyType: "ssh", algorithm: "ed25519", privateKey: "-----BEGIN OPENSSH PRIVATE KEY-----", path: "~/.ssh/id_ed25519", mode: "0600" }, + key: { keyType: "ssh", algorithm: "ed25519", privateKey: "", path: "~/.ssh/id_ed25519", mode: "0600" }, } as Partial), createItem("account", { name: "Stripe", - account: { provider: "stripe", accessToken: "sk_live_x", scopes: ["charges:write", "customers:read"], environment: "production" }, + account: { provider: "stripe", accessToken: "", scopes: ["charges:write", "customers:read"], environment: "production" }, } as Partial), ], }; diff --git a/prd/README.md b/prd/README.md index 7fdca717..057fda18 100644 --- a/prd/README.md +++ b/prd/README.md @@ -14,3 +14,4 @@ Status lives in each file's front-matter and is the source of truth: | [0001](./0001-add-logicsrc-openontology-spec.md) | Add the LogicSRC OpenOntology specification | Draft | openontology, ontology, knowledge-graph, agents, mcp, schemas | | [0002](./0002-hourly-hire-us-rate.md) | Move Hire Us pricing from a weekly retainer to an hourly rate | Accepted | pricing, site, billing | | [0003](./0003-add-logicsrc-opencontext-spec.md) | Add the LogicSRC OpenContext specification | Draft | opencontext, context, agents, permissions, provenance, schemas | +| [0004](./0004-add-logicsrc-opencreds-spec.md) | Add the LogicSRC OpenCreds specification | Draft | opencreds, credentials, vault, encryption, portability, schemas |