Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
72 commits
Select commit Hold shift + click to select a range
21b02e7
chore(interactive): open P0-A staged Draft PR (no code changes)
rockyshi1993 Nov 12, 2026
c3a3fdf
docs(interactive): record G01 frozen contract audit
rockyshi1993 Nov 12, 2026
d17a7da
docs(interactive): record G03 Grok Build capability limits
rockyshi1993 Nov 12, 2026
6989190
fix(interactive): retain validated compile feature stage
rockyshi1993 Nov 12, 2026
9c66d1d
feat(interactive): separate public terminal projection from trusted r…
rockyshi1993 Nov 12, 2026
6d30087
test(security): add isolated Host fixtures for Linux and Windows
rockyshi1993 Nov 12, 2026
1ec7d2e
ci(security): run dual-account Host isolation checks
rockyshi1993 Nov 12, 2026
ce179a1
test(security): precompile the Windows access probe before logon
rockyshi1993 Nov 12, 2026
57a39c8
test(security): restrict Windows Host process and token DACLs
rockyshi1993 Nov 12, 2026
9a17bd9
test(interactive): verify multi-process receipts and delayed acknowle…
rockyshi1993 Nov 12, 2026
7014366
test(interactive): verify long ledger and installed Interactive types
rockyshi1993 Nov 12, 2026
e1cd5c7
feat(interactive): add compatible async SDK and versioned transition …
rockyshi1993 Nov 12, 2026
6892aa4
feat(interactive): migrate SQLite for atomic audited admin termination
rockyshi1993 Nov 13, 2026
eb58230
test(interactive): record Codex App Server acceptance and inline limits
rockyshi1993 Nov 13, 2026
7acdfdd
feat(interactive): bind immutable file handoff to observed Codex calls
rockyshi1993 Nov 13, 2026
9584184
Fix Windows Node 22 file handoff identity checks
rockyshi1993 Nov 13, 2026
4deb7c8
Prepare isolated Codex App Server acceptance runners
rockyshi1993 Nov 13, 2026
52633b2
Restore blocking stdio for isolated Linux Codex
rockyshi1993 Nov 13, 2026
493213c
Capture Windows launcher fixture failures
rockyshi1993 Nov 13, 2026
695bc0e
Compile Windows stdio helper as a standalone executable
rockyshi1993 Nov 13, 2026
d9dcc00
Read Windows token elevation without impersonation
rockyshi1993 Nov 13, 2026
81c6a29
Record live Windows and Linux dual-account acceptance
rockyshi1993 Nov 13, 2026
81a4c6e
Recover signed Codex receipts from a durable Host outbox
rockyshi1993 Nov 13, 2026
56ddf93
Record Windows and Linux native Outbox acceptance
rockyshi1993 Nov 13, 2026
f01f2b5
Recover Codex file receipts and reconcile post-CAS Outbox Ack
rockyshi1993 Nov 13, 2026
380be08
Record post-CAS and file Outbox recovery on both hosts
rockyshi1993 Nov 13, 2026
ddf8c68
Exercise Codex Outbox signing cuts and key rotation
rockyshi1993 Nov 13, 2026
cfe867c
Record native Outbox signing lifecycle results on both hosts
rockyshi1993 Nov 13, 2026
ab931af
Probe revoked Host trust and current Outbox retention
rockyshi1993 Nov 13, 2026
32fec01
Record native trust revocation and Outbox retention evidence
rockyshi1993 Nov 13, 2026
1693f06
Map dual-platform Codex evidence to P0-A release gates
rockyshi1993 Nov 13, 2026
d0cb0b5
Align first-release checkpoints with R5 and add Host operations
rockyshi1993 Nov 13, 2026
d3674bc
Stage the R5 checkpoint module in both isolation test launchers
rockyshi1993 Nov 13, 2026
5efa127
Exercise R5 recovery, scoped revocation and retention with live Codex
rockyshi1993 Nov 13, 2026
2d56d04
Record dual-account R5 release verification on Windows and Linux
rockyshi1993 Nov 13, 2026
e0df84b
Exercise snapshot cleanup crash recovery and Host operations
rockyshi1993 Nov 13, 2026
a9498ab
Record dual-account snapshot cleanup and operations evidence
rockyshi1993 Nov 13, 2026
0d1da06
Exercise native Codex branching and protected terminal reads
rockyshi1993 Nov 13, 2026
1eb68a9
Record dual-account Codex branch acceptance evidence
rockyshi1993 Nov 13, 2026
60b745e
Exercise native Codex session binding and observation deadlines
rockyshi1993 Nov 13, 2026
154fe33
Record dual-account Codex entry binding evidence
rockyshi1993 Nov 13, 2026
2f6a673
Exercise OS-mapped operator and auditor roles on Codex entry paths
rockyshi1993 Nov 13, 2026
e40123f
Record dual-platform OS identity and audit acceptance evidence
rockyshi1993 Nov 13, 2026
3fd1d2f
Invalidate revoked Host sessions and test live staged file isolation
rockyshi1993 Nov 13, 2026
a82c9bc
Recheck audit access before reply and organize release documentation
rockyshi1993 Nov 13, 2026
9ba894c
Exercise Host operator and auditor sessions through OS-launched peers
rockyshi1993 Nov 13, 2026
eb52a6f
Verify P0-A faults, bounded load and coordinated Store revocation
rockyshi1993 Nov 13, 2026
a80cd0e
Record independent G12 disposition and dual-platform evidence
rockyshi1993 Nov 13, 2026
00f8400
Use explicit loopback HTTP transport in capacity acceptance
rockyshi1993 Nov 13, 2026
8324e0c
Exercise authenticated peer replies, App Server EOF and R5 backups
rockyshi1993 Nov 13, 2026
3847277
Exercise staging admission and alert delivery
rockyshi1993 Nov 13, 2026
5980872
Record G12 joint staging acceptance and release blockers
rockyshi1993 Nov 13, 2026
fc7fd69
Include Linux staging proof and independent adjudication
rockyshi1993 Nov 13, 2026
a43ff75
Verify live turn interruption and recovery of file-backed R5 receipts
rockyshi1993 Nov 13, 2026
0a2b5fc
Record G12 dual-platform interruption and release prerequisites
rockyshi1993 Nov 13, 2026
cfe4776
Exercise recovery discovery and abrupt active-turn transport loss
rockyshi1993 Nov 13, 2026
585ad5f
Record G12 recovery and transport-loss rehearsal
rockyshi1993 Nov 13, 2026
cb55668
Record Linux recovery and transport-loss evidence
rockyshi1993 Nov 13, 2026
c338cd4
Validate R5 proposal shapes and verify both Genesis crash boundaries
rockyshi1993 Nov 13, 2026
90e2055
Record joint G12 adjudication and v1.0.0 package preflight
rockyshi1993 Nov 13, 2026
f391fd0
Assert each durable Interactive crash boundary precisely
rockyshi1993 Nov 13, 2026
88fd132
Record selected stdio P0 acceptance and residual G12 gates
rockyshi1993 Nov 13, 2026
20a621b
Reject unobserved stdio callbacks without stopping the acceptance probe
rockyshi1993 Nov 13, 2026
d6bd8d8
Bind OS probe turn before processing subsequent stdio lines
rockyshi1993 Nov 13, 2026
e4d6128
Record selected stdio observation regression and Linux sandbox limits
rockyshi1993 Nov 13, 2026
2594511
Verify same Pending survives stdio observation denial
rockyshi1993 Nov 13, 2026
122c6f5
Record Pending recovery and Linux command sandbox evidence
rockyshi1993 Nov 13, 2026
8667704
Exercise a single OS-authenticated Run through Codex and auditor deli…
rockyshi1993 Nov 13, 2026
97d01bb
Record Windows same-Run acceptance and Linux readiness gate
rockyshi1993 Nov 13, 2026
1d2d216
Verify native Codex interruption resumes the same Pending
rockyshi1993 Nov 13, 2026
5842586
Record native Windows recovery and managed Linux provisioning gap
rockyshi1993 Nov 13, 2026
e145d94
Record Linux same-Run Codex and auditor acceptance
rockyshi1993 Nov 13, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ jobs:
- name: Measure repeated Interactive Program loads (diagnostic, Ubuntu Node 24)
if: ${{ matrix.os == 'ubuntu-24.04' && matrix.node == '24.22.1' }}
run: node scripts/bench-interactive-load.mjs
- name: Measure Interactive ledger writes and verify reopened receipt history
if: ${{ matrix.os == 'ubuntu-24.04' && matrix.node == '24.22.1' }}
run: node scripts/bench-interactive-ledger.mjs
- name: Consume candidate package through all documentation examples
env:
FLOWKIT_DOCS_EVIDENCE: .tmp/docs/candidate.json
Expand Down Expand Up @@ -85,11 +88,29 @@ jobs:
run: npm ci --ignore-scripts --no-audit --no-fund
- name: Prove cross-UID model worker cannot read Host key or SQLite DB
run: node tests/security/host-isolation.mjs
- name: Verify the disposable Linux Host profile
if: ${{ matrix.node == '24.22.1' }}
run: sudo -n "$(command -v node)" tests/security/secure-host-linux.mjs
- name: Prove M6 Host and isolated worker integration
env:
FLOWKIT_M6_ISOLATION: '1'
run: node --test tests/integration/m6-e2e.test.mjs

