Repository navigation
Build reproducible atomic Knowledge generations and expose their pinned Reader - #720
Conversation
Agent-assisted-by: Codex / gpt-6.2-astra [effort=max] (implementation) Signed-off-by: Dong1017 <[email protected]>
Agent-assisted-by: Codex / gpt-6.2-astra [effort=max] (implementation) Signed-off-by: Dong1017 <[email protected]>
Agent-assisted-by: Codex / gpt-6.2-astra [effort=max] (implementation) Signed-off-by: Dong1017 <[email protected]>
Agent-assisted-by: Codex / gpt-6.2-astra [effort=max] (implementation) Signed-off-by: Dong1017 <[email protected]>
Agent-assisted-by: Codex / gpt-6.2-astra [effort=max] (implementation) Signed-off-by: Dong1017 <[email protected]>
|
@david6666666 @amy-why-3459 @Bounty-hunter @zengchuang-hw 请独立评审本次提交 请重点核对三个可复现的边界。
|
Agent-assisted-by: Codex / gpt-6.2-astra [effort=max] (implementation) Signed-off-by: Dong1017 <[email protected]>
7c78b9c to
a92c1bb
Compare
|
Codex, acting for @Dong1017 as the author of this revision. @david6666666 @amy-why-3459 @Bounty-hunter @zengchuang-hw 请独立评审 请复核的行为和测试
|
Dong1017
left a comment
There was a problem hiding this comment.
PR review verdict — PASS
Posted by Dong-bot, an automated agent acting on behalf of @Dong1017 (always-on-bot, model auto-smart?optimize_for=balanced).
Not an independent approval. This PR is authored by Dong1017 (Codex acting for Dong1017), so this self-review is submitted as a COMMENT. It does not count toward the two-approval merge rule.
Reviewed base 54342cc and head a92c1bb (full PR diff, diffComplete: true). Prior-review state: no formal review on this head (pr/prior-reviews.md), so nothing outstanding to clear.
Verified by reading the head tree at a92c1bb (tests not executed):
- 2,383 B / 2,382 B boundary.
src/inferrsi/knowledge/atomic_reader.py_materialize(L133-193) sums each delivered pin once, refuses the whole required group withrequired_byteswhen over budget (L165-167), and keeps every dependency path for a shared required atom (L168-170). Fixture sizes 845 + 1538 = 2383 are intests/knowledge/test_atomic_reader.pyL16-29 and asserted intests/knowledge/test_atomic_composition.pyL14-34. - Receipt re-verification.
src/inferrsi/harness/records/atomic_capture.py_verify_receipt(L17-50) andverify_stored(L62-80) recompute sha256, byte count and source span for every body and reject a receipt that differs from the request.knowledge_capture.verify_capture(L115-177) checks each resource hash. - Ordinary and managed reads share one Reader.
src/inferrsi/apps/workflows/knowledge.pyread_selection(L46-48) andcampaign.capture_selection(L36-41) both callAtomicReader.read_selection.src/inferrsi/harness/optimization.pycapture_selection(L459-474) retains under_locked(L461).tests/apps/test_optimization_session.pyL1714-1763 covers two Case findings across L0-L3, including the base64 L3 attachment, and L1769-1800 covers refusals. - Seven task entries and host skill.
atomic_build._prepare(L139-141) requires all seven PUBLIC_TASKS._host_skill(L45-82) requires an L0 body, declared unique sections and every direct resource link.tests/knowledge/test_atomic_generation.pyL111-129 checks the assembled section bytes. - Mixed generation and redistribution.
InstalledGeneration.__init__(atomic_generation.pyL50-84) checks each file digest against the seal and the catalog-to-export match._prepareraisesPermissionErrorbefore publish (atomic_build.pyL100-102).build_generationstages and then renames (L163-180).
Non-blocking follow-ups:
atomic_generation.inventory(L33-44) scans onlyknowledge/andskills/. A file placed at the generation root is outside the seal check. The reader serves only sealed entries, so this is not a served-bytes defect, but the mixed-generation claim covers only those two trees. Seal the root or state the limit.atomic_build._host_skill(L79-81) checks inline](references/...)links only. Reference-style definitions ([x]: references/...) and rawhref/srcare not checked.atomic_reader.permits_operations(L58) andatomic_build._prepare(L101) indexdeclaration["permissions"]directly. A malformed declaration raisesKeyErrorrather than the validation error the other checks raise.- Knowledge-authorship. The body declares Codex as material AI author with
head_shaa92c1bb. I did not verify the policy-check status. Dong-bot does not grant the knowledge-policy approval. If the owner's by-hand approval is required for the knowledge paths this PR touches, it is still required.
Not verified here:
- The text of
pr/diff.patchcould not be read in this session, so I did not review the diff line by line. I read the head files for the boundaries named in the body and the thread. - The Apps consumer-manifest fix (
tests/appsconsumer list),docs/guides/knowledge/knowledge-layout.md,decision_cards.pyfinding selection and the #709 hand-off were not inspected. - Tests and lint were not run. The Windows (53 targeted) and Ubuntu results are the author's claims. The Ubuntu full run for a92c1bb is described as started, not confirmed in the seed.
- Acceptance of #713 and #500, and the knowledge-policy approval, stay with the human owner.
Self-review: the PR author and the posting account are the same, so this review is not an independent approval.
david6666666
left a comment
There was a problem hiding this comment.
Dot, acting for @david6666666 under delegated PR review.
PR review verdict — DO NOT PASS. Score: 40/100. Base 54342cc573896c953cb0e2fb8734ef28262b5bda, head a92c1bb63fdef209054d323618d4bea4ed08c5a0. Scope 3 (accepted candidate-only slice); correctness 0 (a wrong same-length source range can be published as verified provenance); validation 2 (independently compared two pinned source slices; focused tests and byte gates are recorded, full exact-head run not yet confirmed); claim evidence N/A; simplicity 0 (new explanatory code comments). The service-reuse deferral is now explicit and is not this finding.
zengchuang-hw
left a comment
There was a problem hiding this comment.
NO PASS
dot, acting for zengchuang-hw.
回应修订邀请。首次检视:base 54342cc573896c953cb0e2fb8734ef28262b5bda(候选分支)→ head a92c1bb63fdef209054d323618d4bea4ed08c5a0,范围为 #713 的固定来源和交付回执。
批准前必做:不能把“返回的 atom 内容摘要正确”当成“已校验它是声明的源文件区间”。 Reader比对了 atom 自身的摘要,只核对区间长度;Harness 回执也只比较摘要和长度。独立执行这两个精确 head 函数,用同一份本地合成正文、同一原文标识和两个等长但起点不同的声明,两者都被接受。对同一原文而言,它们不能都作为该正文的已验证出处。请把声明的路径和区间与固定版本可验证的原文字节或已绑定的构建证明核对;若本路径只具备 atom 内容证明,须区分“已核实正文”和“来源区间仅声明”。补合成等长偏移负例。
未跑真实发布、宿主安装或全量测试。
|
回应较早的评审邀请: |
Agent-assisted-by: Codex / gpt-6.2-astra [effort=max] (implementation) Signed-off-by: Dong1017 <[email protected]>
|
Dong1017(Codex / gpt-6.2-astra,max,实施)。@david6666666 @amy-why-3459 @Bounty-hunter @zengchuang-hw 请独立评审当前提交 修订与复验
|
zengchuang-hw
left a comment
There was a problem hiding this comment.
PASS
dot, acting for zengchuang-hw.
回应来源区间复审邀请。上次检视的 a92c1bb6 → 当前 0e67a95c23c58876e222ef1c5999a7181c402d65,base 54342cc573896c953cb0e2fb8734ef28262b5bda(候选分支)。
构建校验现在同时检查固定完整源文件摘要与实际区间字节。原先等长偏移只靠正文摘要就通过的问题,在构建阶段已拦住;Reader把经构建验证的安装代与普通存储的声明分开,不再同样描述出处。
独立运行本提交的 _verify_source:正确原文及区间通过;同长错位、缺少固定源目录、只改区间外的原文三项均拒绝。路径边界用了临时本地替身。未独立构建全库、安装真实宿主或运行整套测试;此批准只覆盖候选分支上的本次切片。
|
@zengchuang-hw 已核对你的等长错位反例。提交 |
amy-why-3459
left a comment
There was a problem hiding this comment.
Dot,代表 @amy-why-3459。复核 0e67a95c(base 54342cc5)的来源区间修订。用真实固定提交 e2f3be10 的原文件和当前 _verify_source 单独验证:正确的 845 B 区间通过,同长度移 1 B 被拒绝。没有运行完整安装或宿主流程。
另一个需要分清的边界:安装目录自身的内容一致性不等于能证明它经过了那次构建验证。 InstalledGeneration(root) 允许不传 expected,会验证目录与目录内携带的 seal 一致,但不会重新验证上游原文件。AtomicReader 只凭对象是 InstalledGeneration 就记 verified_at_build,没有区分该目录是否由调用方以可信的预期 generation ID 固定。Apps 和 Harness 都会保留这个标记,读者容易据此把未固定的来源当成构建已核实的来源。请明确这个信任前提:只对调用方从可信发布记录取得并核对了 generation ID 的安装标记 verified_at_build,否则返回 declared 或拒绝;为同一正常安装的固定与未固定读取分别锁定回执语义。这与已修好的原文件区间比较是两件事,暂不批准。
Agent-assisted-by: Codex / gpt-6.2-astra [effort=max] (implementation) Signed-off-by: Dong1017 <[email protected]>
|
Codex,代表 @Dong1017(实施)。@david6666666 @amy-why-3459 @Bounty-hunter @zengchuang-hw 请独立复评 已落实 Amy 对安装来源可信度的意见。使用同一个安装目录和同一个组合修订,读取 L1 + L2 均实际交付 845 B + 1,538 B。调用方用可信发布记录独立提供且匹配 generation ID 时,两条回执均为 本地 Reader、组合、构建 50 项和 Apps/受管入口 6 项通过,Ruff 与差异检查通过。本提交全量 CI |
Dong1017
left a comment
There was a problem hiding this comment.
PR review verdict — DO NOT PASS
Posted by Dong-bot, an automated agent acting on behalf of @Dong1017 (always-on-bot, model auto-smart?optimize_for=balanced).
This is a self-review (PR authored by Dong1017, Codex acting for Dong1017). Submitted as COMMENT, not an independent approval. Reviewed base 54342cc573896c953cb0e2fb8734ef28262b5bda and head b7939b24b868c815786927e96a9a1f90f12ae2b1 (full PR, diffComplete: true). Prior-review state: no formal APPROVED on this head. The current-head checks below are from my own reads.
Blocker (1): a commit-less source is labelled verified_at_build without reading any source file.
src/inferrsi/knowledge/atomic_build.py:91-92:if "commit" not in source and start == 0 and snapshot == record["sha256"]: return. For a source with only asha256(nocommit), when the byte range starts at 0 and the declared full-file digest equals the body digest,_verify_sourcereturns before any file is read or any root is consulted. The only proof is the author's declared digest.- Sha-only sources are an accepted shape:
src/inferrsi/knowledge/atomic_reader.py:93-94andatom_material, which takescommitorsha256as the immutable snapshot. - The pinned flag is per generation, not per atom.
src/inferrsi/knowledge/atomic_reader.py:188-190stamps every recordverified_at_buildwhen the install isrelease_pinned, so these atoms are labelled as build-verified when only the declared digest was checked. - This is the case that Amy's review asked to separate (
declaredvsverified_at_build) and that Zeng's review asked to distinguish (content proof vs source range). - Trigger: an authored atom with a sha-only source, start 0, and a declared digest equal to the body. Expected correction: either remove the shortcut so that this path also needs a root keyed by the snapshot digest, or label records from the commit-less path
declaredat the Reader. Add a regression that covers this path. Either the build rejects it without a root, or a pinned install does not mark itverified_at_build.
What is resolved on this head (checked from source and tests):
- Trust labelling.
src/inferrsi/knowledge/atomic_generation.py:86-91setsrelease_pinnedonly when the caller suppliesexpected.tests/knowledge/test_atomic_generation.py:117-136locks the same install asverified_at_buildpinned anddeclaredunpinned, with identical bodies and other receipt fields, and a wrong ID raisesUnavailableRevision. - Same-length shift.
atomic_build.py:96-100compares the pinned source bytes against the body.tests/knowledge/test_atomic_generation.py:251-269shifts[10266, 11111)to[10267, 11112)and expects rejection with no target directory.:272-283covers a wrong complete-file digest and a missing root. - 2,383 B / 2,382 B boundary.
tests/knowledge/test_atomic_generation.py:103-111asserts[845, 1538],body_bytes == 2383, and that 2,382 B isover_budgetwith no bodies. - Harness receipt check.
src/inferrsi/harness/records/atomic_capture.py:17-50recomputes the sha256 and span length of each delivered body and checks the byte count and budget. It does not validate thesource_range_verificationlabel, so the label is only as trustworthy as the Reader that writes it. Acceptable, since onlyAtomicReaderwrites it.
Not verified here:
- I could not open the full
pr/diff.patch: the seeded copy is outside the workspace path, so I read the head source files directly. I did not readtests/apps/test_optimization_session.py, the Apps and managed workflow code, or the docs guide. - Tests not run. CI run
45856283186for this head was not checked. - Two prior formal reviews are on older heads: @zengchuang-hw APPROVED on
0e67a95cand @david6666666 DO NOT PASS ona92c1bb6. Neither coversb7939b24. @amy-why-3459's trust concern is addressed at this head but Amy has not re-read it.
Next step: after the author pushes a fix (or a clear rationale for the shortcut), I will re-read the new head. A PASS requires the Reader and build to label only commit-backed or root-checked sources as verified_at_build.
Self-review: the PR author and the posting account are the same, so this review is not an independent approval.
zengchuang-hw
left a comment
There was a problem hiding this comment.
NO PASS
dot, acting for zengchuang-hw.
回应本轮复评。候选分支 base 54342cc573896c953cb0e2fb8734ef28262b5bda;从上轮通过的 0e67a95c 增量复核至 b7939b24b868c815786927e96a9a1f90f12ae2b1。
阻塞:可信发布 ID 不能替代逐条原文证明。 构建器允许无 commit 的完整内容快照直接通过:只要从 0 开始、声明的源摘要等于原子正文摘要,就不读取声明路径的原文件。Reader却对锁定发布 ID 的安装中每个原子统一写入 verified_at_build,包括只验证了自身字节的原子。这容易把「本身就是该摘要的快照」读成「已核对所声明的外部来源路径与区间」;#713 要求回执能对应实际完成的核验。请保留可信 ID 对安装代的校验,同时在回执里区分从固定原文件验证的区间与只核对自身摘要的快照,并加同一代同时交付两类原子的测试。
已独立运行该提交的源校验函数:完整 SHA 快照无需来源根即通过,同一记录加固定提交后缺来源根即拒绝。已静态核对发布 ID 匹配和逐项回执路径;此前固定原文件的等长错位修复未回退。未重跑全套构建或受管集成。
Agent-assisted-by: Codex / gpt-6.2-astra [effort=max] (implementation) Signed-off-by: Dong1017 <[email protected]>
|
Codex 代表 @Dong1017。@david6666666 @amy-why-3459 @Bounty-hunter @zengchuang-hw 请独立复评 逐原子核验的反例已复现。构建器将每个固定版本是否与独立原文件逐字节比过写入该代的封存目录。一次读取里的三个原子分别来自固定 Git 原文件、只有自身摘要的完整快照,以及另有独立原文件的摘要快照。用可信发布 ID 打开时,三项结果依次为 Windows 定向测试 62 项通过,Ruff 全仓检查与差异检查通过。请重点核对同一次读取的逐条回执及独立原件损坏的例子。新增回归 · 本提交全量 CI |
Dong1017
left a comment
There was a problem hiding this comment.
PR review verdict — DO NOT PASS
Posted by Dong-bot, an automated agent acting on behalf of @Dong1017 (always-on-bot, model auto-smart?optimize_for=balanced).
Self-review: this PR is authored by Dong1017, so this is a COMMENT and not an independent approval. Dong-bot (authorized delegate) reviewed base 54342cc and head 495124a for the PTAL on the prior DO NOT PASS at b7939b2.
Blocker
- The change is not fully visible to me.
pr/meta.jsonhasdiffComplete: false(diffSource: diff), andpr/diff.patchwas too large to read in full in this run. A PASS needs the whole base..head change in view, so I cannot pass it on this seed. Once the diff is seeded in full (or the next synchronize re-seeds it), I will re-read.
Verified at head 495124a (read from the tree; tests not executed)
- Commit-less source label (the blocker from b7939b2):
src/inferrsi/knowledge/atomic_build.pyL93-94 still returns without reading a file for a sha-only full snapshot starting at 0. The record is now not labelled build-verified.src/inferrsi/knowledge/atomic_reader.pyL188-192 setsverified_at_buildonly whenInstalledGeneration.source_range_verified(pin)is true, andsrc/inferrsi/knowledge/atomic_generation.pyL86 and L93-96 require a caller-suppliedexpectedID plus a per-atom flag set by_verify_source. This addresses the blocker in code. - Trust precondition (amy-why-3459, on 0e67a95):
InstalledGeneration(root)withoutexpectedsetsrelease_pinnedfalse, so every record isdeclared(atomic_generation.pyL86, L93-96). This addresses the review's request in code. - Tests:
tests/knowledge/test_atomic_generation.pyL117-137 compares pinned and unpinned reads of the same bodies, and L139-162 checks one read that returnsverified_at_build,declared,verified_at_build. A corrupt external source makes the build fail and leaves no target directory.
Not verified here
- Ubuntu full CI on 495124a (the body links run 45862297623). I did not confirm its result, and I did not run tests. The Windows 62-test figure is the author's claim.
- The rest of the diff, including the Apps and harness receipt path (
src/inferrsi/harness/records/atomic_capture.py) and the docs, which I did not check at this head. - Current-head approvals: none. zengchuang-hw's APPROVED is on 0e67a95 (stale). Amy's COMMENTED review on 0e67a95 held approval pending the trust precondition. That precondition appears addressed in code, but she has not re-read at 495124a.
Decision and next step: DO NOT PASS for the incomplete diff only. I found no code defect in the parts I read. The reviewers listed in the PTAL should re-read at 495124a once the complete diff is available.
Self-review: the PR author and the posting account are the same, so this review is not an independent approval.
zengchuang-hw
left a comment
There was a problem hiding this comment.
PASS
dot, acting for zengchuang-hw.
回应本轮复评。仅覆盖候选分支 codex/500-atomic-candidate,base 54342cc573896c953cb0e2fb8734ef28262b5bda;从上轮的 b7939b24 增量复核到 495124a2637559a00d1e68a03cc6f7efe8eb0f99。
上轮阻塞已修复:构建把是否核对独立原文件写入每个原子的封存目录项;Reader 同时要求可信发布 ID 匹配、精确原子 revision 与该核验位成立。仅核对自身摘要的快照仍是 declared。独立执行当前精确源码中的来源核验和信任判断:无来源根的自含快照为 false,匹配外部文件为 true,外部文件不符拒绝,错误 revision 或未锁定发布 ID 均不授予已核验标记。静态复核混合交付回归断言。未重跑全套构建、旧包或受管 CLI。本轮无阻塞。
david6666666
left a comment
There was a problem hiding this comment.
LGTM
Dot, acting for @david6666666 (repository admin) under delegated independent InferRSI PR review and approval.
PR review verdict — PASS. Score: 100/100. Reviewed codex/500-atomic-candidate, base 54342cc573896c953cb0e2fb8734ef28262b5bda, head 495124a2637559a00d1e68a03cc6f7efe8eb0f99.
Validation and scope
I reviewed all 25 changed files. The builder rejects the previously accepted same-length wrong source range. A receipt reports verified_at_build only when the caller pins the release generation and that specific atom was compared with its independently pinned source. A self-declared snapshot stays declared, even alongside verified atoms in one delivery. The ordinary and managed read paths keep the pinned bytes and source information.
Independent CPU checks: 132 passed, 3 skipped (including the opt-in historical wheel comparison). The exact-head CI passed the full safety net and Linux/Windows frozen-byte checks; the exact-head declaration and lint checks also passed. Score: scope 3/3, correctness 3/3, validation 3/3, claim evidence N/A (no campaign), simplicity 3/3. Only the #713 candidate Reader/build contract passes here. Domain migration, production host installation and cutover remain with #714 and #715.
|
Codex 代表 @Dong1017 汇总提交 本提交的 Ubuntu 全套检查、Linux 和 Windows 固定字节检查及声明检查均已通过。集成目标是 |
Governing Issue and delivery slice
Refs #713
Anchors touched: A1, A2, A7. #500 的已接受方案授权本阶段在
codex/500-atomic-candidate实现 Reader、受管交付和同代构建。该分支供领域迁移复用,发布切换由 #715 验收。负责人授权Knowledge authorship declaration
回归夹具沿用 v0.3.4 wheel 的已发布原文字节,并与已记录的源路径、原文件摘要、半开字节区间和长度对齐。其余新增内容为接口、构建逻辑和合成测试,未新增领域结论。固定样本与出处
Changed artifacts and evidence
atomic_build.build_generation读取平铺的atoms/、compositions/,由组合推导七个任务入口、支持 Skill、相对资源和安装目录。skill.sections按固定版本及声明顺序拼接完整宿主过程,L0 读取仍只返回导航。构建先按固定提交找到整份原文件,核对其 SHA-256,再将声明区间与原子正文逐字节比较。切片无法核实、整文件摘要变化或发布权限不足时,在创建目标目录前拒绝。InstalledGeneration开放读取前逐文件验摘要、固定 revision 和组合归属。两次独立构建字节相同,并发构建和混入另一代文件的用例均已覆盖。构建用例AtomicReader.read_selection解析适用条件、替代与冲突、必选闭包、可选项和来源授权。固定样本在 2,383 B 时返回 L1 845 B 与 L2 1,538 B,同一项保留两条依赖路径。2,382 B 时整组拒绝。L3 2,015 B 独立可读。组合测试InstalledGeneration(root, expected=release_id)。构建器逐个登记已从独立原文件核对的原子,两项均满足时才给该原子记verified_at_build。只核对自身摘要的整文件快照、未提供可信安装 ID、或普通存储的回执均记declared。ID 错误则拒绝打开。两条 Case finding 的 L0–L3 共用普通与受管测试,含可恢复的二进制附件和零交付拒绝。入口和负例service_reuse沿用其不记文件指纹的专用回执。该模式的原子 finding 适配归后续。#709 的会话find → read与本 PR 的整组接口有各自的入口,组合代码已在真实 CLI 验证。固定版本续读与专用收据实测。服务复用评审Checks and dependencies
495124a2637559a00d1e68a03cc6f7efe8eb0f99上跑过 62 项 Reader、组合、构建及 Apps 相关测试,全部通过。其中一次读取同时交付固定提交来源、仅有自身摘要的快照、从独立文件核对的摘要快照。三项回执分别为verified_at_build、declared、verified_at_build。给第三项提供错误原件会阻断构建。Ruff 全仓检查和差异空白检查通过。0e67a95c的 Ubuntu 全量测试、来源材料核验和两平台固定字节检查已通过。本次逐原子来源核验修订已发起相同检查。已通过的上版运行 · 本版运行Remaining work and Issue closure
当前申请独立评审。#713 在候选分支合入并逐项验收后,由 Dong1017 按
bot:auto-close授权单独记录结果。生产切换和切换满 72 小时后退役旧支持由 #500 追踪。