Skip to content

Open-source platform for 3D AI agents. Turn text or a photo into a rigged, animated GLB avatar, give it an LLM brain, memory and a wallet, and embed it anywhere with one web component. Remote MCP server, x402 payments, Three.js, browser-native.

chore(guards): register check-secrets in the guard ledger and stop the genome proof double-parsing driver output

nich860fc67fa5d0
diff --git a/api/labor/tick.js b/api/labor/tick.js
index 8aab92dd8..4ec84ea65 100644
--- a/api/labor/tick.js
+++ b/api/labor/tick.js
@@ -10,7 +10,7 @@
// an optimization, it is the correctness property that keeps the cap from
// starving the market: the scans are ordered oldest-first, so any row the driver
// can never move occupies a slot on every tick forever. Two such rows existed:
-// • a 'working' job whose worker never opted into autonomy, runAutopilot
+// • a 'working' job whose worker never opted into autonomy. runAutopilot
// returns immediately for it, so it can only ever leave 'working' through
// the manual /deliver endpoint. Ten of them (a human sitting on ten jobs)
// used to consume the entire job batch and no autonomous job was ever driven
diff --git a/data/guards.json b/data/guards.json
index 6546ec3ef..689cf8796 100644
--- a/data/guards.json
+++ b/data/guards.json
@@ -123,6 +123,28 @@
"expect": "src/guard-proof-rule.js"
}
},
+ {
+ "id": "check-secrets",
+ "script": "scripts/check-secrets.mjs",
+ "npm": "check:secrets",
+ "title": "Credential material, before it leaves the machine",
+ "protects": "No dotenv file, private key, keystore, or downloaded cloud credential becomes a tracked file, and no added line carries a provider-issued key.",
+ "why": "A leaked key in git is not a bug you fix by deleting the line: every clone, fork, and mirror keeps a copy, so the only real remedy is rotating the credential at the provider. That asymmetry is why it runs before the push rather than after. Filenames are judged repo-wide and absolutely (the tree holds zero of them, so there is no legacy to grandfather); contents are judged diff scoped, because a repo-wide content scan drowns in hex addresses and placeholder docs until someone switches it off.",
+ "stages": [
+ "pre-push"
+ ],
+ "needs": "none",
+ "proof": {
+ "summary": "An SSH private key staged as a tracked file.",
+ "stage": true,
+ "violation": {
+ "write": {
+ "id_ed25519": "not a real key: the filename alone is what this guard judges\n"
+ }
+ },
+ "expect": "id_ed25519"
+ }
+ },
{
"id": "check-cron-drift",
"script": "scripts/check-cron-drift.mjs",
diff --git a/scripts/genome-endpoints-proof.mjs b/scripts/genome-endpoints-proof.mjs
index fb6728058..e4b2178b8 100644
--- a/scripts/genome-endpoints-proof.mjs
+++ b/scripts/genome-endpoints-proof.mjs
@@ -105,17 +105,11 @@ function startShim() {
import http from 'node:http';
import pg from ${JSON.stringify(path.join(root, 'node_modules/pg/esm/index.mjs'))};
const pool = new pg.Pool({ connectionString: ${JSON.stringify(PG_URL)}, max: 8 });
-const NUMERIC_OIDS = new Set([700, 701, 1700]);
-const INT_OIDS = new Set([20, 21, 23, 26]);
-const JSON_OIDS = new Set([114, 3802]);
-function coerce(value, oid) {
- if (value === null || value === undefined) return null;
- if (oid === 16) return value === 't' || value === 'true';
- if (INT_OIDS.has(oid)) { const n = BigInt(value); return n <= 9007199254740991n && n >= -9007199254740991n ? Number(n) : value; }
- if (NUMERIC_OIDS.has(oid)) return Number(value);
- if (JSON_OIDS.has(oid)) { try { return JSON.parse(value); } catch { return value; } }
- return value;
-}
+// Neon's HTTP endpoint returns EVERY column as raw text and lets the driver's
+// own pg-types parsers turn it into a JS value. Coercing here as well double
+// parses: a pre-made boolean re-enters parseBool as a non-string and comes back
+// false, and a pre-parsed jsonb object makes JSON.parse throw on "[object
+// Object]". Raw text in, driver parsing out, exactly like production.
http.createServer(async (req, res) => {
if (req.method !== 'POST') { res.writeHead(405); res.end(); return; }
let body = '';
@@ -323,7 +317,7 @@ async function main() {
const http = makeHttp();
const anon = makeHttp();
- http.cookies.set('session', sessionToken);
+ http.cookies.set('__Host-sid', sessionToken);
// ── 4. edges ──────────────────────────────────────────────────────────────
step('4. GET /api/genome/edges');
@@ -531,6 +525,10 @@ async function main() {
const unhandled = serverLog.join('').match(/\[api\] unhandled/g) || [];
check('server logged no unhandled exception', unhandled.length === 0, `${unhandled.length} unhandled`);
+ if (failed > 0) {
+ console.log('\n-- server log tail (last 40 lines)');
+ console.log(serverLog.join('').split('\n').slice(-40).join('\n'));
+ }
console.log(`\n${failed === 0 ? 'ALL CHECKS PASSED' : `${failed} CHECK(S) FAILED`} - ${results.length} assertions`);
if (KEEP) console.log(`postgres left running: ${PG_CONTAINER} (${PG_URL})`);
}
diff --git a/tests/api/kol-route-resolution.test.js b/tests/api/kol-route-resolution.test.js
index d45a8d04e..94a633ccf 100644
--- a/tests/api/kol-route-resolution.test.js
+++ b/tests/api/kol-route-resolution.test.js
@@ -9,7 +9,7 @@
// drifted from the served copy (different limit clamping, different validation
// message) until this guard was written.
//
-// The guard therefore asserts both halves: every dispatcher action resolves to
+// The guard asserts both halves: every dispatcher action resolves to
// [action].js and has a branch, and /api/kol/trades resolves to trades.js and is
// absent from the dispatcher.