Found while landing #15394 (PR #16248), out of that card's scope; filed unassigned.
What was measured (origin/main 159dbad)
Suggested shape
Refuse .create( at lowering the way .sudo( is refused (a FORBIDDEN_PATTERNS entry whose reason names .insert() as the spelling the sandbox has), and drop create from the extractor's advertised api-crud-literal syntax and API_WRITE_METHODS so the advisory rule stops grading a call that cannot run. Alternatively install a create alias in installCtx — but the spec contract declares insert only, so the refusal is the contract-first route.
Not this
The host-side ObjectRepository.create() alias is reachable by in-process handlers and actions and is not the defect; only the L2 body surface is.
Generated by Claude Code
Found while landing #15394 (PR #16248), out of that card's scope; filed unassigned.
What was measured (
origin/main159dbad)ObjectRepository(packages/objectql/src/engine.ts, classObjectRepository) declarescreate(data)as an alias ofinsert(), and the spec contract (packages/spec/src/contracts/scoped-context.ts:154) declaresinsertonly.installCtx(packages/runtime/src/sandbox/quickjs-runner.ts:556) installs exactlyinsert / update / delete / updateMany / deleteMany / upsertasctx.api.object()write leaves — nocreate. An L2 body callingctx.api.object('x').create({ ... })therefore throwsTypeError: not a functionat run time, and under a hook's defaultonError: 'abort'that aborts the triggering write with a message naming no member (the same blind message A hook cannot elevate, so a hook-written computed column cannot be protected by field-leveleditable: false— the guard and the writer are the same door #14010 measured forsudo()).FORBIDDEN_PATTERNSinpackages/cli/src/utils/extract-hook-body.ts:170refuses.sudo(for exactly this reason (A hook cannot elevate, so a hook-written computed column cannot be protected by field-leveleditable: false— the guard and the writer are the same door #14010) but has no.create(entry; the shared extractor ledgerHOOK_BODY_WRITE_PATTERNS(packages/lint/src/validate-hook-body-writes.ts:230) advertises the syntax as.insert({...}) | .create({...}) | .update({...}) | .updateById(id, {...})andAPI_WRITE_METHODSmapscreateto payload argument 0, sohook-body-write-unknown-fieldgrades a.create()payload as a live write and stays silent when the field exists..create()OUT ofhook-api-update-readonly-field's subject set for this reason (pinned asREADONLY_HOOK_METHOD_EXCLUSIONSinvalidate-readonly-hook-writes.ts): a "silently dropped" finding about a call that throws would be false. That exclusion is correct but leaves the author with no build-time signal at all.Suggested shape
Refuse
.create(at lowering the way.sudo(is refused (aFORBIDDEN_PATTERNSentry whose reason names.insert()as the spelling the sandbox has), and dropcreatefrom the extractor's advertisedapi-crud-literalsyntax andAPI_WRITE_METHODSso the advisory rule stops grading a call that cannot run. Alternatively install acreatealias ininstallCtx— but the spec contract declaresinsertonly, so the refusal is the contract-first route.Not this
The host-side
ObjectRepository.create()alias is reachable by in-process handlers and actions and is not the defect; only the L2 body surface is.Generated by Claude Code