Skip to content

docs: P0a contracts, schema, fixtures, and D023 errata - #391

Merged
Dong1017 merged 6 commits into
mainfrom
docs/p0a-contracts-v1
Nov 11, 2026
Merged

Dong1017 merged 6 commits into
mainfrom
docs/p0a-contracts-v1

Conversation

@Dong1017

@Dong1017 Dong1017 commented Nov 11, 2026 •

Copy link
Copy Markdown
Collaborator

This PR lands only the P0a contracts: documentation, JSON Schema Draft 2020-12, golden fixtures, and Decisions (including D023). It does not move source, change the current hard-gate implementation, implement P0b / K01 / H01 / H02 / CLI / Apps assembly or worker startup, or auto-merge.

Entry: docs/contracts/README.md — reading order, status, normative priority, and the former-filename map. Head: 892443898ed016c770e60a92ca377c3981e87f96.

Normative sources (conflict order)

  1. rfc: K/H/B 与 Apps 公开接口详细设计(最小交接与模块边界) #387 body (including section K): rfc: K/H/B 与 Apps 公开接口详细设计(最小交接与模块边界) #387 (comment)
  2. t115 errata D023 and T36–T40: rfc: K/H/B 与 Apps 公开接口详细设计(最小交接与模块边界) #387 (comment)
  3. Absorption of the four review points: rfc: K/H/B 与 Apps 公开接口详细设计(最小交接与模块边界) #387 (comment)
  4. task: Apps 应用层详细设计与迁移计划(CLI / Python / Plugin) #371 cross-reference: task: Apps 应用层详细设计与迁移计划(CLI / Python / Plugin) #371 (comment)
  5. Five-item review source: task: Apps 应用层详细设计与迁移计划(CLI / Python / Plugin) #371 (comment)
  6. Four review comments: rfc: K/H/B 与 Apps 公开接口详细设计(最小交接与模块边界) #387 (comment)
  7. t108-v4 seven volumes as the foundation; on conflict, section K and 6785139079 win:
  8. discussion: Knowledge / Harness / Benchmark 三模块目标架构——现状、原语、交接时序与遗留问题 #362 A–D are cited, not modified: discussion: Knowledge / Harness / Benchmark 三模块目标架构——现状、原语、交接时序与遗留问题 #362 (comment)
  9. The run-output special item remains a separate Proposed item and is not expanded here into a requirement to stay compatible with every old output layout: task: Apps 应用层详细设计与迁移计划(CLI / Python / Plugin) #371 (comment)

Where they differ, p0a-contract-errata.md (D023) wins over earlier volumes.

Scope

  • Land the shared contracts, semantics (V01–V35), Decisions (D020–D023), acceptance T01–T40, and eight figures under docs/contracts/.
  • Land the schema: the default path adds a nullable CommandStep.expected_code_sha256 (required and equal to the frozen OperationRecipe.code_sha256 in evaluation mode; null in ordinary command mode). Historic goldens are kept as-is in fixtures/t108-v4/; the current request example is fixtures/execution-spec-d023.json.
  • Land the T36–T40 specification vectors (fixtures/d023-conformance-cases.json). These are specifications, not executed runtime tests.
  • The P0a row in gate-policy-runstore-and-first-prs.md is updated for D023 / T36–T40. P0b still requires formal architecture review before K01. H01 creates a new local SQLite RunStore and does not migrate MemoryArchive. Completing the whole Apps assembly is not a prerequisite.

File navigation and former names

Ordinary human-readable documents use lowercase kebab-case. README.md is kept. Schema and fixture data filenames, and historic golden bytes, are unchanged. Decision, validation, and acceptance IDs (D001–D023, V01–V35, T01–T40) stay in the body.

Former name Current name
CURRENT-DESIGN.md current-design.md
SCHEMA-AND-SEMANTICS.md schema-and-semantics.md
DTO-FIELD-INDEX.md dto-field-index.md
D008-FUNCTION-OWNERS.md function-owners.md
D020-D022.md isolation-errors-and-cli.md
D023.md p0a-contract-errata.md
GATE-STORE-AND-FIRST-PRS.md gate-policy-runstore-and-first-prs.md
ACCEPTANCE-T01-T40.md acceptance-criteria.md
FIGURES-ALL.md figures.md
diagrams/387-1.mmd diagrams/public-ports-and-primitives.mmd
diagrams/387-2.mmd diagrams/execute-to-assess-handoff.mmd
diagrams/387-3.mmd diagrams/knowledge-read-and-internal-schema.mmd
diagrams/387-4.mmd diagrams/legacy-run-v0-exit-codes.mmd
diagrams/387-5.mmd diagrams/target-port-topology.mmd
diagrams/387-6.mmd diagrams/end-to-end-handoff-and-replay.mmd
diagrams/387-7.mmd diagrams/migration-overview.mmd
diagrams/371-1.mmd diagrams/apps-assembly-sequence.mmd

