Skip to content

Commit 693be0d

Browse files
committed
feat: add durable analyzer start control ledger
1 parent 8e92980 commit 693be0d

15 files changed

Lines changed: 2177 additions & 41 deletions

‎README.md‎

Lines changed: 38 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@
1010

1111
项目从 schema v49 起同时使用两项工程指标,避免把“架构已经搭好”误解为“产品已经完整可用”。这些百分比是基于当前任务书和可验证工作流的工程估算,不是性能基准。
1212

13-
- **架构完成度 / Architecture completion:约 99%**。衡量 Go 控制平面、Run/Session、状态恢复、Policy、审批、预算、事件流、Tool Gateway、Agent 协调、Skills、报告、Sandbox 协议及 Go/TypeScript/Rust 边界的覆盖程度;其中 V2 Run-centric Runtime 约 99%。当前 schema v92:v91 提供独立的 `restricted|full_debug` CDP 权限快照;P11-C5-C8B 进一步补上 Safe Web Windows 进程、一次性 Profile、受限 loopback CDP、WFP 默认拒绝探针和可恢复生命周期账本,但保持无产品入口。P10-F1-H3 又以纯 caller-byte/测试态方式固定 PE/ELF 与架构证据、digest-only 发布候选、canonical Ed25519 来源验证、精确 scope/limits 人工确认,以及 Windows/Linux 的资源、不可变句柄、低权限上下文和受限文件系统符合性证据。
13+
- **架构完成度 / Architecture completion:约 99%**。衡量 Go 控制平面、Run/Session、状态恢复、Policy、审批、预算、事件流、Tool Gateway、Agent 协调、Skills、报告、Sandbox 协议及 Go/TypeScript/Rust 边界的覆盖程度;其中 V2 Run-centric Runtime 约 99%。当前 schema v93:v91 提供独立的 `restricted|full_debug` CDP 权限快照,v92 提供可恢复浏览器生命周期账本;v93 再为 Analyzer 增加签名请求/nonce 防重放、generation-fenced 写前意图和只追加恢复收据,但仅接通 `Disabled/Fake`,没有产品进程入口。P10-F1-J3 以 caller-byte、测试符合性与纯元数据方式固定格式、来源、scope、资源隔离、低权限、准入、认证请求和持久恢复边界。
1414
- **产品可用度 / Product usability:约 96-98%**。衡量普通用户能否依靠当前 CLI、TUI、Web 和 Windows Desktop 完成真实端到端工作。通用 Coding Agent 工作流约 97%,Cyber 自动化工作流约 20%;四种固定诊断动作已形成 Agent 提案到人工审批的完整链,操作者还可在双重确认和本次进程闸门下从 CLI 执行一次非沙箱宿主命令。任意 `approval` 提案、Debug Agent 输入和受限浏览器内核仍无模型、HTTP 或 React 产品入口。独立浏览器网络隔离、Docker 持久终端、可操作的内置浏览器窗口、安装脚本/钩子、Windows 10 人工发布矩阵和 Cyber 工具链仍未完成。
1515

1616
Starting with schema v49, the project reports two engineering indicators so architectural maturity is not mistaken for end-user completeness. These percentages are roadmap estimates backed by tested workflows, not performance benchmarks.
1717

18-
- **Architecture completion: about 99%.** Schema v91 adds an independent `restricted|full_debug` browser-CDP policy ceiling. P11-C5-C8B add a product-inert Safe Web Windows process adapter, disposable Profile lifecycle, restricted loopback CDP, a WFP default-deny probe, and schema-v92 recoverable lifecycle records. P10-F1-H3 add caller-byte PE/ELF evidence, digest-only release candidates, canonical Ed25519 provenance verification, exact scope/limits acknowledgement, and test-only Windows/Linux resource, immutable-handle, low-privilege-context, and scoped-filesystem conformance without product execution authority.
18+
- **Architecture completion: about 99%.** Schema v91 adds an independent `restricted|full_debug` browser-CDP policy ceiling and v92 adds recoverable browser lifecycle records. Schema v93 adds an Analyzer signed-request/nonce replay ledger, generation-fenced write-ahead intents, and append-only recovery receipts. That control plane is restricted to `Disabled/Fake`; it creates no product process route. P10-F1-J3 now cover format, provenance, scope, resource isolation, low privilege, admission, authenticated requests, and durable recovery as caller-byte, test-conformance, or metadata-only evidence without product execution authority.
1919
- **Product usability: about 96-98%.** The generic coding-agent workflow is about 97% usable and Cyber automation about 20%. Fixed diagnostics have an end-to-end Agent-proposal workflow, and an operator can explicitly launch one non-sandboxed host command from the CLI under the current process gates. Arbitrary approval proposals, Debug Agent input, and the restricted browser core still have no model, HTTP, or React product route. Independent browser network containment, Docker terminals, an operational built-in browser window, install hooks, the Windows 10 release matrix, and the Cyber toolchain remain unfinished.
2020