host-security-windows-profile:
name: Host OS-user isolation / Windows
runs-on: windows-2025
timeout-minutes: 8
steps:
- uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6
with:
persist-credentials: false
- uses: actions/setup-node@249970729cb0ef3589644e2896645e5dc5ba9c38 # v6
with:
node-version: '24.22.1'
- name: Verify the disposable Windows Host profile
shell: powershell
run: .\tests\security\secure-host-windows.ps1 -Node (Get-Command node.exe).Source -DisposableRunner

website:
runs-on: ubuntu-24.04
timeout-minutes: 15
Expand Down
12 changes: 12 additions & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# 文档入口

| 用途 | 入口 |
|---|---|
| 用户指南、示例和 API | [文档站](https://devcodex-labs.github.io/flowkit/)及其[源码](../website/content/) |
| 内部 Interactive P0-A 接入 | [Interactive 接入](./interactive.md)、[可信 Host 安全](./interactive-host-security.md)、[Stage 2 契约](./interactive-stage2-contract.md) |
| 候选状态和审查 | [P0-A 发布验收矩阵](./evidence/p0a-g07-g12-20261113/release-matrix.md) |
| 正式发行与安装 | [发布维护](./releasing.md) |

`docs/evidence/` 保存提交绑定的验收报告、探针、命令和原始日志。文件名含 `attempt` 或 `probe` 的条目可能被证据报告引用。日期化的审查记录描述当时的基线,当前状态以发布验收矩阵为准。暂存输出写到已忽略的 `.tmp/`,需要留存的日志和校验和随对应验收记录归档。

PR #16/#17 的[历史核验报告](./evidence/20261112-pr16-pr17/FlowKit-PR16-PR17-Local-Verification-Final-20261112.md)和 Phase 2 [R1](./evidence/20261112-pr16-pr17/interactive-phase2-conformance-audit-r1-20261112.md)/[R2](./evidence/20261112-pr16-pr17/interactive-phase2-conformance-audit-r2-20261112.md) 审查记录已归档到对应证据目录。
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ PR #16 / #17 的 HEAD 与任务开始时给出的历史 SHA 一致,执行前

`git diff --stat 13d573c 90cc0de` 只有:

- `docs/interactive-phase2-conformance-audit-r1-20261112.md`
- `docs/interactive-phase2-conformance-audit-r2-20261112.md`
- [Phase 2 R1](./interactive-phase2-conformance-audit-r1-20261112.md)
- [Phase 2 R2](./interactive-phase2-conformance-audit-r2-20261112.md)

没有生产代码。`git diff ada01c9 -- tests/interactive/coordinator.test.mjs` 在修复分支上为空,说明纳入的回归测试与 PR #17 逐字相同。

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
- 当前 main(2026-11-12 检查):`13d573c5ddc4a0ed3502401589c581799c96c5d2`;[main commit](https://github.com/devcodex-labs/flowkit/commit/13d573c5ddc4a0ed3502401589c581799c96c5d2)。
- R1 使用的旧 main:`ae5fc5a42c67eb6e2c229d72ff4d9ac8e3aab3cd`;对 `src/interactive/coordinator.mjs`、`trusted-host.mjs`、`sqlite-store.mjs`、`compile.mjs`、`types/interactive.d.ts` 逐一读取两版 GitHub 文件并比较 **Git blob SHA 五项完全一致**。因此 R1 的相关代码事实不因 PR #15 文档合并而失效;其他未比较文件不能套用这一结论。
- 已直接读取正式 V0.3 `FlowKit-Host-Driven-Interactive-Execution-Requirements-V0.3-Confirmed(1).md`(§§1–7、15–19 与关键段落);其历史登记身份为 56,883 bytes / SHA-256 `3a0adc3edb41869a6309bae29ec5496df00970c815f8dc16330a90cbf26e703e`。
- 正式 V0.6-R5 的身份为 114,621 bytes / SHA-256 `09f3a5698e238d10b80efb8e26d1c41e51b663ca620efa70815dd7b52f2106ba`,由 [正式原件登记](./interactive-phase2-formal-source-register.md) 及 PR #15 的历史 9/9 校验支持。**本轮当前会话无法直接读取 Library 中该 Markdown 原始正文(原始文件读取接口返回不可访问),因此涉及 §4/§5/§8/§16 的精确规范措辞,仍引用 R1 已抽取的条款并列为独立复核门禁;不能声称本轮已独立全文复读 V0.6-R5。** 不应因此推翻此前原件已找回的事实,也无需重写原件。
- 正式 V0.6-R5 的身份为 114,621 bytes / SHA-256 `09f3a5698e238d10b80efb8e26d1c41e51b663ca620efa70815dd7b52f2106ba`,由 [正式原件登记](../../interactive-phase2-formal-source-register.md) 及 PR #15 的历史 9/9 校验支持。**本轮当前会话无法直接读取 Library 中该 Markdown 原始正文(原始文件读取接口返回不可访问),因此涉及 §4/§5/§8/§16 的精确规范措辞,仍引用 R1 已抽取的条款并列为独立复核门禁;不能声称本轮已独立全文复读 V0.6-R5。** 不应因此推翻此前原件已找回的事实,也无需重写原件。
- 证据等级:`SOURCE-CONFIRMED` = 已直接读取具体源码及类型;`SOURCE-INFERRED` = 源码顺序推断、尚未运行反例;`CONTRACT-CONFIRMED-V03` = 已直接读取正式 V0.3;`V06-R1-EXTRACT` = 对应 V0.6 原文由 R1 转录、待独立原文复核;`RUN-BLOCKED` = 未取得该执行场景的原始运行证明。**以上不是测试 PASS 等级。**

### 1.1 当前关键源码身份
Expand Down
41 changes: 41 additions & 0 deletions docs/evidence/p0a-admin-codex-20261113/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# P0-A 管理终止和 Codex 实测

> 此页记录首发方案确认前的 V2 迁移实验。当前首发初始化全新 R5 数据库,参考入口只接收 `namespace` 选项。部署和验收以 [Interactive 接入](../../interactive.md) 和 [当前发布矩阵](../p0a-g07-g12-20261113/release-matrix.md) 为准。

Draft [#22](https://github.com/devcodex-labs/flowkit/pull/22) 的实施基线为 `e1cd5c7c4f89397fbdee50e1a430074c4c610e9d`,基线 [CI](https://github.com/devcodex-labs/flowkit/actions/runs/43331776187) 8/8 通过。

## R5 管理终止

SQLite 使用显式 V2 迁移。维护窗口内先停写入方,再由可信 Host 调用:

```js
const persistence = createSqliteInteractivePersistence(file, {
namespace, migrationBackupPath: newProtectedBackupFile,
});
```

备份路径必须是可安全新建的 Host 私有文件。SQLite 生成一致性备份,并执行完整性检查。事务锁定写入后重新核对 schema 和 data version,再创建专用审计表、安装写入保护并提交 V2。新 writer 可在迁移后正常写入,已部署旧二进制不含 V2 writer 函数,旧 SQL 写入会被触发器拒绝。该保护针对旧软件兼容性,私有数据库的 OS 访问仍依赖 Host 账户隔离。需要回滚时,在停写窗口将原备份恢复到独立位置并校验 Run/Journal。切换到迁移前快照会丢掉迁移之后的写入,需要先对账。

管理控制器仅接受由可信 Host 在进程内创建的独立管理能力,核对 namespace、管理主体和 `run:admin-terminate`。在一个 SQLite 事务写入 `cancelled` Checkpoint、转移账本及 `fk_i_admin_events`,审计只保存操作主体、reason code、时间和转移身份。管理操作无需加载 Program。原状态已终结时直接返回其终态,审计写入失败回滚整个事务。重复操作不会追加审计,迟到回执拒绝,已持久接纳记录仍可从 Store 读出。管理操作与 P0-B 业务撤销分开。

本地 Windows / Node 24.22.2 的 `npm run verify` 通过 405 项及打包消费者。S12-A 新增测试验证迁移、备份重开、旧写入方拒绝、跨租户与假能力拒绝、专用审计回滚、Program 字节不可用、重复终止、迟到回执,以及两个 SQLite 连接上的管理终止和业务终态竞争。现有生产数据库没有执行迁移。

## Codex App Server 实际执行

Codex CLI 0.145.0 通过 stdio 启动 App Server,使用账号模型目录默认项 `gpt-5.6-sol`。同一 Windows SID 下真实生成一个 Agent 结果。FlowKit 实际编译、发布 Pending、观察原生动态工具开始和回调、校验同一调用 ID 及规范参数摘要,再签名接纳。Run 返回 succeeded,接纳 revision 4,终态 revision 9,Journal 10 条。所有工具的响应都是实际程序输出。

| 样本 | 结果 | 证据限制 |
|---|---|---|
| 65,536 B 完整内联 JSON | PASS | 开始事件、工具回调及预期规范字节完全相同,回合成功完成。 |
| 262,144 B 完整内联 JSON | BLOCKED | 模型结束回合,未发出该动态工具调用。 |
| 2,093,056 B 完整内联 JSON | BLOCKED | 模型结束回合,未发出该动态工具调用。 |

三档都使用确定性 ASCII 样本,大小计算包含完整探针 JSON 对象。64 KiB 属实际传输实测。另两档只能证明当前模型和提示没有交付所需调用,无法推断底层硬上限或 2 MiB FlowKit 内联回执已通过。未启用文件回退。

**Windows/Linux 双账户等价验收 BLOCKED。** Windows 本机非提升账户,WSL 在有界探测中未启动。仓库没有配置凭据或注册自托管 runner。此前的双账户 CI 使用受限脚本并已实测 OS 权限,仍缺当前版本 Codex App Server 在独立身份下的模型调用、进程和句柄证据。探针可接收环境提供的受信隔离启动器。Linux 包含同 PID 的 exec 身份检查。Windows 需要受信启动器从实际非管理员 Host/Model Token 记录两个 SID,并只传递指定 stdio。启动器和真实环境还需联合验证。等价验收、真实多会话、签后崩溃恢复以及 NAT-14/15 保持 BLOCKED。

## 文件回退候选,待确认

建议对超过已验证内联范围的结果采用由 Host 固定的不可变内容。模型工具提交的仅是当前 Pending 的有界引用,Host 从预设的隔离入口获取内容,把同一份读取快照写入 Host 私有存储,再校验长度、UTF-8、JSON、schema 和 SHA-256。摘要、长度、命名空间、Run、Request、Attempt、thread/turn/call 及过期时间与当前受保护的动态调用绑定。模型自报路径或摘要只用于定位或比对,授权与摘要以 Host 的实际观测为准。

验收要求:256 KiB 和接近上限可由 Host 固定并复核。内容变化、超限、截断、过期、错 Run/tenant、重复消费以及未绑定调用均拒绝且无签名或 CAS。外部业务产物和完整内联回执按各自限额处理。成本是增加私有临时存储、清理和对账流程,收益是完整字节可以独立验证。等待用户确认后才实施。
22 changes: 22 additions & 0 deletions docs/evidence/p0a-codex-file-fallback-20261113/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Codex 文件回退验收

Draft [#22](https://github.com/devcodex-labs/flowkit/pull/22) 的基线 `eb5823094cdee0f5d8fe8a558a9824e1c712db4d` 在 [CI](https://github.com/devcodex-labs/flowkit/actions/runs/43343789989) 8/8 通过。本批只修改 Host 示例、Codex 探针和测试。FlowKit Core、Receipt V1、Checkpoint 格式、内联容量和包导出沿用原契约。

Host 在预设入口用受信来源登记字节数、SHA-256、Pending 和会话。工具收到的是 Host 颁发的随机引用和 requestId。入口文件只打开一次并有界读取,读取时检查普通文件、身份、长度和变化,随后校验实际原始字节的摘要、严格 UTF-8、规范 JSON 和应用提供的 schema。原始字节以 BLOB 写入 Host 私有 SQLite,使用 WAL/FULL。入口文件此后可删掉。模型工具不接收文件路径,也没有登记摘要和读取私有 BLOB 的能力。

提交时,Host 比较自己观察到的动态工具开始事件和回调,核对 thread/turn/call、相同规范参数、当前 namespace/Run/Request/Node/Attempt、Program/Policy 摘要和时效。再次校验私有快照字节数和 SHA-256,原子领取一次,然后才调用可信签名与接纳。已签收的 Agent 结果只包含快照 ID、长度和 Host 摘要。调用结束时记录接纳 revision。失去签收结果的已领取引用保持锁定,等待人工对账,重开后也不会重签。过期且未领取的快照可清除。已领取及已接纳快照的持久恢复和保留由部署方决定,自动 Outbox 恢复仍属独立验收。

| 样本 | Codex App Server 同账户实测 |
|---|---|
| 256 KiB(262,144 B) | Codex 读取真实 Pending,提交有界引用。Host 从已保存原始字节核对摘要,签名并接纳,再返回 succeeded。 |
| 近 2 MiB(2,093,056 B) | 同路径,快照字节数和摘要与登记一致,仍只把引用写进 FlowKit State。 |

两个样本由受信合成生产者生成。模型实际调用了 App Server 的动态工具并提交引用。Host 在签收前删除入口文件。日志分别记录原生开始事件、回调、快照 SHA-256、签名、接纳和终态。在该同账户验收阶段,Windows/Linux 双账户原生宿主、生产文件入口的权限部署、真实签后崩溃恢复及 NAT-14/15 均待验证。此次文件回退实测的对象是 Host 合成输入和模型提交的真实引用。

定向用例覆盖入口文件在登记前被替换、截断、超限、非法 UTF-8/重复键/schema、错误 Pending 或会话、缺少开始事件、重复或并发消费、过期、已领取后重开。登记成功后替换或删除入口文件,签收使用已固定的原始快照。

## Windows Node 22 文件身份回归

基线 `7acdfdd0137bc34cd4407ee9ffb8c2fa1e5a18a7` 的 [Windows Node 22.13.0 CI](https://github.com/devcodex-labs/flowkit/actions/runs/43345740815/job/131624564355) 将普通入口文件误判为 `FK_FILE_SOURCE`。在 Windows 实测,Node 22.13.0 对同一文件的 `lstat` 返回设备号 0,句柄 `stat` 返回非零设备号,两者的文件 ID 一致。Windows 路径查询缺失设备号时仍要求打开前后路径与句柄的非零文件 ID 一致,并要求两次路径查询的设备号相同。可用的非零设备号仍须匹配。校验同时保留普通文件、单链接、长度、时间戳和原始字节 SHA-256 检查。

P 级回归用真实文件和私有 SQLite 测试。新增硬链接和文件符号链接拒绝用例,Windows 无文件符号链接权限时实测目录联接点。两项拒绝后,同一请求仍能登记合法文件。后续两个平台均通过[独立账户下的三个真实样本](../p0a-codex-isolated-20261113/live-samples.md),生产部署和完整原生安全门禁仍待验收。
Loading