Skip to content

task: 实现原子与组合的 Reader 契约及同代 Skill 构建 #713

Done

Description

@Dong1017

Current state: completed — #720 已合入共享候选 43b75b62。四项契约均已验收,复验入口、独立批准及 CI 见关闭摘要。
Decision needed: 无。
Next action: #714 的领域 PR 在该候选上复验。#715 负责整库安装、发布中断、旧收据回滚和生产切换,#709 后续接入 Reader。

目标

实现 knowledge/atoms/ 与 knowledge/compositions/ 的限定引用、依赖解析、读取及构建。由 composition 推导目录、七个任务入口和宿主 Skill,供各领域迁移复用。

交付与验收

  • 从同一输入产生稳定的 Bundle。构建产物在安装根下交付 knowledge/ 和 skills/<name>/SKILL.md 及其相对资源。验证七个入口、L0–L3、按任务与条件选分支、限定引用和固定版本回读、依赖闭包与可复现性。
  • 以正负夹具覆盖必选依赖在授权和预算内整组交付或明确拒绝、按 authority 去重、适用条件下的 supersedes、冲突、许可证和分发权限、缺失历史版本与收据对应实际交付的内容。
  • 普通入口经 Apps 调 Reader,受管入口由 Apps 注入 Reader 到 Harness Indexer,核验并登记交付。Unify knowledge discovery and delivery through find and read #709 后续适配这里的公共契约。公共契约和构建 PR 进入同一候选分支,相关验收可复验。
  • 普通与受管读取共享 L0–L3 和单条 Case finding 的选择语义。固定版本的受管读取须返回所选 finding 的正文或附件,并核验、登记实际交付的字节。缺少版本、权限或必选组预算不足时返回明确拒绝,成功交付记录为空。用相同样本覆盖普通与受管路径,保持普通 read --layer L1 [--finding …] 的既有行为。Unify knowledge discovery and delivery through find and read #709 在公共契约落地后接入。负责人交接确认

已冻结的契约样本

候选集成分支为 codex/500-atomic-candidate,起点为 3efb03e。普通入口与受管入口共用本单的 Reader。#709 后续适配该接口,collect --relevance 等已有入口按现行契约工作。

七个公开入口为 task-day-0、task-performance、task-debug、task-accuracy、task-version-alignment、task-derived-engine、task-independent-engine。L0 提供定位,L1 提供规则和适用条件,L2 提供步骤和必选前提,L3 提供附件与证据。

固定输入 预期
L1 规则、L2 步骤、L3 样例 三块原文分别为 845、1,538、2,015 B。在已发布的 v0.3.4 wheel 复核,原字节和摘要全部相同。L1 在发行版移到第 197–213 行,定位必须与版本绑定。
两条依赖路径使用同一 L1,L2 必选,L3 可选 预算 2,383 B 完整交付一份 L1 和一份 L2,回执保留两条来源路径。预算 2,382 B 时整组拒绝、正文 0 B。计入冻结的导航和回执开销后完整交付 2,483 B;真实重发 L1 后为 3,328 B;仅交 L1 记缺项。
两个 authority 有同名条目,指定 authority 的必选 revision 不可用 整组拒绝,区分缺版本、权限、预算和不适用。成功交付记录只涵盖实际交出的字节,禁止借用另一来源。

另验条件路由、冲突、带条件的 supersedes、读/保留/分发权限、附件与历史回读。每个 PR 需要当前提交上两位合格独立 reviewer 批准及所需 CI。本单与 #500 分别按各自交付证据关闭。 固定样本与摘要 · 依赖去重 · 累计字节 · 来源冲突负例

归属与关闭

原生父单 #500。Dong1017 负责集成及验收,Codex 代表 Dong1017 实施。负责人授权本单使用 bot:auto-close,在本单交付、独立评审、所需检查和验收均完成后,按仓库流程单独记录并关闭。

负责人实施与关闭授权 · #500 已接受的目录、接口和验收标准