2121
## 项目简介 / Project Overview
@@ -259,9 +259,9 @@ The final batch gate passed the repository-wide Go suite once in about 435 secon
259259

260260
## 开发历程 / Development History
261261

262-
下表是唯一按时间排序的 schema 开发历程,完整保留了早期 `v1`、`v2`、`v3`,并连续列到当前 `v92`。这里的 `vN` 是不可变 SQLite schema/runtime 里程碑,不等同于产品发布版本;后面的架构说明按能力域组织,因此不再承担版本排序职责。
262+
下表是唯一按时间排序的 schema 开发历程,完整保留了早期 `v1`、`v2`、`v3`,并连续列到当前 `v93`。这里的 `vN` 是不可变 SQLite schema/runtime 里程碑,不等同于产品发布版本;后面的架构说明按能力域组织,因此不再承担版本排序职责。
263263

264-
The table below is the canonical chronological schema history. It includes every immutable SQLite schema/runtime milestone from `v1` through the current `v92`. These schema numbers are not product release versions; the architecture notes that follow are grouped by capability instead of chronology.
264+
The table below is the canonical chronological schema history. It includes every immutable SQLite schema/runtime milestone from `v1` through the current `v93`. These schema numbers are not product release versions; the architecture notes that follow are grouped by capability instead of chronology.
265265

266266
| Schema | 中文里程碑 | English milestone |
267267
| --- | --- | --- |
@@ -357,6 +357,7 @@ The table below is the canonical chronological schema history. It includes every
357357
| v90 | 非沙箱一次性宿主命令执行账本 | non-sandboxed one-shot host-command execution ledger |
358358
| v91 | 独立的受限/完整调试 CDP 权限快照 | independent restricted/full-debug CDP permission snapshots |
359359
| v92 | 可恢复且只追加的浏览器运行时生命周期记录 | recoverable append-only browser runtime lifecycle records |
360+
| v93 | Analyzer 一次性请求、写前意图与恢复收据 | Analyzer one-shot request, write-ahead intent, and recovery receipts |
360361

361362
### v85 之后的近期运行时里程碑 / Recent runtime milestones after v85
362363

@@ -2668,6 +2669,39 @@ execution, append-only audit, and a production sandbox are still absent. No
26682669
product route or process starter was added, so schema v92 and product authority
26692670
remain unchanged.
26702671

