Skip to content

Integrate NyxID tools and workflow observation support#1698

Open
eanzhao wants to merge 146 commits into
devfrom
feature/integrate
Open

Integrate NyxID tools and workflow observation support#1698
eanzhao wants to merge 146 commits into
devfrom
feature/integrate

Conversation

@eanzhao

@eanzhao eanzhao commented Jun 2, 2026

Copy link
Copy Markdown
Contributor

摘要

集成分支 feature/integrate:把 eanzhao 的可用 PR + 一批架构/能力 issue 合到一条分支,已 reconcile 到当前 dev

包含的工作

PR 整合

Forge 自我扩展 / runs 可观测 / OpenAI 兼容 issue

因 dev 已超越而弃用(同步时丢弃 + 关闭)

验证(本地)

  • dotnet build aevatar.slnx --nologo0 error
  • architecture_guards.sh / test_stability_guards.sh:通过
  • 测试全绿:AI 764 · Ornn 50 · Workflow.Host.Api 417 · Workflow.Application 205 · CQRS.Core 51 · Hosting 250 · GAgentService 704 · ScopeService 99 · ScopeGAgent 33 · ChannelRuntime 984 · bug(scripting): promoted script revisions do not update bound scope services #1699 scripting-republish 集成 2
  • 需外部基础设施(kafka/es/mongo)的集成测试由 CI 运行

Closes #1685
Closes #1686
Closes #1687
Closes #1695
Closes #1699
Closes #1700
Closes #1701
Closes #1703
Closes #1704

PR #1691 内容已含于本 PR,merge 后可关闭 #1691

eanzhao and others added 23 commits May 1, 2026 00:19
Replaces magic-string suspension_type on WorkflowSuspendedEvent with
a proto enum and adds expected_options to the event itself, eliminating
the string-compare switch in WorkflowHumanInteractionProjector. Modules
emit the typed enum and seed default options via a single helper.

Issue #553 finding 5 (rollout step 1).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
通过强类型 tool execution port 统一 workflow 直调工具执行路径,避免缺失审批管线时继续裸执行工具。

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
覆盖 timeout 与 pending approval 通过执行端口映射 typed status,避免 workflow direct tool_call 回归到绕过审批链路。

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…tool-call-approval

修复 workflow tool_call 审批中间件旁路
Remove the lossy runtime LLM override mirror so llm_call derives its child request from the workflow ToolContext single source of truth.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
合并 #1664:修复 workflow llm_call ToolContext 传播。

Review-gate: architect/tests/quality 均 approve。
CI: all required checks completed successfully.

⟦AI:AUTO-LOOP⟧
eanzhao PR #1691 -> feature/integrate integration.
将 eanzhao PR #554 合入 feature/integrate。

冲突解决:
- workflow_execution_messages.proto: dev 的 secure(10)/redacted_output(11) 与 PR 的
  suspension_type/expected_options 字段号冲突;保留 dev 已部署的 10/11,PR 新字段移至
  suspension_type=12 / expected_options=13;slot 3 保持 reserved(旧字符串 suspension_type 已移除)。
- EventEnvelopeToWorkflowRunEventMapper.cs: 合并 dev 的 secure-input 处理(Secure/RedactedOutput/
  resolved variableName/filtered metadata) 与 PR 的 enum→ToWireName + Options。
- WorkflowHumanInteractionProjector.cs: 保留 dev 的 BuildAnnotations,删除被 enum 取代的死方法 ResolveOptions。
- demos/Aevatar.Demos.Workflow.Web/Program.cs: dev 已删除该 demo,保持删除。
- 三个 Host.Api 测试 + 一个集成测试:WorkflowSuspendedEvent.SuspensionType 字符串字面量改为枚举值。

验证:build 0 error;Host.Api mapper/projector 47 测试通过;SecureInputModule 集成测试通过。

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
- ToLegacyMetadata() 与 AgentToolRequestContext.LegacyMetadata 增加边界约束注释:
  仅限旧/第三方 tool adapter 边界调用;主链必须消费 typed AgentToolExecutionContext 字段。
- 重命名 CurrentMetadata -> LegacyMetadata(保留 CurrentMetadata 别名兼容旧测试)。
- AIGAgentBase: 移除从 legacy metadata 读取 MaxToolRoundsOverride 的主链回退
  (删除 ResolveMaxToolRounds),改用 EffectiveConfig.MaxToolRounds + typed Routing.MaxToolRoundsOverride。
