Skip to content

正式版前调研+优化: mattpocock/skills 出处钉死 + 契约/schema 对账闸 + 六条复查落账 - #212

Merged
2233admin merged 2 commits into
mainfrom
claudeMaster/pre-release-research-optimization-5e8fa4
Aug 7, 2026
Merged

正式版前调研+优化: mattpocock/skills 出处钉死 + 契约/schema 对账闸 + 六条复查落账#212
2233admin merged 2 commits into
mainfrom
claudeMaster/pre-release-research-optimization-5e8fa4

Conversation

@2233admin

Copy link
Copy Markdown
Owner

正式版发布前那波调研 + 优化。调研落成两条可核对的机制改动,其余五条复查落成 issue 与已知延后项清单——没有把「查过了」和「修好了」混在一起写。

一、mattpocock/skills 吸收:出处从「没查」变成钉住

内化记录里 revision: "unverified-upstream; local-adr-sha256:1431a4df…",license UNKNOWN-RESEARCH-ONLY。实测:

  • 上游 revision 钉到 84fdeffd12f2ee307994d1eb6feb48173b6e0502(2026-08-06),license 实为 MIT(LICENSE blob f1dd2c09…),义务从「查清前禁止一切」换成真实的 MIT 保留声明义务;
  • 那枚 ADR digest 是错的——docs/adr/0006-*.md 的实际 digest 是 7a0e7da5…,而 repinclean。原因是 pin 只活在 revision 串里,旁边没有 {path, sha256} 声明,正是 declared_pins 模块文档写明的自身盲区。本轮补上声明并重钉,这枚 pin 进入 repin --write 的可解析面;
  • 测试契约分家:assert_research_candidate 钉的是「完全没查」的形状(unverified-upstream + UNKNOWN-RESEARCH-ONLY + license/upstream-revision 两条 gap)。核实完还套这张断言,等于核实完继续通过未核实契约。新增 assert_verified_research_candidate,并断言 mattpocock 记录只剩 gap:mattpocock-skills:security-review 一条——核实出处不等于读过上游 skill 到底干什么,这条继续挡住它离开 research。

吸收的方法论侧(deletion test、「一个 adapter 是假 seam,两个才算」、expand→migrate→contract)没有写进代码,而是直接拿来跑了下面的复查,产出 #210 / #211#206 的方向建议。