2672+
### P10-J1/J2/J3:一次性请求账本、写前意图与恢复收据
2673+
2674+
P10-J1 将 P10-I2 已验证的 Ed25519 请求投影为 schema v93 的只追加账本。记录精确绑定
2675+
Run、Workspace、操作者、准入矩阵、scope、请求/合同摘要、有效期和唯一 nonce;原始 nonce、密钥、
2676+
签名、路径、命令、argv、环境和输入正文不落库。相同 ID/指纹可幂等重放,nonce 被另一请求复用、
2677+
终态 Run 或错误 Workspace 绑定都会失败关闭。该记录仍不是 bearer capability,`capability_issued`、
2678+
`atomic_consumption_present`、process start 和全部 authority 保持 false。
2679+
2680+
P10-J2 增加 generation-fenced 写前意图。`disabled` 在第一代直接终止;`fake` 只能从 `prepared`
2681+
原子进入 `consumed`,再进入 `fake_succeeded|fake_failed|recovery_required|cancelled`,或在消费前进入
2682+
`expired|cancelled`。Go 与 SQLite trigger 同时校验前代指纹、最新 generation、签名有效期和精确状态
2683+
转换;同一前代的并发消费/取消只允许一个结果提交。所有状态都固定
2684+
`process_start_authorized=false`、`process_observed=false`、`network_authorized=false`,没有真实 Runner。
2685+
2686+
P10-J3 为每代意图在同一事务中追加一份脱敏 lifecycle receipt 和 Run event。重启协调器只做两件事:
2687+
把悬空 `consumed` 关闭为 `recovery_required`,把过期 `prepared` 关闭为 `expired`;它不会 start、kill、
2688+
扫描进程、清理文件或提交 Artifact。严格 JSON 拒绝重复、缺失、未知和扩权字段,三张表均禁止
2689+
UPDATE/DELETE。CLI、HTTP、Desktop、Tool、Skill 与模型没有调用入口,真实 Analyzer 产品执行仍关闭。
2690+
2691+
2026-08-05 收口审计补强了独立解码边界:未知后继状态即使携带空 reason 也会失败,收据前代必须同时
2692+
匹配 Run、Workspace、request digest 与 intent 指纹。Analyzer/Store 聚焦普通测试、竞态测试、`go vet`、
2693+
`staticcheck` 和 `git diff --check` 均通过;本批没有宣称整仓六切片门,也没有重复 WFP/P10-I 审计。
2694+
2695+
P10-J1/J2/J3 advances SQLite to schema v93 with a unique-nonce signed-request
2696+
ledger, generation-fenced write-ahead intents, and one append-only redacted
2697+
receipt per generation. Only Disabled/Fake lifecycle semantics are available.
2698+
Restart reconciliation closes consumed or expired metadata state and never
2699+
starts, observes, terminates, or cleans a real process, nor commits an Artifact.
2700+
The final focused gate also rejects invented successor states and cross-bound
2701+
receipt ancestry; package tests, race tests, `go vet`, `staticcheck`, and
2702+
`git diff --check` pass. No CLI, HTTP, Desktop, Tool, Skill, or model route was added. See
2703+
[ADR 0089](docs/adr/0089-analyzer-durable-request-intent-and-recovery-ledger.md).
2704+
26712705
### D1-UX4/UX5/UX6:无边框工作台、可调侧栏与 Agent 输入区
26722706

26732707
本批不新增 migration,schema/OpenAPI 仍为 v84 与 75 path / 83 operation / 182 schema。

‎docs/PROGRESS_BOOK.md‎

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2447,3 +2447,26 @@ govulncheck、module verify、48 文件 178 项 Web、API check/build/npm audit
24472447
下一批建议 P10-J1/J2/J3:仅用 Disabled/Fake 执行建立 durable nonce/request ledger、generation-fenced
24482448
write-ahead start-intent 状态机与 atomic consume/expiry/cancel,以及 append-only lifecycle/recovery
24492449
收据。真实 process starter 仍须等生产 OS sandbox 与恢复证据独立验收后另批评审。
2450+
2451+
## P10-J1/J2/J3:持久请求、写前意图与恢复收据
2452+
2453+
任务 ID:`P10-Analyzer-Durable-Request-Intent-Recovery-Ledger`。P10-J1 将 P10-I2 的完整签名验证结果
2454+
投影到 schema v93:记录精确 Run/Workspace、operator/evidence digest、有效期、`disabled|fake` adapter
2455+
和全局唯一 nonce。相同 ID/指纹幂等,nonce 换载荷、终态 Run、错误 Workspace 均失败;不保存原始
2456+
nonce、密钥、签名、路径、命令、argv、环境、输入或 process spec,也不签发 capability。
2457+
2458+
P10-J2 增加 write-ahead `analyzer_start_intent.v1`。每次转换生成新 generation 并绑定前代指纹;
2459+
Disabled 第一代终止,Fake 只能 prepared→consumed→fake terminal/recovery,另有消费前 expire/cancel。
2460+
Go 与 SQLite 双重限制状态、最新代、时间和零 authority;并发 consume/cancel 只能有一个前代胜者,
2461+
精确同操作重放返回已提交代。
2462+
2463+
P10-J3 在每代意图同一事务中写入脱敏 Run event 和 append-only receipt。重启协调器只把悬空 consumed
2464+
记为 recovery_required、把到期 prepared 记为 expired,不进行 process start/observe/kill、文件清理或
2465+
Artifact 提交。三表拒绝 UPDATE/DELETE,严格 JSON 与 SQL trigger 拒绝 unknown/missing/duplicate/
2466+
authority widening。没有 CLI/HTTP/Desktop/Tool/Skill/model route,产品 starter 继续关闭。边界见
2467+
[ADR 0089](adr/0089-analyzer-durable-request-intent-and-recovery-ledger.md)。
2468+
2469+
三切片收口审计发现并修复两处领域校验缺口:未知的第二代状态不能再借空 reason 通过;receipt 前代除
2470+
request ID/generation 外,还必须精确匹配 Run、Workspace、request fingerprint 和 previous intent
2471+
fingerprint。最终通过 Analyzer 全包、Store v93/迁移/README 聚焦测试、聚焦 `-race`、两包 `go vet`、
2472+
`staticcheck` 与 `git diff --check`。本次不是六切片整仓门,没有重复 P10-I 或 WFP。

