Skip to content

test(interactive): G02 intent-to-JS product closed-loop evidence - #21

Merged
rockyshi1993 merged 2 commits into
mainfrom
verify/g02-intent-js-closed-loop-20261112
Nov 12, 2026
Merged

rockyshi1993 merged 2 commits into
mainfrom
verify/g02-intent-js-closed-loop-20261112

Conversation

@rockyshi1993

@rockyshi1993 rockyshi1993 commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

范围

G02 产品闭环验证:真实用户意图 → 现有 Workflow DSL → 官方编译器生成可执行 JavaScript → Standard run() 与 Interactive P0-A Coordinator/Trusted Host 执行。

本 PR 只增加示例、测试、夹具和证据文档,不修改 FlowKit Core / Standard Root API / Store schema / LICENSE,也没有第二套 DSL 解析器或模型网关。

Base:main @7e5960fc570f0cd91a5ff8e9fe6029345932442f。不要重做 M1–M5,不要重复合并 #11 / #12 / #20。

覆盖的路径

  • 成功路径:三个 Agent 步进后,程序根据 reviewApproved=true 进入 accepted
  • 入口条件 false:materialsReady=false 时不发布 Pending,程序直接进入 rejected
  • 评审拒绝:模型返回 reviewApproved=false,程序进入 rejected
  • 非法 Agent 输出重试:脚本化负例(明确标注 source=scripted-invalid)触发评审第 2 次 attempt,随后由 Grok 撰写合法结果

分支由编译后的 JS Program(Standard evalWhen / Interactive advance())选择,模型结果不含 next / toBlockId。

证据分级(请勿升格)

  • P:真实 flowkit compile / check / compileInteractive 与 JS/SQLite 执行
  • M:Grok 在查阅已发布 Pending 后撰写、并绑定精确 requestId / taskDigest 的 Agent 正文
  • 不是 N-PASS:本环境用 Node 与 FlowKit CLI 执行 JS;回执使用本地测试 Ed25519 密钥。这不是原生安全 Host 来源认证,也不是供应商证明。

与现有 Standard golden(examples/editorial.workflow.js)的差异见 docs/evidence/g02-intent-js-closed-loop-20261112/07-standard-golden-diff.md。G02 DSL 仅含 Condition / Agent / Terminal,因此可以进入 Interactive P0-A;不得把 editorial 的 Loop / Action / Human / Parallel 记为 Interactive 已实现。

复现

npm ci
npm run build
node dist/cli.mjs compile examples/g02/feature-review.workflow.js --skills-root examples/g02/skills
node dist/cli.mjs check examples/g02/feature-review.workflow.js --skills-root examples/g02/skills
node examples/g02/run-standard.mjs
node examples/g02/run-interactive.mjs
node --test tests/interactive/g02-product-closed-loop.test.mjs

Interactive Program Hash:sha256:8d811766fd1d58456ce4e58cc2a2f04c4d1e36dd683f86496c2df946cb15eded

审查门禁

请按精确 PR HEAD 跑 CI。本阶段结束后停在独立复审门禁,请勿合并,也不要开始 G03 / G01 / G04。用户将把报告与证据包交给 ChatGPT 做独立复审;如有修复要求,在本 PR 上迭代。


Note

Low Risk
Additive examples, fixtures, tests, and evidence docs only; runtime/compiler behavior is exercised but not modified.

Overview
Adds the G02 product closed-loop bundle: a Grok-generated feature-review.workflow.js (Interactive P0-A only: Condition / Agent / Terminal), checked-in Standard and Interactive compile outputs, skills, Mermaid diagram, and maintainer replay scripts (run-standard.mjs, run-interactive.mjs).

Introduces fixtures (turns-success-retry.json, turns-review-false.json) with bound requestId / taskDigest, Grok-authored bodies, one scripted-invalid review retry, and accounting metadata; plus tests/interactive/g02-product-closed-loop.test.mjs (8 tests) that lock artifact hashes, exercise success / gate-false / review-false / retry on both layers, SQLite reopen recovery, and contrast with the editorial golden.

Adds docs/evidence/g02-intent-js-closed-loop-20261112/ (generation inputs, CLI/execution logs, golden diff vs editorial, HASHES.sha256) and a short pointer in examples/README.md. No FlowKit Core, API, or compiler source changes in this PR.

Reviewed by Cursor Bugbot for commit 708d41a. Bugbot is set up for automated code reviews on this repo. Configure here.

Record a Grok-generated feature-review workflow, compile it with the official
Standard and Interactive compilers, and replay success, gate-false,
review-false, and scripted schema-retry paths. Agent payloads are M-level
Grok-authored results bound to exact Pendings, except one labeled scripted
invalid fixture. This does not claim native Host provenance or N-PASS.

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 689e0bd. Configure here.

const diagnostics = await check(workflowFile, compileOptions);
assert.equal(diagnostics.some(d => d.severity === 'error'), false,
JSON.stringify(diagnostics));
});

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Golden compile check overwrites artifact

Medium Severity

The Standard golden assertion calls compile() first, which writes feature-review.compiled.mjs (and the mermaid file) in place, then hashes that same path and runs check() against it. The comparison therefore always matches the just-written output and cannot detect a stale checked-in artifact. The Interactive test avoids this by compiling with output: 'memory'.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 689e0bd. Configure here.

@rockyshi1993

Copy link
Copy Markdown
Contributor Author

GitHub Actions 已在本 PR 的精确 HEAD 689e0bd97127bf32116bdfa37f88b8e013f3adb2 上完成:https://github.com/devcodex-labs/flowkit/actions/runs/43189773064 ,7/7 success(2026-11-12 17:17:28 Asia/Shanghai)。

这只是仓库既有四矩阵 + website 回归,不是 N-PASS,也不是原生安全 Host 来源认证。G02 已停止,待 ChatGPT 独立复审,请勿合并,不要开始 G03。

Address ChatGPT G02 review findings R01 and R02 without changing Core,
Program ABI, or Store Schema. Distinguish six grok-model result uses,
five distinct authored bodies, and one rebound reuse. Rename the runner
pendingPublished field to pendingAtEnd and record publishedPendingCount
measured from each run's route.
@rockyshi1993
rockyshi1993 merged commit 5a82a88 into main Nov 12, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant