Repository navigation
docs(spec): screen-input refusal fields carry one entry per finding - #38814
Conversation
Claude-Session: https://claude.ai/code/session_01QSeKYnrQ7UMtHofKQVjcH2 Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QSeKYnrQ7UMtHofKQVjcH2 Co-authored-by: Claude <noreply@anthropic.com>
📓 Docs Drift CheckThis PR changes 2 package(s): 4 hand-written doc(s) NAME something this change touched and may need an implementation-accuracy re-verification:
⛔ 3 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 514631de77885ac30e35f203f1aceb9ec6240e23 && git checkout 514631de77885ac30e35f203f1aceb9ec6240e23
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin d97aaaea9a1e4298f7db799879709fe365c2df3e 7ec661d9380ef1eb02b7bacd00a8563fcca751e2 && git checkout -B drift-repro d97aaaea9a1e4298f7db799879709fe365c2df3e && git merge --no-ff 7ec661d9380ef1eb02b7bacd00a8563fcca751e2
node scripts/docs-audit/affected-docs.mjs --json d97aaaea9a1e4298f7db799879709fe365c2df3e
|
|
repo:objectstack@os-justin · os-justin · session_01QSeKYnrQ7UMtHofKQVjcH2 Contract reviewServed-tier: Read-only: the card, the PR body, the diff ① Derived judgments
② Semver level
③ Boundary flags
④ Design judgment
Items to fix:
The changed head owes a delta read by this reviewer. Implemented-by: VERDICT: FAIL |
…ntry per field Claude-Session: https://claude.ai/code/session_01QSeKYnrQ7UMtHofKQVjcH2 Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QSeKYnrQ7UMtHofKQVjcH2 Co-authored-by: Claude <noreply@anthropic.com>
|
repo:objectstack@os-justin · os-justin · session_01QSeKYnrQ7UMtHofKQVjcH2 Contract reviewServed-tier: Delta read of ① Derived judgments
② Semver level
③ Boundary flags
④ Design judgment
No must-fix or should-fix is open. This is the final round for this head. Implemented-by: VERDICT: PASS |
|
repo:objectstack@os-justin · os-justin · session_01QSeKYnrQ7UMtHofKQVjcH2 L1 ACCEPT · PR #38814 (#37659) · head 席位核对
|
|
repo:objectstack@os-justin · os-justin · session_01QSeKYnrQ7UMtHofKQVjcH2 Queue kick, 2026-12-01T03:35Z · PR #38814 dequeued with Signature (new; no ledger row matches it — the nearest, #26288, is a tsc OOM with exit 134, a different form):
Initial judgement: a hang in the runner, not this PR's diff. The three facts for one re-enqueue:
Action: one re-enqueue, as is. If the same signature kicks it again, this seat stops and hands it to the next seat for re-diagnosis. |
… the body the run ran, so it survives restarts (objectstack-ai#38825) repo:objectstack@os-justin · os-justin · session_01QSeKYnrQ7UMtHofKQVjcH2 Fixes objectstack-ai#37218 Clause-②: yes (widening: AutomationEngine gains getRunFlowChecksum and getFlowBodyChecksum; RunRecord gains optional flowChecksum; the exported ApprovalResumeSurface drops the optional getFlowVersionHistory and gains optional getRunFlowChecksum and getFlowBodyChecksum) Metadata-protocol: none ## 维护者速读 - 用户能看到什么变化:审批人和提交人在记录的审批面板上看已决定的请求时,"审批在此结束"这一行在每次重启或流程重新加载后不再消失;只有流程确实被改过时才不显示。 - 为什么做:这是"审批去向"功能(告诉大家一条审批走到哪一步、是否结束)的后续修补,之前它对历史请求在每次部署后就悄悄失效。 - 出错会怎样:最坏情况是某条已决定请求少显示"审批在此结束"(与改动前相同的保守方向),不会显示错误的结论;改动可直接撤回。 - 要你做什么:无 ## What changes A decided request's `flow_route.outcome.ended` ("The approval ended here") is served only when the run ran the flow body armed now. That proof used to read this process's registration history (newest registration, registered before the run started), so every restart and every re-registration of the flow dropped the line, and two narrow cases (a rollback undone after the run started; a replica that registered an edit before another replica started the run on the older body) served it for a body the run did not run. The witness is now the body's **content**: - **service-automation (the producer).** A run's context carries a stamp naming the run and the content checksum of its body (`$flowChecksum`, `run-flow-checksum.ts`), written where the run starts beside `$rootRun` and carried through every pause and resume. The terminal record carries it (`RunRecord.flowChecksum`), and the `sys_automation_run` terminal row now writes `flow_checksum` on every run that paused (it was NULL on every finished run). A strand's row keeps its snapshot's pin first, as before. A run whose pinned body could no longer be found, and that resumed on another body, records none. Two reads: `AutomationEngine.getRunFlowChecksum(runId)` (memory, terminal row, paused row, in `getRun`'s order) and `AutomationEngine.getFlowBodyChecksum(flow)`. - **plugin-approvals.** `ranArmedBody` delegates to the new `run-body-witness.ts`: the run's recorded checksum equals the armed body's, else "not known". It no longer reads `getFlowVersionHistory`. The in-memory registration-time check is dropped rather than kept as a fast path: its only extra answers are the N7 cases, which it gets wrong. - **spec.** The `ended` sentence on `ApprovalRequestRow.flow_route.outcome` says this (doc text only). - **N2.** "Later" stays a later `created_at`: a pin shows the sibling case unreachable (an approval in a `parallel` branch, a `loop` body or a `try_catch` body is refused at parse; a `subflow` or `map` child files its requests under its own run id), and the `attachFlowRoute` docblock says so. Why the producer is in service-automation, not a read-side accessor only: measured on d97aaae, the terminal row of a run that paused and then finished wrote `flow_checksum = NULL` (`serializeConsumedSuspension(undefined)`), so no durable identity of a finished run existed to read. ## Tests - `packages/plugins/plugin-approvals/src/flow-route.integration.test.ts`, new top-level describe over a shared durable store: restart and same-content re-registration keep `ended: true`; rollback-undone and two-replica cases serve no `ended`; a control for two replicas holding the same body serves it. - `packages/plugins/plugin-approvals/src/approval-route.test.ts`: the N2 sibling pin, with a green control. - `packages/services/service-automation/src/flow-version-pinning.test.ts`: terminal record carries the run's body checksum; a restart reads it back; resumed after an edit names the started body; a lost pinned body records none; a run parked before the stamp gets its pin; a context carrying another run's stamp is not this run's identity. - `packages/services/service-automation/src/suspended-run-store.test.ts`: the object store writes, clears and reads back `flow_checksum` on terminal rows, and a strand keeps its snapshot's pin. Ablation (reverted in the tree only, then restored from HEAD): the plugin's `approval-service.ts` at the base turns the 4 new plugin pins red (restart, re-registration, rollback undone, two replicas); `run-history.ts` at the base turns 5 of the engine pins red. ## Acceptance notes - A run that finished before this release has no checksum on its row, so its decided requests do not serve `ended` (they already lost it at the restart an upgrade makes). A run paused before the release and finished after gets the pin its suspension recorded. - A run that never paused records no checksum on its terminal row: the execute-path record reads the caller's context, not the run's. No approval request exists for such a run, so `ended` is unaffected. - Residual: a run parked before this release that had already resumed once on a lost or unrecorded body was re-pinned to the armed body by the existing resume; the resume here takes that pin. Narrow, and pre-existing in what the pin means. - ADR-0162's table row citing `approval-service.ts#ranArmedBody` ("cannot always prove which flow body a run ran ... after an edit of the flow, or the registration a restart makes") is now partly stale: a restart no longer defeats the proof. The declaration is kept so the anchor resolves; the ADR text is left for its owner. - Clause-②: the diff adds public members to `AutomationEngine` (`getRunFlowChecksum`, `getFlowBodyChecksum`) and an optional `RunRecord.flowChecksum`. By the objectstack-ai#28405 precedent that reads `yes (widening)`; the claim's `no` is copied as dispatched and flagged in the report. - A contract review is owed for the `ended` sentence in `packages/spec/src/contracts/approval-service.ts`. Read first (by risk): 1. `packages/services/service-automation/src/run-flow-checksum.ts`: the stamp rules (own run only, `null` never re-derived, unrecovered resume clears). 2. `packages/services/service-automation/src/suspended-run-store.ts` `writeTerminal`: `flow_checksum` now written on every terminal row, snapshot pin first. 3. `packages/services/service-automation/src/run-resume.ts` at the segment context: `resumeRunFlowChecksum`. Two-minute check: `pnpm --filter @objectstack/plugin-approvals exec vitest run src/flow-route.integration.test.ts` shows the describe "the approval-ended witness is the content of the body the run ran" with 5 passing tests. ## Verification All readings on head b21c5e1 (after merging origin/main 440574f once). <details><summary>Builds and typecheck</summary> - `pnpm --filter '@objectstack/plugin-approvals...' build --concurrency=2` under the verify lock: VERDICT command-exit 0. - `pnpm --filter @objectstack/spec check:generated`: "All 14 generated artifacts are up to date". - `pnpm --filter @objectstack/service-automation typecheck` and `pnpm --filter @objectstack/plugin-approvals typecheck`: VERDICT command-exit 0, both test layers OK. </details> <details><summary>Tests</summary> - `@objectstack/plugin-approvals` vitest: Test Files 142 passed (142), Tests 2255 passed (2255). - `@objectstack/service-automation` vitest: Test Files 301 passed (301), Tests 4467 passed (4467). </details> <details><summary>Derived gates</summary> - `dispatch-gates --ran`: 99 derived, 99 run, reconciled. - 95 exit 0. Not measured locally (CI owns): `check:dual-build-cjs-loads` and `check:i18n` (exit 3, PREREQUISITE NOT MET: need the full build), `check:query-options-erasure` and `check:type-check-debt` (timed out at 200 s on the shared box). - Re-run on the final head: `check:adr-symbol-anchors`, `check:durability-log-level`, `check:startup-registry-verdict`, `check:nul-bytes`, `check:issue-citations`, `check:doc-authoring`, the three changeset gates, `check:closing-keyword-parity`, `check:cross-package-test-inputs`, `check:test-source-alias`, `check:engine-double-contract`, all exit 0; `check-platform-checklist --changed-from origin/main`: OK, 44 anchors judged, 0 lost. - `node scripts/pm/overlap-check.mjs`: VERDICT clean (origin/main and objectstack-ai#38814 merge cleanly). </details> --- _Generated by [Claude Code](https://claude.ai/code/session_01QSeKYnrQ7UMtHofKQVjcH2)_ --------- Co-authored-by: Claude <noreply@anthropic.com>
repo:objectstack@os-justin · os-justin · session_01QSeKYnrQ7UMtHofKQVjcH2
Fixes #37659
Clause-②: no
Metadata-protocol: none
维护者速读
用户无感:接口说明与流程文档里关于屏幕输入被拒时逐项错误列表的说法改准了,接口返回内容不变。
所属流程自动化,替调用方解决:按「每个字段一条」去数错误条目的客户端会看到重复行却不知原因。
只改文字,没有任何运行行为变化,可直接撤回。
无
What changes
Text and doc comments only; the response is unchanged.
packages/spec/src/contracts/automation-service.ts: theAutomationResult.fieldsjsdoc now says one entry per finding, says one field can carry more than one entry (with themin-above-maxcase as its example), says a runner groups byfield, and says that forunknown_fieldthefieldis the key the caller sent (N1).packages/spec/src/api/automation-api.zod.ts: theTriggerFlowResponseSchemadata.fieldsdescribe says the same (N1);packages/spec/docs/references/api/automation-api.mdregenerated from it withgen:docs(the generatorcheck:generatednamed).content/docs/automation/flows.mdx: the hand-written copy of the sentence, reworded the same way (N1).packages/services/service-automation/src/screen-input-contract.ts: theScreenInputIssue.codejsdoc points aterror.details.fieldsinstead of "ride inside the refusal's message" (N2).packages/services/service-automation/src/engine.ts: the comment above thefieldsmapping in the screen-input refusal says one entry per finding, not one per field (comment only)..changeset/37659-screen-input-fields-wording.md:@objectstack/specpatch (the describe ships in the JSON schema). The service-automation edit is a comment only, so it takes no bump.The example is checked against
validateScreenInputs, and the engine maps its issues one to one ontofields. For a field whoseminexceeds itsmax, only a value abovemaxand belowmintrips bothmin_valueandmax_value. A value at or undermaxtripsmin_valuealone, and the wording says exactly that. No authoring rule refusesminabovemax, so a published flow can serve it. The first round also named arequiredrecord_linkfield sentnull. That case is removed: the screen-field authoring schema refusesrequiredon arecord_linkfield at publish, so no served screen can produce it. The text says "more than one entry", not "two", because two is not a ceiling.Tests
No behaviour changed, so no test was added or ablated. Local readings at
7ec661d938:Local runs
pnpm --filter @objectstack/spec build: VERDICT command-exit 0.pnpm --filter @objectstack/spec check:generated: first run named one stale artifact (content/docs/references/**, regenerate withgen:docs); aftergen:docs,check:docsprinted "249 generated files in sync with packages/spec", exit 0, and a rerun ofcheck:generatedexited 0.pnpm --filter @objectstack/spec typecheckplusvitest run src/api/automation-api.zod.test.ts: VERDICT command-exit 0, 77 tests passed (first round, at19efb34bd4; the second round changed only describe text and comments).check:api-surface"public API surface + factory signatures unchanged",check:authorable-surface,check:nul-bytes,check:doc-authoring,check-issue-citationsand 15 more derived families: exit 0.Acceptance notes
flows.mdxwas a line-wrap miss: the guide carried it across two lines ("one" ending one line, "entry per violated field" opening the next). It is reworded here.ui/packages/app-shell/src/views/FlowRunner.tsx("per violated field"), two copies inpackages/services/service-automation/src/builtin/screen-input-whitespace-fields-37526.test.ts(its header comment at line 5 and a test title at line 89), the header comment ofpackages/runtime/src/domains/automation-resume-screen-input-fields-37526.test.ts(line 7), and the released changeset text in.changeset/pre/and the package CHANGELOGs (shipped release notes, not rewritten).check:docs-transcript-drift,check:doc-security-postureandcheck:doc-formula-expressionsreported PREREQUISITE NOT MET (the lint package is not built in this container), so they are NOT MEASURED locally and read from CI.Verification
Read first:
packages/spec/src/api/automation-api.zod.ts(the describe text that feeds the published JSON schema and reference page), thenpackages/spec/src/contracts/automation-service.ts.Two-minute check:
git grep -n "per violated field" -- packages/spec/src packages/spec/docs content/docsprints nothing (the released CHANGELOG text still carries it, by design); the four edited passages each say "one entry per finding".Generated by Claude Code