fix(automation,objectql,spec,approvals): flow system-write audit attribution (#4366) + structured reassign hand-off (#4365) - #4403
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
Contributor
📓 Docs Drift CheckThis PR changes 4 package(s): 110 hand-written doc(s) reference the affected code and may need an implementation-accuracy re-verification:
|
…s svc:flow:<name> in the audit log (#4366) A runAs:'system' flow's data writes carried no attribution: the run context resolved to { isSystem: true } with no userId and no service principal, so the audit writer recorded user_id=null, actor=null and the record-history UI rendered "Unknown user". The svc:* channel (ADR-0014 D2, ExecutionContext.actor) existed for exactly this writer class but was never wired end-to-end: - service-automation: resolveRunContext stamps flowName alongside runAs/flowRunId; resolveRunDataContext labels a system run's data context actor: 'svc:flow:<flowName>' (fallback svc:flow:automation). - objectql: buildSession propagates ExecutionContext.actor onto the hook session — without this hop the audit writer's `userId ?? session.actor` fallback was unreachable from the engine path. - spec: AutomationContext.flowName (engine-stamped provenance) and the hook session's optional `actor` field document the contract. userId still wins wherever present; the label is attribution only — no security middleware keys on it. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…roval_action (#4365) A reassign's audit row encoded "who handed the slot to whom" only inside a default free-text comment — "<from_id> → <to_id>", two raw user ids — which clients could neither parse reliably nor render readably. - sys_approval_action gains reassign_from / reassign_to (lookup('sys_user')), written by ApprovalService.reassign(). - comment is pure user input again: nothing is invented when the actor supplies none. - listActions() resolves both parties' display names into reassign_from_name / reassign_to_name alongside actor_name, so timelines render "from A to B" without extra lookups. - ApprovalActionRow (spec contract) declares the four new fields; i18n bundles regenerated with zh-CN/ja-JP/es-ES translations. Pre-existing rows keep their legacy comment; clients should prefer the structured fields and fall back to comment otherwise. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
59 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #4365, closes #4366。两个都是审批/审计归因的可读性问题,一次分支两个 commit 分别修复。
#4366 —
runAs:'system'流回写的审计行无归因(bug 修复)runAs:'system'流的数据写入完全无归因:run context 只有{ isSystem: true },audit writer 落user_id=null, actor=null,console 历史渲染「未知用户」。svc:*归因通道(ADR-0014 D2,ExecutionContext.actor)本来就是为这类写入者设计的,只是从未端到端接通——包括 issue 里没写到的第三环:objectqlbuildSession()根本不透传actor,audit writer 的userId ?? session.actor回退在引擎路径上不可达。resolveRunContext在唯一构造点随runAs/flowRunId打上flowName;resolveRunDataContext给 system run 的数据上下文标actor: 'svc:flow:<flowName>'(无名回退svc:flow:automation)。buildSession透传ExecutionContext.actor→ hook session。AutomationContext.flowName(引擎打标的溯源字段)+ hook session schema 的可选actor字段。仅归因,不涉授权:任何安全中间件都不 key 在
actor上;有userId时依旧userId优先。#4365 — 转签审计默认 comment 落裸用户 ID(schema/契约改进)
转签「谁转给谁」此前只存在于默认自由文本 comment(
"<from_id> → <to_id>")里,客户端既不能可靠解析也没法可读渲染。sys_approval_action新增reassign_from/reassign_to(lookup('sys_user')),reassign()写入;comment回归纯用户输入,没填就不落;listActions()随actor_name一并解析reassign_from_name/reassign_to_name;ApprovalActionRow契约声明 4 个新字段;i18n bundle 重生成并补 zh-CN/ja-JP/es-ES 翻译。存量行保留旧 comment;客户端优先结构化字段、缺失时回退 comment(objectui 侧渲染 PR 另开)。
验证
check:generated全绿(docs 已重生成);i18n 两门禁 OK。showcase_invoice_signoffreject 边系统回写的sys_audit_log行actor=svc:flow:showcase_invoice_signoff;配 objectui HMR console 验过「从 A 转给 B」与「系统」徽标渲染。changeset:
patch(#4366)+minor(#4365,新增契约字段)。🤖 Generated with Claude Code