二、契约登记表 ↔ schema 发布面对账闸(#206 第一刀)

registered_contract() 接受的每一对 (schema, type) 现在都必须有 orchestration/schemas/<id>.schema.json

设计要点是不另立第二份清单:registry 就是那些 match 臂,判据从 artifact_ref.rs 自己的源码把臂读出来,再把读出的每一对喂回 registered_contract() 核对——解析一旦跟真臂漂移,喂回去就不认,测试炸而不是静默检查空气。另写一份 id 数组等于制造下一个「写入方和校验方各维护一份现实」。

两道假绿灯陷阱:

  • 臂数 < 40 判定「扫描器瞎了」。这条当场生效——第一版实现按第一个 #[cfg(test)] 截断源码,漏掉整个 native code-evidence 家族,只解析出 32 条;
  • AWAITING_SCHEMA 豁免表只减不增,表里 id 一旦有 schema 文件立刻红(已实测:临时补一个文件会得到 now publishes a schema — delete it from AWAITING_SCHEMA)。

markdown 与 native 两类豁免都是机械核对(前者要求 <x>.v1 也已注册,后者要求伞状 schema 实测包含该 id),不是注释里的口头承诺。

基线:41 个已注册契约 / 24 个已发布 schema / 4 个 markdown 视图 / 8 个走伞状 schema / 5 个真缺口#210)。

零生产代码改动,不碰巨石拆分——按 #206 自己「先分开决策,再动代码」的约束办。source of truth 定在哪仍未拍板,建议与迁移方法写在 #206 的评论里。

三、复查产出(不在本 PR 里修)

复查项 结论
artifact_ref 拆分后的 deletion test content_contract.rs 通过:6 个消费者,sha256_hex 73 处 / reject_duplicate_json_keys 50 处 / validate_artifact_ref_shape 16 处调用,删掉它复杂度真会散回 150+ 个点。真接缝,不动。
#206 机制化 见上。同时查清「无机制同步」只对了一半——digest 侧 repin 有机制(本 PR 期间当场抓到一次),participants 侧 orchestration.rs::reconcile_production_registry 有双向对账,没机制的只有契约身份。详见 #206 评论。
4 个 bug magnet 架构复查 main.rs 97 行 1 函数,不是架构目标(churn 来自接线)。sentrux_gate.rs 1816 / sentrux_analysis.rs 1405 / capability_inventory.rs 1275 行均破巨石线,已由 .sentrux/baseline.json 按身份豁免——是豁免,不是消失。
a9baf61 / d4f4313 双轴复查 a9baf61 方向正确(拆分 + 删除并存)。d4f4313 产出 #211:四层单消费者直链约 1900 行,接缝的形状没有接缝的功能;外加三个不相干主题捆在一刀里(+3620/-6,几乎无替换)。
expand→migrate→contract 写进 #206 评论第六节与 #211,作为后续动 registry 与 integrations.json 的方法约束。
release note 已知延后项 写进 CHANGELOG [Unreleased] > Notes,见下。

四、正式版已知延后项(CHANGELOG 已明写)

579 条 I/O-in-loop 静态发现未处理 · artifact_ref.rs 1.85/10、3807 行仍是仓内最差且本轮只加检查未拆 · 33 个 god file 按身份豁免 · 5 个已注册契约无 schema(#210)· 内化记录 104 枚本地 digest pin 未用可解析形状声明,其中 37 枚已对不上任何在册文件而 repin 仍报 clean(#133)。

五、期间实测到的三条既有 issue 的活样本

验证

  • cargo test 全绿(646 + 274 + 275 + 273 + … 全部 test binary,exit 0)
  • cargo fmt --all -- --check 干净
  • code-intel repin --repo . clean(且这次是真 clean——手工修正了 repin 盲区:连续两轮未提交编辑后 pin 孤儿化,repin 假报 clean #129 造成的那 3 处)
  • code-intel sentrux gate . 无退化:Quality 4423→4436,Coupling 67.09→65.47,Cycles 0→0,God files 33→33
  • pwsh legacy/scripts/tests/test-atomic-capability-contract.ps1 ok(96 outcome matrix cases,17 toolchain evidence capabilities)
  • pwsh legacy/scripts/tests/test-project-management-support.ps1 passed
  • code-intel change risk origin/main..HEAD:score 57,percentile 51,level low,testAsymmetry=false

Refs #129, #133, #178, #192, #206, #210, #211

…ct/schema drift gate

The mattpocock/skills internalization record claimed `unverified-upstream`
and `UNKNOWN-RESEARCH-ONLY` while carrying an ADR digest that no longer
matched the file it named -- and `repin` reported the tree clean, because
that pin lived only inside the `revision` string with no `{path, sha256}`
declaration to anchor it (the blind spot `declared_pins` documents about
itself, #133).

- Pin the upstream revision to 84fdeffd12f2ee307994d1eb6feb48173b6e0502
  and record the verified MIT license (LICENSE blob f1dd2c09), replacing
  the "verify before any use" obligations with the real MIT terms.
- Re-pin the ADR digest and declare it as `{path, sha256}` so `repin` can
  resync it.
- Split the test contract: `assert_research_candidate` pins the
  never-checked shape, so a verified record kept passing the unverified
  contract. `assert_verified_research_candidate` asserts the opposite, and
  the mattpocock test now asserts the one remaining gap is the security
  review -- verified provenance is not a read of what the upstream skills
  actually do.

Separately, every `(schema, type)` pair `registered_contract()` accepts must
now publish `orchestration/schemas/<id>.schema.json` (#206). The registry is
`match` arms, so the check reads the arms out of the source rather than
keeping a second hand-maintained list, and feeds every parsed pair back
through `registered_contract()` so a drifting parse fails instead of
silently checking nothing. Two false-green traps: fewer than 40 arms means
the scanner went blind (it caught the first implementation, which truncated
at the wrong `#[cfg(test)]` and saw only 32 arms), and the `AWAITING_SCHEMA`
exemption list may only shrink. Baseline: 41 registered contracts, 24 with
schemas, 4 markdown views, 8 under the native umbrella schema, 5 real gaps.

Refs #133, #206, #210
@repowise-bot

repowise-bot Bot commented Aug 7, 2026

Copy link
Copy Markdown

⚠️ Health of changed files: 3.5 → 3.5 (-0.1)
🚨 Change risk: high, riskier than 70% of this repo's commits.

📋 At a glance
1 file changed health · 2 hotspots touched · 5 new findings introduced · 1 file with recent fix history. Scoped to crates.

✅ Health gate: passed

🔎 More signals (2)

🗺️ Change map

flowchart LR
  subgraph PR ["Changed in this PR (1 with dependents)"]
    f_crates_code_intel_cli_src_artifact_ref_rs[".../src/artifact_ref.rs 🔥"]:::changed
  end
  f_crates_code_intel_cli_src_admissibility_rs[".../src/admissibility.rs"]
  f_crates_code_intel_cli_src_artifact_ref_rs --> f_crates_code_intel_cli_src_admissibility_rs
  f_crates_code_intel_cli_src_assistance_adapter_rs[".../src/assistance_adapter.rs"]
  f_crates_code_intel_cli_src_artifact_ref_rs --> f_crates_code_intel_cli_src_assistance_adapter_rs
  f_crates_code_intel_cli_src_builtin_provider_evidence_rs[".../src/builtin_provider_evidence.rs"]
  f_crates_code_intel_cli_src_artifact_ref_rs --> f_crates_code_intel_cli_src_builtin_provider_evidence_rs
  f_crates_code_intel_cli_src_capability_rs[".../src/capability.rs"]
  f_crates_code_intel_cli_src_artifact_ref_rs --> f_crates_code_intel_cli_src_capability_rs
  more(["+17 more dependents"])
  PR --> more
  classDef changed fill:#dbeafe,stroke:#1d4ed8,color:#1e3a5f
  classDef warn fill:#fef3c7,stroke:#b45309,color:#78350f
  classDef guard fill:#dcfce7,stroke:#15803d,color:#14532d
Loading

Solid arrows: code that imports the changed files (21 direct dependents, from the last indexed snapshot). Dashed: history/tests.

🔥 Hotspots touched (2)

  • .../src/artifact_ref.rs: 10 commits/90d, 22 dependents
  • .../tests/internalization_record.rs: 10 commits/90d, 1 dependents

📊 See the full report for this PR
Your repo map with this PR's blast radius lit up, every caller of the contracts it changes, and health before and after. No sign-in. · ⭐ Star Repowise · 📥 Install bot · Silence on a single PR with [skip repowise] in the title · Per-repo toggle on repowise.dev/settings?tab=bot · Updated 2026-08-07 02:05 UTC (since the last push: 1 new finding)

@coderabbitai

coderabbitai Bot commented Aug 7, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@2233admin, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 48 minutes

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: d2de07d4-182a-40f1-bf9e-f1921c1d4e1e

📥 Commits

Reviewing files that changed from the base of the PR and between ec2900f and 188058c.

📒 Files selected for processing (3)
  • CHANGELOG.md
  • crates/code-intel-cli/src/artifact_ref.rs
  • orchestration/integrations.json
📝 Walkthrough

Summary by CodeRabbit

  • Documentation

    • Updated release documentation with contract-to-schema validation coverage, known limitations, and research-record verification details.
  • Bug Fixes

    • Corrected and verified the Matt Pocock Skills record, including its upstream revision, licensing information, evidence, and integrity reference.
    • Refreshed integration capability records with current toolchain verification data.
  • Tests

    • Added automated checks to ensure registered contracts have valid schemas or approved documented exceptions.
    • Expanded verification of research provenance, licensing, security-review status, and integrity references.

Walkthrough

The PR adds contract/schema registry checks, updates Matt Pocock Skills provenance to verified revision and license evidence, refreshes three integration digests, and records these changes and deferred items in the changelog.

Changes

Registry and provenance reconciliation

Layer / File(s) Summary
Schema registry validation
crates/code-intel-cli/src/artifact_ref.rs, CHANGELOG.md
The new test scans registered contracts, validates schema/type pairs, and enforces published-schema or approved-exemption coverage. The changelog records the reconciliation checks and read-only MCP query surface.
Research provenance verification
orchestration/internalization/mattpocock-skills.json, crates/code-intel-cli/tests/internalization_record.rs, CHANGELOG.md
The Matt Pocock Skills record and tests now verify the upstream revision and MIT license, retain only the security-review gap, and validate the ADR digest.
Toolchain digest refresh
orchestration/integrations.json
Three integration capability declarations now use the updated toolchain digest.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Possibly related PRs

Suggested labels: risk-accepted

Poem

A rabbit checks each schema line,
Pins a license, crisp and fine.
Three bright digests hop in tune,
Provenance rests beneath the moon.
Tests guard every contract gate.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed 标题准确概括了上游来源固定、契约与 schema 对账闸及复查落账等主要变更。
Description check ✅ Passed 描述详细说明了两项机制改动、复查结果、已知延后项和验证结果,且与变更内容一致。
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot added the risk-accepted 人已审阅并接受高风险评分,放行 pr-gate label Aug 7, 2026

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

Actionable comments posted: 4

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@CHANGELOG.md`:
- Line 17: Update the CHANGELOG entry’s command examples to use the compiled
CLI: replace every bare “repin” with “code-intel repin” and every “repin
--write” with “code-intel repin --write”, while leaving the surrounding
explanation unchanged.

In `@crates/code-intel-cli/src/artifact_ref.rs`:
- Around line 3254-3275: Replace the substring search in the native umbrella
coverage check within the registered-schema loop with parsed JSON Schema
inspection. Traverse the applicable oneOf structure and require each native
schema ID to appear as a branch reference, while preserving the existing
markdown handling and unpublished reporting.
- Around line 3162-3168: Update the validation around AWAITING_SCHEMA and its
checks near the registered-schema handling to compare exemptions against an
approved CI baseline or merge-base policy input, requiring issue metadata for
every approved entry. Reject newly added exemptions while preserving detection
of stale entries, and only update the CHANGELOG claim once this non-expansion
gate is enforced.
- Around line 3204-3212: Update the registry-arm scanning logic around the
literals collection and registered_contract validation so every non-literal
registry arm is accounted for, rather than silently omitted when its pattern is
not exactly two string literals. Prefer deriving the iterable registry data from
the same complete arm representation used by registered_contract, while
preserving the existing REPOSITORY_ITERATION_* handling and schema-publication
checks.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 6aaddea6-2f75-489a-a6e0-8c735c5d0c26

📥 Commits

Reviewing files that changed from the base of the PR and between 580ebe1 and ec2900f.

📒 Files selected for processing (5)
  • CHANGELOG.md
  • crates/code-intel-cli/src/artifact_ref.rs
  • crates/code-intel-cli/tests/internalization_record.rs
  • orchestration/integrations.json
  • orchestration/internalization/mattpocock-skills.json

Comment thread CHANGELOG.md Outdated
Comment thread crates/code-intel-cli/src/artifact_ref.rs
Comment thread crates/code-intel-cli/src/artifact_ref.rs Outdated
Comment thread crates/code-intel-cli/src/artifact_ref.rs Outdated
@github-actions

github-actions Bot commented Aug 7, 2026

Copy link
Copy Markdown

Code Intel change risk

Score Percentile Level
62/100 60th (vs last 48 commits) 🟡 medium

Top signals

  • Diff shape: 5 file(s), +431/-12 (max file share 0.71)
  • Test asymmetry: source changed, tests touched
  • Bug-magnet: 44 fix commit(s) in touched files (180d)
  • Churn: 115 commit(s) touching these files (90d)

revspec: origin/main..HEAD · threshold: percentile >= 90 blocks unless labeled risk-accepted · code-intel change risk

…ify umbrella coverage structurally

Review found three real gaps in the contract/schema gate, one of which
defeated the gate for a whole class of arms.

- A match arm the scanner could not parse was silently skipped. A future
  `(NEW_SCHEMA, NEW_TYPE) =>` arm would produce no pair, leave the arm
  count healthy, and let that contract escape the schema check entirely --
  the arm-count guard only catches wholesale blindness, not one dropped
  arm. Constant-form arms now resolve through the file's `const NAME:
  &str` items, and an arm that still will not resolve is a hard failure
  naming the family and the pattern. Proven by temporarily adding an
  arm over `&'static str` constants: the gate reports `uses a form the
  registry scanner cannot resolve`. This also removes the
  `REPOSITORY_ITERATION_*` special case, which is now just another
  resolved arm.
- The family list is no longer written here either: it is read from
  `registered_contract`'s own dispatch body, so a new family reaches the
  scanner by the same edit that reaches production. Guarded by a
  minimum family count.
- Native umbrella coverage was a substring search, so an id appearing in
  a title, an example, or an unrelated field counted as published. It now
  walks `oneOf` -> `$ref` -> `$defs/<target>/properties/schema/const`.

Also:
- Replace the per-contract `Path::exists` with one directory listing.
  A filesystem call inside a loop over 41 contracts is the finding class
  this repository is trying to burn down.
- Correct an overclaim: `AWAITING_SCHEMA` entries are checked for going
  stale, but nothing stops the list from growing. Gating that needs a
  merge-base or CI-held baseline; noted against #210 rather than claimed.
- CHANGELOG command examples lead with the compiled `code-intel` CLI.

Refs #206, #210
@2233admin
2233admin merged commit bfb1cd8 into main Aug 7, 2026
12 of 13 checks passed
@2233admin
2233admin deleted the claudeMaster/pre-release-research-optimization-5e8fa4 branch August 7, 2026 10:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk-accepted 人已审阅并接受高风险评分,放行 pr-gate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant