feat(compat): doctor 带 in-band invocationIdentity + --nonce 缓存击穿——#197 收官 - #200
Conversation
…三缺口收官
- doctor bootstrap 输出根部新增 CLI 层 invocationIdentity {id, nonce},
human 渲染尾部同步一行;stderr 保持空,envelope 契约不动
- 新 flag --nonce <value>:调用方变化 nonce 即让命令行字节唯一,按字节
键控的重放缓存永远打不中;缺值 fail-closed
- 身份逻辑收进 doctor_bootstrap/identity.rs 子模块(仿 config/paths/probe
结构):observe() 不受触碰,DAG doctor 节点 artifact digest 保持重放稳定;
不引 crate::invocation_identity(adapter 副本编译根约束)
- identity.rs 纳入 doctor toolchainDigests 声明与绑定测试(堵 pin 门盲区);
repin 二轮孤儿 pin 假 clean 复现(#129),按声明路径手动对账修复
- E08 hospital 退役包按原 EvaluatedAt 重造(冻结面含 doctor_adapter.rs)
- docs/host-command-proxy-compat.md 补 doctor in-band 身份与 nonce 语义
Closes #197
|
Warning Review limit reached
Next review available in: 24 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 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 configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (22)
📝 WalkthroughSummary by CodeRabbit
WalkthroughDoctor bootstrap now generates invocation identities, accepts an optional nonce, and includes identity data in CLI output. Tests, documentation, integration digests, and hospital retirement snapshots were updated. ChangesDoctor invocation identity
Estimated code review effort: 3 (Moderate) | ~25 minutes Sequence Diagram(s)sequenceDiagram
participant Caller
participant doctor_bootstrap_run_raw
participant doctor_bootstrap_identity
participant CLIOutput
Caller->>doctor_bootstrap_run_raw: invoke with optional --nonce
doctor_bootstrap_run_raw->>doctor_bootstrap_identity: generate identity and augment observation
doctor_bootstrap_identity->>CLIOutput: return JSON or human-readable identity
doctor_bootstrap_run_raw-->>Caller: output with empty stderr
Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
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. Comment |
Code Intel change risk
Top signals
revspec: |
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 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 `@docs/host-command-proxy-compat.md`:
- Around line 57-62: Update the nonce command example in the documentation to
use the complete compiled CLI invocation, `code-intel doctor bootstrap --nonce
<value>`, instead of starting with `doctor`. Keep the surrounding explanation
unchanged and follow the guideline that new examples lead with `code-intel`.
In `@orchestration/integrations.json`:
- Around line 288-290: The Doctor toolchain evidence set omits a digest-bound
source and lacks validation that both declarations stay consistent. In
orchestration/integrations.json lines 288-290, add
crates/code-intel-cli/src/doctor_bootstrap/identity.rs to
toolchainDigestEvidence.inputs; in crates/code-intel-cli/src/doctor_adapter.rs
lines 470-485, update the existing validation to assert every digest-bound
source is included in toolchainDigestEvidence.inputs.
In
`@orchestration/retirements/e08-hospital/compatibility-retirement-deletion-diff.json`:
- Line 1: Remove stale Hospital and surgery consumers from the report and
summary construction, including all dereferences of $hospitalReport and
$surgeryPlan and the advertised Hospital artifact paths, while preserving the
remaining report publication flow. Update the pinned compatibility-retirement
JSON via literal string replacement, then recompute and refresh every affected
{path, sha256} or toolchainDigests pin once after all edits.
🪄 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: 02995742-0a38-4ae0-a6fe-0625ef781388
📒 Files selected for processing (26)
crates/code-intel-cli/src/doctor_adapter.rscrates/code-intel-cli/src/doctor_bootstrap/identity.rscrates/code-intel-cli/src/doctor_bootstrap/mod.rscrates/code-intel-cli/src/invocation_identity.rscrates/code-intel-cli/tests/doctor_bootstrap_cli.rsdocs/host-command-proxy-compat.mdorchestration/integrations.jsonorchestration/retirements/e08-hospital/compatibility-retirement-deletion-diff.jsonorchestration/retirements/e08-hospital/compatibility-retirement-manifest.jsonorchestration/retirements/e08-hospital/compatibility-retirement-ticket.jsonorchestration/retirements/e08-hospital/e00-request.jsonorchestration/retirements/e08-hospital/e01-request.jsonorchestration/retirements/e08-hospital/e01-stderr.txtorchestration/retirements/e08-hospital/evidence/c00-necessity.jsonorchestration/retirements/e08-hospital/evidence/compatibility-window.jsonorchestration/retirements/e08-hospital/evidence/contract-parity.jsonorchestration/retirements/e08-hospital/evidence/dependency-a04.jsonorchestration/retirements/e08-hospital/evidence/dependency-b07.jsonorchestration/retirements/e08-hospital/evidence/effect-parity.jsonorchestration/retirements/e08-hospital/evidence/golden-parity.jsonorchestration/retirements/e08-hospital/evidence/independent-approval.jsonorchestration/retirements/e08-hospital/evidence/registry-reconciliation.jsonorchestration/retirements/e08-hospital/evidence/replacement-atom.jsonorchestration/retirements/e08-hospital/evidence/rollback-execution.jsonorchestration/retirements/e08-hospital/evidence/usage-observation.jsonorchestration/retirements/e08-hospital/gate-out/compatibility-retirement-decision.json
- doctor_adapter.rs 的 registry_toolchain_digests 测试从只查成员资格升级为: inputs/digests 计数相等 + 每个 digest-bound 源在 inputs 内 + inputs[i] 与 toolchainDigests[i] 按下标配对——CI 才抓得到的错位从此本地 cargo test 即红 - docs 示例改为 code-intel doctor bootstrap --nonce <value>(编译 CLI 先行准则) - doctor_adapter.rs digest 重钉;E08 包随冻结面重造(rehearsal root 需独占, 已清残留) Refs #176
内容
#197 收尾:doctor 的防重放身份 +
--nonce缓存击穿参数。至此 #197 三个缺口全部落地。实现
doctor bootstrap输出根部新增 CLI 层字段invocationIdentity: { id: <nanos-pid-seq hex>, nonce: <回显或空> };human 渲染尾部追加同信息一行。stderr 保持空——doctor 的 envelope 契约
(doctor_envelope / doctor_bootstrap_cli 断言)不动。
doctor bootstrap --nonce <value>:检测之外的预防半边——调用方变化 nonce 即让命令行字节唯一,按字节键控的重放缓存永远打不中;回显证明
值到达了活进程。缺值 fail-closed(
--nonce requires a value,exit 65)。关键取舍
observe()本体不动:DAG doctor 节点直接消费observe()落 artifact 算 sha256,唯一 id 进去会破坏 benchmark 的"重放 digest 全等"契约。身份属于调用,不属于观察。
crate::invocation_identity):本模块被集成测试的 doctor-adapter 副本当独立编译根
#[path]引入,跨模块crate::引用在那些根里不解析——与observe()里 graphProvider 注释记录的是同一条约束。
--contract-probe对 doctor bootstrap 走 unknown-argument路径,head-parity fixture 无需同步;help 文本不列 flag。
验证
--nonce缺值fail-closed、进程内 id 不重复(在主二进制与 adapter 副本两个编译根各跑一遍)。
orchestration/integrations.json的 doctor toolchainDigests 重钉,且identity.rs 新增进声明清单与绑定测试(否则 pin 门对新文件失明——Gates are scoped to what the propagation script touches, not to the invariant #184
同款盲区,当场堵上)。过程中复现 repin 盲区:连续两轮未提交编辑后 pin 孤儿化,repin 假报 clean #129 的 repin 二轮孤儿 pin 假 clean
(报 0 orphaned 但绑定测试红),按声明路径手动对账修复。
quality −1 / coupling +0.09 拒绝(adapter 副本把新 import 摊进
capability_inventory 的口径)——收进 identity.rs 子模块后指标回基线内,
门禁按设计工作。
doctor_adapter.rs,按原EvaluatedAt=1785441780重造,packet suite 10/10。doctor_bootstrap_cli10/10;全量cargo test -p code-intel --locked全绿;权威 self-scan(release-gate parity)exit 0——self-scan 内部 doctor 节点走
observe()直连,artifact digest 不受影响,恰好是本取舍的实证。docs/host-command-proxy-compat.md补 doctor in-band 身份与 nonce 语义;invocation_identity.rs模块注释同步。Closes #197