Repository navigation
fix(service-automation)!: automation variable keys cannot use reserved object segments, and one run's writes never change a flow's defaults - #38001
Conversation
…d object segments A flow variable key, and every dot-separated part of one, may not be `__proto__`, `constructor` or `prototype`. Two doors hold the rule: - registration (and the stored pass that previews it) refuses a flow that declares, assigns or binds such a key, naming each site; - resume refuses a signal whose `output` or `inputs` carry such a key with INVALID_SIGNAL, before anything reads the submitted values, so nothing is applied and the pause stays live. Claude-Session: https://claude.ai/code/session_01ASNY8XNef4ywkQio6S9ju4 Co-authored-by: Claude <noreply@anthropic.com>
…lts or another run's values - A dotted write whose head names a value the run holds lands in a copy the expression scope owns; the run reads it back, and the held value (a declared default, the trigger record, the value `record` and `$record` share) keeps what it was. - Each run binds its own copy of an object or list default. - With no durable store, a paused run is handed out with its own copy of its variables, as a stored run is, so a resume writes into nothing the parked run shared. Claude-Session: https://claude.ai/code/session_01ASNY8XNef4ywkQio6S9ju4 Co-authored-by: Claude <noreply@anthropic.com>
…ngeset Claude-Session: https://claude.ai/code/session_01ASNY8XNef4ywkQio6S9ju4 Co-authored-by: Claude <noreply@anthropic.com>
…ent keys for every caller Claude-Session: https://claude.ai/code/session_01ASNY8XNef4ywkQio6S9ju4 Co-authored-by: Claude <noreply@anthropic.com>
… and stays paused Claude-Session: https://claude.ai/code/session_01ASNY8XNef4ywkQio6S9ju4 Co-authored-by: Claude <noreply@anthropic.com>
📓 Docs Drift CheckThis PR changes 3 package(s): 15 hand-written doc(s) NAME something this change touched and may need an implementation-accuracy re-verification:
⛔ 12 release-owned page(s) also name something this change touched. These are read-only:
What this run could not see
Coarse fallback — 182 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): Which tree this was computed onThis run read A worktree cut from an older # while this PR is open — GitHub drops the merge commit once it closes
git fetch origin 500cd899f05420f421b6f7f620adb4a81f584d01 && git checkout 500cd899f05420f421b6f7f620adb4a81f584d01
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin f19350b410df08db604881848b2c370047a114f2 3cceede51218db83878b1a5787f890c6485488bb && git checkout -B drift-repro f19350b410df08db604881848b2c370047a114f2 && git merge --no-ff 3cceede51218db83878b1a5787f890c6485488bb
node scripts/docs-audit/affected-docs.mjs --json f19350b410df08db604881848b2c370047a114f2
|
…mes and INVALID_SIGNAL are described; declare the narrowing Claude-Session: https://claude.ai/code/session_01ASNY8XNef4ywkQio6S9ju4 Co-authored-by: Claude <noreply@anthropic.com>
… ledger Claude-Session: https://claude.ai/code/session_01ASNY8XNef4ywkQio6S9ju4 Co-authored-by: Claude <noreply@anthropic.com>
|
security#1 · os-mickey · session_01ASNY8XNef4ywkQio6S9ju4 Contract reviewServed-tier: Inputs: the governing ruling (two halves: the door, and P2), the PR body, its 14-file list, the net diff Gate verdicts: every completed check-run on this head is ① Derived judgments
② Semver level
③ Boundary flags
④ Design judgmentThe ruling, sentence by sentence.
One must-fix (M1), four should-fix (S1–S4), three nits. The resume door and the default-isolation half hold as ruled; the authoring door does not yet refuse every key a flow names, so the narrowing is not delivered whole at this head. Implemented-by: VERDICT: FAIL |
… registration, exempt the engine's own continuations at resume, and give each run its own trigger record - Registration judges node ids, object-form screen idVariable, and each name with surrounding whitespace trimmed; the judged positions are held equal to the spec's binding positions. - Resume judges a caller's signal only; the engine's own continuations still complete. - Each run binds its own copy of the trigger record. - A run value that contains itself is refused by the copy by name, and a held run carrying one still resumes. Claude-Session: https://claude.ai/code/session_01ASNY8XNef4ywkQio6S9ju4 Co-authored-by: Claude <noreply@anthropic.com>
…s own record copy carries the declared lookups Claude-Session: https://claude.ai/code/session_01ASNY8XNef4ywkQio6S9ju4 Co-authored-by: Claude <noreply@anthropic.com>
…s an input of the package's tests Claude-Session: https://claude.ai/code/session_01ASNY8XNef4ywkQio6S9ju4 Co-authored-by: Claude <noreply@anthropic.com>
… not the context's record Claude-Session: https://claude.ai/code/session_01ASNY8XNef4ywkQio6S9ju4 Co-authored-by: Claude <noreply@anthropic.com>
|
security#1 · os-mickey · session_01ASNY8XNef4ywkQio6S9ju4 Contract reviewServed-tier: Delta round on the record at Gate verdicts: 74 check-runs on this head, all completed: 63 ① Derived judgments
② Semver level
③ Boundary flags
④ Design judgmentPrior findings, on the tree under the rulings.
New in the delta.
No must-fix. Three should-fix (S5, S6, S7), each closable in prose or by one small move, and three nits (N3, N4, N5). The door, the resume rule and the three rulings hold on this head. Implemented-by: VERDICT: PASS |
…ext resolves, previous is copied too, and a value that contains itself fails the run - resolveRunContext takes the run's own copy of the handed record before anything writes onto it; the start node's declared lookups are grafted onto that copy, and the run's variables are seeded from the resolved context, so the caller's record object is left as handed. - previous is bound as the run's own copy, by the same rule as the record. - A value handed to execute that contains itself is answered as a failed run (status 'failed', the copy's named error, one failed history row) instead of a rejection out of execute. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017xRBcW9L8Noz9BxEwjwiov
…d a second ADR-0087 semantic entry carries it - The third BREAKING bullet's FROM and TO name the readers only: a text hole and $record. - New semantic ledger entry flow-dotted-write-read-by-run-expressions-only states the rule; the changeset's registered marker names both entries. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017xRBcW9L8Noz9BxEwjwiov
|
security#2 · sunhaolin · session_017xRBcW9L8Noz9BxEwjwiov Contract-review-claim: session_017xRBcW9L8Noz9BxEwjwiov · head d2273ab · 2026-11-28T04:07Z The delta round after the patch round (b1d5a7f..d2273ab), at |
|
security#2 · sunhaolin · session_017xRBcW9L8Noz9BxEwjwiov Delta L2 contract review — PASS · head d2273abScope: the delta b1d5a7f..d2273ab, 2 commits and 7 files. It was reviewed by an isolated reviewer at
Must-fix: none. Should-fix (owed, non-blocking):
Nits: seven, carried in the seat's record. Among them: the PR body's test count and gates header are stale. |
|
security#2 · sunhaolin · session_017xRBcW9L8Noz9BxEwjwiov 维护者速读
席位核对ACCEPT · head
|
|
security#2 · sunhaolin · session_017xRBcW9L8Noz9BxEwjwiov 维护者速读
席位核对ACCEPT · head
|
|
security#2 · sunhaolin · session_017xRBcW9L8Noz9BxEwjwiov Contract reviewServed-tier: No must-fix. Two should-fix are owed, both non-blocking and recorded in 7234081837: a pin each for the retry and dry-run seeding, and a stated or widened bound for a non-plain record. VERDICT: PASS |
…level record, so the caller's record is never written expandDeclaredLookups no longer assigns into the record it is given: it sets a new top-level record as runContext.record, built from the record's own enumerable properties and then the grafted relations. A record that is not a plain object, which the run's copy hands back as it is, now keeps what the caller handed, and the run still reads the expanded relation. Pins: a class-instance record with a start node that declares expand; and, for the two other paths that seed from the resolved run context, a retried run (every attempt reads the expanded relation) and a dry run. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017xRBcW9L8Noz9BxEwjwiov
…on-plain records The comments above the record copy in resolveRunContext and seedRunVariables now say that copyHeldValue copies a plain record, that a record which is not a plain object is not copied (with no lookup graft it is itself the object the run binds as `record`), and that a self-containing record throws HeldValueCycleError. Drops the stale "taken before anything below writes onto it". Comment-only. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017xRBcW9L8Noz9BxEwjwiov
|
security#2 · sunhaolin · session_017xRBcW9L8Noz9BxEwjwiov Contract reviewServed-tier: Closing the open findings of 7234081837 and 7237696365:
No must-fix, no should-fix. Nits only (outside this delta, optional): a few neighbouring comments use the unqualified shorthand "the run's own copy". The null-prototype branch has no pin. VERDICT: PASS |
|
security#2 · sunhaolin · session_017xRBcW9L8Noz9BxEwjwiov 维护者速读
席位核对ACCEPT · head
|
|
security#2 · sunhaolin · session_017xRBcW9L8Noz9BxEwjwiov Contract reviewServed-tier: Closing the open findings of 7234081837 and 7237696365: No must-fix, no should-fix. Nits only (outside this delta, optional): a few neighbouring comments use the unqualified shorthand "the run's own copy". The null-prototype branch has no pin. VERDICT: PASS |
|
security#2 · sunhaolin · session_017xRBcW9L8Noz9BxEwjwiov Contract reviewServed-tier: What closed them. The retry-attempt and dry-run seeding each have their own pin, and each pin is red when its line is reverted. A declared lookup is grafted into a new top-level record, pinned with a class-instance record. The remaining bound is stated in the PR body, and a write-logging probe on every entry path measured it true. The comment over-claim raised at 26d6b3a is corrected at 3cceede, and both rewritten comments match the code. The open findings of 7234081837 and 7237696365:
No must-fix, no should-fix. Nits only (outside this delta, optional): a few neighbouring comments use the unqualified shorthand "the run's own copy". The null-prototype branch has no pin. VERDICT: PASS |
|
security#2 · sunhaolin · session_017xRBcW9L8Noz9BxEwjwiov Contract reviewServed-tier: What closed them. The retry-attempt and dry-run seeding each have their own pin, and each pin is red when its line is reverted. A declared lookup is grafted into a new top-level record, pinned with a class-instance record. The remaining bound is stated in the PR body, and a write-logging probe on every entry path measured it true. The comment over-claim raised at 26d6b3a is corrected at 3cceede, and both rewritten comments match the code. The open findings of 7234081837 and 7237696365:
No must-fix, no should-fix. Nits only (outside this delta, optional): a few neighbouring comments use the unqualified shorthand "the run's own copy". The null-prototype branch has no pin. VERDICT: PASS |
|
security#2 · sunhaolin · session_017xRBcW9L8Noz9BxEwjwiov Tier H approval request 2026-11-28T11:18Z. This is a narrowing change, so it lands by the maintainer.
|
⛔ merge queue 构建失败 — 先分诊,再决定要不要重排队列构建 46139352903 红了。队列跑的是全量套件(PR 侧 CI 只跑 affected 子集), 分类: 失败的 job(日志抽取,best effort):
跨 PR 相同签名(24h,按失败测试文件聚合):
历史信号:
分诊清单:
Generated by Claude Code · merge-queue-triage workflow (#4859) |
Clause-②: no (narrowing)
Metadata-protocol: narrowed
Skills-docs: none — no published skill teaches a flow variable name, assignment target, screen field name or resume-signal key rule (checked:
git grepoverskills/**for__proto__,constructor,prototype, and the automation skill's variable,outputVariable, assignment, screen-field and resume text; the only hits areskills/objectuiexpression-sandbox lists, unrelated)维护者速读
What changes
Three rules, stated once each in the automation service:
__proto__,constructororprototypeas its name or as any dot-separated part of it — at registration. Registration, and the stored pass that previews it, judges every key a flow names, in every graph it holds: each node'sid(it heads every key the node's output is stored under), each declared variable'sname, eachassignmentnode's targets in every shape, each node'soutputVariable/iteratorVariable/indexVariable/errorVariable/idVariable, and eachscreenfield'sname, each judged with surrounding whitespace trimmed. The judged positions are held equal to the spec's binding positions by a pin. The refusal names every such key and where it sits. A name that only contains one of the words (constructor_name) is unaffected.outputand ofinputsis judged first, before anything reads the submitted values, a signal handed on to a paused subflow child included; the answer isINVALID_SIGNAL(400), nothing is applied, and the run stays paused for a valid submission. The engine's own continuations (amapitem handing back, a subflow child finishing) are not judged, so a run paused before this release still completes.recordand$record), seeded once the run's context has resolved so the copy carries the lookups the start node declares. A dotted write whose head names a value the run holds is read back by the run's expressions (conditions and CEL values) and leaves the value as it was, so a text hole and$recordread the value. With no durable store, a resumed run works on its own copy of its variables, as a stored run does. A run value that contains itself is refused by the copy by name; a paused run holding one still resumes.Commits: the door half (rules 1 and 2), then rule 3, then the docs page and changeset, then one more pin for the chokepoint, then a dogfood pin updated, then the published prose and the ledger entry, then the review round: node ids,
idVariableand trimmed names at registration, the engine's own continuations exempt at resume, the run's own record copy (seeded after the context resolves), and the named refusal for a value that contains itself; then a patch round: the run's record copy taken as its context resolves, so declared lookups land on the copy;previouscopied too; a value that contains itself answered as a failed run; the third changeset bullet trimmed to its readers; and a second ledger entry; then a should-fix round (26d6b3a): a declared lookup is grafted into a new top-level record, so the caller's record, a class instance included, is never written; new pins cover retry-attempt and dry-run seeding and a class-instance record. Bound, stated: with no graft, a record that is not a plain object is used as handed; the engine writes nothing into it, though a node's in-place change ofrecordthen reaches that object, and CEL cannot read a record that is not a plain object unless a graft landed (service-automation 299 files / 4436 tests, trigger-record-change 123).packages/triggers/trigger-record-change/src/before-update-flow-payload-reach.test.tsstated that a run'srecordvariable is the record on its context; it now states the rule: the run's own copy.packages/qa/dogfood/test/flow-condition-scope-keys.dogfood.test.ts(a screen resume'sinputsandoutputbags) stated the earlier accept set and goes red under this change; it now states the ruled one — refused withINVALID_SIGNAL, the run stays paused, and the valid submission then lands.packages/spec/src/automation/builtin-node-config.zod.ts, theINVALID_SIGNALdescription inpackages/spec/src/contracts/automation-service.ts, and the resume route's status note inpackages/runtime/src/domains/automation.ts.flow-variable-key-reserved-segment-refusedandflow-dotted-write-read-by-run-expressions-only(packages/spec/src/migrations/entries/semantic/), soos migrate metaand the upgrade guide carry both rules; the changeset is markedregisteredwith both. The changeset isminoron@objectstack/service-automation(the kindnarrowed),patchon@objectstack/specand@objectstack/runtime.Tests
src/variable-key-reserved-segments.test.ts— rules 1 and 2: each sample is refused at registration and listed by the stored pass; each resume sample is refused on a screen (the screen's conditions are never evaluated, the paused variables are byte-identical, and the valid submission then lands) and on a pause with no input contract; the chokepoint refuses them as a whole. Controls: ordinary dotted keys and names containing the words register, run and resume.src/run-values-isolation.test.ts— rule 3: object and list defaults (dotted writes, list index and length, a node that changes the value in place), the trigger record against$record, and a paused run with and without a store.mapnode id; a signal delegated to a subflow child; engine-built signals and an engine-built continuation that completes; a node changing the trigger record in place before any pause; a value that contains itself. All 88 pass.5cd060c9d6d(existing flow suites with ordinary dotted keys unchanged). The commits after it change no service-automation source.Reverse verification — each new pin, one change reverted at a time (counts only)
Each leg through
scripts/ablation-replace.mjs(anchor x1 -> x0, restored to HEAD,git diff HEADempty after every leg), on the two new files (50 tests):Review round, on the same two files (88 tests), at
2da449d7736:mapnode ididVariableidVariableposition, the three trimmed-name casesoutputVariableandidVariablepositionsnodeIdin the judged positionsinputscasesThe record copy taken before the context resolved reds 2 tests in the existing
record-lookup-expand.integration.test.ts(declared lookups missing from the run's copy); seeding after the context resolves turns them green.Acceptance notes
$recordread relied on reading a dotted write now reads the held value; the changeset gives the rewrite (assign the computed value to a variable of its own).Verification
First read (by risk):
packages/services/service-automation/src/run-resume.ts— the resume-door block just before the screen contract.packages/services/service-automation/src/flow-registration-checks.ts—validateVariableKeySegments.packages/services/service-automation/src/dag-traversal.ts— the descent incelScope, the default and record seeding, and seeding after the context resolves.Two-minute check:
pnpm --filter @objectstack/service-automation exec vitest run src/variable-key-reserved-segments.test.ts src/run-values-isolation.test.ts— expectTests 94 passed (94)(at 26d6b3a).Local gates at b1d5a7f (later rounds: service-automation 299 files / 4436 tests and trigger-record-change 123 at 26d6b3a)
@objectstack/service-automationtypecheck (tsc and the test-layer typecheck): exit 0; the whole package suite: 299 files / 4430 tests passed (at82e81476d6c; the later commits change no source of that package).@objectstack/trigger-record-changetests: 12 files / 123 tests passed.@objectstack/speccheck:generatedexit 0 andsrc/migrations203/203;@objectstack/runtimetypecheck exit 0.b1d5a7f4597is the same 142 families as at469a6acd57c;check:nul-bytes,check:test-source-alias,check:tier-file-adoptionandcheck:cross-package-test-inputsre-run there: exit 0.check:adr-0087-registration: exit 0,registered flow-variable-key-reserved-segment-refused, flow-dotted-write-read-by-run-expressions-only(at d2273ab).check:cross-package-test-inputs: exit 0, after declaring the spec module the enumeration pin reads (the package's declared globs and its turbotestinputs).dispatch-gates --commands, 142 families): 139 exit 0; 3 NOT MEASURED, prerequisite not met on this box (exit 3):check:skill-examples(no client SDK build),check:dual-build-cjs-loads(no full build),check:type-check-debt(no full build). CI runs all three.--ranreconciliation: 142 derived, 142 run, 0 unrun.Dogfood battery at b1d5a7f (re-run at d2273ab: 490 files passed)
pnpm --filter @objectstack/dogfood testunder the verify lock, no shard: exit 0 · Test Files 490 passed / 3 skipped (493) · Tests 4144 passed / 68 skipped (4212).469a6acd57cfailed to load packages (Cannot find package '@objectstack/platform-objects/…') because that package's built output was rewritten while the run was going; the re-run after rebuilding the closure was green at that head too.Generated by Claude Code