Activity

  1. self-assigned this
    on Nov 26, 2026
  2. added
    kind:task
    area:harness
    area:knowledge
    status:accepted
    area:apps
    bot:auto-close
    on Nov 26, 2026
  3. Dong1017 commented on Nov 26, 2026

    @Dong1017
    CollaboratorAuthor

    Dong1017 确认本单沿用父单已经接受的第 2 项实施范围,并授权使用 bot:auto-close。逐项满足本单验收、评审及合入条件后,记录证据并关闭。父单授权

  4. Dong1017 commented on Nov 26, 2026

    @Dong1017
    CollaboratorAuthor

    Posted by Dong-bot, an automated agent acting on behalf of @Dong1017 (always-on-bot, model auto-smart?optimize_for=balanced).

    Dong-bot (authorized delegate): #713 needs no decision now, since the owner has accepted the scope. Before Codex starts, pin the seven entry points, the fixture set, and what "independent review" means.

    What it asks. Build the shared Reader contract and composition-based Skill build for knowledge/atoms/ and knowledge/compositions/: qualified refs, dependency closure, reads, a reproducible Bundle with seven task entries and host Skills, and Apps → Reader → Harness Indexer registration. It is a child of #500, and #709 adapts to this contract afterward.

    Details

    Gaps and risks

    Questions

    1. Is Unify knowledge discovery and delivery through find and read #709 a merge prerequisite or a follow-up? The body says follow-up, but both touch find, read, and collect. Unify knowledge discovery and delivery through find and read #709 narrows collect to --id REF selection.
    2. Which byte limits and budgets apply to composition delivery? Are they taken from [Tracking] 高效知识表达:知识目录(含 Skill)的分层披露与搜索空间索引 #500?
    3. Does bot:auto-close cover only task: 实现原子与组合的 Reader 契约及同代 Skill 构建 #713, or does it also touch the parent [Tracking] 高效知识表达:知识目录(含 Skill)的分层披露与搜索空间索引 #500?

    Next steps

    Verified and not verified. I read issue/meta.json, issue/body.md, decisions.md, and #709. The #500 read returned more text than I could page through, so I did not check the #500 acceptance criteria against this body. I did not run tests or read any code.

  5. zengchuang-hw commented on Nov 26, 2026

    @zengchuang-hw
    Contributor

    PASS
    dot, acting for zengchuang-hw.

    独立首审通过公共契约切片。现有 KnowledgeReader 来源归属入口与限定引用契约提供兼容基线;本单把组合依赖闭包、同代生成和真实交付回执纳入一处,领域迁移复用它,不提前上线。验收请固定一个「两个 authority 同名、且其中一个必需引用版本不可用」负例:应显式拒绝,不换成别的来源、不记成功交付。仅静态审阅,未核验候选构建。

  6. Dong1017 commented on Nov 26, 2026

    @Dong1017
    CollaboratorAuthor

    Codex, acting for @Dong1017: claiming the public Reader and composition-build slice. Next artifact: candidate branch and pinned contract fixtures by 2026-11-26 23:00 Asia/Shanghai.

    七个入口固定为 task-day-0、task-performance、task-debug、task-accuracy、task-version-alignment、task-derived-engine、task-independent-engine。L0 导航和定位,L1 判断规则与适用条件,L2 正文、顺序和必选前提,L3 原始附件与证据。共同输入生成同一代目录、入口与相对资源。 #500 的目录、路由及 Reader 交互

    第一套固定样本是 performance-ceiling-analysis 的规则 L1(845 B)、步骤 L2(1,538 B)和可选 L3(2,015 B)。两个路径共用同一 L1。必选正文 2,383 B 正好可交付,2,382 B 必须整组拒绝。端到端另按 Amy 的固定开销检查 2,483 B 与重发 3,328 B。第二套覆盖两个 authority 下同名,所选 authority 的指定 revision 缺失时整组拒绝。其余固定负例覆盖适用条件分支、显式冲突、分发权限、历史回读和收据。 原文与定位 · 预算 · 累计字节 · 跨 authority 负例

    每个 PR 以当前提交为准请求四位 reviewer,验收沿用仓库要求的两位合格独立批准和必要 CI。#709 后续适配;现有查询命令另由 #686 / #709 处理。

  7. Dong1017 commented on Nov 26, 2026

    @Dong1017
    CollaboratorAuthor

    Codex 代表 @Dong1017 交付本次认领的 Reader 固定测试输入。候选集成分支已建在 3efb03ea71356786b19b705e53f65267c17d19bf。开发与评审可直接用下列 JSON 重放预算、版本和授权用例。候选分支 · 旧 wheel 与实际回执

    source_range 和 release_range 均为原始 UTF-8 字节的左闭右开区间。L1 在两个版本中位置不同,验证时先匹配固定源或发行包摘要。a / b 是两个不同内容版本的测试代号;X / Y 是两条有适用条件的规则。执行测试时分别绑定到各自的真实内容摘要。

    Reader 输入及预期结果(JSON)
    {
      "cases": {
        "accounting": {
          "complete_bytes": 2483,
          "l1_only": "incomplete",
          "l1_repeat_bytes": 3328,
          "new_overhead": [
            60,
            40
          ],
          "old_overhead": [
            100
          ]
        },
        "applicable_supersedes": {
          "historical_v0.4": "X",
          "matching_query": "current",
          "v0.4": "X",
          "v0.5": "Y"
        },
        "authority_collision": {
          "available": [
            "package:rule@a",
            "checkout:rule@b"
          ],
          "body_bytes": 0,
          "delivered": [],
          "required": "checkout:rule@a",
          "status": "unavailable_revision"
        },
        "exact_l2": {
          "body_bytes": 1538,
          "level": "L2",
          "limit": 1538
        },
        "l2_one_byte_short": {
          "body_bytes": 0,
          "level": "L2",
          "limit": 1537
        },
        "one_byte_short": {
          "body_bytes": 0,
          "limit": 2382,
          "required_bytes": 2383,
          "status": "over_budget"
        },
        "redistribution": {
          "can_read": true,
          "can_redistribute": false,
          "required_in_skill": "build_refused",
          "synthetic_marker": "restricted-excerpt"
        },
        "required_pair": {
          "body_bytes": 2383,
          "branches": [
            [
              "rule"
            ],
            [
              "prerequisite",
              "rule"
            ],
            [
              "steps"
            ]
          ],
          "delivered": [
            "L1",
            "L2"
          ],
          "limit": 2383,
          "optional": [
            "L3"
          ],
          "required": [
            "L1",
            "L2"
          ],
          "shared_rule_paths": 2
        },
        "selection": {
          "acceptance criteria": {
            "L1": [
              "L1"
            ],
            "L2": [
              "L2"
            ]
          },
          "roofline example": {
            "L3": [
              "L3"
            ]
          }
        }
      },
      "source_commit": "d29b3e68d4bd4375837a39bdc5149b9307d63dbd",
      "sources": {
        "L1": {
          "bytes": 845,
          "path": "inferrsi/knowledge/data/skill_library/playbooks/measurement/performance-ceiling-analysis/SKILL.md",
          "release_range": [
            10266,
            11111
          ],
          "sha256": "b4e6bdffe5cf990a6be96b6ae8d1b442cf61b47f63bcd8949aae6650ab538089",
          "source_range": [
            9356,
            10201
          ]
        },
        "L2": {
          "bytes": 1538,
          "path": "inferrsi/knowledge/data/skill_library/playbooks/measurement/performance-ceiling-analysis/references/acceptance-criteria.md",
          "release_range": [
            252,
            1790
          ],
          "sha256": "b1c9caafde8ac6912a5e4678bd11212a68016fb685a633970c69ad4977d9134a",
          "source_range": [
            252,
            1790
          ]
        },
        "L3": {
          "bytes": 2015,
          "path": "inferrsi/knowledge/data/skill_library/playbooks/measurement/performance-ceiling-analysis/references/roofline-example.json",
          "release_range": [
            0,
            2015
          ],
          "sha256": "597cd3205df043cff3ae9d15924c77934e8d8eb300c00c4840f6bb2921f90faf",
          "source_range": [
            0,
            2015
          ]
        }
      },
      "tag": "v0.3.4",
      "wheel_sha256": "9a1015f2c1e1347f46d1ca899d2cb8e32c8279a75e88669b9de1a8c8bda5b6c9"
    }
    

    上述数值是验收预期。候选 Reader 的实测结果、同代生成包和宿主验证由交付 PR 附上。

  8. jiaran-king commented on Nov 26, 2026

    @jiaran-king
    Contributor

    @Dong1017,转交 #709 的 Reader 评审意见,请纳入 #713 的公共 Reader 契约及验收。#709 当前受管 find → read 已支持按命中和固定版本读取正文或附件、由 Harness 登记交付,但不支持显式 --layer 或 --finding;普通 read --layer L1 [--finding …] 保持不变。合入前的受管命令也没有这两个选择器。

    按本 issue 的既定分工,建议 #713 负责定义普通和受管共用的层级与 finding 选择语义(不限定 CLI 参数拼法),并用固定版本样本验证受管路径返回准确内容和实际交付回执;若版本、权限或必选依赖预算不满足,应明确拒绝且不记为成功交付。契约落定后,#709 这边负责把统一的 find → read 接到该接口,而不是在 #709 先给旧知识布局另写一套分层逻辑。请确认这个交接,并回链可复用的接口与用例。

  9. Dong1017 commented on Nov 26, 2026

    @Dong1017
    CollaboratorAuthor

    Posted by Dong-bot, an automated agent acting on behalf of @Dong1017 (always-on-bot, model auto-smart?optimize_for=balanced).

    Accepted: the handoff to #709 is confirmed. #713 defines the shared L0–L3 level and finding-selection semantics for ordinary and managed reads (CLI spelling not fixed here), and #709's managed find → read adapts to that interface after it lands, with no separate layer logic for the old layout. (Dong-bot, authorized delegate)

    Details

    Reusable interface and cases

    • Interface: the Reader contract in the task: 实现原子与组合的 Reader 契约及同代 Skill 构建 #713 body (knowledge/atoms/ and knowledge/compositions/, qualified refs, fixed-version reads, required-closure delivery or explicit refusal, actual delivery receipt). It is on candidate branch codex/500-atomic-candidate (start 3efb03e). The public API is not pinned yet, so link the Reader PR once it exists.
    • Cases: the fixed-input JSON in thread comment 7192749168 (accounting, applicable_supersedes, authority_collision, required_pair, redistribution, one_byte_short, exact_l2) and the frozen samples in #500 comment 7162038417.

    Added to #713 acceptance (before #709 adapts)

    • Finding selection is not defined in the seeded body or in the fixture JSON. The Reader PR must define it.
    • Add a fixed-version managed case: the path returns the exact body or attachment for the selected finding and records the bytes actually delivered. A missing version, permission, or budget refusal must be explicit and must not be recorded as delivered.
    • Ordinary read --layer L1 [--finding …] keeps its current behavior, and the Reader cases should cover both paths.

    Scope boundaries

    Verified and not verified

  10. Dong1017 commented on Nov 26, 2026

    @Dong1017
    CollaboratorAuthor

    Codex 代表 Dong1017 提交第一组可复验的 Reader 实现。分支 codex/500-atomic-reader 的当前提交为 44124d0。

    • 用 v0.3.4 wheel 的原字节验证了必选组。两条路径指向同一 L1 规则时只交付一份,回执保留两条路径。L1 加 L2 的预算为 2,383 B 时完整交付,2,382 B 时明确拒绝、成功记录为空。L2 单读的边界为 1,538 B,L3 附件为 2,015 B。拒绝读取的来源与缺失的固定版本都不能用另一 authority 的同名条目替代。固定样本 · Reader 回归用例
    • 条件匹配支持精确取值和数值版本区间。夹具对 v0.4.99、v0.5.0、v0.10 和排他的 v1.0 上界分别复核。按适用条件决定当前查询里哪项取代旧项,仍需在检索路径验收。区间实现
    • 本地 Reader 专项 21 项通过,连同 Bundle、Store 和来源快照的测试共 82 项通过、1 项跳过,仓库 lint 通过。上述字节数只计正文;整库端到端对照另计导航、回执和重发。

    下个交付点是在普通与受管入口上,用同一组合和固定版本验证 L0–L3 及单条 Case finding 的选择、实际交付字节与回执,然后附正式 PR 及对应测试供 #709 适配。交接决定

  11. Dong1017 commented on Nov 26, 2026

    @Dong1017
    CollaboratorAuthor

    Codex 代表 Dong1017 已在共享候选的 Reader 开发分支完成普通与受管接口。当前已推送提交为 7c991e84。

    • 普通读取和受管 campaign 以相同的组合、revision、layer、finding 和预算调用 Reader。固定的两个 Case finding 分别按原始 JSON 指针及稳定 ID 读取,八次交付均登记了所选 finding 的实际字节,二进制附件逐字节读回。普通和受管回归测试
    • 预算少一字节、缺少保留权限、缺版本或找不到 finding 均登记为拒绝,交付清单为空。篡改实际摘要、请求版本、条目数或原文字节区间的四种回执在写入前被拒绝。本地上述受管用例共 6 项通过,仓库代码 lint 通过。回执验证
    • 单条 finding 的候选 Apps 接口可供 Unify knowledge discovery and delivery through find and read #709 对接。正式评审将同时提交七个任务入口、同代构建和安装态回读。生产切换、宿主真实安装及 72 小时窗口仍归 task: 验证整库候选、一次切换并完成 Day-3 退役 #715。
  12. david6666666 commented on Nov 26, 2026

    @david6666666
    Collaborator

    Dot, acting for @david6666666 under delegated Issue review.

    Please make the service-reuse boundary explicit before #709 adapts. The candidate’s managed Reader entry rejects evaluation_mode=service_reuse because it uses a fingerprint-free receipt format. The paired finding tests exercise the ordinary managed campaign, not that branch. If service-reuse is in this slice, pin one fixed-version finding case that returns the exact bytes while preserving its existing receipt contract. If it is deferred, record the deferral here and show that #709's service-reuse find → read continues working without being routed to this rejection.

  13. Dong1017 commented on Nov 26, 2026

    @Dong1017
    CollaboratorAuthor

    @david6666666 @jiaran-king 已在 #720 落实并验证 服务复用会话的评审意见。本阶段的原子选择适用于普通读取和常规受管优化会话。服务复用会话按指定 finding 或层级选择原子的能力留给 #709 之后按公共 Reader 契约适配。 它当前通过自己的 find --session → 命中的 read_args 读取,沿用现有无文件指纹的收据。Reader 契约及接入说明

    在隔离工作树合并 #709 的 f5d19e91482c75408cb943f3fe442838cb252ce3 和 #720 的 bd611c3ee9cc609d23f6f54c2f05c1113e31566e 后运行 #709 的实际 CLI 回归。搜索后替换已安装正文,附件翻页后再替换已安装附件,仍能从搜索保留的来源完整读回原字节,两者的 revision 都等于命中记录。公开响应和保留回执满足无文件指纹校验。缺少旧来源的历史收据重放会拒绝,也保留此前的搜索、读取记录。实际跨页用例 · 历史回执用例

    Windows 用短临时目录跑原测试,4 项通过。第 5 项在模拟附件丢失时,系统阻止测试直接删除只读文件。在临时测试副本中仅于删除前解除该文件的只读属性,同一产品代码 5 项全部通过,缺失附件明确拒绝且同版正文仍可读取。联测的 Git tree 为 39b425e1b434f0a6f17669614036ab40a1a79268。四位 reviewer 的正式请求已发至 #720 当前提交。

  14. Dong1017 commented on Nov 26, 2026

    @Dong1017
    CollaboratorAuthor

    Codex 代表 @Dong1017 逐项验收 #713。Reader、同代构建及普通与受管两条读取路径已进入共享候选,供 #714 和 #709 接入。

    flowchart LR
      source["固定版本的原子与组合"] --> build["核对原文件并构建同一代"]
      build --> skills["宿主目录 skills/"]
      build --> reader["按来源、版本、层级或 finding 读取"]
      reader --> apps["普通 Apps 收到正文与回执"]
      reader --> managed["受管会话核验并登记实际交付"]
    
    Loading
    四项完成条件及证据
    1. 固定来源重建、重装和并发生成得到同代目录;七个任务可被发现,缺资源、混代和不匹配的原文件范围均拒绝。 构建回归
    2. 资格条件、带条件替代、冲突、权限、限定来源和固定版本都参与选择。两条依赖路径复用一个原子。必选组失败时收据无成功交付项。 组合及负例 · 读取回执
    3. Apps 调用公共 Reader,常规受管优化会话注入相同 Reader,Harness 在会话锁内核验和登记返回内容。 接入契约
    4. 两条 finding 的 L0–L3 覆盖了单条选择、原文字节、二进制附件和拒绝情形。历史服务复用路径按自己的收据契约单列。 受管路径回归 · 实际命令及边界
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area:appsarea:harnessarea:knowledgebot:auto-closekind:taskstatus:accepted

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions