Repository navigation
kb: 支持保留未知项的基础知识发布与深化交接 #319
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
47371bb
fix(kb): review foundation with its full offered evidence packet
tzhouam 960af6d
fix(kb): pass bounded review feedback to foundation retries
tzhouam 3083ae1
fix(kb): include related indexed test assertions in foundation packets
tzhouam b205599
Prioritize direct capability tests before foundation context cap
tzhouam 5d0684e
Keep unsafe foundation prose out of publication without losing approvals
tzhouam 7a77724
feat(kb): publish partial foundation with frozen native handoff
tzhouam fd0fef1
fix(kb): bound partial foundation PR metadata and refresh SPEC
tzhouam File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 42 additions & 0 deletions
42
doc/architecture/SPEC/kb_service/foundation_publication.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,42 @@ | ||
| # kb_service/foundation_publication.py —— 规范 | ||
|
|
||
| <!-- verified-against: 2026-10-06 --> | ||
|
|
||
| ## 职责 | ||
|
|
||
| 为显式 `--foundation-mode partial` 保存和复核基础知识发布收据,并为新深度批次 | ||
| 验证原发布记录。调用方的默认完整门槛保持不变;使用方式见 | ||
| [部分发布说明](../../../knowledge/partial-foundation.md)。 | ||
|
|
||
| ## 不变量 | ||
|
|
||
| - 只发布已经完成初轮扫描、保留真实原生任务的固定源码批次。已有基线未覆盖的 | ||
| 功能和 owner 缺少初轮任务时拒绝发布;已处理范围不能称为已补齐全部知识。 | ||
| - 生产文件结构覆盖达到原政策目标;源码、目录与政策身份、引用、格式及原生 | ||
| 认可仍须有效。不能修改功能集合、分母、语义认可条件或失败记录来满足门槛。 | ||
| - `freeze_receipt` 重放每个任务的原生证明,再冻结生成身份、KB/source SHA、 | ||
| 全部终态任务的输入/结果摘要、实际进入页面的认可区块、输出文件哈希及未知项。 | ||
| 收据按内容哈希在原始 Git 外阶段目录独占创建;既有字节或路径损坏必须拒绝。 | ||
| - `verify_prepared_receipt` 核对原始 partial 模式、收据范围和 prepared 文件, | ||
| 从固定源码及实际准备发布的字节重新计算覆盖。不能只信检查点里的计数。 | ||
| 旧 strict prepared 发布保持原行为,不能偷偷转换为 partial。 | ||
| - `foundation_handoff` 只接受原始 published、非 dry-run 的 partial 记录。 | ||
| 记录、收据、任务、prepared 文件、当前合并基线及政策必须一致,且真实 PR | ||
| 状态为 MERGED。返回原记录/收据路径与哈希、固定 pin、目录绑定和输出文件哈希。 | ||
| 下游以这些字节建立新批次身份,发生变化即拒绝复用。 | ||
| - 发布状态只表示 PR 传输。收据保留 `init_complete=false`、原六维目标结果和 | ||
| 所有未知项;结构覆盖、六维基础知识、七维深度认可及实际测试执行分别表述。 | ||
|
|
||
| ## PR 正文与恢复 | ||
|
|
||
| `render_partial_body` 只渲染汇总数量、固定身份、真实未知维度和收据引用;完整 | ||
| 模型输入、输出、评审及历史仍在 Git 外。费用未报告时为未知。 | ||
| 若原 prepared 发布因正文过长而未成功,官方恢复路径须先通过全部原生、源码和 | ||
| 收据校验,再仅刷新正文元数据:commit、文件字节、任务和修正次数不得改变, | ||
| 不得重新生成知识或伪造发布状态。 | ||
|
|
||
| ## 验证 | ||
|
|
||
| `test_kb_foundation_explicit_partial.py` 覆盖原生证明、范围、收据、恢复与门槛; | ||
| `test_kb_foundation_partial_interfaces.py` 覆盖 CLI、campaign、worker 与 assembly | ||
| 身份传递;`test_kb_foundation_partial_prbody.py` 覆盖紧凑正文和官方正文恢复。 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,34 @@ | ||
| # Explicit partial foundation publication | ||
|
|
||
| The default initialization workflow requires all six foundation facets for every | ||
| catalog feature. `--foundation-mode partial` is an explicit alternative for an | ||
| existing, source-pinned subscription batch whose genuine native tasks have | ||
| already finished. It reconstructs approved sections and inspects the declared | ||
| scope without calling either model again. Unknown sections remain unknown; | ||
| local publication exclusions retain their original native evidence archives. | ||
|
|
||
| Publication still requires the configured production-file threshold, valid | ||
| catalog and source inventories, genuine native proofs, valid knowledge files, | ||
| and a complete terminal scope. Missing initial feature tasks block publication | ||
| unless that feature was already covered in the merged baseline. The external | ||
| immutable receipt records the original generation identity, source/catalog and | ||
| policy, terminal tasks, active approvals, exact output hashes and unknowns. | ||
| Prepared publication retries recheck these bindings and the actual pinned | ||
| coverage before writing. Publication status describes PR transport: the | ||
| foundation target remains false when six-facet gaps remain, and | ||
| `init_complete` remains false. | ||
|
|
||
| After this foundation PR merges, start a **new depth batch** with | ||
| `--foundation-mode partial --foundation-record /path/to/original/knowledge.json`. | ||
| The original published record and receipt, merged output bytes and fixed source | ||
| pin become immutable depth inputs. The campaign and standalone depth audit use | ||
| the same structural prerequisite; six-facet foundation completion is reported | ||
| separately. The audit also requires native approval reports in this mode. | ||
|
|
||
| This option preserves the catalog and all semantic acceptance criteria. Each | ||
| feature must have recognized depth knowledge, each of the seven depth facets | ||
| must exceed the policy threshold, and production coverage must meet the policy | ||
| target. The denominator remains the complete frozen catalog times seven. | ||
| Partition workers report their actual execution scope separately from global | ||
| semantic completion; completing a partition never implies the whole catalog | ||
| has passed. Retrieval, independent review and CI remain delivery gates. | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This new page is not linked from
doc/knowledge/README.mdor another documentation index—repository-wide search forpartial-foundationfinds only this page—so readers entering through the knowledge documentation cannot discover it. Add the page to the directory's existing documentation index in the same change.AGENTS.md reference: AGENTS.md:L7-L11
Useful? React with 👍 / 👎.