‎docs/PROJECT_MEMORY.md‎

Lines changed: 34 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2414,6 +2414,34 @@ govulncheck, module verification, 48 Web files/178 tests, API check, production
24142414
build, zero-finding npm audit, Rust fmt/test/clippy/RustSec, Desktop boundaries,
24152415
and Linux no-CGO Analyzer cross-compilation. Schema remains v92. See ADR 0088.
24162416

2417+
## Completed Analyzer Durable Start Control Batch (P10-J1/J2/J3)
2418+
2419+
P10-J1 advances SQLite to schema v93 with an append-only signed-request
2420+
projection. It binds the exact Run, Workspace, operator/evidence digests,
2421+
validity interval, adapter, and a globally unique nonce. Exact replay is
2422+
idempotent; nonce rebinding, terminal Run use, and Workspace mismatch fail.
2423+
No raw nonce, key, signature, path, command, argv, environment, input, or
2424+
process material is retained, and the record is not a bearer capability.
2425+
2426+
P10-J2 adds generation-fenced write-ahead intents. Disabled is terminal at
2427+
generation one. Fake is restricted to prepared -> consumed and then a closed
2428+
fake/recovery state, or pre-consumption expiry/cancellation. Go validation and
2429+
SQLite triggers independently enforce exact predecessor fingerprints, latest
2430+
generation, signed expiry, strict JSON shape, and zero runtime authority.
2431+
2432+
P10-J3 appends one redacted receipt and two bounded Run-event projections in
2433+
the same transaction as each intent generation. Restart reconciliation only
2434+
changes dangling consumed metadata to recovery_required and expired prepared
2435+
metadata to expired. It never starts, observes, kills, or cleans a process and
2436+
never commits an Artifact. There is no CLI, HTTP, Desktop, Tool, Skill, model,
2437+
or real Runner route. See ADR 0089.
2438+
2439+
The 2026-08-05 focused closeout fixed two audit findings: stored successor
2440+
states must be known even when reason is empty, and receipt predecessors must
2441+
match Run, Workspace, request fingerprint, and previous intent fingerprint.
2442+
Analyzer/Store focused ordinary and race tests, `go vet`, `staticcheck`, and
2443+
`git diff --check` pass. This was not another full six-slice repository gate.
2444+
24172445
## Next Slice
24182446

24192447
P11-C8C remains blocked and is tracked in GitHub Issue #1. Do not spend normal
@@ -2423,14 +2451,12 @@ operator-only Restricted Safe Web adapter must still exclude model Tools,
24232451
personal Profiles, request mutation/replay, arbitrary remote debugging, CTF
24242452
security-disable flags, and Full Debug CDP.
24252453

2426-
The next recommended analyzer batch is P10-J1/J2/J3. Add a durable one-shot
2427-
nonce/request ledger with exact Run/operator/evidence binding, a
2428-
generation-fenced write-ahead start-intent state machine with atomic
2429-
consume/expiry/cancel transitions, and append-only lifecycle/recovery receipts.
2430-
Use only Disabled/Fake execution; do not add a real process starter. A later
2431-
independent batch may consider product execution only after production OS
2432-
sandbox evidence and recovery acceptance exist. Docker PTY, arbitrary model
2433-
Shell, signed distribution, and the Windows 10 matrix remain separate gates.
2454+
P10-J1/J2/J3 and their focused closeout are complete. Do not repeat the v93 ledger, Fake lifecycle, WFP
2455+
probe, P10-I contracts, or cumulative six-slice gate after context compaction.
2456+
Before any real Analyzer starter is considered, select an independently
2457+
verifiable production OS sandbox evidence path and exact recovery ownership;
2458+
Fake success is not production evidence. Docker PTY, arbitrary model Shell,
2459+
signed distribution, and the Windows 10 matrix remain separate gates.
24342460

24352461
## Local Machine Note
24362462

0 commit comments

Comments
 (0)