…`, stacking the loop row
`ExecutionStepLog.iteration` is single-valued since objectstack#14414
(ruling A): the enclosing loop's row. The parallel branch index moved to
its own key, `branch`, which @objectstack/spec 17.4.0 declares.
- The local step type gains `branch?: number`; `iteration` gets one meaning.
- `parallel-branch` steps key and label on `branch`, plus `iteration`
(the row) when present: "Branch 2 · Iteration 3".
- Legacy records (a `parallel-branch` step with no `branch`) are told apart
by the record itself: the pre-objectstack#15230 engine never wrote
`branch` and put the branch index in `iteration`; the current one
always writes `branch` on a parallel-branch step. Their `iteration` is
read as the branch index, never as a row, never defaulted to 0.
- `loop-body` / `try` / `catch` grouping is unchanged.
Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BA3nKVUwKQJf8DBxrSVtNC
Fixes #7614
Clause-②: no
What changes
@objectstack/spec17.4.0 (the version this repo installs) declaresExecutionStepLog.branchbesideiteration. Since objectstack#14414 (ruling A),iterationmeans one thing only: the row of the enclosing loop. The Studio flow Runs panel (FlowRunsPanel.tsx) still groupedparallel-branchsteps oniteration.branch?: number. Theiterationcomment now has one meaning: "Zero-based iteration of the enclosingloop, carried through any nesting."parallel-branchsteps group onbranch, plusiterationwhen present. The grouping key isparallel-branch#branch=B#iteration=I. The header readsBranch 2, orBranch 2 · Iteration 3inside a loop. The new designer stringengine.flowRuns.branchNIterationMis added to the en and zh tables.loop-body,tryandcatchstill group oniterationexactly as before.parallelBranchIndexandgroupChildrenare exported for tests, likebuildStepTreeandregionLabelalready are.The live defect this closes: against an engine that writes
branch, every branch of a bareparallelgot the same key (parallel-branch#). They merged into one unnumberedBranchheader. Inside a loop, the header was numbered by the row, not the branch.Premise check (made against
origin/main9b281519f)${regionKind}#${iteration}key are in the tree as the card describes.packages/app-shell:'branch' in ExecutionStepLogSchema.shapeexits 0. The negative control (a key that does not exist) exits 1..iteration,regionKindandparallel-branchunderapps/andpackages/finds only this panel.apps/console'sFlowRunsPage.tsxdefines its ownFlowRunsPanelfunction, and it reads neither key.Legacy records: a deterministic rule, not "indistinguishable"
The rule: a
parallel-branchstep with nobranchkey comes from an engine that predatesbranch. Itsiterationis read as the branch index. Its loop row is unknown, because the older engine discarded it. It is never read as a row and never defaulted to branch 0. The record alone decides this. No date or version guess is involved, andExecutionLogSchemacarries no engine-build field that could be used for one.Evidence, read from objectstack at the time of writing. Nothing in this repo re-derives it, and the code comment says so.
parallelexecutor (parallel-node.tsat objectstackb07d829d64) tags each branch region{ parentNodeId, iteration: i, regionKind: 'parallel-branch' }. Every parallel-branch step carriesiteration, and none carriesbranch.65ec530f8c). The executor tags{ parentNodeId, branch: i, regionKind: 'parallel-branch' }.runRegion'stag()writesregionKind(inside theparentNodeId === undefinedarm) andbranchin the same pass. So the current engine cannot emit aparallel-branchstep withoutbranch.steps_jsonis a whole-objectJSON.stringify(serializeStepsBounded), sobranchsurvives.branchis.optional()and nothing ties it toregionKind, so the rule rests on the producer. The ADR-0087 entryexecution-step-iteration-single-valuednames this rule in its acceptance criteria: "treat itsiterationunderparallel-branchas the legacy branch index only when the record predates the engine build that writesbranch."For historical runs, the panel shows exactly what it showed before. Their
iterationreally was the branch index, so they keepBranch N.Pins (
FlowRunsPanel.test.ts, describe "parallel-branch grouping readsbranch(objectui#7614)")branch: 0, 0, 1gives['Branch 1:a1,a2', 'Branch 2:b1']. A step withbranch: 1, iteration: 2yields{ branch: 1, iteration: 2, legacy: false }and the labelBranch 2 · Iteration 3(zh:分支 2 · 第 3 次迭代). Same row with a different branch gives two groups; same branch with a different row also gives two groups.loop-bodygroups oniteration, and abranchcarried through nesting is ignored.try/catchkeep their handler labels and theiriterationkey.{ regionKind: 'parallel-branch', iteration: 2 }yields{ branch: 2, legacy: true }and the labelBranch 3. Legacy groups split by legacy index. A legacy step with no index at all stays unnumbered (Branch) and is not branch 0.FlowRunsPanel.render.test.tsx): a new-engineloop { parallel }run showsIteration 1,Branch 1 · Iteration 1andBranch 2 · Iteration 1in the DOM.iterationunderparallel-branch). They used it incidentally, so I respelled them tobranch. The legacy shape now has its own pins, (d).Ablation (proven on disk; ran at
782b57188, whose source is byte-identical to the head)The mutation keys
parallel-branchoniterationagain:node ../objectstack/scripts/ablation-replace.mjs, WRAP mode with its restore trap, anchor x1 then x0, markerABLATION-7614x0 then x1, blob9ef9458f1eeethenc95d6fd8b7c1.expected [ 'Branch 1:a1,a2,b1' ] to deeply equal [ 'Branch 1:a1,a2', 'Branch 2:b1' ]. The (b), (c) and (d) pins stayed green.9ef9458f1eeeequals HEAD, andgit diff HEADis empty. An independent re-count found the marker 0 times and the anchor once../FlowRunsPanelrelatively, from source, so nodist/leg applies.Verification (head
875b3c221)pnpm exec vitest run packages/app-shell/ --maxWorkers=2from the repo root: Test Files 773 passed | 1 skipped (774); Tests 7627 passed | 9 skipped. This covers the dispatch'smetadata-admin/gate and every app-shell ratchet that reads sources as text. The skipped file is an existingskip/skipIffile, not one of mine.pnpm --filter @object-ui/app-shell type-check(tsc --noEmit && tsc -p tsconfig.test.json): exit 0. The dependency closure was built first (turbo run build --filter=@object-ui/app-shell^..., 28/28).--listFilesOnlyon the test project includes all threeFlowRunsPanelfiles..ts/.tsxfiles.pnpm lintruns per-packageeslint ..--format jsonreports 4 files, 0 errors and 7 warnings. The base version of the file has 5 warnings; the +2 arereact-refresh/only-export-componentson the two new test-exposed exports, andlint.ymlsets no--max-warnings.eslint.config.jshas 0 type-aware hits (projectService,parserOptions.project,*TypeChecked), with the positive controlreact-refreshat 3 hits. No rule undereslint-rules/reads the filesystem. So this diff cannot change the verdict on an untouched file.check:control-bytes,check:new-line-citations(0 new),check-changeset-presence,check-changeset-no-major,check-changeset-fixed,check-changeset-overwritecheck:i18n-designer-parity,check:i18n-keys,check:i18n-drift,check:spec-symbols,check-test-path-roots,check-vi-mock-{override-shape,inherit,specifiers}check:handler-key-reads,check:unreferenced-sources,check:designer-field-key-parity,check:metadata-write-doors,check:phantom-deps,check-type-check-coverage,check-lint-coveragecheck:changeset-claims(report-only) flags 3 pending changesets that namemetadata-admin/i18n.ts:6310-…,7125-…and8632-…. I re-read all three. They describe other keys (designer.field.formula,table.noRows/engine.form.noRows) and their own additions, and adding oneengine.flowRuns.*row falsifies none of them.check-governed-queue-guard --teston all 5 paths: NOT GOVERNED.minoron@object-ui/app-shell, because the displayed grouping changes.Acceptance notes
branchis optional, with no refinement againstregionKind. That is a design observation, not a defect, and I did not file it.package.jsonand.github/workflows/. objectui has nodispatch-gates.mjs.Session:
https://claude.ai/code/session_01BA3nKVUwKQJf8DBxrSVtNC(domain:uiseat 1, dispatchedos-dev).Generated by Claude Code