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
rockyshi1993 added a commit that referenced this pull request Nov 13, 2026
* chore(interactive): open P0-A staged Draft PR (no code changes)

Base: main 5a82a88 (after G02 #21).
Stages G01/G03/G04, H3-01..05, native Grok Build acceptance, C01-C24, M6
will be committed here one by one, each stopping at independent review.

* docs(interactive): record G01 frozen contract audit

* docs(interactive): record G03 Grok Build capability limits

* fix(interactive): retain validated compile feature stage

* feat(interactive): separate public terminal projection from trusted result

* test(security): add isolated Host fixtures for Linux and Windows

* ci(security): run dual-account Host isolation checks

* test(security): precompile the Windows access probe before logon

* test(security): restrict Windows Host process and token DACLs

* test(interactive): verify multi-process receipts and delayed acknowledgement recovery

* test(interactive): verify long ledger and installed Interactive types

* feat(interactive): add compatible async SDK and versioned transition identities

* feat(interactive): migrate SQLite for atomic audited admin termination

* test(interactive): record Codex App Server acceptance and inline limits

* feat(interactive): bind immutable file handoff to observed Codex calls

* Fix Windows Node 22 file handoff identity checks

* Prepare isolated Codex App Server acceptance runners

* Restore blocking stdio for isolated Linux Codex

* Capture Windows launcher fixture failures

* Compile Windows stdio helper as a standalone executable

* Read Windows token elevation without impersonation

* Record live Windows and Linux dual-account acceptance

* Recover signed Codex receipts from a durable Host outbox

* Record Windows and Linux native Outbox acceptance

* Recover Codex file receipts and reconcile post-CAS Outbox Ack

* Record post-CAS and file Outbox recovery on both hosts

* Exercise Codex Outbox signing cuts and key rotation

* Record native Outbox signing lifecycle results on both hosts

* Probe revoked Host trust and current Outbox retention

* Record native trust revocation and Outbox retention evidence

* Map dual-platform Codex evidence to P0-A release gates

* Align first-release checkpoints with R5 and add Host operations

* Stage the R5 checkpoint module in both isolation test launchers

* Exercise R5 recovery, scoped revocation and retention with live Codex

* Record dual-account R5 release verification on Windows and Linux

* Exercise snapshot cleanup crash recovery and Host operations

* Record dual-account snapshot cleanup and operations evidence

* Exercise native Codex branching and protected terminal reads

* Record dual-account Codex branch acceptance evidence

* Exercise native Codex session binding and observation deadlines

* Record dual-account Codex entry binding evidence

* Exercise OS-mapped operator and auditor roles on Codex entry paths

* Record dual-platform OS identity and audit acceptance evidence

* Invalidate revoked Host sessions and test live staged file isolation

* Recheck audit access before reply and organize release documentation

* Exercise Host operator and auditor sessions through OS-launched peers

* Verify P0-A faults, bounded load and coordinated Store revocation

* Record independent G12 disposition and dual-platform evidence

* Use explicit loopback HTTP transport in capacity acceptance

* Exercise authenticated peer replies, App Server EOF and R5 backups

* Exercise staging admission and alert delivery

* Record G12 joint staging acceptance and release blockers

* Include Linux staging proof and independent adjudication

* Verify live turn interruption and recovery of file-backed R5 receipts

* Record G12 dual-platform interruption and release prerequisites

* Exercise recovery discovery and abrupt active-turn transport loss

* Record G12 recovery and transport-loss rehearsal

* Record Linux recovery and transport-loss evidence

* Validate R5 proposal shapes and verify both Genesis crash boundaries

* Record joint G12 adjudication and v1.0.0 package preflight

* Assert each durable Interactive crash boundary precisely

* Record selected stdio P0 acceptance and residual G12 gates

* Reject unobserved stdio callbacks without stopping the acceptance probe

* Bind OS probe turn before processing subsequent stdio lines

* Record selected stdio observation regression and Linux sandbox limits

* Verify same Pending survives stdio observation denial

* Record Pending recovery and Linux command sandbox evidence

* Exercise a single OS-authenticated Run through Codex and auditor delivery

* Record Windows same-Run acceptance and Linux readiness gate

* Verify native Codex interruption resumes the same Pending

* Record native Windows recovery and managed Linux provisioning gap

* Record Linux same-Run Codex and auditor acceptance
@rockyshi1993
rockyshi1993 deleted the verify/g02-intent-js-closed-loop-20261112 branch November 13, 2026 16:36
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