From 18d86e318b59ef8c528fc7288c2ba658dcee5260 Mon Sep 17 00:00:00 2001 From: Claude Date: Thu, 19 Nov 2026 06:19:40 +0000 Subject: [PATCH] fix(lint)!: refuse an action body whose regular-expression literal never closes or carries a bad flag set action-body-does-not-compile sent every host SyntaxError opening "Invalid regular expression" to warning. V8's two token errors (an unterminated literal, "missing /", and an invalid flag set) open the same way, and QuickJS refuses both, so such a body was accepted at write and failed every run. Only the pattern-body shape stays a warning. Co-authored-by: Claude Claude-Session: https://claude.ai/code/session_01L6bhgTggz8AL2bCABoDGis --- ...ction-body-regexp-literal-token-refused.md | 23 ++++++++ content/docs/automation/hook-bodies.mdx | 2 +- packages/lint/src/authoring-rules.ts | 6 +- packages/lint/src/rule-explanations.ts | 10 ++-- .../src/validate-action-body-compiles.test.ts | 55 +++++++++++++++++- .../lint/src/validate-action-body-compiles.ts | 58 +++++++++++++++---- ...18.action-body-does-not-compile-refused.ts | 5 +- ...ction-body-regexp-literal-token-refused.ts | 43 ++++++++++++++ 8 files changed, 179 insertions(+), 23 deletions(-) create mode 100644 .changeset/35040-action-body-regexp-literal-token-refused.md create mode 100644 packages/spec/src/migrations/entries/semantic/18.action-body-regexp-literal-token-refused.ts diff --git a/.changeset/35040-action-body-regexp-literal-token-refused.md b/.changeset/35040-action-body-regexp-literal-token-refused.md new file mode 100644 index 00000000000..cdde0a5c00f --- /dev/null +++ b/.changeset/35040-action-body-regexp-literal-token-refused.md @@ -0,0 +1,23 @@ +--- +'@objectstack/lint': minor +'@objectstack/spec': minor +--- + +fix(lint)!: an action body whose regular-expression literal never closes, or whose flags are not a flag set, is refused, not only warned about + +Clause-②: no (narrowing) +Metadata-protocol: narrowed +Skills-docs: none — no published skill teaches the action-body compile check or regular-expression literals in an action body + + + +**BREAKING** only for an action body that never ran. `action-body-does-not-compile` compiles an L2 action's `body.source` inside `(async (input, ctx) => { … })` with the host's JavaScript engine, and reported every failure whose sentence opens `Invalid regular expression` at `warning`, because the host's V8 and the runtime's QuickJS differ on some patterns. That sentence also opens V8's two token errors: a literal that never closes on its line (`return /abc;`, `return /[/;`, a literal broken by a line terminator: `Invalid regular expression: missing /`) and a flag set that is not one (`/a/gg`, `/a/zz`, `/a/uv`: `Invalid regular expression flags`). QuickJS refuses every one of them, so such a body passed `os validate`, `os build`, `os lint` and the runtime publish door, and every run of the action failed with the coded `500` that names the action and the compile error. + +What moves (FROM → TO): + +- `action-body-does-not-compile` on an unterminated regular-expression literal or an invalid flag set (`validateActionBodyCompiles`, `@objectstack/lint`): FROM `warning` TO `error` at `os validate`, `os build`, `os lint` and the runtime publish door (`action` and `object` writes, `422 INVALID_METADATA`), with a hint that names the fix. A failure in the literal's pattern (a duplicate named capture group, a modifier group: syntax QuickJS accepts and runs) is still a `warning`. +- `os explain action-body-does-not-compile` and the ADR-0087 entry `action-body-does-not-compile-refused` now say that only a pattern the host refuses is a warning. + +The fix: close the literal with `/`, write a `/` inside it as `\/`, or, when the `/` is a division, give it a left-hand operand; write the flags as letters from `dgimsuvy`, each at most once, never `u` with `v`. + +No conversion is made (ADR-0087 D3, entry `action-body-regexp-literal-token-refused`): whether a `/` opened a literal or meant a division is the author's choice. Measured first-party exposure: zero. diff --git a/content/docs/automation/hook-bodies.mdx b/content/docs/automation/hook-bodies.mdx index eb9f583fe7d..035f8675ef2 100644 --- a/content/docs/automation/hook-bodies.mdx +++ b/content/docs/automation/hook-bodies.mdx @@ -227,7 +227,7 @@ Static validation around a hook is asymmetric, and it is worth knowing exactly w - **Checked — write side, literal-only.** Since [#4271](https://github.com/objectstack-ai/objectstack/issues/4271), `body.source` is **parsed** (never executed, never type-checked) and the field names it writes are resolved against the target object's declarations, which include every field an `objectExtensions` entry of the same artifact adds to it. An unknown field raises `hook-body-write-unknown-field` — a **warning** carrying a did-you-mean suggestion, which never blocks a build. Action bodies get the same check on their `ctx.api` writes (`action-body-write-unknown-field`). Both run under `os validate`, `os lint` and `os compile`. The *existence* question is advisory like this because the answer can depend on a package the build cannot see; the separate *writability* question — [writing a `readonly` field through `ctx.api`](#writing-a-readonly-field) — **does** gate, because both halves of that judgement are declared in the stack being checked. - **Checked — writes to a system column the object has no storage for.** Since [#8663](https://github.com/objectstack-ai/objectstack/issues/8663), a write to an injected system column is no longer exempted on the strength of its NAME alone. The registry injects `owner_id` / `organization_id` / the audit family onto an ADR-0015 [`external` object](/docs/data-modeling/external-datasources) exactly as onto a local one, but the remote database owns that schema and no column exists behind them. Writing one raises `hook-body-write-unprovisioned-anchor` (or `action-body-write-unprovisioned-anchor` / `flow-node-write-unprovisioned-anchor` on the other two surfaces) — a **warning** on all three, including the flow-node rule that otherwise gates, because the claim is about a remote schema the build cannot see. A column you **declare** yourself is untouched: on a federated object a declared `owner_id` maps a remote column you vouch for. Why it matters more than an ordinary typo: an undeclared name is refused upstream by the engine's own write-path validator (`INVALID_FIELD`), whereas the injected anchor is in the registered schema and passes it — so it is the one payload key that reaches the remote database raw, where a SQL remote aborts the **whole statement** with an untyped `no such column` and takes the correctly named fields of the same payload with it. - **Checked — writes that reach nothing at all.** Since [#4345](https://github.com/objectstack-ai/objectstack/issues/4345), an action body assigning to `ctx.record` raises `action-record-write-discarded`, also a warning. This one is **not** a field-resolution question: an action's `ctx.record` is a snapshot the runtime never writes back, so the assignment is discarded whether or not the field is declared — see [Signature conventions](#signature-conventions) below. -- **Checked — an action body compiles in its wrapper.** An action body runs as the body of `(async (input, ctx) => { … })`, so `input` and `ctx` are parameters the body shares a scope with. A body that does not compile there — `const input = ctx.input || {}` redeclares a parameter, a syntax error — raises `action-body-does-not-compile`, an **error** under `os validate`, `os build`, `os lint` and the runtime publish door (`action` and `object` writes), naming the action and the compile error. Read the params as `input`, or name the local differently (`const params = ctx.input || {}`); `var input = …` compiles. The check compiles the body inside the same expression the runtime builds, without running it, with the host's JavaScript engine; a regular-expression literal that engine refuses is a warning, because its dialect measurably differs from the runtime's QuickJS. An action whose body still fails to compile at run time answers `500 INTERNAL_ERROR` with a sentence naming the action and the compile error, never a bare `Internal server error`. +- **Checked — an action body compiles in its wrapper.** An action body runs as the body of `(async (input, ctx) => { … })`, so `input` and `ctx` are parameters the body shares a scope with. A body that does not compile there — `const input = ctx.input || {}` redeclares a parameter, a syntax error — raises `action-body-does-not-compile`, an **error** under `os validate`, `os build`, `os lint` and the runtime publish door (`action` and `object` writes), naming the action and the compile error. Read the params as `input`, or name the local differently (`const params = ctx.input || {}`); `var input = …` compiles. The check compiles the body inside the same expression the runtime builds, without running it, with the host's JavaScript engine; a regular-expression pattern that engine refuses is a warning, because the two pattern dialects measurably differ (the runtime's QuickJS accepts duplicate named groups and modifier groups), while a literal that never closes on its line, or whose flags are not a flag set, is an error like any other compile failure. An action whose body still fails to compile at run time answers `500 INTERNAL_ERROR` with a sentence naming the action and the compile error, never a bare `Internal server error`. Four literal write shapes are recognized, and only these: diff --git a/packages/lint/src/authoring-rules.ts b/packages/lint/src/authoring-rules.ts index 4e48111b30e..435a441b0cf 100644 --- a/packages/lint/src/authoring-rules.ts +++ b/packages/lint/src/authoring-rules.ts @@ -2949,9 +2949,9 @@ export const AUTHORING_RULES: readonly AuthoringRule[] = [ // failed every run, on every door; `const input = ctx.input || {}` is the // shape an AI author writes, a redeclared parameter. Gating: no reading of // the metadata behaves as written, because the body never starts. A - // regular-expression literal the host refuses is the one `warning` arm (the - // two engines' regular-expression dialects measurably differ; see the - // module). Across the runtime publish gate for `action` writes and for + // regular-expression PATTERN the host refuses is the one `warning` arm (the + // two engines' pattern dialects measurably differ; a literal that never + // closes or carries a bad flag set is refused; see the module). Across the runtime publish gate for `action` writes and for // `object` writes, whose inline `actions[]` the same walk reads; the // differential charges a write only with the bodies it adds. The rule loads // no dependency: compiling goes through the host's `node:vm`. diff --git a/packages/lint/src/rule-explanations.ts b/packages/lint/src/rule-explanations.ts index cba378f810d..f119238d02c 100644 --- a/packages/lint/src/rule-explanations.ts +++ b/packages/lint/src/rule-explanations.ts @@ -1478,10 +1478,12 @@ const ACTION_BODY_DOES_NOT_COMPILE_EXPLANATION: RuleExplanation = { 'local another name. `var input = …` is not a redeclaration and compiles.', 'The rule compiles the body inside the same expression the runtime builds, from the same function, ' + 'with this host\'s JavaScript engine and without running it. The runtime\'s engine is QuickJS. ' + - 'The two agree on redeclarations, grammar and strict-mode errors; they measurably differ on regular ' + - 'expressions, so a regular-expression literal the host refuses is reported as a warning rather than ' + - 'refused. Syntax the host accepts and QuickJS does not is not caught here; at run time such an ' + - 'action answers a 500 that names the action and the compile error.', + 'The two agree on redeclarations, grammar and strict-mode errors; they measurably differ inside the ' + + 'pattern of a regular expression (duplicate named groups, modifier groups), so a pattern the host ' + + 'refuses is reported as a warning rather than refused. A literal that never closes on its line, or ' + + 'whose flags are not a flag set, is refused like any other compile error: QuickJS refuses it too. ' + + 'Syntax the host accepts and QuickJS does not is not caught here; at run time such an action answers ' + + 'a 500 that names the action and the compile error.', ], }; diff --git a/packages/lint/src/validate-action-body-compiles.test.ts b/packages/lint/src/validate-action-body-compiles.test.ts index 0d0fa211025..7fc781c8460 100644 --- a/packages/lint/src/validate-action-body-compiles.test.ts +++ b/packages/lint/src/validate-action-body-compiles.test.ts @@ -84,7 +84,7 @@ describe('action-body-does-not-compile · the wrapper is the runtime\'s', () => expect(validateActionBodyCompiles({ actions })).toEqual([]); }); - it('reports a regular-expression literal the host refuses as a warning, never a refusal', () => { + it('reports a regular-expression pattern the host refuses as a warning, never a refusal', () => { const [f] = validateActionBodyCompiles({ actions: [scriptAction('p', 'return /(/.test(input.s);')] }); expect(f.severity).toBe('warning'); expect(f.message).toContain('regular expression'); @@ -150,3 +150,56 @@ describe('action-body-does-not-compile · the doors that run it', () => { expect(compileFindings(r.errors)).toEqual([]); }); }); + +describe('action-body-does-not-compile · a regular-expression literal\'s token is refused, only its pattern warns', () => { + // Measured against the runtime's QuickJS (quickjs-emscripten, the engine quickjs-runner.ts runs a body in): + // every case refused here is refused by QuickJS too, and both warning cases compile and run there. + const only = (source: string) => { + const findings = validateActionBodyCompiles({ actions: [scriptAction('p', source)] }); + expect(findings, source).toHaveLength(1); + return findings[0]; + }; + + it.each([ + ['an unterminated literal', 'return /abc;'], + ['an unterminated literal whose class never closes', 'return /[/.test(input.s);'], + ['a literal the body ends inside', 'const ok = /abc'], + ['a literal broken by a line terminator', 'return /ab\nc/.test(input.s);'], + ])('refuses %s at error, the way every other compile error is refused', (_label, source) => { + const f = only(source); + expect([f.rule, f.severity, f.path]).toEqual([ACTION_BODY_DOES_NOT_COMPILE, 'error', 'actions[0].body.source']); + }); + + it.each([ + ['a repeated flag', 'return /a/gg;'], + ['an unknown flag', 'return /a/zz;'], + ['`u` with `v`', 'return /a/uv;'], + ])('refuses a flag set that is not one, %s, at error', (_label, source) => { + const f = only(source); + expect([f.rule, f.severity]).toEqual([ACTION_BODY_DOES_NOT_COMPILE, 'error']); + }); + + it.each([ + ['a duplicate named capture group', 'return /(?x)|(?y)/.test(input.s);'], + ['a modifier group', 'return /(?i:a)/.test(input.s);'], + ])('still only warns on %s, a pattern the runtime\'s engine accepts', (_label, source) => { + const f = only(source); + expect([f.rule, f.severity]).toEqual([ACTION_BODY_DOES_NOT_COMPILE, 'warning']); + }); + + it('accepts the flags both engines take', () => { + const actions = ['return /a/dgimsuy;', 'return /[a&&b]/v;'].map((source, i) => scriptAction(`ok${i}`, source)); + expect(validateActionBodyCompiles({ actions })).toEqual([]); + }); + + it('os validate refuses an unterminated literal, and so does the runtime publish door', () => { + const body = 'return /abc;'; + const stack = { objects: [ticket()], actions: [scriptAction('p', body)] }; + const fs = compileFindings(runAuthoringRules('validate', { normalized: stack, parsed: stack })); + expect(fs.map((f) => [f.severity, f.path])).toEqual([['error', 'actions[0].body.source']]); + + const refused = runRuntimeAuthoringRules({ type: 'action', item: scriptAction('p', body), context: { objects: [ticket()] } }); + expect(compileFindings(refused.errors)).toHaveLength(1); + expect(compileFindings(refused.advisories)).toEqual([]); + }); +}); diff --git a/packages/lint/src/validate-action-body-compiles.ts b/packages/lint/src/validate-action-body-compiles.ts index 9e2fd44dd44..bae57fbce50 100644 --- a/packages/lint/src/validate-action-body-compiles.ts +++ b/packages/lint/src/validate-action-body-compiles.ts @@ -37,12 +37,23 @@ * The runtime's engine is QuickJS; this rule's is the host's (V8 on Node). Both * implement the same early errors, and over a probe of 36 bodies the two agreed * on every redeclaration, every grammar error, every strict-mode error and every - * misplaced `new.target` / `super`. They disagreed in one place: a regular - * expression literal. Node 22's V8 refuses duplicate named capture groups - * (`/(?x)|(?y)/`), which QuickJS accepts and runs. A regular-expression - * failure is therefore reported as a `warning`: the two dialects are where a - * host refusal measurably does not predict a runtime refusal, and an `error` - * there would refuse a body that runs. Every other compile failure is an + * misplaced `new.target` / `super`. They disagree inside the PATTERN of a + * regular-expression literal: Node 22's V8 refuses duplicate named capture + * groups (`/(?x)|(?y)/`) and modifier groups (`/(?i:a)/`), both of which + * QuickJS accepts and runs. A failure V8 reports against a pattern — its + * sentence names the literal, `Invalid regular expression: /PATTERN/FLAGS: + * REASON` — is therefore a `warning`: that is where a host refusal measurably + * does not predict a runtime refusal, and an `error` there would refuse a body + * that runs. + * + * The literal's own TOKEN is not a dialect question. A literal that never closes + * on its line (`return /abc;` — V8 `Invalid regular expression: missing /`) and + * a flag set that is not one (`/a/gg`, `/a/zz`, `/a/uv` — V8 `Invalid regular + * expression flags`) are refused by QuickJS as well (`unexpected end of regexp`, + * `unexpected line terminator in regexp`, `invalid regular expression flags`), + * and over 55 single characters and every ordered pair of the eight flags the + * two engines agreed on all 119 flag sets. So only the pattern shape takes + * the warning arm, and every other compile failure — these two included — is an * `error`. The disagreement in the other direction (syntax the host accepts and * QuickJS does not, such as newer grammar) is a missed finding, never a false * one; at run time the action then answers a coded `500` naming itself and the @@ -59,7 +70,10 @@ import { collectActionBodies } from './validate-action-body-writes.js'; export const ACTION_BODY_DOES_NOT_COMPILE = 'action-body-does-not-compile'; export interface ActionBodyCompileFinding { - /** `error`, except a regular-expression literal the host refuses (`warning`; see the module note). */ + /** + * `error`, except a regular-expression PATTERN the host refuses (`warning`; see the module note). A + * literal that never closes, or whose flags are not a flag set, is an `error`. + */ severity: 'error' | 'warning'; rule: string; /** e.g. `action "decide_approval_step" › body`. */ @@ -116,8 +130,20 @@ export function hostCompileFailure(text: string): HostCompileFailure | undefined } } -/** The host's sentence for a regular-expression literal it refuses (V8 and SpiderMonkey both open so). */ -const REGEXP_FAILURE = /^SyntaxError: Invalid regular expression/; +/** + * V8's sentence for a regular-expression PATTERN it refuses, which names the + * literal: `Invalid regular expression: /PATTERN/FLAGS: REASON`. The one + * `warning` arm. The literal's token errors open with the same three words and + * are not this shape (`Invalid regular expression: missing /`, `Invalid regular + * expression flags`), so they stay `error`, and so does any other sentence. + */ +const REGEXP_PATTERN_FAILURE = /^SyntaxError: Invalid regular expression: \//; + +/** V8's sentence for a regular-expression literal that never closes on its line. */ +const REGEXP_UNTERMINATED = /^SyntaxError: Invalid regular expression: missing \//; + +/** V8's sentence for a regular-expression literal whose flags are not a flag set. */ +const REGEXP_FLAGS = /^SyntaxError: Invalid regular expression flags/; /** A redeclaration the host names (`Identifier 'input' has already been declared`), and the name. */ const REDECLARED = /^SyntaxError: Identifier '([^']+)' has already been declared/; @@ -137,7 +163,9 @@ export function validateActionBodyCompiles(stack: Record): Acti if (!failure) continue; const at = failure.line !== undefined ? `, line ${failure.line}` : ''; - const regexp = REGEXP_FAILURE.test(failure.error); + const regexp = REGEXP_PATTERN_FAILURE.test(failure.error); + const unterminated = REGEXP_UNTERMINATED.test(failure.error); + const flags = REGEXP_FLAGS.test(failure.error); const redeclared = REDECLARED.exec(failure.error)?.[1]; const parameter = redeclared !== undefined && (ACTION_BODY_PARAMETERS as readonly string[]).includes(redeclared) ? redeclared @@ -159,8 +187,14 @@ export function validateActionBodyCompiles(stack: Record): Acti `\`const params = ctx.input || {}\`` : regexp ? 'Rewrite the regular expression in a form both engines accept, or build it with new RegExp(…) at run time' - : `Fix body.source so it compiles as the statements of an async function whose parameters are ` + - `${ACTION_BODY_PARAMETERS.map((p) => `\`${p}\``).join(' and ')}`, + : unterminated + ? 'A `/` opens a regular-expression literal that never closes on its line: close it with `/`, write a ' + + '`/` inside it as `\\/`, or, if the `/` is a division, give it a left-hand operand' + : flags + ? 'A regular-expression literal\'s flags are letters from `dgimsuvy`, each at most once, and never ' + + '`u` with `v`' + : `Fix body.source so it compiles as the statements of an async function whose parameters are ` + + `${ACTION_BODY_PARAMETERS.map((p) => `\`${p}\``).join(' and ')}`, }); } diff --git a/packages/spec/src/migrations/entries/semantic/18.action-body-does-not-compile-refused.ts b/packages/spec/src/migrations/entries/semantic/18.action-body-does-not-compile-refused.ts index c362a231d94..45932c0265c 100644 --- a/packages/spec/src/migrations/entries/semantic/18.action-body-does-not-compile-refused.ts +++ b/packages/spec/src/migrations/entries/semantic/18.action-body-does-not-compile-refused.ts @@ -24,7 +24,8 @@ export const entry: SemanticMigration = { + '(the context): read the params as input, or give the local another name (const params = ctx.input || {}); ' + 'var input = … also compiles. Fix any other compile error the finding names at the line of body.source it ' + 'names. Refused at error as `action-body-does-not-compile` (422 INVALID_METADATA at the doors). A regular ' - + 'expression literal the host engine refuses is reported at warning, never refused.', + + 'expression whose pattern the host engine refuses is reported at warning, never refused; a literal that never ' + + 'closes or whose flags are not a flag set is refused (action-body-regexp-literal-token-refused).', reason: 'The runtime never runs body.source as a script of its own: it compiles it inside an async arrow function with ' + 'the parameters input and ctx, and a source that redeclares one of them, or otherwise fails to compile there, ' @@ -33,7 +34,7 @@ export const entry: SemanticMigration = { + 'and then EVERY run of the action failed, answering an opaque 500 INTERNAL_ERROR on the /actions door and on ' + 'MCP run_action for as long as it stayed deployed. The rule compiles the source inside the expression the ' + 'runtime builds, from the same function, with the host JavaScript engine and without running it. The host ' - + 'engine and the runtime\'s QuickJS agreed on every early error probed except regular-expression literals, ' + + 'engine and the runtime\'s QuickJS agreed on every early error probed except regular-expression patterns, ' + 'hence the warning there. Such a body never ran, so no run of it ever succeeded and no stored row changes ' + 'shape. Hook and job bodies, which run in a different wrapper, are not judged. No first-party stack (example ' + 'apps, skills, docs samples) carries such a body today. There is no mechanical rewrite: renaming a local is ' diff --git a/packages/spec/src/migrations/entries/semantic/18.action-body-regexp-literal-token-refused.ts b/packages/spec/src/migrations/entries/semantic/18.action-body-regexp-literal-token-refused.ts new file mode 100644 index 00000000000..fe741e8d1cd --- /dev/null +++ b/packages/spec/src/migrations/entries/semantic/18.action-body-regexp-literal-token-refused.ts @@ -0,0 +1,43 @@ +// Copyright (c) 2026 ObjectStack. Licensed under the Apache-2.0 license. + +import type { SemanticMigration } from '../../types.js'; + +// #35040 — `action-body-does-not-compile` (@objectstack/lint) reported every +// regular-expression failure the host engine raised at warning, so a literal +// that never closes on its line, or whose flags are not a flag set, was +// accepted at write and failed every run. Only a failure in the literal's +// PATTERN stays a warning (that is where the host's V8 and the runtime's +// QuickJS measurably differ); the token errors are refused at error. It +// narrows what the authoring doors accept; no key is removed, so there is no +// tombstone. Measured first-party exposure at this change: zero. Not +// converted: whether a `/` meant a literal or a division is a judgement. +export const entry: SemanticMigration = { + id: 'action-body-regexp-literal-token-refused', + surface: + 'actions[].body.source, and objects[].actions[].body.source, of an action of type script whose body.language is ' + + 'js, on an action or object saved or published through the metadata doors (PUT /api/v1/meta/action/NAME, ' + + 'PUT /api/v1/meta/object/NAME with inline actions, POST /api/v1/packages/PKG/publish-drafts and the per-item ' + + 'publish) or loaded by os validate / os build / os lint: a regular-expression literal that never closes on its ' + + 'line (return /abc; or /[/), or whose flags are not a flag set (/a/gg, /a/zz, /a/uv)', + replacement: + 'Close the literal with /, write a / inside it as a backslash followed by /, or, when the / is a division, give it ' + + 'a left-hand operand; write the flags as letters from dgimsuvy, each at most once, never u with v. Refused at ' + + 'error as `action-body-does-not-compile` (422 INVALID_METADATA at the doors). A literal whose pattern the host ' + + 'engine refuses (a duplicate named capture group, a modifier group) is still reported at warning.', + reason: + 'The rule compiles the body with the host JavaScript engine and reported every failure whose sentence opens ' + + '"Invalid regular expression" at warning, because the host\'s V8 and the runtime\'s QuickJS differ on some ' + + 'patterns. That sentence also opens V8\'s two token errors, an unterminated literal ("missing /") and an invalid ' + + 'flag set ("Invalid regular expression flags"), and QuickJS refuses both ("unexpected end of regexp", ' + + '"unexpected line terminator in regexp", "invalid regular expression flags"); over 55 single characters and ' + + 'every ordered pair of the eight flags the two engines agreed on all 119 flag sets. So such a body was accepted ' + + 'at every authoring door and then every run of the action failed with the coded 500 that names the action and ' + + 'the compile error. Such a body never ran, so no run of it ever succeeded and no stored row changes shape. No ' + + 'first-party stack (example apps, skills, docs samples) carries one. There is no mechanical rewrite: whether ' + + 'the / opened a literal or meant a division is a choice about what the body computes.', + acceptanceCriteria: + 'Load every action (`os validate` or `os build`): no `action-body-does-not-compile` finding at error at ' + + 'actions[N].body.source or objects[N].actions[N].body.source. PUT /api/v1/meta/action/NAME with each such body ' + + 'corrected answers 200, and running the action on POST /api/v1/actions/OBJECT/ACTION/ID answers the body\'s ' + + 'result instead of 500.', +};