- architecture_guards.sh: 扩展 guard 禁止主链消费 LegacyMetadata/CurrentMetadata/TryGet/ToLegacyMetadata
  (adapter/test 除外)。
- 新增测试覆盖允许边界与 guard 存在性。

验证:dotnet build aevatar.slnx 0 error;Aevatar.AI.Tests 741 passed;guard clean。

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
- 新增 CQRS 交互层统一 seam ICommandObservationScopeLeasePreparation<...>,由
  DefaultCommandInteractionService 在 dispatch 前统一准备 observation lease。
- Workflow 与 GAgent draft-run Application service 不再各自调用 projection EnsureAsync/ActivateAsync;
  feature 适配器收窄并改名为 *ObservationScopeLeasePreparationPort。
- 澄清 ProjectionUnavailable ACK 语义:表示「本次交互无法建立 observation」,与 target-missing、
  dispatch 失败明确区分。
- 测试:新增 CQRS-core prepare-fail / prepare-release / 顺序覆盖;更新 Workflow/GAgent 测试;
  删除随实现移除的 per-service activation 旧测试。

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…tion.cs

.gitignore 的 `runs/` 规则在 macOS 大小写不敏感文件系统上误匹配
src/workflow/Aevatar.Workflow.Application/Runs/,导致该新文件被 git add -A 跳过,
合并后 trunk 编译缺类。force-add 补回(已 tracked 文件不受 gitignore 影响;Linux CI 不受此规则误伤)。

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
- 新增 typed views(ToolResultView / SkillSearchToolResultView / SkillLoadToolResultView /
  SkillSearchMatchView,位于 AI.Abstractions.LLMProviders;进程内 intra-turn 控制流视图,未跨
  actor/session 序列化边界,故不引入 Protobuf)。
- OrnnSearchSkillsTool / UseSkillTool 输出结构化 JSON envelope(result_type + status + matches/error
  + human-readable text)。
- ToolCallLoop.BuildToolResultMessage 在边界一次性解析 envelope -> typed view 挂到 ChatMessage,
  Content 取 envelope 的 text(LLM 仍看可读文本,非 raw JSON);非 skill 工具不受影响;旧字符串输出仅在边界兜底。
- SkillRecoveryPlanner 仅依据 typed 字段判定 search 命中/无匹配/错误、skill name、load 成功/失败/not-found。
- 测试:重写 SkillRecoveryPlannerTests 等,覆盖无匹配/命中/错误/加载成功失败/文本变化但 typed result 不变。

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…odel 轮询

- 删除 LlmSessionCompletionObserver(Task.Delay(50ms) 轮询 + committed 后 503 伪失败)。
- ResponsesCommandFacade.RecordCompletionAndReadAsync -> RecordCompletionAsync:持久化后直接用
  已持有的 completion 构造 snapshot 返回,不再轮询 read model。
- 新增 ResponsesCompletionStage(Committed / ReadModelObserved)区分 ACK 阶段;already-resolved
  tool-result 路径返回 Committed,不冒充 read-model observed。
- 测试:ResponsesCommandFacadeTests 覆盖 record 成功即返回 Committed(无轮询、无 503 伪失败)。

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…kflow

- 新增低层抽象 port ISkillWorkflowMountPort(+ NoOp 默认实现)于 Aevatar.AI.ToolProviders.Skills;
  平台层 SkillWorkflowMountAdapter(GAgentService.Infrastructure)实现之,经
  IScopeWorkflowCommandPort.UpsertAsync 将 skill 抽出的 inline WorkflowYamls 注册进调用者 scope。
- use_skill 增加 mount_workflows 参数(默认 false,不破坏现有行为);仅 loaded && mount_workflows 时挂载;
  scope_id / nyxid token 缺失时安全降级(missing_scope / missing_identity),不抛未受控异常。
- 复用既有 SkillWorkflowExtractor 抽取结果与 use_skill live/per-request/identity-scoped 语义,不引入进程内 catalog。
- 保留 #1686 的 skill_load typed envelope,新增 workflow_mount 字段。
- 测试:SkillWorkflowMountAdapterTests + use_skill 挂载路径 + DI 注册。

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
… superseded

