{"draft":null,"from":151,"to":318,"files":[{"path":"server/test/router.test.ts","added":17,"removed":0,"diff":"--- a/server/test/router.test.ts\n+++ b/server/test/router.test.ts\n@@ -45,6 +45,23 @@\n };\n \n describe(\"routes\", () => {\n+\tit(\"forwards request identity separately from untrusted JSON body\", async () => {\n+\t\tconst { env, calls } = fakeEnv();\n+\t\tconst id = \"00000000-0000-4000-8000-000000000007\";\n+\t\tconst response = await handle(\n+\t\t\trequest(\"/p/game/a/alice/record\", {\n+\t\t\t\tmethod: \"POST\",\n+\t\t\t\theaders: { \"content-type\": \"application/json\", \"Idempotency-Key\": id },\n+\t\t\t\tbody: JSON.stringify({ files: {}, principal: \"forged\" }),\n+\t\t\t}),\n+\t\t\tenv,\n+\t\t\tctx,\n+\t\t\tnoIssues as never,\n+\t\t);\n+\t\tassert.equal(response.status, 200);\n+\t\tassert.equal(calls[0]!.args[7], id);\n+\t\tassert.equal(calls[0]!.args[6], undefined);\n+\t});\n \tit(\"matches the project's top routes and an agent's ops\", () => {\n \t\tassert.deepEqual(PROJECT_ROUTE.exec(\"/p/game/status\")?.slice(1, 3), [\"game\", \"status\"]);\n \t\tassert.deepEqual(PROJECT_ROUTE.exec(\"/p/game/a/alice/publish\")?.slice(1), ["}],"unmatched":[]}