Repository navigation
test(workflows): cover canonical agent result handoffs - #286
Conversation
somewan820
left a comment
There was a problem hiding this comment.
Issue #284 要求修复 Windows 下成功 child result 因反斜杠 artifact identity 被 handoff 拒绝的问题,并保持消费者严格、补充 artifact 单测、execute E2E 和 workflow.json 的 POSIX identity 断言。
本轮未发现阻塞问题。生产改动 extensions/workflows/artifacts.ts:130 将协议身份改为 path.posix.join,而本地落盘仍通过宿主平台的 path.join;handoff 与 dashboard 的严格 canonical 校验未被放宽。新增测试覆盖结构化结果、ref、下游 inputs 和两个 workflow.json artifact。
非阻塞验证问题:
- tests/extensions/workflows/execute.e2e.test.ts:850:已验证事实是新增 E2E 断言了成功结果和 POSIX artifact;未验证项是 Windows 实机执行。仓库 CI 的工作流测试运行在 Ubuntu,.github/workflows/ci.yml:18;Windows job 只运行 background-terminals,.github/workflows/ci.yml:44。影响是 Issue 要求的 Windows E2E 没有自动化门禁,但这不构成已证明的生产回归。
简化审计结论:未发现有充分证据的简化项。严格校验、持久化边界以及取消和清理机制均有实际消费者或独立生命周期保证,不建议删除。
验证状态:本轮仅完成静态审查;bun run check、bun run test 和 Windows execute E2E 均未运行,因此没有测试通过或失败的运行结论。残余风险限于 Windows 实际运行证据和 fake session 与真实 provider 之间的差异。
|
感谢审查。确认 Windows workflow E2E 尚未纳入 CI 是测试基础设施层面的非阻塞缺口; |
somewan820
left a comment
There was a problem hiding this comment.
已完成静态审查:path.posix.join 生成的逻辑 artifact identity 与 handoff.ts 的 / 校验契约一致,主机文件系统写入仍使用 host path.join。未发现 P0-P2 或死代码问题。P3:缺少 Windows 主机写入/读取路径的直接测试,建议后续补充。未运行测试。
|
感谢审查。 |
de130a3 to
a134bdc
Compare
|
Rebase update for reviewers:
The force-push dismissed the previous approval; the current one-commit diff is ready for re-review. |
tt-a1i
left a comment
There was a problem hiding this comment.
Exact-head merge-gate review at a134bdc against main 6286bd8. This is test-only and exercises the real structured result -> handoff ref -> explicit downstream inputs -> persisted POSIX artifact path chain. Two independent reviews found no actionable findings; focused artifact/E2E tests and bun run check passed locally, and all required CI checks are green. The remaining absence of Workflow tests in the Windows CI job is a non-blocking CI-coverage follow-up, not a production regression introduced by this PR.
a134bdc to
0a99a1e
Compare
|
Rebased linearly onto current |
(cherry picked from commit 2740971)
Problem
Issue #284 exposed a Windows-specific contract violation in workflow agent result handoffs: a successful child result could be written to disk with a host-native path, but its protocol-visible artifact identity used backslashes and was rejected by the strict handoff registry.
While this PR was under review, upstream independently landed the production correction in
aa326f9: persisted artifact identities use the explicit POSIX formagent-results/agent-XXXX.json, whilewriteRunFile()continues to translate that identity through hostpath.join()for filesystem access.After rebasing onto current
main, duplicating that production change would add no value. This PR therefore completes the regression coverage requested by #284 and protects the already-landed behavior.Value
The tests lock down the full contract, not just string construction: a structured child result must produce
ok: true, a canonical handoffref, valid downstreaminputs, and POSIX artifact identities in persistedworkflow.jsonstate.This keeps the handoff and dashboard consumers strict. The tests would fail if a future Windows change reintroduced backslash artifact identities or broke the result-to-ref-to-inputs chain.
Approach
agent-results/agent-XXXX.jsonidentity in the artifact persistence test.ref-> downstreaminputs.workflow.jsonuse/.Validation
node --test --experimental-strip-types --test-name-pattern "agent result artifacts are complete or fail without leaving a file" tests/extensions/workflows/artifacts.test.ts- passed on Windows.node --test --experimental-strip-types --test-name-pattern "structured agent results survive handoff refs and downstream inputs" tests/extensions/workflows/execute.e2e.test.ts- passed on Windows.bunx tsc --noEmit --pretty false- passed.git diff --check upstream/main...HEAD- passed.bun run checkreached the formatter after the config-contract and discipline checks passed, then reported 270 repository-wide CRLF diagnostics. The same formatter failure reproduces on a cleanmain; the separate.gitattributes/CRLF baseline is documented under the related work in Windows 上测试套件不绿:setup-config 死锁回收从未在 win32 验证 + capabilities 测试硬编码正斜杠路径 #211 and is outside this PR.bun run testwas attempted on Windows but did not complete: unrelated background-terminal termination tests failed and the runner later stopped producing output, so it was terminated. The focused workflow tests above are green. All three repository CI checks pass on this rebased commit.Impact
This PR is now test-only: two workflow test files, no production code, no schema changes, and no changes to tools, permissions, providers, or consumer validation. It completes regression coverage for #284 without reopening or weakening the canonical path implementation already present on
main.