dev advanced 41 commits since feature/integrate branched, including its own parallel
refactors that supersede two pieces of this branch's work:

- #1688 (constrain ToLegacyMetadata): dev removed ToLegacyMetadata / CurrentMetadata /
  LegacyMetadata entirely (issues #1621 FromMetadata-external-only + #1574 metadata-scrub-only).
  #1688's goal is already achieved by dev; dropped (took dev's versions of
  AgentToolExecutionContext / AgentToolRequestContext / AIGAgentBase / mapper test / guard).
- #554 (suspension enum): dev chose a different design — kept suspension_type as string and
  added typed WorkflowToolApprovalSuspension tool_approval (issue #1668). Dropped #554's enum
  (took dev's proto + workflow suspension files; removed dead WorkflowSuspensionTypes.cs).

Kept + reconciled onto current dev: PR #1691, and issues #1685 / #1686 / #1687 / #1695.
Reconciliation fixes: LocalSkillCatalogTests uses dev's typed AgentToolRequestContext.Current;
SkillWorkflowMountAdapter(+test) updated to dev's flat ScopeWorkflowUpsertResult shape.

验证:dotnet build aevatar.slnx 0 error;architecture + test_stability guards 通过;
AI.Tests 763 / Ornn.Tests 41 / GAgentService.Tests 690 / CQRS.Core.Tests 51 /
Workflow.Host.Api.Tests 417 / Workflow.Application.Tests 206 / Hosting.Tests 241 全通过。

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@codecov

codecov Bot commented Jun 2, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 87.53076% with 152 lines in your changes missing coverage. Please review.
✅ Project coverage is 84.29%. Comparing base (d73dd6c) to head (46cb198).
⚠️ Report is 36 commits behind head on dev.

Files with missing lines Patch % Lines
src/Aevatar.AI.Core/RoleGAgent.cs 55.31% 35 Missing and 7 partials ⚠️
...c/Aevatar.AI.Core/Tools/AgentToolReceiptFactory.cs 69.13% 3 Missing and 22 partials ⚠️
...vatar.AI.Core/Chat/SkillRecoveryToolResultViews.cs 93.42% 9 Missing and 10 partials ⚠️
....Implementations.Local/Actors/LocalActorRuntime.cs 29.41% 8 Missing and 4 partials ⚠️
src/Aevatar.AI.Core/Chat/SkillRecoveryPlanner.cs 77.77% 5 Missing and 5 partials ⚠️
...s/SkillInvocations/SkillInvocationTriggerParser.cs 89.47% 4 Missing and 4 partials ⚠️
....Core/Orchestration/ProjectionScopeActorRuntime.cs 63.15% 4 Missing and 3 partials ⚠️
.../Orchestration/ProjectionScopeAgentRegistration.cs 86.84% 3 Missing and 2 partials ⚠️
src/Aevatar.AI.Core/Chat/ChatRuntime.cs 55.55% 2 Missing and 2 partials ⚠️
.../SkillInvocations/SkillInvocationTriggerOptions.cs 89.65% 1 Missing and 2 partials ⚠️
... and 8 more
@@            Coverage Diff             @@
##              dev    #1698      +/-   ##
==========================================
+ Coverage   84.06%   84.29%   +0.23%     
==========================================
  Files        1028     1103      +75     
  Lines       68513    76636    +8123     
  Branches     8885     9973    +1088     
==========================================
+ Hits        57593    64598    +7005     
- Misses       7032     7676     +644     
- Partials     3888     4362     +474     
Flag Coverage Δ
ci 84.29% <87.53%> (+0.23%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
...Aevatar.AI.Abstractions/LLMProviders/LLMRequest.cs 77.94% <100.00%> (+0.32%) ⬆️
...evatar.AI.Abstractions/LLMProviders/LLMResponse.cs 100.00% <100.00%> (ø)
...ar.AI.Abstractions/LLMProviders/ToolResultViews.cs 100.00% <100.00%> (ø)
....AI.Abstractions/Middleware/IToolCallMiddleware.cs 100.00% <100.00%> (ø)
...illInvocations/AgentSkillRecoveryContextBuilder.cs 100.00% <100.00%> (ø)
...actions/SkillInvocations/SkillInvocationTrigger.cs 100.00% <100.00%> (ø)
...tar.AI.Abstractions/ToolProviders/AgentToolBase.cs 100.00% <100.00%> (ø)
...actions/ToolProviders/AgentToolExecutionContext.cs 100.00% <100.00%> (ø)
...s/ToolProviders/AgentToolExecutionContextMapper.cs 97.07% <100.00%> (+0.55%) ⬆️
...evatar.AI.Abstractions/ToolProviders/IAgentTool.cs 100.00% <100.00%> (ø)
... and 58 more

... and 199 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

eanzhao and others added 2 commits June 2, 2026 23:01
- 新增 ExecutionActivityPublisherHook(IGAgentExecutionHook):start/end/error 把 hook context 发布到
  scope-keyed 流 aevatar://scopes/{scopeId}/execution-events(typed ExecutionActivityEvent protobuf);
  bounded channel + DropWrite + 后台 drain,非阻塞、失败不影响 handler;与 ExecutionTraceHook 并存。
- scopeId 从权威 inbound EventEnvelope 解析(typed scope 字段 + 窄 descriptor fallback);解析不出则丢弃,避免跨租户泄漏。
- 新增 SSE 端点 GET /api/scopes/{scopeId}/execution-events:AevatarScopeAccessGuard 鉴权 + scope 过滤 +
  evt.ScopeId 双校验;复用 host SSE 约定;只发 handler.started/completed/failed,不重复 run-output。
- 测试:scope 内 handler → 帧齐全;跨 scope 隔离;failed 带 error;非阻塞背压。

验证:build 0 error;ScopeGAgentEndpointsTests 33 通过。

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
eanzhao and others added 30 commits June 7, 2026 21:46
Design for forking a new WorkflowRunGAgent from a chosen step with
seeded intermediate state after editing the workflow YAML. One fork
primitive + two drivers (manual fork / auto on_failure retry).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…ery (#1864)

- proto: WorkflowRunResumeSeed, WorkflowRunForkRequestedEvent, StartWorkflowEvent.resume_seed
- IWorkflowRunSeedQueryPort + WorkflowRunResumeSeedView (Application.Abstractions)
- read-model seed query (no actor side-read/replay): projection transport fields 18-22,
  projector materialization, WorkflowRunResumeSeedReadModelMapper, WorkflowRunSeedQueryPort
- tests: seed mapper, query port, proto coverage (build + 692 workflow tests + guards green)

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…#1866)

- HandleStartWorkflowAsync honors StartWorkflowEvent.resume_seed: hydrate variables
  (precedence seed -> input -> start params), start at resume_seed.start_at_step_id
  instead of first step, loud-fail when the seeded step is absent, dispatch with
  seeded "input" when present
- does NOT reuse WorkflowResumedEvent (suspension-resume is a distinct path)
- tests: valid seed dispatch+hydrate, missing step failure, precedence, no-seed regression
  (build + Core.Tests 431 + guards green)

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…1868)

- WorkflowForkRunCommand + IWorkflowForkRunService/WorkflowForkRunService (Application/RunForks):
  query seed via IWorkflowRunSeedQueryPort -> validate source terminal + YAML compiles +
  start step exists (structured errors) -> CreateRunAsync(chosen YAML) -> dispatch
  WorkflowChatRequestEvent carrying resume_seed; compensates orphan actors on dispatch failure
- proto: WorkflowChatRequestEvent.resume_seed = 11; app model WorkflowChatRunResumeSeed +
  WorkflowChatRunRequest.ResumeSeed; envelope factory maps app model -> proto
- WorkflowRunGAgent.HandleChatRequest forwards ResumeSeed into self-published StartWorkflowEvent
  and resolves execution input from seed["input"] (consistent Variables["input"])
- seed rides the execute trigger, not the bind; new run never side-reads old run
- tests: terminal/missing/yaml-compile errors, override precedence, happy-path dispatch, envelope
  (build + Core 431 + Application 262 + guards green)

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…point (#1872)

- WorkflowForkRunInput + HandleForkRun in WorkflowCapabilityEndpoints: validate required
  (400) -> WorkflowForkRunCommand -> IWorkflowForkRunService.ForkAsync -> map result:
  accepted 202 + Location (.../workflow-actors/{newRunId}/current-state) + honest body;
  SourceRunNotFound 404, NotTerminal 409, InvalidYaml/StartStepNotFound 422, create/dispatch 502
- ACK honest (only fork-dispatch admission, not applied continuation)
- tests: accepted+location+mapped dispatch, missing-required 400, error mapping
  (build + Host.Api.Tests 465 + guards green)

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…nator (#1874)

- WorkflowParser/WorkflowDefinition parse top-level on_failure {action: fork_from_failed_step,
  max_attempts} (run-level; distinct from step-level retry/on_error)
- WorkflowRunGAgent emits committed WorkflowRunForkRequestedEvent on terminal failure when policy
  matches and fork_attempt < max_attempts (decision inside the actor event handler)
- attempt propagation bounds the chain: WorkflowRunForkRequestedEvent.attempt -> command -> seed ->
  proto -> WorkflowRunExecutionStartedEvent.attempt -> WorkflowRunState.fork_attempt
- WorkflowRunForkCoordinator (ICommittedStatePublicationHook) consumes the committed event and calls
  IWorkflowForkRunService.ForkAsync(InlineYaml:null) -> reuse source YAML; no persistent-definition dep
- kernel CleanupRunAsync preserves terminal facts so a terminal run's seed stays readable (required
  for forking any terminal run; necessary fix the earlier units missed)
- tests: on_failure parse, failed+policy emit, no-policy/attempt>=max no-emit, coordinator->ForkAsync
  (build + Core 436 + Application 263 + guards green; workflow integration tests clean)

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…单渲染 + typed CardActionSubmission.action_kind gate (#1871)

* feat(#1846): reply_with_interaction Select/TextInput/Form primitives + LarkMessageComposer form render + typed CardActionSubmission.action_kind gate (design-consensus structural:typed)

* PR #1871 review-fix output
…scheduled skill runs (#1849)

Adds SkillRunnerOutputFormat enum threaded through skill_runner.proto
(SkillRunnerOutboundConfig + InitializeSkillRunnerCommand), the
scheduled_agent_creator schema + mapper, SkillRunnerGAgent output
branching (FEISHU_DOC forces a Feishu doc, TEXT forces chunked text,
AUTO keeps length-based behavior), and the user_agent_catalog
projection + readers. Closes #1847.

Verified: affected projects build; ChannelRuntime.Tests 1085/1085 pass;
stability/query/projection guards pass.

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…apper + workflow typed lift (#1869)

* feat(#1861): typed InteractionSpec contract (Foundation) + InteractionSpecMapper + workflow typed lift (design-consensus structural:Foundation)

* fix(#1861): 删除 dead HasVisibleContent + 补 WorkflowParser root-level/inline presentation 分支测试

reviewer r1: tests reject(net-new 分支缺测)+ quality comment(dead public API)。
按 controller 决策(删除优先)删除无调用方的 InteractionSpecMapper.HasVisibleContent,
并补 root-level interaction_spec source 与 inline presentation lifting 两个 WorkflowParser 行为测试。

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
…tion (#1845) (#1850)

* feat(nyxid-chat): system-prompt playbook for autonomous long-running task automation

Adds a 'Long-running task automation playbook' to the bot system-prompt
guiding it to: recognize recurring-task requests, author a runnable
active-playbook skill (mirroring deadline-monitor: collect via
nyxid_proxy->api-github, analyze, deliver to Lark), publish via
ornn_publish_skill, negotiate frequency/time/delivery/output via an
interactive card, then schedule 24x7 via scheduled_agent_creator
(+ agent_delivery_targets rebind), with failure/rejection recovery.
Adds a regression test asserting the playbook + tool references.
Closes #1845.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* fix(#1845): 删除生产 prompt 里 deadline-monitor 具体技能名硬编码,改泛化 discovery 表述 + 同步测试

architect review r1 reject:system-prompt.md 在生产 prompt 里硬编码具体 skill/模板名 deadline-monitor,违反 CLAUDE.md:22。
改为基于已加载 skill metadata/instructions 的泛化监控/digest 表述;测试改断言通用行为并加 deadline-monitor 不出现的负断言。

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
… Lark boundary (#1873)

* feat(#1863): 出站交互 notify primitive — typed notification event chain + Lark boundary

design-consensus structural(issue #1863):新 notify primitive 走独立 typed 出站事件链,不挂起、不复用 HITL suspension。
- NotifyModule(校验 delivery_target_id + interaction/interaction_template 恰一 → 发 WorkflowInteractionNotificationEvent → StepCompletedEvent(accepted),绝不发 WorkflowSuspendedEvent)
- WorkflowInteractionNotificationEvent proto(oneof InteractionSpec/InteractionTemplateSpec)+ Foundation InteractionTemplateSpec
- WorkflowInteractionNotificationProjector → IChannelInteractionNotificationPort(+ Null 实现)
- FeishuCardNotificationPort + 抽出 FeishuCardOutboundMessageSender 与 HITL 共享
- architecture_guards.sh FI-006:Workflow Core 禁引用 channel 渲染
- ACK 诚实:accepted=event published,不暗示 Lark delivered

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

* fix(#1863): delivery_target_id 强类型化 + 补 dispatch/guard 测试 + 删 dead Annotations (review r1)

- architect reject:delivery_target_id 在通用 bag → 加 typed WorkflowStepParameters.delivery_target_id=6,
  WorkflowParser lift 到 StepPresentation.DeliveryTargetId、kernel 求值写入、NotifyModule 只读 typed;删 camelCase alias
- quality reject:删除无 producer/consumer 的 ChannelInteractionNotificationRequest.Annotations
- tests reject:补 kernel 真实 dispatch template 求值测试、parser typed-lift 断言、FI-006 guard source-regression、proto round-trip

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
…val) (#1876)

* feat(#1862): HITL typed interaction consumer chain (human_input/approval)

design-consensus r4 structural(issue #1862):human_input/human_approval 携带 typed InteractionSpec,
经 WorkflowSuspendedEvent → WorkflowHumanInteractionProjector → IHumanInteractionPort/FeishuCardHumanInteractionPort 投递;
回流只消费 #1846 typed CardActionSubmission.action_kind 的 FormSubmit gate。
HITL 显式拒绝 interaction_template(仅 notify 用)。只消费 #1861/#1846/#1863 已落地 typed surface,不改 parser/step/kernel。

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

* fix(#1862): HITL approval 决策强类型化 + 去重 HasInteractionSpec (review r1)

architect reject:approval 决策从 action_id 字面推导 → 加 typed InteractionApprovalDecision +
InteractionAction.approval_decision(Foundation 扩展,architect 要求 typed modeling),
FeishuCardHumanInteractionPort 从 typed payload 构造 WorkflowResumeActionPayload.Approved,删除 action_id==approve/reject 控制映射;
WorkflowParser 解析 typed approval_decision、InteractionSpecMapper 映射;action_id 只作 UI 标识。
quality comment:3 处重复 HasInteractionSpec 改用 canonical StepPresentation.HasInteractionSpec。

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
…ow run 失败恢复 batch

汇总合并 eanzhao 两天内 issues 的实现(经 consensus-rnd loop 评审):
- 交互协议: #1861 Foundation typed InteractionSpec + #1846 reply_with_interaction 原语 + #1863 出站 notify + #1862 HITL typed consumer
- workflow run 失败恢复: #1855 #1856 #1857 #1858 #1859 (epic #1854)

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
* Reserve implementation PR for issue #1885

* Fix scheduled agent creator approval mode

* Add scheduled agent prompt approval regression test
…uled creator on relay path

Surfaced by a real Lark automation test ("每天5点发我 github deadline 概要").

Skill discovery: the long-running automation playbook authored a new skill without searching first, creating a duplicate deadline-monitor instead of reusing the published deadline-monitor-digest-payload-builder. Add a 'search Ornn first, reuse via use_skill' step before authoring.

Scheduled scope: BuildLlmReplyRequestAsync never threaded the bot registration scope into the deferred LLM-reply tool context, so scheduled_agent_creator failed with scope_id_unavailable. Set Caller/Channel/ExternalMetadata mirroring the direct-reply BuildAgentBuilderToolContext; ToToolContext only overlays creds/routing so the typed scope survives to tool execution.

Add a regression test asserting the LLM-reply tool context carries the scope; update one stale assertion that pinned the old scope-absent behavior.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…und Lark bot

After scope threading, scheduled_agent_creator next failed with lark_outbound_provider_slug_unavailable: the inbound chat path wrote InboundChannelBotProxySlug but never LarkOutboundProxySlug, which the mapper requires for the primary outbound provider. Set it to inboundEvent.NyxProviderSlug so a chat-triggered scheduled task delivers via the same Lark bot that received the message; a distinct outbound provider stays expressible via agent_delivery_targets.

Extend the LLM-reply tool-context regression test to assert the outbound provider slug is exposed.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Squash merge release rollup after resolving conflicts with feature/integrate.
… DM 为空 (#1916)

* fix(nyxid-chat): relay registration 按 canonical scope 选择,修复 /agents 在 DM 为空

ChannelConversationTurnRunner.ResolveRegistrationAsync 改用 ListByNyxAgentApiKeyIdAsync:
有 TransportExtras.NyxRegistrationScopeId 时只接受 ScopeId 精确匹配的候选,否则 fail closed;
无 canonical scope 时只允许折叠到唯一非空 ScopeId(0/全空/多个 distinct 均 fail closed);
bot-id fallback 仅在 API-key 候选为空时参与,并校验 canonical scope 与 API key。
删除 GetByNyxAgentApiKeyIdAsync 单结果与 QueryAllAsync first-hit bounded scan,
使 DM 与群聊解析到同一 registration,strict OwnerScope 过滤不再漏掉用户自建的 scheduled agent。
保留 /agents 的 strict OwnerScope 四元组隔离(#466),不改 NyxID/chrono-* 外部仓库。

Closes #1914

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

* test(nyxid-chat): 补 registration scope 选择的两个 fail-closed 分支测试

- identity-query port 缺失但带 NyxAgentApiKeyId 时应返回 registration_not_found,不回落 bot-id
- API-key 候选为空且 bot-id fallback 的 ScopeId 与 canonical 不一致时应拒绝

补强 review r1 中 tests reviewer 指出的覆盖缺口(PR #1916)。

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
* Reserve implementation PR for issue #1886 (#1888)

* 强化 direct Responses 本地工具失败处理 (#1895)

* 实现 issue #1886

* Add user skill cancellation coverage

* 修复 workflow fork run 命令分发与 scope 继承 (#1887)

* Reserve implementation PR for issue #1881

* Remove spawn-codex.sh script: deprecated execution wrapper for codex-refactor-loop skill

* docs: 记录 aevatar 为 consensus-rnd:codex-refactor-loop dogfood 仓库

- 新增 Dogfood 段:本仓库是该 skill 的 dogfood host
- skill 自身 bug/使用问题及时自动提到上游 ChronoAIProject/consensus-rnd
- daemon 只跑最新版,本仓库历史版本进程即停(仅约束本仓库)
- host.env 为运行时注入点,缺失即停不臆造

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* 实现 issue #1605 (#1844)

* 收敛团队创建页路由契约 (#1843)

* 实现 issue #1770

* 实现 issue #1770

* PR #1843 remote-ci-fix output

* PR #1843 review-fix output

* PR #1843 remote-ci-fix output

* PR #1843 review-fix output

* Improve team member entry actions (#1867)

* Improve team member entry actions

* Avoid duplicate team members actions

* PR #1887 review-fix output

* PR #1887 review-fix output

* 实现 issue #1881

* PR #1887 review-fix output

* PR #1887 review-fix output

* Remove unused workflow resume seed name

* Use shared command pipeline for workflow fork dispatch

---------

Co-authored-by: Loning <aloning@gmail.com>
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-authored-by: potter-sun <82434926+potter-sun@users.noreply.github.com>

* 收紧 Aevatar 运行观察工具契约 (#1908)

* 实现 issue #1894

* PR #1908 review-fix output

* Fix Lark card finalize delivery truth (#1910)

* 实现 issue #1884

* PR #1910 review-fix output

* 预留 issue #1883 实现分支 (#1889)

* Reserve implementation PR for issue #1883

* 实现 issue #1883

* PR #1889 review-fix output

* PR #1889 review-fix output

* PR #1889 review-fix output

* PR #1889 review-fix output

---------

Co-authored-by: Loning <aloning@gmail.com>
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-authored-by: potter-sun <82434926+potter-sun@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment