Repository navigation
docs(skills): objectstack-automation carries the flow-authoring judgment of cloud's private corpus — option values, a named hour's zone, who an approval cascade runs as (#31155, port 2/3) - #31393
Conversation
…udgment — option values, a named hour's zone, who an approval cascade runs as Card 1 of the cloud#3659 ruling A split, the objectstack-automation port. SKILL.md § Valid-but-silently-wrong item 4 (option value, never label); references/examples-flows.md (timezone on config.schedule, the requires restatement cut); references/state-machines-and-approvals.md (approval cascade identity, corrected against the approval service; the trigger comment cut to a pointer; three Chinese glosses removed). Three eval cases (17–19). Three token-ratchet rows re-pinned AT the measurement. Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012dn2AdARJtc4RgABPH7PHk
… measurement (6527) The row the first commit missed; its comment carries the arithmetic and the authority (cloud#3659 letter A; ruling record 6513306068). Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012dn2AdARJtc4RgABPH7PHk
…ng their own must_not_contain strings; case 18 asks for a daily hour Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012dn2AdARJtc4RgABPH7PHk
|
repo:cloud#1 · os-bob · session_012dn2AdARJtc4RgABPH7PHk Contract-review-claim: session_012dn2AdARJtc4RgABPH7PHk · head 2ab1ee0 · 2026-11-08T05:56Z PR #31393 · port 2/3 of #31155 ( |
|
repo:cloud#1 · os-bob · session_012dn2AdARJtc4RgABPH7PHk Contract reviewServed-tier: Full review of the first substantive head of this PR (port 2/3 of card #31155, the ① Derived judgments
② Semver level
③ Boundary flags
④ Design judgment
Must-fix: 1 (the ratchet row vs the merge result, red on the head). Should-fix: (1) Implemented-by: VERDICT: FAIL |
…jectstack-automation
…merged measurement; split item 4's two consequences Contract review 6718050728 (FAIL on 2ab1ee0): main c0068ed had added 24 bytes to state-machines-and-approvals.md under the first pin, so CI measured the merge result at 5844 against 5838. After the merge: three legacy "(the old …)" glosses cut as the same-file pay-down, the mirrored statuses list `returned`, the dynamic-approval condition reads `record.status`; the row is 5825, pinned AT the measurement, its comment on main's 22908 base. SKILL.md item 4 now says the condition leg never fires while the fields / filter leg fails the run as invalid_option; it stays within 6527. Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012dn2AdARJtc4RgABPH7PHk
|
repo:cloud#1 · os-bob · session_012dn2AdARJtc4RgABPH7PHk Contract-review-claim: session_012dn2AdARJtc4RgABPH7PHk · head 874185a · 2026-11-08T06:30Z Delta review of the round-1 rework head (answers FAIL record 6718050728 on 2ab1ee0) · no record and no live claim on this head at read time. Record follows on this PR. |
|
repo:cloud#1 · os-bob · session_012dn2AdARJtc4RgABPH7PHk Contract reviewServed-tier: Delta review, round 1, of the head that answers my FAIL record 6718050728 on 2ab1ee0 (one must-fix: the ① Derived judgments
② Semver levelUnchanged: ③ Boundary flags
④ Design judgment
Must-fix: none. Should-fix: none. Implemented-by: VERDICT: PASS |
|
repo:cloud#1 · os-bob · session_012dn2AdARJtc4RgABPH7PHk ACCEPT · 2026-11-08T06:35Z · head 维护者速读
席位核对
|
Part of #31155 — card 1 of 4 of the objectstack-ai/cloud#3659 ruling-A split; this is the second per-domain port (
objectstack-automation), after #31223 (objectstack-data). Theobjectstack-uiport follows as its own PR on the same card, so the card stays open.Clause-②: no
Metadata-protocol: none
Rework round 1 (contract review 6718050728, FAIL on 2ab1ee0):
origin/main77a675d merged by merge commit b73f140 (no rebase, no force-push);mainc0068ed (#31322) had added 24 bytes toreferences/state-machines-and-approvals.mdunder the first pin, so CI measured the merge result at 5844 against a 5838 row. The row is re-pinned AT the merged measurement after a same-file pay-down (the three legacy "(the old …)" glosses), its comment and the tables below carrymain's true base 22908; SKILL.md item 4 now states the two legs' different consequences; the two pre-existing one-word errors the reviewer listed in that file are corrected in the same pass.维护者速读
objectstack-automationskill:① 流程条件和写入里的下拉值一律用选项的value,不用用户嘴里说的标签(写在触发条件里:流程能过校验但永远不触发;写在fields/filter里:运行时以invalid_option拒绝);② 用户说「早上 9 点」就写'0 9 * * *'加timezone: 'Asia/Shanghai',不要自己换算成 UTC 裸写(裸写按 UTC 跑、也没记录你指的是哪个时区);③ 对审批结果做出反应的流程以「做出决定的那个人」的身份运行,保持runAs: 'user';只有 SLA 自动裁决和死亡运行释放这两种机器转换没有用户,要对它们也起反应的流程才声明runAs: 'system'。外加 3 条 eval 用例。顺手把该 skill 一个参考文件里残留的 3 处中文注释改成英文(对外 skill 全英文),并改正该文件里两处原有小错(审批状态镜像值漏了returned;一处示例条件缺record.前缀)。净增 71 行。返工第 1 轮:合并了main(docs(skills, spec): guard the nullable amount in the approval-flow and hook-condition examples #31322 给同一文件加了 24 字节),体积上限按合并后实测重新钉住。main上的审批服务是错的(回写带着决定人的身份),本 PR 按运行时的真实行为搬入,并在卡上记了更正。skills/objectstack-automation/references/state-machines-and-approvals.md(Approval Best Practices 第 4 条——身份判断,对照packages/plugins/plugin-approvals/src/approval-service.ts的mirrorStatusField)、skills/objectstack-automation/references/examples-flows.md(示例里新增的timezone)、skills/objectstack-automation/SKILL.md(Valid-but-silently-wrong 第 4 条)。node scripts/check-skills-token-ratchet.mjs,预期全绿且 objectstack-automation 三行 headroom 0;python3 -c "import json;json.load(open('skills/objectstack-automation/evals/flows-triggers-approvals.json'))"不报错。skills/**),需要你的 APPROVED review 后由席位落地;本 PR 保持 draft。What changes
Four files under
skills/objectstack-automation/, one changeset, three token-ratchet rows.SKILL.md§ Valid-but-silently-wrong — item 4: aselectis compared and written by its optionvalue, never the label the request speaks, in the startconditionAND everyfields/filterentry. The two legs fail differently and the item says so: a label in theconditionparses, matches no row, and the flow stages clean and never fires; a label infields/filterfails the run at the write asinvalid_option(packages/objectql/src/validation/record-validator.ts).references/examples-flows.md— the schedule example writesschedule: { type: 'cron', expression: '0 9 * * *', timezone: 'Asia/Shanghai' }with the rule beside it: a bare expression runs in UTC; a wall-clock hour the request names is written as said with its IANAtimezone, never converted to UTC by hand (nothing then records which zone was meant). The time-relative cadence comment shows the same shape. Same-file pay-down: therequires: ['automation', 'triggers']/ always-onjobsentence, restated from SKILL.md § Prerequisite, is a pointer.references/state-machines-and-approvals.md§ Approval Best Practices — item 4: a flow reacting to the mirroredapprovalStatusFieldruns as the person who acted (submit carries the submitter; approve / reject / recall / send-back the decider) and staysrunAs: 'user'; only the SLAescalationauto-decision and the dead-run release carry no user, so a flow that must react to those too declaresrunAs: 'system'. Same-file pay-downs: the discount-approval example's four-line trigger comment (a restatement of SKILL.md § Trigger Configuration) is one pointer line; the three Chinese glosses (lines 145, 293, 366 onmain) are gone; the three legacy "(the oldentryCriteria/back_to_previous/reject_process)" glosses in § Branching, side-effects & rejection — approval-process keys with no author since ADR-0019 — are gone. Two one-word corrections of pre-existing text in the same file (the reviewer's optional items): theapprovalStatusFieldrow listsreturnedamong the mirrored statuses (send-back writes it, approval-service.ts send-back path), and the dynamic-approval example's start condition readsrecord.status == 'submitted'like the rest of the file.evals/flows-triggers-approvals.json— cases 17 (option value, never label; CEL envelopes, no single-brace token), 18 (a named hour with its zone, never a hand-converted UTC cron), 19 (an approval-outcome cascade staysrunAs: 'user')..changeset/31155-port-authoring-rules-automation.md—@objectstack/skillspatch,Clause-②: no,Metadata-protocol: none.scripts/check-skills-token-ratchet.mjs— three rows re-pinned AT the measurement (table below).Language scope (the approver's review on #31223, verbatim 「skills 对外发布的版本应该全部用英文」; the account owner's 「同意」): every non-eval
skills/**file this PR touches holds 0 CJK code points at the head (Python scan over the CJK, kana, fullwidth and CJK-punctuation blocks); eval prompt strings keep their Chinese under exemption (a);objectstack-i18nis untouched (exemption (b)). The touched reference file was one of the six pre-existing CJK carriers the delta reviewer listed on #31223; it is English now. The other five (objectstack-formula/SKILL.md,objectstack-ui/rules/navigation.md,objectstack-ui/rules/record-page.md,objectstack-upgrade/SKILL.md,objectui/guides/i18n.md) are not this PR's.Line readings (
skills/**, vsorigin/main77a675d, merged in)SKILL.mdreferences/examples-flows.mdreferences/state-machines-and-approvals.mdevals/flows-triggers-approvals.jsonskills/*/SKILL.mdsummedskills/treeNet +71 lines against the dispatch's +250 budget (evals included).
Token-ratchet rows (priced bytes; a SKILL.md's stamp line excluded)
main77a675dSKILL.mdreferences/examples-flows.mdrequiresrestatementreferences/state-machines-and-approvals.mdAll three pinned AT the measurement, headroom 0 (the reference file's row is pinned 19 below the first round's 5838 and 19 below the merge-result reading CI rejected, 5844). Authority: the ruling of record that orders this text into the published skills, objectstack-ai/cloud#3659 letter A (ruling comment 6682024726, 2026-11-06: "How to write valid, working metadata lives in the public skills … The private corpus's rules of that kind move there"), via the standing 2026-10-27 ruling, verbatim and untranslated: 「A:先削重复,余额按实测提高」 (ruling record 6513306068).
No-loss mapping — the automation rows (v1 ledger 6711215678; corrections 6711710289, 6715112987; this PR's note on the card)
Classes as in the ledger: CLOUD (orchestration / hosted-only, stays), SPEC (restates
packages/spec), E/R (parses clean, dead at runtime — the spec lane, #31224), STATED (the published skill already says it), PORT (judgment, ported here).triggerTypestring;record-after-writefor create-or-update;previousnull on the create leg; no array of trigger types; bare CEL condition;fields/filterkeys; norecordId; CEL value envelopes, no{…}tokens;isoDate/current_userenvelopesautomation/flow.zod.ts(top-leveltriggerType/triggerrefused with the start-node prescription; node configsstrictObject),automation/flow-template-token.ts(single-brace tokens refused at save); SKILL.md § Trigger Types / § Trigger Configuration / § Flow Variables / § Filter operands / § Valid-but-silently-wrong 1; objectstack-formula § 5 (previousisnullon insert)flow-value-envelope.test.ts(9 cases) pins the envelope teaching — the spec refusal and SKILL.md § Valid-but-silently-wrong 1 are its equivalent; eval 17 now pins the envelope shape too (dialect: 'cel', no single-brace token)value— map it in the condition AND everyfieldsentry== 'lost'must_contain;== '已流失',status: '已流失'must_not_contain)timeRelativeon the start node;offsetDaysvswithinDays;filterINSIDE the descriptor; never a date-equality conditionautomation/time-relative-trigger.zod.ts;references/examples-flows.md§ Time-relative triggersflow-value-envelope.test.ts"rule 14b writes a time-relative flow value the same way" — same equivalent as 14filterbesidetimeRelative;runAs: 'user'on a swept flowfilter);runAsis lintflow-runas-unscoped(already enforced, 6711340388); therunAs: 'system'sweep is STATED inexamples-flows.mdtimezone, never a silent UTC conversionreferences/examples-flows.md— the schedule example and the time-relative cadence comment. Verified onmain:system/job.zod.tsCronScheduleSchema.timezone(described, IANA-checked);trigger-schedule/src/schedule-trigger.tsnormalizeSchedulecarriestimezoneonto the job (both the schedule and the time-relative trigger call it);service-job/src/cron-job-adapter.tshands it to the cron librarytimezone: 'Asia/Shanghai',0 9 * * *must_contain;0 1 * * *,UTC+8must_not_contain)CLOCK_TRIGGER_*warnings), the tier's record-driven way outapprovers: [{ type, value }], approver types,behavior; out-edges labelledapprove/reject;managerresolves only when the directory is filledautomation/approval.zod.ts;references/state-machines-and-approvals.md(approver table,behaviorrow, labelled edges in the example)runAs: 'system'"main:packages/plugins/plugin-approvals/src/approval-service.tsmirrorStatusFieldis elevated but attributed (submit passessubmitter_id; approve / reject / recall / send-back / revision-limit auto-reject passactingUserId(context)); only the SLA auto-decision and the dead-run release passnull. Lintflow-runas-unscopedleavesrecord_changeundecidable by design ("caught at run time")references/state-machines-and-approvals.md§ Approval Best Practices item 4, stating what the runtime doesrunAs: 'user', the cascade's trigger shape must_contain; an approval node or asys_approval_requestread must_not_contain)typeis the engine's vocabulary; a tool-named node =NO_EXECUTORtest_flow/toggle_flowhalf is CLOUD. The E/R half (os validate/os buildrefusing a nodetypeoutside the composed registry) is in the ledger's row but NOT among #31224's four candidates — named on the card for the spec laneauthoring-rules.test.tscorpus integrity — stays in cloudCoverage decision the v1 ledger left to this PR: cloud
flow-value-envelope.test.tsstays in cloud pointing at the moved text; eval 17 is the automation-side equivalent of its "every envelope the skill teaches passes clean" case (an envelope per field, no single-brace token), beside the spec refusal at save.Conflicts with spec on
main: none in the three ported clauses. One conflict with the runtime, resolved by porting the true statement (14c above); the cloud corpus's own sentence is for cloud to correct (card 4 of the split rewires that corpus).Tests
Docs and eval fixtures only, no runtime change ⇒ no ablation owed. The eval file parses (
json.load), ids 1–19 contiguous; a per-case cross-check over cases 17–19 finds nomust_not_containstring inside its ownexpected_output. Prerequisite build for the skill gates under the shared verify lock:pnpm --filter '@objectstack/lint...' build—os-verify-lock: VERDICT command-exit 0 · held the lock 71s.Acceptance notes
flow-node-types' E/R half — a nodetypeoutside the composed registry parses (open string by contract, ADR-0018) and fails every runNO_EXECUTOR; the runtime audits it at boot (sealNodeTypeVocabulary),os validatedoes not; (ii) the mechanical half of rule 14's value-vs-label — a literal compared to aselectfield in a startcondition, or written to one infields/filter, that is none of the field's optionvalues; cloud's graph-lint hasflow_condition_uses_label/flow_field_value_uses_label, this repo's lint has no equivalent. The judgment half (the request speaks the label) is the prose ported here.mainin five other shipped non-i18n files (listed above): not this PR's; a separate card if the English-only rule is to cover the catalog.must_containtokens== 'lost'andapproval_status == 'approved'are prompt-specific values, asapplicant_email/signed_copy/hotcrm.customare in cases 6, 8 and 13; the root catalog has no taught-token oracle (that gate scansui/skillsonly).Verification
Head cited:
874185a4(the rework commit on top of merge commit b73f140 oforigin/main77a675d; the union below ran on it). Derived withnode scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack— 64 families; every exit code captured to a file before any pipe (COMMAND > LOG 2>&1; status=$?); reconciled with--ran.✓ dispatch-gates --ran: 64 derived famil(ies) accounted for — 63 run, 1 NOT-MEASURED (1 DERIVED from a recorded exit 3).node scripts/check-skills-token-ratchet.mjs :: exit 0—skills/objectstack-automation/SKILL.md is 6527 tokens (ceiling 6527; headroom 0),references/examples-flows.md is 1494 tokens (ceiling 1494; headroom 0),references/state-machines-and-approvals.md is 5825 tokens (ceiling 5825; headroom 0),evals/flows-triggers-approvals.json is 5153 tokens — eval fixture, measured but not ratcheted;--self-test :: exit 0(97 cases pass);pnpm check:role-word :: exit 0;pnpm --filter @objectstack/spec run check:skill-docs :: exit 0;check:skill-refs :: exit 0;pnpm --filter @objectstack/lint run check:doc-formula-expressions :: exit 0;pnpm check:lean-entry-closure :: exit 0;pnpm check:dts-closure :: exit 0;pnpm check:pm-dispatch-gates :: exit 0(detached,tail --pid);check:nul-bytes,check:doc-authoring,check:closing-keyword-parity,check:skill-frame-sync,check:skill-identifier-liveness,check:skill-compatibility,check:pm-skill-id-lintand the rest exit 0.pnpm check:dual-build-cjs-loads :: exit 3(PREREQUISITE NOT MET — needs every package's dist, a fullpnpm build; CI'sLint & Repo Gatesreads it).os:checkblocks (the schedule example; the dynamic-approval flow's condition):pnpm --filter @objectstack/spec run check:skill-examples :: exit 0—285 prose examples type-check across 3 surface(s).packages/spec,lintandobjectqlsources moved onmain):pnpm --filter '@objectstack/lint...' --filter '@objectstack/objectql...' --filter '@objectstack/client-react...' build—VERDICT command-exit 0 · held the lock 232s(round 0: 71s + 242s).SKILL.md,references/examples-flows.md,references/state-machines-and-approvals.md, the changeset, and the lines this PR adds to the ratchet script: 0 lines. Eval fixture: parses, ids 1–19 contiguous.Type Check · source gates, job 128644219285:state-machines-and-approvals.md is 5844 tokens; the ratchet ceiling is 5838) is the must-fix above; the row now reads 5825 on the merged tree.test:reponot run locally (no test file in the diff; CITest Core). Governedskills/**⇒ Tier H: draft kept; landing waits for an APPROVED review fromGOVERNED_APPROVERS; no seat arms, queues or readies it. CI check-runs: read by the seat at hand-over, not awaited by the dev.Generated by Claude Code