Skip to content

fix: 29 verified defects — git hardening, Rust correctness, dead routing/facades, CI gates that gate, docs drift - #60

Merged
2233admin merged 6 commits into
mainfrom
fix/sweep-hardening-and-gates
Jul 28, 2026
Merged

fix: 29 verified defects — git hardening, Rust correctness, dead routing/facades, CI gates that gate, docs drift#60
2233admin merged 6 commits into
mainfrom
fix/sweep-hardening-and-gates

Conversation

@2233admin

Copy link
Copy Markdown
Owner

Summary

Fixes 29 adversarially-verified defects: 27 from a fresh 6-lens sweep (Rust core correctness, live PS1 path, CI gate honesty, contract drift, test-suite honesty, security fresh-eyes) plus the two remaining residuals from the self-audit issues.

Every finding was independently discovered, then adversarially re-verified against HEAD before being fixed.

Security (closes #33)

  • GitHardening extended to all live sibling scriptsInvoke-ScopedRepowise.ps1 (including the worktree-mutating checkout/reset/clean path where core.hooksPath/core.fsmonitor fired), Invoke-CodeNexusLite.ps1, OpenSpec-Detector.ps1, and Invoke-SentruxAgentTool.ps1 (the previously unreported fourth instance on the live agent path). Regression test boobytraps a fixture repo with fsmonitor/hooksPath canaries.
  • ast-grep / repowise now spawn via tool_path absolute resolution instead of bare names with cwd inside the scanned repo; tool_path::locate skips relative PATH entries.

Supply chain (closes #35)

  • repowise pip install pinned (==0.36.0), plan text updated (supply-chain-003)
  • choco ripgrep pinned to 14.1.0 in both ci.yml sites (supply-chain-002 residual)
  • gh attestation verify documented in docs/public-beta.md (supply-chain-007 residual)
  • parity-observe.yml re-pinned to commit SHAs (restores fix(ci): harden workflow supply-chain and injection surface #43 hardening it had regressed)

Correctness (Rust core)

  • Non-ASCII (e.g. CJK) paths were silently dropped from audit scope and misclassified in sentrux git signalshardened_git now injects -c core.quotepath=false; real-git regression test with a 测试.txt fixture
  • change impact panicked (unwrap) on committed artifacts that passed validation — now exit-65 contract errors, and validate_native_array_artifact validates element shape
  • advisory.workflow-recommend.compat was dead for any relocated/CI-built binary (compile-time CARGO_MANIFEST_DIR only) — now resolves via discover_manifest
  • sentrux gate baselines missing metric keys silently disabled the quality gate (0.0 defaults) — keys now required present+numeric
  • index.json replacement crash window removed (bak-swap instead of remove-then-rename)
  • --help --all gained the four unlisted routes (audit, compatibility retirement-ticket, provider codenexus-adapt, repository survival-scan)

Live PS1 path

  • Model-routing adoption was dead code: the routed/authorized provider+model from -ModelRoutingResult could never be adopted (provider was normalized to non-empty before the emptiness guard). Routed values now win unless the operator explicitly overrode them.
  • update-code-intel-index.ps1 required a target\debug build no installer/release produces — proper resolution chain (CODE_INTEL_RUST_CLI → release → debug → PATH)
  • invoke-code-intel.ps1 honored pipeline.config.json artifactRoot only for -Repo/-Config shapes; and rejected -Verbose/-ErrorAction as "unsupported"
  • doctor's CODE_INTEL_HOME check was tautological (compared the env var against itself)

CI gates now gate

  • Ten previously never-executed PS1 suites wired into CI — including the PR fix(ai-safety): prompt injection boundary, hardened model delegate, audit regression fixtures #44 model-delegate ai-safety regression suite, test-primary-launchers.ps1 (tamper-rejection E2E), and the four conformance-evidence suites pinned by internalization records
  • Invoke-ModelChannelDelegate.ps1 / Invoke-SentruxAgentTool.ps1 added to parser-check lists
  • parity-observe.yml now provisions sentrux, so the harness's only evidenced comparison is no longer structurally vacuous
  • skill-check.yml: link check actually fails on broken relative links; darwin score's unscoreable dimension fixed; unused ANTHROPIC_API_KEY removed

Docs drift

  • README no longer claims the Rust DAG is the default engine (it is opt-in -DagCoordinate); artifact/read-flow sections distinguish primary-entry outputs from legacy-path artifacts; code-intel audit documented
  • follow-up-automation and sentrux auto-Pro claims aligned with shipped behavior

Verification

  • cargo test -p code-intel --all-targets: all green (incl. all 40 internalization-record digest tests after final re-sync)
  • Parser check on all 11 edited PS1 files: 0 failures
  • All 11 newly CI-wired PS1 suites run locally: PASS except test-run-commit-contract.ps1, which fails identically at unmodified HEAD (facade published an incoherent A07 marker) — pre-existing defect, wired continue-on-error with a comment, tracked in a follow-up issue
  • New regression tests: relative-PATH tool resolution, CJK path emission (real git fixture), fsmonitor/hooksPath boobytrap fixture, artifact element-shape rejection, index bak-swap, facade resolution black-box cases

Not fixed (deliberate)

  • strict-vs-lossy UTF-8 divergence between sentrux dsm and gate/check — strict behavior is test-pinned as intended; needs a design decision
  • primary entry not producing the legacy artifact set — product decision (docs were aligned honestly instead); docs/artifact-data-contract.md needs the same treatment
  • test-run-commit-contract.ps1 A07 marker incoherence at HEAD — separate issue

Refs #33, #35. Sweep and fix executed by a multi-agent workflow (6 finder lenses → adversarial verification → 10 disjoint fix agents → central digest re-sync and full verification).

…ng scripts

Extend run-code-intel.ps1's GitHardening pattern (core.fsmonitor, core.hooksPath,
core.sshCommand, diff.external, core.pager pinned empty + GIT_CONFIG_NOSYSTEM=1)
to every git invocation in Invoke-ScopedRepowise.ps1 (incl. the worktree-mutating
checkout/reset/clean path), Invoke-CodeNexusLite.ps1, OpenSpec-Detector.ps1, and
Invoke-SentruxAgentTool.ps1. Booby-trapped fixture in the scoped-repowise security
test proves fsmonitor/hooksPath no longer fire.

Closes the security-001 residual documented in #33.
- structured_edit/providers: resolve ast-grep and repowise through tool_path to
  absolute paths (with .cmd/.bat shim wrapping) instead of bare-name spawns with
  cwd inside the scanned repo
- tool_path: skip relative PATH entries so locate() only returns absolute paths
- hardened_git: inject -c core.quotepath=false so non-ASCII paths are emitted
  verbatim (fixes silent drops in audit scope and sentrux git signals)
- change_impact/artifact_ref: replace element-shape unwrap panics with exit-65
  contract errors; validate_native_array_artifact now validates element fields
- capability_inventory: resolve the workflow-recommendation facade via
  discover_manifest instead of compile-time CARGO_MANIFEST_DIR
- main: add four missing routes to FULL_HELP_TEXT (audit, compatibility
  retirement-ticket, provider codenexus-adapt, repository survival-scan)
- sentrux_gate: require gated metric keys present+numeric in baselines instead
  of silently comparing against 0.0
- artifact_index: replace remove-then-rename with bak-swap so index.json is
  recoverable at every instant
- audit_report tests: adversarial fixtures now assert the specific rejection
  reason, not just exit 65
- orchestration records: re-sync toolchain/conformance digest pins to the
  edited sources
- run-code-intel.ps1: model-routing adoption was dead code (provider normalized
  to non-empty before the intake guard checked for emptiness) - routed
  provider/model now win unless the operator explicitly overrode them
- update-code-intel-index.ps1: resolve the binary via CODE_INTEL_RUST_CLI,
  target/release, target/debug, then PATH instead of requiring a debug build
  that no installer or release ever produces
- invoke-code-intel.ps1: load the default pipeline.config.json for the plain
  -RepoPath shape (artifactRoot was silently dropped); stop rejecting
  PowerShell common parameters as unsupported options
- check-code-intel-tools.ps1: CODE_INTEL_HOME check compared the env var
  against itself; now checks the directory exists and flags divergence from
  the default derivation
- install-code-intel-pipeline.ps1: pin repowise (==0.36.0) instead of
  unpinned --upgrade (supply-chain-003 in #35)
- ci.yml: execute the ten previously never-run PS1 suites (incl. the PR #44
  model-delegate ai-safety regression suite and the conformance-evidence
  suites); add the two large PS1 entry points to both parser-check lists;
  pin choco ripgrep to 14.1.0 in both install sites (supply-chain-002)
- parity-observe.yml: provision sentrux + PATH before the parity harness (its
  only evidenced comparison was structurally vacuous without it); pin actions
  to commit SHAs and ripgrep to 14.1.0 (restores #43 hardening)
- skill-check.yml: link check now actually fails on broken relative links;
  darwin score gains the missing checkpoint_design scoring branch and drops
  the unused ANTHROPIC_API_KEY

test-run-commit-contract.ps1 is wired continue-on-error: it fails at HEAD with
'facade published an incoherent A07 marker' - pre-existing defect, tracked
separately.
- README: the un-flagged run-code-intel.ps1 default is the legacy scanner
  (Rust DAG is opt-in via -DagCoordinate), not the inverse; artifact/read-flow
  sections now distinguish primary-entry DAG outputs from legacy-path
  artifacts; document the 0.6.0 'code-intel audit' command
- follow-up-automation: emission and policy reading happen only on the legacy
  runner; the compiled primary entry does neither
- code-intel-architecture: sentrux Pro activation is SENTRUX_AUTO_PRO=1
  opt-in, not automatic
- public-beta: document release attestation verification with gh attestation
  verify (supply-chain-007 in #35)
@gemini-code-assist

Copy link
Copy Markdown

Caution

The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased.

@coderabbitai

coderabbitai Bot commented Jul 28, 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: 43 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

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: c70fa85c-d1c4-433a-af12-80f2cc3a57d2

📥 Commits

Reviewing files that changed from the base of the PR and between 384617f and 0d5ed71.

📒 Files selected for processing (38)
  • .github/workflows/ci.yml
  • .github/workflows/parity-observe.yml
  • .github/workflows/skill-check.yml
  • Invoke-CodeNexusLite.ps1
  • Invoke-ScopedRepowise.ps1
  • Invoke-SentruxAgentTool.ps1
  • OpenSpec-Detector.ps1
  • README.md
  • check-code-intel-tools.ps1
  • crates/code-intel-cli/src/artifact_index.rs
  • crates/code-intel-cli/src/artifact_ref.rs
  • crates/code-intel-cli/src/audit_report/cli_tests.rs
  • crates/code-intel-cli/src/capability_inventory.rs
  • crates/code-intel-cli/src/change_impact.rs
  • crates/code-intel-cli/src/hardened_git.rs
  • crates/code-intel-cli/src/main.rs
  • crates/code-intel-cli/src/providers.rs
  • crates/code-intel-cli/src/sentrux_gate.rs
  • crates/code-intel-cli/src/structured_edit.rs
  • crates/code-intel-cli/src/tool_path.rs
  • crates/code-intel-cli/tests/artifact_index.rs
  • crates/code-intel-cli/tests/artifact_ref.rs
  • crates/code-intel-cli/tests/capability_exec.rs
  • docs/code-intel-architecture.md
  • docs/follow-up-automation.md
  • docs/public-beta.md
  • install-code-intel-pipeline.ps1
  • invoke-code-intel.ps1
  • orchestration/integrations.json
  • orchestration/internalization/ast-grep.json
  • orchestration/internalization/codenexus.json
  • orchestration/internalization/repowise.json
  • orchestration/internalization/rg.json
  • orchestration/internalization/sentrux.json
  • run-code-intel.ps1
  • scripts/tests/test-regression-fixes.ps1
  • scripts/tests/test-scoped-repowise-security.ps1
  • update-code-intel-index.ps1

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.

@2233admin
2233admin merged commit 06e2194 into main Jul 28, 2026
5 of 10 checks passed
@2233admin
2233admin deleted the fix/sweep-hardening-and-gates branch July 28, 2026 02:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[self-audit] supply-chain department findings against this repository [self-audit] security department findings against this repository

1 participant