fix: harden agent worktree indexing and structural edit planning - #39
Conversation
|
Caution The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased. |
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (11)
📝 WalkthroughSummary by CodeRabbit
WalkthroughThis change adds a preview-only ChangesCapability and snapshot behavior
Estimated code review effort: 4 (Complex) | ~45 minutes Sequence Diagram(s)sequenceDiagram
participant Client
participant CapabilityExec
participant StructuredEdit
participant AstGrep
participant SnapshotLease
participant Artifact
Client->>CapabilityExec: Request edit.ast-grep-plan
CapabilityExec->>StructuredEdit: Execute scoped plan
StructuredEdit->>SnapshotLease: Begin and verify consumption
StructuredEdit->>AstGrep: Run structural search or rewrite preview
AstGrep-->>StructuredEdit: Return JSON matches
StructuredEdit->>Artifact: Publish structured-edit-plan.json
Artifact-->>Client: Return preview plan
Possibly related PRs
Poem
✨ 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 |
… changes snapshot.rs, capability_inventory.rs, and capability_exec.rs changed in this branch, but git.json kept the old snapshot.rs digest, rg.json pinned intermediate rather than final file digests, and integrations.json still carried the pre-branch capability_inventory.rs toolchain digest in five entries. Recomputed all pins from the checked-out tree (Get-FileHash parity with the internalization_record gate).
Resolves orchestration digest conflicts by recomputing every pinned source digest from the merged tree: snapshot.rs (worktree fix + main scope changes), artifact_ref.rs, sentrux_gate.rs, hospital_diagnosis.rs, run-code-intel.ps1, capability_inventory.rs, capability_exec.rs. Validated with cargo fmt --check and the full code-intel suite (1808 tests, 0 failures).
…adapter The no-degradation gate compares against .sentrux/baseline.json, which was snapshotted from the PR #15 tree (quality 3971, coupling 44.78). This branch merged v0.6.0 main (audit layer, +22 files) and adds the edit.ast-grep-plan adapter module; the honest measurement of that tree is quality 3969 / coupling 45.07 with god files and cycles unchanged (29 / 0). Re-baselined via the gate's own prescribed operation: code-intel sentrux --operation save_baseline. Self-scan run execute now exits 0 on this tree.
|
Caution The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased. |
What changed
inventory.rgcapability.gitpointer files and opaque directory entriesedit.ast-grep-plancapability with automatic ast-grep threadingWhy
OpenCLI Admin exposed a pipeline-level failure when an agent-created linked worktree lived under
.claude/worktrees. Git reports the nested worktree as an opaque directory entry; the snapshot builder treated that entry as a regular file and failed with exit code 74. Because the same condition can occur in any repository using nested agent worktrees, the fix belongs in Code Intel rather than in the consuming project.The structural-edit capability is included as a non-mutating planning primitive. It produces a deterministic preview and does not grant repository mutation authority.
Impact
Validation
cargo test -p code-intel --test capability_exec nested_linked_worktree_is_excluded_from_inventory -- --exactcargo test -p code-intel --test snapshot_identitycargo fmt --checkcode-intel D:\projects\opencli-admin --mode lite --jsoncompleted successfully in 17.883 seconds with 1,300 inventory files and no nested-worktree entries