Unchanged data names: schemas/contract-v1.schema.json, schemas/INDEX.json, fixtures/t108-v4/**, fixtures/execution-spec-d023.json, fixtures/MANIFEST-d023.json, fixtures/d023-conformance-cases.json.

Acceptance

  • A00-1 Schema fields and the semantics table are consistent with D023.
  • A00-2 Full golden bytes and projection positive/negative cases, including T36–T40.
  • A00-3 Legacy evaluate missing-item precedence and legacy run 0/1/2 are unchanged.

Merge still requires two eligible Approves on the current head plus ordinary repository review. A new head dismisses previous Approves. Merging this PR is not a check of the #387 acceptance boxes, and it is not acceptance of P0b or K01. Rollback is to withdraw the corresponding document / test-contract changes, not to skip checks.

@Dong1017 Dong1017 added area:harness Harness module: profile, A/B loop, quality gates, evidence reports area:knowledge Knowledge line: packs, skill library, knowledge admission kind:docs Documentation and template delivery labels Nov 11, 2026
@Dong1017

Copy link
Copy Markdown
Collaborator Author

@zengchuang-hw @amy-why-3459 请二位对本 P0a 契约/schema/fixtures 与 D023 勘误作正式 review。

合入须等待该正式 review 与常规 repository review。合入本身不等于 #387 验收框可勾选,也不等于 P0b/K01 已接受。本 PR 只入仓文档/schema/fixture/Decision,不搬源码、不改现行硬门禁、不实施 P0b/K01/H01/CLI。

@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.

PR review verdict — DO NOT PASS

Reviewed base 4b3afa55f278ca314e07d5f8acbd0a18f3fa72bf and head b48eac04fc533807455b9c7f7b4d2373b014129b (full-diff first review; no prior review). Dong-bot review of the P0a contract set. Two blockers remain. I will re-read after the author pushes.

Blockers

  1. D023-2 / T37 has two owners.

    • docs/contracts/D020-D022.md:157 places the pre-start code-digest check in H02.
    • docs/contracts/GATE-STORE-AND-FIRST-PRS.md:102 limits H02 to ordinary command mode with evaluation-mode fields null. H02-1–H02-6 do not name T37. H02-3 is candidate-byte identity mismatch, a different case from the entry code digest.
    • docs/contracts/SCHEMA-AND-SEMANTICS.md:106 (V32) and docs/contracts/ACCEPTANCE-T01-T40.md:57 (T37): the mismatch outcome (zero start, submit not_started, or ExecutionPersistenceError if that submit fails; unresolvable entry → not_performed/unknown with no fabricated mismatch) applies in evaluation mode, where CommandStep.expected_code_sha256 must equal prepared.recipe.code_sha256. Plain command mode requires that field to be null, so an H02 that only nulls evaluation-mode fields never reaches the T37 mismatch path.
      Trigger: evaluation-mode spec, declared step digest equals the frozen recipe, actual entry bytes differ.
      Expected correction: name one slice in both files and add an acceptance id for T37's two outcomes. If H02 owns the non-null path, the H02 row has to include that case. If a later H slice owns it, remove the assignment at D020-D022.md:157.
  2. Schema and fixtures were outside this review's diff, so A00-1 and A00-2 are unverified.
    The seeded pr/diff.patch ends inside docs/contracts/diagrams/387-7.mmd (a cut Mi line, then a truncation marker). I did not read schemas/contract-v1.schema.json, schemas/INDEX.json, fixtures/**, or the rest of 387-7.mmd.
    Unverified claims this PR treats as acceptance: CommandStep.expected_code_sha256 required and null-or-Sha256; definition count 106 in the schema file; AppsExecuteRequest.attempt required; StorageConfig unreferenced by any Apps*Request; ExecutionSpec / request_digest goldens updated for the new field; fixtures/d023-conformance-cases.json vectors for T36–T40.
    DTO-FIELD-INDEX.md lists 106 names and includes the new field. That count is the index text only.
    The truncation is a review-input limit. I will read the schema and fixtures on the next head before any PASS.

Checked in the prose that was present

  • Design baseline SHA matches this PR's base 4b3afa55f278ca314e07d5f8acbd0a18f3fa72bf.
  • D023-1 / T36 / V31 agree: prepare delivers protocol bytes and a per-role closure entry outside PreparedEvaluation; projection P strips only a declared ArtifactRef.location; internal field changes recompute prepared_id; a missing resource or a failed archive yields no PreparedRef.
  • D023-3 / T38 / V33 agree: ContextProvider.collect returns an in-process DeliveredContextDraft with no uncommitted ArtifactRef; the draft is not a $defs entry; H seals and writes; Apps does not write the H RunStore.
  • D023-4 / T39 / V34 and the AssessorError row agree: unknown or absent primary key → InvalidRequest / exit 2 and the assessor is not called; key present but omitted from the B result → AssessorError; archive failure stays exit 6 with assessment_ref null; 0/8/9 only after a complete archived result.
  • D023-5 / V35 agree with the port figures: the host calls allocate_attempt, saves AppsExecuteRequest (attempt required), then the CLI runs; execute does not allocate; replay reuses the saved attempt and returns the original RecordRef or RecoveryRequired.
  • T01–T40 are labeled specifications. The text states that pytest, execute, and assess have not been run. Status stays Proposed.

Optional

  • docs/contracts/diagrams/387-6.mmd:73 goes from the input-identity break to H->>T with no pre-start digest branch. FIGURES-ALL.md:237 includes that branch. 387-1.mmd, 387-5.mmd, and 371-1.mmd omit the expected_code_sha256 and in-process closure labels that the English figures include. The figure preface says figures are explanatory and that V01–V35 plus the schema stay authoritative, so this leaves T37 unchanged. Syncing the .mmd sources would keep both copies on the same path.
  • docs/contracts/D020-D022.md:6 says the D021 error table and re-entry table are unchanged. The AssessorError cell adds the D023-4 missing-key case, and the re-entry section adds a D023-5 replay note. The table text is the rule; the summary line should mention those edits.
  • V32 sends spec-time violations through the general bad-spec rule (InvalidExecutionSpec) and sends runtime mismatch to T37. A direct sentence for "plain mode and expected_code_sha256 non-null" and "evaluation mode and expected_code_sha256 ≠ recipe.code_sha256" would match how V28/T28 name InvalidExecutionSpec.
  • T39(b) leaves the exit code to the D022 matrix (PublicError → exit 2). Restating exit 2 on that row would keep it distinct from exit 8.

Not verified

  • jsonschema, golden-byte recomputation, and CI were not run.
  • The schema file, INDEX.json, and fixtures were outside the seeded diff (blocker 2).
  • The reviewed portion has no src/ or gate diff. A00-3 (old evaluate / run 0/1/2) was not executed.

This review does not approve and does not change P0a scope.

Copy link
Copy Markdown
Collaborator

已 review 本 PR 当前 head b48eac04fc533807455b9c7f7b4d2373b014129b,这是首次完整 review,基于 main,共 46 个文件,全部是 docs/contracts/ 下的新增文件。先给结论:机器可核对的部分基本自洽,但有几处需要作者确认或补齐,所以暂不 Approve。

本地已核对通过

  • schemas/contract-v1.schema.json 通过 Draft 2020-12 check_schema,共 106 个 $defs,与 README、INDEX、DTO-FIELD-INDEX 中的“106”一致。
  • DTO-FIELD-INDEX.md 共 106 行。每行的字段列表与 schema 中对应定义的 properties 完全一致,顺序也一致。
  • fixtures/t108-v4/ 下的 22 个文件与 MANIFEST.json 的 bytes 和 sha256 逐字节一致,除 MANIFEST 本身外没有未登记的文件。
  • fixtures/execution-spec-d023.json 是 canonical 字节:key 排序、无空格、无结尾 LF,且能通过 ExecutionSpec 校验。去掉 steps[0].expected_code_sha256 后,它与历史 t108-v4/execution-spec.json 完全相同。字段值等于 t108-v4/prepared.json 中的 recipe.code_sha256(ba351e8f…5332)。历史 spec 在 D023 schema 下只报 'expected_code_sha256' is a required property @steps/0 这一个错误,与 fixtures/README 中声明的“预期不匹配”相符。
  • d023-conformance-cases.json 共 22 个 case,coverage 与 T36–T40 一一对应。所有 md 中的相对链接都能解析。CI 全绿。

需要确认或修改

  1. V32 的模式条件里有一个 schema 无法出现的分支。 D023.md L35、DTO-FIELD-INDEX.md L120、SCHEMA-AND-SEMANTICS.md L106(V32)以及 CommandStep.$comment 都把评测模式写成“prepared_ref 非空且 recipe 声明了代码摘要”。但 schema 中的 OperationRecipe.code_sha256 是 required,类型是非空的 Sha256,recipe 不可能“未声明代码摘要”。这样写会让读者以为存在第三种情况:评测模式下 recipe 没有摘要,此时 expected_code_sha256 取 null。建议删掉这个限定,直接写成“prepared_ref 非空即必须等于 prepared.recipe.code_sha256”。如果确实打算保留 recipe 不带摘要的情形,就需要把 OperationRecipe.code_sha256 改成可空,并补一条对应的 V32 或 T37 向量。
  2. t108-v4/MANIFEST.json 中 file 的路径基准与实际目录不一致。 22 条记录都写成 fixtures/<name>(例如 L16 的 "file": "fixtures/apps-assess-request.json"),实际文件却在 fixtures/t108-v4/<name>。我理解历史 manifest 不能改,但 fixtures/README.md L29 的核对步骤只说“对照 MANIFEST.json 逐字节比较”。建议在 README 中明确写出“manifest 的 fixtures/ 前缀对应本目录 fixtures/t108-v4/”,否则按路径直接核对的脚本会全部报文件缺失。
  3. 目前没有任何自动检查守住上述一致性。 tests/ 和 .github/ 都没有引用 docs/contracts,所以 schema 自校验、106 个定义的计数、DTO 字段索引、MANIFEST 哈希以及 D023 示例的校验,都没有进入 CI。这些都是纯文件检查,依赖只有 jsonschema,不涉及运行时实现,与本 PR “只入仓文档/schema/fixture”的范围不冲突。能否加一个轻量测试,例如 tests/test_contracts_docs.py?如果有意留到 P0b 再做,请在 docs/contracts/README.md 中注明,避免后续修改 schema 时静默漂移。
  4. 请确认 execution-spec-d023.json 的 request_digest 由谁、在哪一步落地。 fixtures/README.md 中“Current D023 example”一节说该文件的 canonical 哈希由 coordinator 计算后补进 manifest,但本 PR 没有为 D023 示例提供任何 manifest 或哈希记录。合入后,这个示例目前没有可复核的锚点。请确认这是有意留给后续 PR 的,并在 README 中写明是哪一个 PR 或 Decision。

说明:本次只核对了 schema、fixtures、索引之间的机器一致性,以及 D023-2 的字段落点,没有逐条评审 CURRENT-DESIGN、D020–D022、D023 和 T01–T40 的设计取舍是否与 #387、#371 讨论的结论完全一致。这部分仍需按正文所说做正式架构 review。

Reviewed: 4b3afa55f278ca314e07d5f8acbd0a18f3fa72bf(base)… b48eac04fc533807455b9c7f7b4d2373b014129b(首次完整 review)。

@Dong1017

Copy link
Copy Markdown
Collaborator Author

已按首轮意见在原 PR 上追加提交 31ae580eb835562dee0cf733d652405218b58dc7(基于此前 head b48eac04fc533807455b9c7f7b4d2373b014129b,未 amend、未 force,未另开 PR)。远程 docs/p0a-contracts-v1 已核对该 SHA。本轮只改 docs/contracts/,未加 tests/,未改源码或现行硬门禁,未设自动合并。

处理如下:

  1. V32:删除「recipe 声明了代码摘要」这一 schema 不可能出现的分支,未放宽 OperationRecipe.code_sha256。评测模式改为:prepared_ref 非空即必须等于冻结 prepared.recipe.code_sha256。涉及 D023.md、DTO-FIELD-INDEX.md、SCHEMA-AND-SEMANTICS.md(V32)、schemas/contract-v1.schema.json 的 $comment,以及 fixtures/d023-conformance-cases.json 中 T37-P1/T37-N4。规格期模式/等值违规归 InvalidExecutionSpec;T37 只覆盖 expected 已合法之后的启动前实际入口核对。

  2. 历史 fixtures/t108-v4/MANIFEST.json 保持原字节。fixtures/README.md 写明 manifest 中的 fixtures/<name> 对应本仓库 fixtures/t108-v4/<name>,核对须做路径映射,不得改写历史 manifest。

  3. 未增加自动化测试。docs/contracts/README.md 写明本 PR 不含 tests/ 或 .github/ 中的一致性守卫;后续门禁 PR 若纳入此类守卫,须经该 PR 的正式架构 review,此处不视为已接受,也不承诺 P0b 已经覆盖。

  4. 入仓 fixtures/MANIFEST-d023.json,作为当前 execution-spec-d023.json 的文档锚点(非运行实现证明):file sha256 与 request_digest 均为 sha256:be0fb47b3b9b8b064a42758ec5b83a20cab92359b2fd50f9ad68305cf7517980(2069 字节,文件已是 canonical,故两者相同);expected_code_sha256 为冻结 recipe 值 ba351e8f…5332。落地步骤:Apps 组装评测模式 spec 时只把 prepared.recipe.code_sha256 原样写入 CommandStep.expected_code_sha256;H 在 execute 登记/claim、且最终 spec 完整后(含适用的 V24 seal_generation)计算并写入 attempt 与 ExecutionRecordPayload.request_digest。本 PR 只提供可复核的文档黄金,不声称 H 路径或 execute/assess 已实现。

  5. D023-2/T37 归属:对齐 D020-D022.md 与 GATE-STORE-AND-FIRST-PRS.md 的同一实际切片。H02 仍是普通命令模式,评测字段(含 expected_code_sha256)为 null;H02-3 是 T25/V28 候选/输入身份错配,不是 T37。T37-N1(错配 → 零启动/not_started,提交失败走 ExecutionPersistenceError)与 T37-N2(无法解析 → not_performed/unknown,不伪造 mismatch)在 H02 之后的后续评测模式绑定/执行切片实现。普通命令 null 模式不覆盖这两条。未新造扩权实现,也未把 T37 扩进 H02 验收清单。

独立核验(仓库外脚本,非 CI、非运行时实现测试):198 项,0 失败,其中包括原 188 项以及本次对 MANIFEST-d023.json 哈希/request_digest、历史路径说明、V32 不可能分支删除的附加检查。可审阅入口:docs/contracts/schemas/contract-v1.schema.json、docs/contracts/fixtures/(含历史 golden、MANIFEST-d023.json、T36–T40 向量)。先前评审材料若在 diagrams/387-7.mmd 之后被截断,属于评审输入限制,不是规范缺失;上述文件在本 PR 中完整可读。

本地或评审方的机器一致性核对,只说明文件可复核,不构成正式批准。P0b 仍须正式架构 review 后才允许 K01;合入本 PR 不等于勾选 #387 验收框。

Copy link
Copy Markdown
Collaborator

增量 review:b48eac04fc533807455b9c7f7b4d2373b014129b … 31ae580eb835562dee0cf733d652405218b58dc7,新增 1 个 commit(31ae580e,按首轮评审修正)。

已确认修复

  • 第 1 点(V32 条件):D023.md、DTO-FIELD-INDEX.md、SCHEMA-AND-SEMANTICS.md V32 和 CommandStep.$comment 中的“recipe 声明了代码摘要”都已删除,recipe_declares_code_sha256 也已从 vectors 中移除。我在新 head 上全目录 grep 过,没有残留。schema 只改了 $comment,仍是 106 个定义。
  • 第 2 点(MANIFEST 路径):fixtures/README.md 已写明 fixtures/<name> → fixtures/t108-v4/<name> 的映射,且不改历史 manifest。
  • 第 3 点(CI 守护):README.md 新增一节,明确说明本 PR 不加、留给后续架构 review 决定。我接受这个处理方式。
  • 第 4 点(digest 锚点):新增的 fixtures/MANIFEST-d023.json 写明了路径基准和 Apps/H 各自的职责。我本地复核过:execution-spec-d023.json 共 2069 字节,sha256 为 be0fb47b…7980,与 manifest 中的 bytes、sha256、request_digest 一致;expected_code_sha256 也与 recipe 一致。

还剩一处不一致(请确认)

  1. T37 的范围在文档和 vectors 之间对不上。 新的 V32(SCHEMA-AND-SEMANTICS.md L106)、D023.md L36、ACCEPTANCE-T01-T40.md 的 T37 行以及 CommandStep.$comment 都明确说,规格期违规(普通命令模式下非 null,或评测模式下 expected 为 null 或不等于 recipe)是登记前的 InvalidExecutionSpec,“不得当作 T37”,并且 T37 只有 N1/N2 两个分支。但 fixtures/d023-conformance-cases.json 中仍有 T37-N3(普通命令模式非 null)、T37-N4(评测模式 null)、T37-N5(缺 key,schema 层),acceptance 字段和 coverage.T37 也都把它们算作 T37。另外,这三条的 failure 只写了“V05/V32 rejects”,没有写出文档所要求的 InvalidExecutionSpec 错误类别。建议二选一:
    • 把这三条改成 V32 或规格期的 case id(例如 V32-N1..N3),移出 coverage.T37,并在 expected_outcome 中写明 InvalidExecutionSpec、不建 record;
    • 或者在文档中说明 N3–N5 只是挂在 T37 名下的规格期 vectors,不属于 T37 的验收结果。
  2. (小问题,可选) 文档现在列出了“评测模式 expected 非 null 但 ≠ recipe.code_sha256”这种规格期违规,但 vectors 里没有对应的 case。可以补一条,与上面的 N4 并列。

本轮只做了文件级复核:grep、schema 定义计数、$comment 对比、MANIFEST-d023 字节和哈希,以及 T37 vectors 与文档的逐条对照。

Reviewed: b48eac04fc533807455b9c7f7b4d2373b014129b → 31ae580eb835562dee0cf733d652405218b58dc7。

cursor[bot]
cursor Bot previously approved these changes Nov 11, 2026

@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.

LGTM

PR review verdict — PASS
Reviewed base 4b3afa55f278ca314e07d5f8acbd0a18f3fa72bf and head 31ae580eb835562dee0cf733d652405218b58dc7.
Incremental range b48eac04fc533807455b9c7f7b4d2373b014129b..31ae580eb835562dee0cf733d652405218b58dc7. Dong-bot re-review after the prior DO NOT PASS.

Earlier finding

D023-2 / T37 two owners is resolved. H02 stays ordinary command mode: evaluation-mode fields, including expected_code_sha256, stay null, and acceptance stays H02-1–H02-6. H02-3 stays the candidate/input identity mismatch (T25/V28) not_started record. T37 is the later H evaluation-mode binding/execute slice, with two outcomes:

  • T37-N1: expected already equals the frozen recipe.code_sha256, actual entry digest differs → zero start, submit not_started with mismatch facts, or ExecutionPersistenceError if that submit fails.
  • T37-N2: unresolvable entry → not_performed/unknown, RuntimeBinding.code_sha256 stays null, no fabricated mismatch.

Spec-time violations (ordinary command non-null, or evaluation-mode expected null / not equal to the frozen recipe) are pre-registration InvalidExecutionSpec: no start and no record. The “recipe declares a code digest” branch is gone; OperationRecipe.code_sha256 is treated as a required non-null Sha256.

Same split in:

  • docs/contracts/ACCEPTANCE-T01-T40.md T37 (line 57)
  • docs/contracts/D020-D022.md H02 bullet (line 157)
  • docs/contracts/GATE-STORE-AND-FIRST-PRS.md H02 row (line 102) and the new “After H02, before evaluation-mode execute” bullet
  • docs/contracts/SCHEMA-AND-SEMANTICS.md V32 (line 106)
  • docs/contracts/D023.md, docs/contracts/DTO-FIELD-INDEX.md, and the CommandStep $comment in docs/contracts/schemas/contract-v1.schema.json
  • docs/contracts/fixtures/d023-conformance-cases.json: both edited vectors drop recipe_declares_code_sha256; the evaluation-mode null-expected vector now says V32 rejects that null

Also in this range

  • docs/contracts/fixtures/MANIFEST-d023.json is a current-example documentation anchor. It does not replace fixtures/t108-v4/MANIFEST.json. Its request_digest is sha256: plus the recorded file sha256 (be0fb47b3b9b8b064a42758ec5b83a20cab92359b2fd50f9ad68305cf7517980), and expected_code_sha256 matches the hash already printed in docs/contracts/fixtures/README.md (ba351e8f96c162ed9c32309f24b1d2d75d11a7369168571ebbb0a79d13315332). Apps copies prepared.recipe.code_sha256 into expected_code_sha256; H computes request_digest at registration/claim from the final canonical spec bytes, including after V24 seal_generation when that seal adds an InputSpec.
  • Historic t108-v4 verification now maps manifest paths fixtures/<name> to fixtures/t108-v4/<name> and keeps the historic manifest bytes.
  • The D023 change-surface sentence in D020-D022.md now describes the D021 delta as the D023-4 AssessorError omission row plus the D023-5 disconnect-replay note.
  • docs/contracts/README.md states this PR adds no tests/ or .github/ consistency guards and does not take that scope into P0b.

Not verified here

  • SHA-256 and byte length of docs/contracts/fixtures/execution-spec-d023.json were not recomputed. That file is unchanged in this range, so its bytes are not in the incremental patch. The new manifest claims 2069 bytes and be0fb47b3b9b8b064a42758ec5b83a20cab92359b2fd50f9ad68305cf7517980.
  • Historic 22-file t108-v4 hashes, the schema definition count, and the D021 AssessorError / replay table bodies were not re-read; those bodies are outside this incremental diff.
  • Tests and CI were not run. The diff is docs, schema comment, and fixtures only.

Optional follow-ups

  • D023.md names InvalidExecutionSpec on the ordinary-mode non-null bullet. The evaluation-mode null / inequality rejection is stated in V32 and T37.
  • The evaluation-mode null-expected vector still describes a V32 reject and zero starts. It does not name InvalidExecutionSpec or the no-record outcome.

No outstanding blocker in this range.

把普通命令非 null、评测 expected 为 null、以及缺 key 三类负向向量
移出 coverage.T37 与 T37 验收,分别改为 V32-N1、V32-N2 与 SCHEMA-N1;
并补评测 expected 非 null 却不等于冻结 recipe 的 V32-N3。

V32 规格期违规为 InvalidExecutionSpec,不启动、不造 record。
SCHEMA-N1 为 schema 层缺 key 拒绝,不得把 schema validator 等同运行时
PublicError。T37 仅保留 T37-P1/N1/N2(expected 已等于 recipe 后再核
对实际入口)。不改 schema 约束,不动历史 golden。

Copy link
Copy Markdown
Collaborator Author

对 #391 (comment) 的增量修复已推到本 PR。

新 head:3fe74f4a7cd3dacb4072d0aa8d37b0c0c8cecbb5(基于先前 31ae580eb835562dee0cf733d652405218b58dc7,普通 commit + SSH push,未 amend / force)。

前四点你已确认保留不变。针对本条评论中 T37 向量与正文不一致的点,按既定 Decision 做了最小修复:

  1. 原 T37-N3(普通命令模式 expected 非 null)改列为 V32-N1:规格期 InvalidExecutionSpec,不启动、不造 record,移出 coverage.T37 与 T37 acceptance。
  2. 原 T37-N4(评测模式 expected 为 null)改列为 V32-N2:同样是规格期 InvalidExecutionSpec,不造 record,移出 T37。
  3. 新增 V32-N3:评测模式 expected 非 null 却不等于冻结 recipe.code_sha256,规格期 InvalidExecutionSpec、不造 record,且 t37_pre_start_actual_entrypoint_check_reached=false;用以区分「规格拒绝」与「T37:expected 已等于 recipe 后实际入口不匹配」。
  4. 原 T37-N5(缺 key)改列为 SCHEMA-N1:schema 层拒绝;error_layer=schema,error_class=schema_validation_failure,invalid_execution_spec=false。明确不得把 schema validator 等同运行时 InvalidExecutionSpec / PublicError。
  5. coverage.T37 现仅为 ["T37-P1", "T37-N1", "T37-N2"];新增 coverage.V32 与 coverage.SCHEMA。ACCEPTANCE-T01-T40.md 的 T37 行、D023.md、SCHEMA-AND-SEMANTICS.md、fixtures/README.md、docs/contracts/README.md 已一致化。对 docs/contracts 全量搜索已无 T37-N3 / T37-N4 / T37-N5 残留。
  6. 未改 schema 约束,未扩大实施;历史 t108-v4 golden 与 MANIFEST-d023.json 哈希锚点未涉及、未改。

仓库外独立校验(verify-p0a.py,非本 PR CI):213 checks,0 failures。覆盖 schema 结构(仍仅 CommandStep 增加 required 可空 expected_code_sha256)、历史字节、当前 execution-spec-d023.json 的 request_digest 锚点(sha256:be0fb47b3b9b8b064a42758ec5b83a20cab92359b2fd50f9ad68305cf7517980)、T37 coverage 收窄、V32/SCHEMA 错误分类,以及文档中无遗留 T37-N3/N4/N5。

本回复不加审查提醒、不催审。本 PR 未加 tests/源码/门禁,也未合并。

amy-why-3459
amy-why-3459 previously approved these changes Nov 11, 2026

@amy-why-3459 amy-why-3459 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM

增量 31ae580eb835562dee0cf733d652405218b58dc7 … 3fe74f4a7cd3dacb4072d0aa8d37b0c0c8cecbb5:T37-N3/N4/N5 已改列为 V32-N1/N2 与 SCHEMA-N1,并补了 V32-N3,expected_outcome 写明了 InvalidExecutionSpec、不建 record。coverage.T37 现在只剩 P1/N1/N2。我本地复核过:coverage 与 case 一一对应,没有残留的 T37-N3..N5 引用,新增的示例摘要格式合法,schema 未改,仍是 106 个定义,MANIFEST-d023 的字节和哈希也仍然一致。我之前提的意见都已处理。本 Approve 只针对契约文件的机器一致性;设计层面仍按 PR 正文所说走正式架构 review。

@Dong1017

Copy link
Copy Markdown
Collaborator Author

@Dong1017 Can you review again

@cursor

cursor Bot commented Nov 11, 2026

Copy link
Copy Markdown

PR review verdict — DO NOT PASS

不能对声称的新 head 3fe74f4a7cd3dacb4072d0aa8d37b0c0c8cecbb5 给出 PASS。上一次有文件级结论的独立 review 停在 31ae580eb835562dee0cf733d652405218b58dc7(amy-why-3459,https://github.com/InferMatrixLab/InferRSI/pull/391#issuecomment-6787498196)。本轮没有打开 3fe74f4a 上的 docs/contracts/,作者说明仍待复核。

仍开放

  • T37 与规格期分流。在 31ae580e 上,fixtures/d023-conformance-cases.json 仍把 T37-N3(普通命令模式 expected 非 null)、T37-N4(评测模式 expected 为 null)、T37-N5(缺 key)算进 coverage.T37,而 SCHEMA-AND-SEMANTICS.md V32、D023.md、ACCEPTANCE-T01-T40.md 的 T37 行和 CommandStep.$comment 写明这些是登记前的 InvalidExecutionSpec,且 T37 只有 N1/N2。这三条的 failure 只写了 “V05/V32 rejects”,没有 InvalidExecutionSpec。同一轮可选缺口:评测模式 expected 非 null 且 ≠ recipe.code_sha256 没有向量。

作者说明(https://github.com/InferMatrixLab/InferRSI/pull/391#issuecomment-6787660189)称 3fe74f4a 已把这三条改为 V32-N1、V32-N2、SCHEMA-N1,并补上 V32-N3(不等值、InvalidExecutionSpec、不造 record、t37_pre_start_actual_entrypoint_check_reached=false),coverage.T37 收成 T37-P1 / T37-N1 / T37-N2,schema 约束未改。这与上一轮要求的修正一致。在读到该 head 的文件之前,这一条仍算开放。

已在 31ae580e 关闭(作者称 3fe74f4a 未再改这些点)

  • V32 已删掉 schema 不可能出现的「recipe 声明了代码摘要」分支,OperationRecipe.code_sha256 仍为必填非空 Sha256。
  • fixtures/README.md 已写明历史 fixtures/<name> 对应 fixtures/t108-v4/<name>,历史 MANIFEST 字节保持不动。
  • 本 PR 不加 tests/ 或 .github/ 一致性守卫;docs/contracts/README.md 已写明,留给后续架构 review。这一处理方式已被接受。
  • fixtures/MANIFEST-d023.json 锚住 execution-spec-d023.json:2069 字节,sha256:be0fb47b3b9b8b064a42758ec5b83a20cab92359b2fd50f9ad68305cf7517980,与 request_digest 及冻结 recipe 的 expected_code_sha256(ba351e8f…5332)一致。

本轮未核对

  • 3fe74f4a 的 diff 与 docs/contracts/ 文件。
  • schema 是否仍为 106 个 $defs、约束未改、仅 $comment 有过更新。
  • 全目录是否已无 T37-N3 / T37-N4 / T37-N5;V32-N1..N3 的 expected_outcome 是否为 InvalidExecutionSpec 且不建 record;SCHEMA-N1 是否为 error_layer=schema、invalid_execution_spec=false。
  • 历史 t108-v4 golden 与 MANIFEST-d023.json 是否未改。
  • 仓库外 213 checks,以及 CI。

合入本 PR 仍不等于勾选 #387 验收框,也不等于 P0b/K01 已接受。下一次能读到 3fe74f4a 的文件时再复审这一条。

Dong-bot

Copy link
Copy Markdown
Collaborator Author

对 #391 (comment) 的澄清。

该意见是 conversation comment,不是 formal review,提交于 Asia/Shanghai 2026-11-11 14:02:20(2026-11-11T06:02:20Z)。它自身写明:不能对声称的新 head 3fe74f4a7cd3dacb4072d0aa8d37b0c0c8cecbb5 给出 PASS,因为本轮没有打开该 head 上的 docs/contracts/。PR 当前 head 仍是该 SHA,base 仍是 4b3afa55f278ca314e07d5f8acbd0a18f3fa72bf。因此这是未读当前 head 文件而下的 DO NOT PASS,不是在 3fe74f4a 上新发现的文档缺陷。本轮不采信该 verdict。

3fe74f4a(3fe74f4a7cd3dacb4072d0aa8d37b0c0c8cecbb5)的 parent 是 31ae580eb835562dee0cf733d652405218b58dc7,提交于 Asia/Shanghai 2026-11-11 13:10:23,只改 6 个 docs/contracts/ 文件(+85/−30),不含 schema 文件、历史 t108-v4 golden 或 MANIFEST-d023.json。

本轮已在当前 head 独立打开上述 6 个文件的完整内容,确认该评论标为「仍开放」的 T37 / 规格期分流已在 3fe74f4a 落地:

  • fixtures/d023-conformance-cases.json:coverage.T37 仅为 T37-P1 / T37-N1 / T37-N2;V32-N1/N2/N3 的 error_class 为 InvalidExecutionSpec,record_created=false;V32-N3 含 t37_pre_start_actual_entrypoint_check_reached=false;SCHEMA-N1 为 error_layer=schema、error_class=schema_validation_failure、invalid_execution_spec=false。该文件中无 T37-N3 / T37-N4 / T37-N5 case。
  • 同 head 的 ACCEPTANCE-T01-T40.md T37 行与第 5 节、D023.md D023-2、SCHEMA-AND-SEMANTICS.md V32、fixtures/README.md 与 docs/contracts/README.md 已一致。

该评论将「上一次有文件级结论的独立 review」停在 31ae580e 的 amy 评论。事实上 amy-why-3459 已在同一当前 head 3fe74f4a 提交 Approve(https://github.com/InferMatrixLab/InferRSI/pull/391#pullrequestreview-5854170990,Asia/Shanghai 13:12:05),并写明只覆盖机器一致性。本轮文件核对与该 Approve 所述事实一致,但不把该 Approve 当作架构接受,也不把 bot comment 计入合格批准。

GitHub checks(head 3fe74f4a,7/7 completed success,Asia/Shanghai 13:11–13:16):lint-and-smoke、declarations、pr-references、installed-package (3.10/3.11)、full-check (3.10/3.11)。本轮未重跑仓库外 213 项核验,也未重算 execution-spec-d023.json 字节或重数 schema 106 个 $defs;3fe74f4a 未改这些文件。当前 MANIFEST-d023.json 仍记 bytes=2069、sha256/request_digest 为 sha256:be0fb47b3b9b8b064a42758ec5b83a20cab92359b2fd50f9ad68305cf7517980、expected_code_sha256=ba351e8f…5332。

本轮未改文件、未新开 commit、未合并。合入仍等待第二张合格 Approve;合入不等于勾选 #387 验收框,也不等于 P0b/K01 已接受。

Rename ordinary contract documents to lowercase kebab-case, translate
human-readable text to English, sync the eight mermaid sources with
figures.md, and restate D022 exit 2 on the T39(b) AssessorError row.
Schema, fixture data, and historic golden bytes are unchanged.

Agent-assisted-by: Grok Bot
Signed-off-by: GUOGUO <xwdong1998@163.com>
@Dong1017 Dong1017 changed the title docs: P0a 契约/schema/fixtures 与 D023 勘误 docs: P0a contracts, schema, fixtures, and D023 errata Nov 11, 2026

Copy link
Copy Markdown
Collaborator Author

@amy-why-3459 @zengchuang-hw Please re-review this PR on the current head.

This update is a readability pass plus the remaining review nits: ordinary contract documents were renamed to lowercase kebab-case and rewritten in English, the eight mermaid sources were synced with figures.md (including the pre-start digest branch and expected_code_sha256 / in-process closure labels), and T39(b) now restates D022's exit 2 for the AssessorError result-contract case. Schema, fixture data, and historic t108-v4 golden bytes are unchanged (106 $defs; MANIFEST-d023.json still records 2069 bytes and request_digest sha256:be0fb47b3b9b8b064a42758ec5b83a20cab92359b2fd50f9ad68305cf7517980).

New head: 892443898ed016c770e60a92ca377c3981e87f96 (docs: English readability pass and figure/T39(b) review nits).

Entry: docs/contracts/README.md — reading order, status, and the former-filename map. Decision, validation, and acceptance IDs (D / V / T) are retained.

Former → current names:

  • CURRENT-DESIGN.md → current-design.md
  • SCHEMA-AND-SEMANTICS.md → schema-and-semantics.md
  • DTO-FIELD-INDEX.md → dto-field-index.md
  • D008-FUNCTION-OWNERS.md → function-owners.md
  • D020-D022.md → isolation-errors-and-cli.md
  • D023.md → p0a-contract-errata.md
  • GATE-STORE-AND-FIRST-PRS.md → gate-policy-runstore-and-first-prs.md
  • ACCEPTANCE-T01-T40.md → acceptance-criteria.md
  • FIGURES-ALL.md → figures.md
  • diagrams/387-1.mmd → diagrams/public-ports-and-primitives.mmd
  • diagrams/387-2.mmd → diagrams/execute-to-assess-handoff.mmd
  • diagrams/387-3.mmd → diagrams/knowledge-read-and-internal-schema.mmd
  • diagrams/387-4.mmd → diagrams/legacy-run-v0-exit-codes.mmd
  • diagrams/387-5.mmd → diagrams/target-port-topology.mmd
  • diagrams/387-6.mmd → diagrams/end-to-end-handoff-and-replay.mmd
  • diagrams/387-7.mmd → diagrams/migration-overview.mmd
  • diagrams/371-1.mmd → diagrams/apps-assembly-sequence.mmd

README.md and fixture/schema data names are unchanged.

A new head dismisses previous Approves, including the earlier machine-consistency Approve on 3fe74f4a. Checks on this commit will need to go green again. This PR remains documentation-only; merging it is not a #387 checkbox and is not acceptance of P0b or K01.

Copy link
Copy Markdown
Collaborator

增量 review:3fe74f4a7cd3dacb4072d0aa8d37b0c0c8cecbb5 … 892443898ed016c770e60a92ca377c3981e87f96,新增 1 个 commit(89244389,文件重命名、英文改写,以及 figure/T39(b) 的修正)。这一轮先评论,暂不 Approve。剩下一处小的不一致,见下文。

本地已核对通过

  • 数据文件没有改动:schemas/、fixtures/*.json、fixtures/t108-v4/** 在两个 head 之间逐字节相同。docs/contracts/ 下仍是 47 个文件。
  • 改写后可追溯性没有丢:新旧两个 head 的 md/mmd 中出现的 D/V/T/H/K/A00 编号集合完全相同,40/64 位哈希值集合也完全相同。
  • 新 head 上所有 md 相对链接都能解析。除 README.md 的新旧文件名对照表外,md/mmd 中已没有引用旧文件名的地方。
  • diagrams/ 下 8 个 .mmd 与 figures.md 中的 8 个 mermaid 块逐字一致。
  • T39(b):acceptance-criteria.md L59 的 AssessorError 类结果契约错误 / exit 2,与 isolation-errors-and-cli.md L109、L147(D022 中 “其他 PublicError → error / 2”)一致。
  • 这个 head 上 CI 的 8 个 check 全部通过。

需要确认或修改

  1. fixture 数据里还留着旧文件名。 fixtures/d023-conformance-cases.json L5 的 scope 写的是 “…mapped onto T36-T40 of ACCEPTANCE-T01-T40.md…”,而这个文件已经改名为 acceptance-criteria.md。我理解 README.md L80 把这个 JSON 列为“数据名不变”,而且它不在任何 manifest 的哈希范围内。建议二选一:
    • 把这一处改成 acceptance-criteria.md。这个文件没有被 MANIFEST-d023.json 或 t108-v4/MANIFEST.json 锚定,改了不会影响已登记的哈希。
    • 或者在 fixtures/README.md 中注明,fixture 内的文件名沿用旧名,按 README.md 的对照表映射。

说明:本轮核对的是机器可查的一致性,包括编号和哈希集合、链接、figure 同步、数据文件字节,以及 T39(b) 与 D022 是否对应。英文改写有没有逐句保持原有语义,我没有逐条对照中英文本,这部分请正式架构 review 一并看。

Reviewed: 3fe74f4a7cd3dacb4072d0aa8d37b0c0c8cecbb5 → 892443898ed016c770e60a92ca377c3981e87f96。

Replace the leftover former filename in the scope string of
fixtures/d023-conformance-cases.json. Vectors, coverage, schema,
and historic golden bytes are unchanged.

Agent-assisted-by: Grok Bot
Signed-off-by: GUOGUO <xwdong1998@163.com>
amy-why-3459
amy-why-3459 previously approved these changes Nov 11, 2026

@amy-why-3459 amy-why-3459 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM

PR review verdict — PASS
Reviewed base 4b3afa55f278ca314e07d5f8acbd0a18f3fa72bf and head 2640b954d54188b40beb938a67ee57c1165a68db. Incremental range: 892443898ed016c770e60a92ca377c3981e87f96 → 2640b954d54188b40beb938a67ee57c1165a68db (one commit, 2640b954).

  • My only open point from the previous comment is fixed. The scope field in fixtures/d023-conformance-cases.json L5 now points to acceptance-criteria.md. This commit changes only that string. The JSON still parses, and coverage is unchanged (T36/T37/V32/SCHEMA/T38/T39/T40). No manifest anchors this file, so no recorded hash is affected.
  • Outside the README name-map table, docs/contracts has no remaining references to old file names.
  • What I checked at 89244389 still holds. The schema and the historical fixture bytes are unchanged. The sets of ID numbers and hashes are complete, all links resolve, and the 8 figures match figures.md.
  • CI at this head: lint-and-smoke, declarations, pr-references and installed-package (3.10/3.11) have passed. full-check (3.10/3.11) was still running when I looked. The previous head with the same code passed all checks.

As before, this Approve covers only the machine consistency of the contract files. The design decisions and the semantic accuracy of the English rewrite still go through formal architecture review, as the PR body says.

@Dong1017

Copy link
Copy Markdown
Collaborator Author

@Dong1017 PTAL

@cursor

cursor Bot commented Nov 11, 2026

Copy link
Copy Markdown

Still open on head 892443898ed016c770e60a92ca377c3981e87f96: one stale filename in the conformance fixture.

fixtures/d023-conformance-cases.json scope (amy-why-3459: about L5) still says ACCEPTANCE-T01-T40.md. That document is now acceptance-criteria.md. The JSON sits outside both manifest hashes (MANIFEST-d023.json and fixtures/t108-v4/MANIFEST.json), so changing that string leaves the registered digests as they are. Alternative: note in fixtures/README.md that fixture text keeps the old name and readers map it through the former-name table in docs/contracts/README.md.

That is the only open item in the file-level pass on 3fe74f4a7cd3dacb4072d0aa8d37b0c0c8cecbb5 … 892443898ed016c770e60a92ca377c3981e87f96 (#391 (comment)). The same pass already accepted: schema and fixture bytes unchanged across that range, D/V/T/H/K/A00 ids and hash sets preserved, relative links resolve, the eight .mmd sources match figures.md, T39(b) AssessorError / exit 2 matches D022 in isolation-errors-and-cli.md, and CI on that head was 8/8 green.

This reply uses the PR body and thread. The tree and diff were not opened again here, so the L5 string is still the open item until a later head shows the edit or the README mapping. Sentence-level fidelity of the English rewrite remains with the formal architecture review. A fix is a new head; the machine-consistency Approve on 3fe74f4a stays dismissed. Merge still needs two eligible Approves on the current head. Merging this PR does not check a #387 acceptance box and does not accept P0b or K01.

Dong-bot

@zengchuang-hw zengchuang-hw left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

PR review verdict — DO NOT PASS

Reviewed base 4b3afa55f278ca314e07d5f8acbd0a18f3fa72bf and current head 2640b954d54188b40beb938a67ee57c1165a68db. This is my first published review on #391, consolidating the full review at b48eac04 and the incremental ranges through 31ae580e, 3fe74f4a, 89244389, and 2640b954. Latest incremental range: 892443898ed016c770e60a92ca377c3981e87f96 → 2640b954d54188b40beb938a67ee57c1165a68db.

Required before approval

P2: T36-N2 must distinguish the full payload byte digest from the projected semantic identity.

fixtures/d023-conformance-cases.json:106–113 correctly says that moving only a schema-declared ArtifactRef.location is stripped by P and preserves prepared_id, but its invariant then states “a distinct canonical byte change yields a distinct identity” without qualifying the identity or the bytes.

I reproduced the distinction with the checked-in fixtures/t108-v4/prepared.json: change only protocol.location to elsewhere/protocol.json. Both objects validate. Their full canonical payload SHA-256 values differ (8450cf59…a3d30ff versus acfe6637…fbcd72d), while the recomputed projected prepared_id stays sha256:7f481e7e61c98343015118d7dcd98806abe863398b2c16dacac125d2d00ed486. This follows the identity table.

Please name the two domains explicitly: a changed full canonical payload requires a new payload/artifact byte digest, while prepared_id is recomputed from its specified P-projected input and is unchanged for a location-only move. Qualify or replace the unbounded invariant so an implementation cannot turn relocation into a semantic identity change. This requires no change to historical golden bytes. The same distinction is now explicit in the #371 T36 clarification: location-only relocation preserves prepared_id, while the new archive digest follows the new prepared bytes; #391's unqualified invariant has not yet been aligned.

Resolved in the reviewed increments

  • T37 ownership is consistently the later H evaluation-mode bind/execute slice, not ordinary-command H02.
  • Spec-time V32 cases and the schema missing-key case are separated from T37; expected non-null but unequal to the recipe is covered. No-start/no-record and error layers are explicit.
  • The current D023 spec has its byte/request_digest anchor; historical manifest paths are mapped without rewriting their bytes.
  • All eight diagram sources now match figures.md; T39(b) restates the existing D022 AssessorError → exit 2.
  • 2640b954 fixes the last old filename in the conformance fixture's scope string. I agree that Amy's latest machine-consistency point is closed; the old-name bot comment does not reopen it.

Non-blocking wording fixes

  • schema-and-semantics.md:42: the English rewrite says “no … trailing space”; restore “no insignificant spaces.” For example, {"x": 0} has no trailing space but is still noncanonical. The overview and unchanged spaces negative vector already preserve the correct rule.
  • p0a-contract-errata.md:66 and the matching DTO note call all four fields nullable. AppsResultV1.exit_code is required and non-null; qualify which fields permit null.
  • fixtures/README.md:23 says the historic manifest's own scope labels it historic, but that field does not. Correct the README rather than rewriting the frozen manifest.

Verification and limits

  • Read the repository review/contribution guidance, #387 t115 and #371, actual full changed files, later diffs, and current discussions. Compared the English rewrite against the preceding Chinese contracts.
  • Independently checked Draft 2020-12 validity, 106 definitions/544 references, required/closed fixed objects, 13 historical positive documents and seven schema negatives, all 22 historical file hashes, five identity/request goldens, typed projection counterexamples, current D023 canonical bytes (2069) and request_digest sha256:be0fb47b3b9b8b064a42758ec5b83a20cab92359b2fd50f9ad68305cf7517980, 23 vector IDs/coverage, 17 strict-byte negatives, and four canonical-byte negatives.
  • On 3fe74f4a, reran 54 CPU regression tests covering smoke, claims, legacy runtime, module boundaries, and import gates. On 89244389, reran 16 smoke/claim/boundary/import tests, checked 92 relative Markdown links and all eight diagram-source matches, and verified schema/fixture byte preservation. The source/tests are unchanged in these later documentation-only increments; I am not claiming a fresh 54-test run on this head.
  • For 89244389 → 2640b954, verified the complete remote file blob and parsed JSON: only the scope filename changes; all 23 cases, coverage, and digest examples are identical. Current head's seven GitHub checks are successful.
  • No full local repository suite, local wheel/host/cross-language run, or production D023 runtime acceptance was executed. Documentary vectors are not implemented runtime tests. P0b's separate manifest/gate review is outside this PR's implementation scope.

This COMMENT records the outstanding review finding; it is not an approval or acceptance of #387/P0b/K01.

Qualify T36-N2 so a location-only ArtifactRef move changes the
complete payload byte digest but leaves the P-projected prepared_id
unchanged. Restore the canonical "no insignificant spaces" rule,
state that AppsResultV1.exit_code is required and non-null, and
correct the historic manifest scope wording in the fixtures README.

Schema, historic golden bytes, and digest anchors are unchanged.

Agent-assisted-by: Grok Bot
Signed-off-by: GUOGUO <xwdong1998@163.com>

Copy link
Copy Markdown
Collaborator Author

@amy-why-3459 @zengchuang-hw

Please re-review this PR on the new head 8885b729621cbd17f8389f213081f051df61c65a.

This commit addresses the findings in #391 (review) and aligns T36-N2 with the #371 clarification at #371 (comment):

  • T36-N2 now distinguishes the complete payload/artifact byte digest from the P-projected prepared_id. Changing only a schema-declared ArtifactRef.location changes the complete canonical payload digest and leaves prepared_id unchanged. Historic golden bytes were not modified.
  • schema-and-semantics.md restores the canonical rule “no insignificant spaces.”
  • p0a-contract-errata.md and dto-field-index.md no longer describe AppsResultV1.exit_code as nullable; it is required and non-null. error, primary_scope, and primary_claim_id may be null.
  • fixtures/README.md no longer claims that the historic manifest's own scope field labels it historic. The frozen manifest was left unchanged.

Schema, historic goldens, manifests, and digest anchors are unchanged. Independent checks: 22 historic file hashes, D023 example request_digest sha256:be0fb47b3b9b8b064a42758ec5b83a20cab92359b2fd50f9ad68305cf7517980 (2069 bytes), 23 vectors and coverage, 8 figure sources matching figures.md, and 92 relative Markdown links.

@amy-why-3459 amy-why-3459 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM

增量 review:2640b954d54188b40beb938a67ee57c1165a68db … 8885b729621cbd17f8389f213081f051df61c65a,新增 1 个 commit(8885b729),只改了 5 个 docs/contracts/ 文件(+7/−6)。

这次增量逐条处理了 @zengchuang-hw 在 review 5856112965 中的意见,我核对如下:

  • T36-N2(P2):fixtures/d023-conformance-cases.json L105–117 现在明确区分了两个摘要域。只移动 schema 声明的 ArtifactRef.location 时,完整 canonical payload 的字节摘要会变,而经 P 投影计算的 prepared_id 不变。原来那条没有限定的不变式已经替换为两条有限定的不变式。prohibited_inferences 保留不变。JSON 可以正常解析,共 23 个 case,coverage 的键(T36/T37/V32/SCHEMA/T38/T39/T40)没有变化。
  • canonical 空格规则:schema-and-semantics.md L42 已改回“no insignificant spaces”,与 current-design.md L190 一致。docs/contracts 下已没有残留的“trailing space”写法。
  • AppsResultV1.exit_code:p0a-contract-errata.md L66 和 dto-field-index.md L126 现在写明 exit_code 必填且非 null,另外三个字段可以为 null。这与 schema 一致:exit_code 是非 null 的 enum,error、primary_scope、primary_claim_id 都是 anyOf [..., null],四个字段都在 required 中。schema 仍是 106 个 $defs。
  • fixtures/README.md L23:已不再声称历史 manifest 的 scope 字段自带 historic 标记。我核对过 t108-v4/MANIFEST.json 的 scope 原文,确实没有这个标记,manifest 本身也没有改。
  • 这个 commit 没有动 schema、历史 golden、MANIFEST-d023.json 或任何 manifest 锚点。
  • 我查看时,本 head 的 CI 中 lint-and-smoke、declarations、pr-references、installed-package (3.10/3.11)、full-check (3.11) 均已通过,full-check (3.10) 仍在运行。

和之前一样,这个 Approve 只覆盖契约文件的机器一致性。设计决策和英文改写的语义准确性,仍按 PR 正文所说走正式架构 review。

@zengchuang-hw zengchuang-hw left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

PR review verdict — PASS

Reviewed base 4b3afa55f278ca314e07d5f8acbd0a18f3fa72bf and head 8885b729621cbd17f8389f213081f051df61c65a. Incremental range: 2640b954d54188b40beb938a67ee57c1165a68db → 8885b729621cbd17f8389f213081f051df61c65a, following my previous review and the re-review request. This is an agent-assisted independent review for zengchuang-hw, under delegated scope to review this P0a PR and approve a verified revision with no outstanding blockers.

Findings closed

  • T36-N2: the revised outcome and invariants explicitly distinguish the complete payload/artifact byte digest from the P-projected prepared_id. I reran the location-only counterexample: the full payload hashes differ (8450cf59…a3d30ff → acfe6637…fbcd72d), while prepared_id remains sha256:7f481e7e61c98343015118d7dcd98806abe863398b2c16dacac125d2d00ed486. Both payloads validate. This agrees with the identity table and the #371 clarification; it does not permit arbitrary internal relocation.
  • The canonical rule again says no insignificant spaces.
  • Both AppsResult notes now agree with the schema: all four fields must be present; exit_code is non-null, while error, primary_scope, and primary_claim_id may be null. Independent missing/null mutation checks confirm this.
  • The README correctly locates the historic label outside the frozen manifest's scope. Historical bytes were not rewritten.

No remaining blocker from my previous review, and no new blocker found in the five-file increment.

Verification on this revision

  • Read the complete five changed blobs and verified their Git blob hashes. Parsed vector changes are confined to T36-N2's location-only outcome and invariants; the 23 IDs and coverage remain intact. Source, tests, schema, historical goldens, manifests, and digest anchors are unchanged.
  • Reran the independent contract checks: Draft 2020-12 / 106 definitions / 544 references, closed required fields, 13 baseline documents and seven schema negatives, all 22 historical file hashes, five identity/request goldens and typed projection counterexamples, 17 strict-byte rejection vectors and four canonical-byte negatives. Historical pre-D023 specs retain their documented current-schema mismatch.
  • Recomputed the current D023 example and checked its manifest: 2069 bytes; request_digest=sha256:be0fb47b3b9b8b064a42758ec5b83a20cab92359b2fd50f9ad68305cf7517980. All 92 relative Markdown links resolve; all eight diagram sources match figures.md.
  • Reran 54 CPU regression tests, all passed: test_smoke.py, test_claim.py, test_runtime.py, test_module_boundaries.py, and test_target_module_import_gate.py. The only warning was an AnyIO pytest-plugin deprecation.
  • Current-head GitHub checks are all successful, including both full-check and installed-package Python versions; knowledge-model-policy is successful / not applicable.

The complete earlier review remains the baseline; this is an incremental re-review, not a second full repository audit. Local verification did not run the entire repository suite, wheel/host/cross-language scenarios, or production D023 acceptance. The documentary vectors are still specifications, not implemented runtime tests.

This approval covers #391's P0a documentation/schema/fixture change only. It does not mark #387 or #371 accepted, authorize P0b/K01, clear P0b's separate manifest review, merge this PR, or claim the runtime implementation is complete.

@Dong1017
Dong1017 merged commit 0da7e2f into main Nov 11, 2026
8 checks passed
@Dong1017
Dong1017 deleted the docs/p0a-contracts-v1 branch November 11, 2026 09:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:harness Harness module: profile, A/B loop, quality gates, evidence reports area:knowledge Knowledge line: packs, skill library, knowledge admission kind:docs Documentation and template delivery

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants