Skip to content

feat(rust): enforce hot-path authority and remove PostToolUse Python fallback - #2598

Open
kantorcodes wants to merge 10 commits into
release/3.0from
rust/hotpath-authority-t001-t100
Open

feat(rust): enforce hot-path authority and remove PostToolUse Python fallback#2598
kantorcodes wants to merge 10 commits into
release/3.0from
rust/hotpath-authority-t001-t100

Conversation

@kantorcodes

@kantorcodes kantorcodes commented Aug 26, 2026

Copy link
Copy Markdown
Member

Summary

Implements the T001-T100 Rust hot-path stability tranche for release/3.0.

  • adds a versioned ownership manifest covering hook decisions, resident transport, packaging, and migration governance
  • adds an always-selected, merge-base-aware authority gate with hard-expiring waivers and unmapped-path rejection
  • classifies both source and destination paths for renames and copies
  • adds privacy-safe backend receipts and asynchronously persisted aggregate route counters
  • removes the Python scanner/evaluator fallback from the daemon PostToolUse path
  • converts native failure, including HOL_GUARD_NATIVE=off, into a deterministic fail-safe block instead of changing decision engines
  • hardens mixed documentation/source target handling so documentation relaxation cannot weaken source scanning
  • adds real compiled-runtime integration for one-shot, authenticated resident, and all supported harness routes

Ownership impact

PostToolUse is Rust-authoritative after this change. Python remains a bounded transport and harness-mapping layer and cannot substitute HookReviewEngine, ContentScanner, or HookDecisionCache when native evaluation fails.

PreToolUse is explicitly staged for the immediately following delivery. The manifest carries one short, hard-expiring waiver through 2026-09-02. It does not allow Python fallback on a Rust-owned surface.

There is no strict mode. Rust is the product default.

Validation

The authority workflow runs entirely on GitHub-hosted runners for pull requests and enforces every selected manifest job:

  • Rust workspace formatting, Clippy, tests, release build, and runtime self-test
  • one-shot and authenticated resident integration
  • all-harness PostToolUse integration through the production worker route
  • native command-model and Rust/Python differential gates needed by staged PreToolUse
  • resident transport fault tests and performance budgets
  • native release contracts and installed static native-wheel integration

The all-harness proof reads measured aggregate counters from the production routing layer and requires zero Python decisions and zero native fail-safe outcomes. Evidence and reports reject both raw and JSON-escaped request content.

Targets release/3.0 only. Never merge into main.

@coderabbitai

coderabbitai Bot commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

🗂️ Base branches to auto review (2)
  • release/2.2
  • release/3.1

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI (base), Organization UI (inherited)

Review profile: CHILL

Plan: Pro Plus

Run ID: a785653d-3bba-4ed7-b57c-af290e847355

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

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.

@qodo-free-for-open-source-projects

qodo-free-for-open-source-projects Bot commented Aug 26, 2026

Copy link
Copy Markdown

PR Summary by Qodo

Enforce Rust PostToolUse authority and fail-safe native routing

✨ Enhancement 🐞 Bug fix 🧪 Tests 📝 Documentation ⚙️ Configuration changes 🕐 40+ Minutes

Grey Divider

AI Description

• Makes Rust authoritative for PostToolUse and fail-safe blocks unavailable native evaluation.
• Adds manifest-driven, merge-base-aware CI governance with expiring waivers and unmapped-path
 rejection.
• Proves compiled one-shot/resident routes and records privacy-safe aggregate backend evidence.
Diagram

graph TD
  A["PostToolUse"] --> B["Python Worker"] --> C["Rust Runtime"] --> D{"Valid Decision?"}
  D -->|valid| E["Rust Result"] --> G["Receipt Metrics"] --> H["Harness Response"]
  D -->|failure| F["Fail-Safe Block"] --> G
Loading
High-Level Assessment

The following are alternative approaches to this PR:

1. Retain Python compatibility fallback
  • ➕ Preserves decisions when the native runtime is unavailable
  • ➕ Reduces immediate behavior changes for existing deployments
  • ➖ Silently changes security engines on failure
  • ➖ Violates the declared Rust authority boundary
  • ➖ Makes route behavior and evidence harder to reason about
2. Move transport supervision into Rust immediately
  • ➕ Creates a fully native data path
  • ➕ Further reduces Python involvement and boundary complexity
  • ➖ Expands this tranche into daemon lifecycle, packaging, and harness migration
  • ➖ Increases rollout risk and delays the targeted PostToolUse authority fix

Recommendation: Use the PR's staged boundary: keep Python limited to transport and harness mapping, require Rust decisions for PostToolUse, and fail closed when native evaluation is unavailable. The manifest and expiring PreToolUse waiver make the remaining migration explicit without retaining an ambiguous production fallback.

Files changed (9) +992 / -80

Enhancement (1) +138 / -0
native_route_metrics.pyAdd privacy-safe native route receipts and counters +138/-0

Add privacy-safe native route receipts and counters

• Introduces bounded backend receipts attached to hook response metrics and thread-safe aggregate Rust/Python route counters. Retained dimensions are restricted to sanitized event, backend, core, transport, and reason identifiers.

src/codex_plugin_scanner/guard/native_route_metrics.py

Bug fix (1) +55 / -80
hook_worker.pyRemove the PostToolUse Python evaluator fallback +55/-80

Remove the PostToolUse Python evaluator fallback

• Eliminates Python scanner, cache, configuration, and review-engine construction from the daemon PostToolUse path. Native unavailability now returns a deterministic block, while valid Rust decisions receive backend receipts before harness mapping.

src/codex_plugin_scanner/guard/daemon/hook_worker.py

Tests (1) +209 / -0
rust_authority_integration.pyProve compiled one-shot and resident Rust authority +209/-0

Prove compiled one-shot and resident Rust authority

• Exercises the real runtime with safe and secret-bearing PostToolUse payloads over one-shot and authenticated Unix resident routes. Verifies HMAC authentication, digest-bound framing, allow/block decisions, excerpt suppression, and aggregate zero-fallback evidence.

scripts/integration/rust_authority_integration.py

Documentation (2) +51 / -0
rust-data-plane-boundary.mdDocument the Rust data-plane authority boundary +39/-0

Document the Rust data-plane authority boundary

• Defines Rust as the PostToolUse decision authority and limits Python to control-plane and bounded transport responsibilities. Documents fail-safe behavior, privacy constraints, CI governance, and the staged PreToolUse cutover.

docs/guard/rust-data-plane-boundary.md

rust-hotpath-todo-001-100.mdRecord the T001-T100 delivery boundary +12/-0

Record the T001-T100 delivery boundary

• Summarizes the first corrective-program tranche and identifies follow-up work gated by the short-lived PreToolUse waiver.

docs/guard/rust-hotpath-todo-001-100.md

Other (4) +539 / -0
rust-hotpath-authority.ymlAdd always-on Rust authority CI workflow +114/-0

Add always-on Rust authority CI workflow

• Adds merge-base ownership classification for every release/3.0 change. Selected Rust changes build the pinned release runtime, run metadata/format/Clippy gates, execute real one-shot and resident integration, and publish evidence artifacts.

.github/workflows/rust-hotpath-authority.yml

rust-hotpath-ownership-report.jsonCommit the Rust ownership baseline report +19/-0

Commit the Rust ownership baseline report

• Records the versioned release boundary, Rust product default, prohibited Python decision fallback, governed surfaces, and the temporary PreToolUse waiver.

ci/rust-hotpath-ownership-report.json

rust-hotpath-ownership.tomlDefine versioned hot-path ownership policy +129/-0

Define versioned hot-path ownership policy

• Maps decision, transport, packaging, and governance surfaces to authorities, path patterns, required jobs, and fallback rules. Establishes route-share thresholds and a hard-expiring PreToolUse migration waiver.

ci/rust-hotpath-ownership.toml

rust_hotpath_ownership.pyValidate and classify hot-path ownership changes +277/-0

Validate and classify hot-path ownership changes

• Validates manifest schema, authority declarations, fallback rules, and waiver dates. Classifies rename-aware merge-base diffs, selects required jobs, emits GitHub outputs and reports, and rejects unmapped hot-path files.

scripts/ci/rust_hotpath_ownership.py

@qodo-free-for-open-source-projects

qodo-free-for-open-source-projects Bot commented Aug 26, 2026

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (1) 📘 Rule violations (0) 📎 Requirement gaps (0) 🎨 UX issues (0) 🔗 Cross-repo conflicts (0) 📜 Skill insights (0)

Grey Divider


Action required

1. Observe mode now blocks ✓ Resolved 🐞 Bug ≡ Correctness
Description
HookWorker.review_http_payload() now always sends observe_mode=False, so installations
configured with mode = "observe" will deny secret-bearing PostToolUse output instead of allowing
it while recording the observed block. This removes an existing product mode from the daemon's
now-authoritative path.
Code

src/codex_plugin_scanner/guard/daemon/hook_worker.py[92]

+        response = review_post_tool_native(request, observe_mode=False)
Relevance

●●● Strong

Removing an existing product mode from the authoritative path is a clear semantic regression,
matches accepted fix patterns.

PR-#2266

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The changed worker hardcodes false, while both the former Python engine and Rust core explicitly
project deny responses to allow_original when observe mode is enabled.

src/codex_plugin_scanner/guard/daemon/hook_worker.py[78-92]
src/codex_plugin_scanner/guard/runtime/hook_review_engine.py[123-150]
rust/crates/guard-hook-core/src/lib.rs[400-424]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The Rust-authoritative PostToolUse worker hardcodes enforcement mode and ignores the configured observe mode.
## Issue Context
Load the effective guard configuration as before and pass its observe-mode state to the native runtime; do not restore Python evaluation fallback.
## Fix Focus Areas
- src/codex_plugin_scanner/guard/daemon/hook_worker.py[78-92]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


2. Fail-safe handler now crashes ✓ Resolved 🐞 Bug ☼ Reliability
Description
The PR removes HookWorker.metrics, but the daemon's catch-all failure path still calls
hook_worker.metrics.record_failure() before constructing its block response. Any exception outside
the native wrapper now raises AttributeError in the exception handler instead of returning the
promised deterministic fail-safe block.
Code

src/codex_plugin_scanner/guard/daemon/hook_worker.py[L76-78]

-        from .hook_metrics import HookMetricsRecorder
-
-        self.metrics = HookMetricsRecorder()
Relevance

●●● Strong

Recent reliability findings accept fixes preventing exceptions from escaping daemon failure/repair
paths.

PR-#1853
PR-#1858

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The new constructor no longer initializes metrics, while the unchanged server exception handler
dereferences that attribute before returning its fail-safe response.

src/codex_plugin_scanner/guard/daemon/hook_worker.py[59-65]
src/codex_plugin_scanner/guard/daemon/server.py[6099-6112]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
Removing the worker metrics recorder breaks the daemon's catch-all fail-safe path.
## Issue Context
Keep or replace the recorder used by the server, or make server-side failure recording independently best-effort before returning the block response.
## Fix Focus Areas
- src/codex_plugin_scanner/guard/daemon/hook_worker.py[62-65]
- src/codex_plugin_scanner/guard/daemon/server.py[6099-6112]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


3. Selected jobs are never enforced ✓ Resolved 🐞 Bug ≡ Correctness
Description
The classifier selects all-harness, pretool-integration, command-differential,
transport-faults, performance, native-release, and installed-wheel, but this workflow
defines and enforces only rust-local-integration. Changes mapped to those requirements can
therefore pass the authority summary without the manifest-required validation running.
Code

.github/workflows/rust-hotpath-authority.yml[R111-114]

+          test "${{ needs.ownership.result }}" = "success"
+          if [[ "${{ needs.ownership.outputs.rust }}" == "true" || "${{ needs.ownership.outputs.resident_integration }}" == "true" ]]; then
+            test "${{ needs.rust-local-integration.result }}" = "success"
+          fi
Relevance

●●● Strong

Accepted workflow precedents enforce missing or bypassable validation gates; selected manifest jobs
must be checked.

PR-#2151

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
Classification adds every matched surface's required jobs, but the workflow has only one downstream
job and the summary checks only the rust/resident-integration condition. For example, native
packaging explicitly requires two jobs that are absent here.

scripts/ci/rust_hotpath_ownership.py[151-174]
ci/rust-hotpath-ownership.toml[84-102]
.github/workflows/rust-hotpath-authority.yml[17-30]
.github/workflows/rust-hotpath-authority.yml[66-114]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
Most manifest-selected required jobs have no corresponding workflow job or summary assertion.
## Issue Context
Add the missing conditional jobs or invoke reusable workflows for them, and make the summary reject every selected job whose result is not success.
## Fix Focus Areas
- .github/workflows/rust-hotpath-authority.yml[17-30]
- .github/workflows/rust-hotpath-authority.yml[103-114]
- ci/rust-hotpath-ownership.toml[12-120]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


View high (22)
4. Manifest permits authority downgrade ✓ Resolved 🐞 Bug ⛨ Security
Description
validate_manifest() checks only that authority values are members of broad enums and that
python_authority_allowed is a boolean; it does not enforce that PostToolUse remains Rust-owned,
that its Python authority flag remains false, or that its required jobs remain fixed. A PR can
modify the manifest alongside implementation code to remap the surface to migration with only
ownership required, and the new gate will accept the downgrade.
Code

scripts/ci/rust_hotpath_ownership.py[R96-99]

+        if raw.get("authority") not in VALID_AUTHORITY:
+            raise ValueError(f"surface {surface_id} has invalid authority")
+        if raw.get("target_authority") not in VALID_AUTHORITY:
+            raise ValueError(f"surface {surface_id} has invalid target_authority")
Relevance

●●● Strong

Security review history accepts trust-chain hardening; mutable authority and required jobs need
protected invariants.

PR-#2151

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The manifest currently declares PostToolUse as Rust-owned with Python authority forbidden, but
validation allows any authority enum and either boolean value; classification then trusts the
manifest's mutable required_jobs without a protected minimum.

ci/rust-hotpath-ownership.toml[12-39]
scripts/ci/rust_hotpath_ownership.py[85-107]
scripts/ci/rust_hotpath_ownership.py[151-174]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The validator accepts semantically weakened ownership declarations for protected surfaces.
## Issue Context
Encode required authority, target authority, Python-authority prohibition, fallback, and minimum required-job invariants for each protected surface rather than validating only types and enum membership.
## Fix Focus Areas
- scripts/ci/rust_hotpath_ownership.py[74-108]
- ci/rust-hotpath-ownership.toml[12-39]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


5. Renames evade hot-path gate ✓ Resolved 🐞 Bug ⛨ Security
Description
git diff --name-only --find-renames supplies only the destination pathname for a detected rename,
so moving a mapped hot-path file outside HOT_PATH_PREFIXES removes the source path from
classification and leaves the destination ignored. Such a PR can relocate or disable authoritative
code without selecting its required jobs or triggering unknown_hot_paths.
Code

scripts/ci/rust_hotpath_ownership.py[R133-136]

+def _git_paths(root: Path, base: str, head: str) -> list[str]:
+    completed = subprocess.run(
+        ["git", "diff", "--name-only", "--find-renames", f"{base}...{head}"],
+        cwd=root,
Relevance

●●● Strong

PR explicitly targets rename/unmapped-path bypasses; this is a direct security gap in that stated
intent.

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The diff collection returns one pathname per output line and classification only evaluates those
returned names against protected prefixes. There is no representation or handling of a rename's old
and new path pair.

scripts/ci/rust_hotpath_ownership.py[133-144]
scripts/ci/rust_hotpath_ownership.py[151-174]
scripts/ci/rust_hotpath_ownership.py[201-235]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
Rename detection discards the mapped source pathname, allowing moves out of protected prefixes to bypass ownership classification.
## Issue Context
Parse `git diff --name-status -z --find-renames` (or equivalent) and classify both source and destination paths for renames and copies; add self-tests for moves into and out of protected prefixes.
## Fix Focus Areas
- scripts/ci/rust_hotpath_ownership.py[133-144]
- scripts/ci/rust_hotpath_ownership.py[151-174]
- scripts/ci/rust_hotpath_ownership.py[201-235]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


6. Selected jobs are never enforced ✓ Resolved 🐞 Bug ≡ Correctness
Description
The classifier selects all-harness, pretool-integration, command-differential,
transport-faults, performance, native-release, and installed-wheel, but this workflow
defines and enforces only rust-local-integration. Changes mapped to those requirements can
therefore pass the authority summary without the manifest-required validation running.
Code

.github/workflows/rust-hotpath-authority.yml[R111-114]

+          test "${{ needs.ownership.result }}" = "success"
+          if [[ "${{ needs.ownership.outputs.rust }}" == "true" || "${{ needs.ownership.outputs.resident_integration }}" == "true" ]]; then
+            test "${{ needs.rust-local-integration.result }}" = "success"
+          fi
Relevance

●●● Strong

Accepted workflow precedents enforce missing or bypassable validation gates; selected manifest jobs
must be checked.

PR-#2151

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
Classification adds every matched surface's required jobs, but the workflow has only one downstream
job and the summary checks only the rust/resident-integration condition. For example, native
packaging explicitly requires two jobs that are absent here.

scripts/ci/rust_hotpath_ownership.py[151-174]
ci/rust-hotpath-ownership.toml[84-102]
.github/workflows/rust-hotpath-authority.yml[17-30]
.github/workflows/rust-hotpath-authority.yml[66-114]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
Most manifest-selected required jobs have no corresponding workflow job or summary assertion.
## Issue Context
Add the missing conditional jobs or invoke reusable workflows for them, and make the summary reject every selected job whose result is not success.
## Fix Focus Areas
- .github/workflows/rust-hotpath-authority.yml[17-30]
- .github/workflows/rust-hotpath-authority.yml[103-114]
- ci/rust-hotpath-ownership.toml[12-120]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


7. Manifest permits authority downgrade ✓ Resolved 🐞 Bug ⛨ Security
Description
validate_manifest() checks only that authority values are members of broad enums and that
python_authority_allowed is a boolean; it does not enforce that PostToolUse remains Rust-owned,
that its Python authority flag remains false, or that its required jobs remain fixed. A PR can
modify the manifest alongside implementation code to remap the surface to migration with only
ownership required, and the new gate will accept the downgrade.
Code

scripts/ci/rust_hotpath_ownership.py[R96-99]

+        if raw.get("authority") not in VALID_AUTHORITY:
+            raise ValueError(f"surface {surface_id} has invalid authority")
+        if raw.get("target_authority") not in VALID_AUTHORITY:
+            raise ValueError(f"surface {surface_id} has invalid target_authority")
Relevance

●●● Strong

Security review history accepts trust-chain hardening; mutable authority and required jobs need
protected invariants.

PR-#2151

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The manifest currently declares PostToolUse as Rust-owned with Python authority forbidden, but
validation allows any authority enum and either boolean value; classification then trusts the
manifest's mutable required_jobs without a protected minimum.

ci/rust-hotpath-ownership.toml[12-39]
scripts/ci/rust_hotpath_ownership.py[85-107]
scripts/ci/rust_hotpath_ownership.py[151-174]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The validator accepts semantically weakened ownership declarations for protected surfaces.
## Issue Context
Encode required authority, target authority, Python-authority prohibition, fallback, and minimum required-job invariants for each protected surface rather than validating only types and enum membership.
## Fix Focus Areas
- scripts/ci/rust_hotpath_ownership.py[74-108]
- ci/rust-hotpath-ownership.toml[12-39]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


8. Renames evade hot-path gate ✓ Resolved 🐞 Bug ⛨ Security
Description
git diff --name-only --find-renames supplies only the destination pathname for a detected rename,
so moving a mapped hot-path file outside HOT_PATH_PREFIXES removes the source path from
classification and leaves the destination ignored. Such a PR can relocate or disable authoritative
code without selecting its required jobs or triggering unknown_hot_paths.
Code

scripts/ci/rust_hotpath_ownership.py[R133-136]

+def _git_paths(root: Path, base: str, head: str) -> list[str]:
+    completed = subprocess.run(
+        ["git", "diff", "--name-only", "--find-renames", f"{base}...{head}"],
+        cwd=root,
Relevance

●●● Strong

PR explicitly targets rename/unmapped-path bypasses; this is a direct security gap in that stated
intent.

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The diff collection returns one pathname per output line and classification only evaluates those
returned names against protected prefixes. There is no representation or handling of a rename's old
and new path pair.

scripts/ci/rust_hotpath_ownership.py[133-144]
scripts/ci/rust_hotpath_ownership.py[151-174]
scripts/ci/rust_hotpath_ownership.py[201-235]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
Rename detection discards the mapped source pathname, allowing moves out of protected prefixes to bypass ownership classification.
## Issue Context
Parse `git diff --name-status -z --find-renames` (or equivalent) and classify both source and destination paths for renames and copies; add self-tests for moves into and out of protected prefixes.
## Fix Focus Areas
- scripts/ci/rust_hotpath_ownership.py[133-144]
- scripts/ci/rust_hotpath_ownership.py[151-174]
- scripts/ci/rust_hotpath_ownership.py[201-235]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


9. Observe mode now blocks ✓ Resolved 🐞 Bug ≡ Correctness
Description
HookWorker.review_http_payload() now always sends observe_mode=False, so installations
configured with mode = "observe" will deny secret-bearing PostToolUse output instead of allowing
it while recording the observed block. This removes an existing product mode from the daemon's
now-authoritative path.
Code

src/codex_plugin_scanner/guard/daemon/hook_worker.py[92]

+        response = review_post_tool_native(request, observe_mode=False)
Relevance

●●● Strong

Removing an existing product mode from the authoritative path is a clear semantic regression,
matches accepted fix patterns.

PR-#2266

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The changed worker hardcodes false, while both the former Python engine and Rust core explicitly
project deny responses to allow_original when observe mode is enabled.

src/codex_plugin_scanner/guard/daemon/hook_worker.py[78-92]
src/codex_plugin_scanner/guard/runtime/hook_review_engine.py[123-150]
rust/crates/guard-hook-core/src/lib.rs[400-424]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The Rust-authoritative PostToolUse worker hardcodes enforcement mode and ignores the configured observe mode.
## Issue Context
Load the effective guard configuration as before and pass its observe-mode state to the native runtime; do not restore Python evaluation fallback.
## Fix Focus Areas
- src/codex_plugin_scanner/guard/daemon/hook_worker.py[78-92]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


10. Fail-safe handler now crashes ✓ Resolved 🐞 Bug ☼ Reliability
Description
The PR removes HookWorker.metrics, but the daemon's catch-all failure path still calls
hook_worker.metrics.record_failure() before constructing its block response. Any exception outside
the native wrapper now raises AttributeError in the exception handler instead of returning the
promised deterministic fail-safe block.
Code

src/codex_plugin_scanner/guard/daemon/hook_worker.py[L76-78]

-        from .hook_metrics import HookMetricsRecorder
-
-        self.metrics = HookMetricsRecorder()
Relevance

●●● Strong

Recent reliability findings accept fixes preventing exceptions from escaping daemon failure/repair
paths.

PR-#1853
PR-#1858

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The new constructor no longer initializes metrics, while the unchanged server exception handler
dereferences that attribute before returning its fail-safe response.

src/codex_plugin_scanner/guard/daemon/hook_worker.py[59-65]
src/codex_plugin_scanner/guard/daemon/server.py[6099-6112]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
Removing the worker metrics recorder breaks the daemon's catch-all fail-safe path.
## Issue Context
Keep or replace the recorder used by the server, or make server-side failure recording independently best-effort before returning the block response.
## Fix Focus Areas
- src/codex_plugin_scanner/guard/daemon/hook_worker.py[62-65]
- src/codex_plugin_scanner/guard/daemon/server.py[6099-6112]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


11. Selected jobs are never enforced ✓ Resolved 🐞 Bug ≡ Correctness
Description
The classifier selects all-harness, pretool-integration, command-differential,
transport-faults, performance, native-release, and installed-wheel, but this workflow
defines and enforces only rust-local-integration. Changes mapped to those requirements can
therefore pass the authority summary without the manifest-required validation running.
Code

.github/workflows/rust-hotpath-authority.yml[R111-114]

+          test "${{ needs.ownership.result }}" = "success"
+          if [[ "${{ needs.ownership.outputs.rust }}" == "true" || "${{ needs.ownership.outputs.resident_integration }}" == "true" ]]; then
+            test "${{ needs.rust-local-integration.result }}" = "success"
+          fi
Relevance

●●● Strong

Accepted workflow precedents enforce missing or bypassable validation gates; selected manifest jobs
must be checked.

PR-#2151

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
Classification adds every matched surface's required jobs, but the workflow has only one downstream
job and the summary checks only the rust/resident-integration condition. For example, native
packaging explicitly requires two jobs that are absent here.

scripts/ci/rust_hotpath_ownership.py[151-174]
ci/rust-hotpath-ownership.toml[84-102]
.github/workflows/rust-hotpath-authority.yml[17-30]
.github/workflows/rust-hotpath-authority.yml[66-114]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
Most manifest-selected required jobs have no corresponding workflow job or summary assertion.
## Issue Context
Add the missing conditional jobs or invoke reusable workflows for them, and make the summary reject every selected job whose result is not success.
## Fix Focus Areas
- .github/workflows/rust-hotpath-authority.yml[17-30]
- .github/workflows/rust-hotpath-authority.yml[103-114]
- ci/rust-hotpath-ownership.toml[12-120]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


12. Manifest permits authority downgrade ✓ Resolved 🐞 Bug ⛨ Security
Description
validate_manifest() checks only that authority values are members of broad enums and that
python_authority_allowed is a boolean; it does not enforce that PostToolUse remains Rust-owned,
that its Python authority flag remains false, or that its required jobs remain fixed. A PR can
modify the manifest alongside implementation code to remap the surface to migration with only
ownership required, and the new gate will accept the downgrade.
Code

scripts/ci/rust_hotpath_ownership.py[R96-99]

+        if raw.get("authority") not in VALID_AUTHORITY:
+            raise ValueError(f"surface {surface_id} has invalid authority")
+        if raw.get("target_authority") not in VALID_AUTHORITY:
+            raise ValueError(f"surface {surface_id} has invalid target_authority")
Relevance

●●● Strong

Security review history accepts trust-chain hardening; mutable authority and required jobs need
protected invariants.

PR-#2151

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The manifest currently declares PostToolUse as Rust-owned with Python authority forbidden, but
validation allows any authority enum and either boolean value; classification then trusts the
manifest's mutable required_jobs without a protected minimum.

ci/rust-hotpath-ownership.toml[12-39]
scripts/ci/rust_hotpath_ownership.py[85-107]
scripts/ci/rust_hotpath_ownership.py[151-174]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The validator accepts semantically weakened ownership declarations for protected surfaces.
## Issue Context
Encode required authority, target authority, Python-authority prohibition, fallback, and minimum required-job invariants for each protected surface rather than validating only types and enum membership.
## Fix Focus Areas
- scripts/ci/rust_hotpath_ownership.py[74-108]
- ci/rust-hotpath-ownership.toml[12-39]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


13. Renames evade hot-path gate ✓ Resolved 🐞 Bug ⛨ Security
Description
git diff --name-only --find-renames supplies only the destination pathname for a detected rename,
so moving a mapped hot-path file outside HOT_PATH_PREFIXES removes the source path from
classification and leaves the destination ignored. Such a PR can relocate or disable authoritative
code without selecting its required jobs or triggering unknown_hot_paths.
Code

scripts/ci/rust_hotpath_ownership.py[R133-136]

+def _git_paths(root: Path, base: str, head: str) -> list[str]:
+    completed = subprocess.run(
+        ["git", "diff", "--name-only", "--find-renames", f"{base}...{head}"],
+        cwd=root,
Relevance

●●● Strong

PR explicitly targets rename/unmapped-path bypasses; this is a direct security gap in that stated
intent.

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The diff collection returns one pathname per output line and classification only evaluates those
returned names against protected prefixes. There is no representation or handling of a rename's old
and new path pair.

scripts/ci/rust_hotpath_ownership.py[133-144]
scripts/ci/rust_hotpath_ownership.py[151-174]
scripts/ci/rust_hotpath_ownership.py[201-235]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
Rename detection discards the mapped source pathname, allowing moves out of protected prefixes to bypass ownership classification.
## Issue Context
Parse `git diff --name-status -z --find-renames` (or equivalent) and classify both source and destination paths for renames and copies; add self-tests for moves into and out of protected prefixes.
## Fix Focus Areas
- scripts/ci/rust_hotpath_ownership.py[133-144]
- scripts/ci/rust_hotpath_ownership.py[151-174]
- scripts/ci/rust_hotpath_ownership.py[201-235]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


14. Observe mode now blocks ✓ Resolved 🐞 Bug ≡ Correctness
Description
HookWorker.review_http_payload() now always sends observe_mode=False, so installations
configured with mode = "observe" will deny secret-bearing PostToolUse output instead of allowing
it while recording the observed block. This removes an existing product mode from the daemon's
now-authoritative path.
Code

src/codex_plugin_scanner/guard/daemon/hook_worker.py[92]

+        response = review_post_tool_native(request, observe_mode=False)
Relevance

●●● Strong

Removing an existing product mode from the authoritative path is a clear semantic regression,
matches accepted fix patterns.

PR-#2266

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The changed worker hardcodes false, while both the former Python engine and Rust core explicitly
project deny responses to allow_original when observe mode is enabled.

src/codex_plugin_scanner/guard/daemon/hook_worker.py[78-92]
src/codex_plugin_scanner/guard/runtime/hook_review_engine.py[123-150]
rust/crates/guard-hook-core/src/lib.rs[400-424]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The Rust-authoritative PostToolUse worker hardcodes enforcement mode and ignores the configured observe mode.
## Issue Context
Load the effective guard configuration as before and pass its observe-mode state to the native runtime; do not restore Python evaluation fallback.
## Fix Focus Areas
- src/codex_plugin_scanner/guard/daemon/hook_worker.py[78-92]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


15. Fail-safe handler now crashes ✓ Resolved 🐞 Bug ☼ Reliability
Description
The PR removes HookWorker.metrics, but the daemon's catch-all failure path still calls
hook_worker.metrics.record_failure() before constructing its block response. Any exception outside
the native wrapper now raises AttributeError in the exception handler instead of returning the
promised deterministic fail-safe block.
Code

src/codex_plugin_scanner/guard/daemon/hook_worker.py[L76-78]

-        from .hook_metrics import HookMetricsRecorder
-
-        self.metrics = HookMetricsRecorder()
Relevance

●●● Strong

Recent reliability findings accept fixes preventing exceptions from escaping daemon failure/repair
paths.

PR-#1853
PR-#1858

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The new constructor no longer initializes metrics, while the unchanged server exception handler
dereferences that attribute before returning its fail-safe response.

src/codex_plugin_scanner/guard/daemon/hook_worker.py[59-65]
src/codex_plugin_scanner/guard/daemon/server.py[6099-6112]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
Removing the worker metrics recorder breaks the daemon's catch-all fail-safe path.
## Issue Context
Keep or replace the recorder used by the server, or make server-side failure recording independently best-effort before returning the block response.
## Fix Focus Areas
- src/codex_plugin_scanner/guard/daemon/hook_worker.py[62-65]
- src/codex_plugin_scanner/guard/daemon/server.py[6099-6112]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


16. Selected jobs are never enforced ✓ Resolved 🐞 Bug ≡ Correctness
Description
The classifier selects all-harness, pretool-integration, command-differential,
transport-faults, performance, native-release, and installed-wheel, but this workflow
defines and enforces only rust-local-integration. Changes mapped to those requirements can
therefore pass the authority summary without the manifest-required validation running.
Code

.github/workflows/rust-hotpath-authority.yml[R111-114]

+          test "${{ needs.ownership.result }}" = "success"
+          if [[ "${{ needs.ownership.outputs.rust }}" == "true" || "${{ needs.ownership.outputs.resident_integration }}" == "true" ]]; then
+            test "${{ needs.rust-local-integration.result }}" = "success"
+          fi
Relevance

●●● Strong

Accepted workflow precedents enforce missing or bypassable validation gates; selected manifest jobs
must be checked.

PR-#2151

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
Classification adds every matched surface's required jobs, but the workflow has only one downstream
job and the summary checks only the rust/resident-integration condition. For example, native
packaging explicitly requires two jobs that are absent here.

scripts/ci/rust_hotpath_ownership.py[151-174]
ci/rust-hotpath-ownership.toml[84-102]
.github/workflows/rust-hotpath-authority.yml[17-30]
.github/workflows/rust-hotpath-authority.yml[66-114]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
Most manifest-selected required jobs have no corresponding workflow job or summary assertion.
## Issue Context
Add the missing conditional jobs or invoke reusable workflows for them, and make the summary reject every selected job whose result is not success.
## Fix Focus Areas
- .github/workflows/rust-hotpath-authority.yml[17-30]
- .github/workflows/rust-hotpath-authority.yml[103-114]
- ci/rust-hotpath-ownership.toml[12-120]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


17. Manifest permits authority downgrade ✓ Resolved 🐞 Bug ⛨ Security
Description
validate_manifest() checks only that authority values are members of broad enums and that
python_authority_allowed is a boolean; it does not enforce that PostToolUse remains Rust-owned,
that its Python authority flag remains false, or that its required jobs remain fixed. A PR can
modify the manifest alongside implementation code to remap the surface to migration with only
ownership required, and the new gate will accept the downgrade.
Code

scripts/ci/rust_hotpath_ownership.py[R96-99]

+        if raw.get("authority") not in VALID_AUTHORITY:
+            raise ValueError(f"surface {surface_id} has invalid authority")
+        if raw.get("target_authority") not in VALID_AUTHORITY:
+            raise ValueError(f"surface {surface_id} has invalid target_authority")
Relevance

●●● Strong

Security review history accepts trust-chain hardening; mutable authority and required jobs need
protected invariants.

PR-#2151

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The manifest currently declares PostToolUse as Rust-owned with Python authority forbidden, but
validation allows any authority enum and either boolean value; classification then trusts the
manifest's mutable required_jobs without a protected minimum.

ci/rust-hotpath-ownership.toml[12-39]
scripts/ci/rust_hotpath_ownership.py[85-107]
scripts/ci/rust_hotpath_ownership.py[151-174]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The validator accepts semantically weakened ownership declarations for protected surfaces.
## Issue Context
Encode required authority, target authority, Python-authority prohibition, fallback, and minimum required-job invariants for each protected surface rather than validating only types and enum membership.
## Fix Focus Areas
- scripts/ci/rust_hotpath_ownership.py[74-108]
- ci/rust-hotpath-ownership.toml[12-39]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


18. Renames evade hot-path gate ✓ Resolved 🐞 Bug ⛨ Security
Description
git diff --name-only --find-renames supplies only the destination pathname for a detected rename,
so moving a mapped hot-path file outside HOT_PATH_PREFIXES removes the source path from
classification and leaves the destination ignored. Such a PR can relocate or disable authoritative
code without selecting its required jobs or triggering unknown_hot_paths.
Code

scripts/ci/rust_hotpath_ownership.py[R133-136]

+def _git_paths(root: Path, base: str, head: str) -> list[str]:
+    completed = subprocess.run(
+        ["git", "diff", "--name-only", "--find-renames", f"{base}...{head}"],
+        cwd=root,
Relevance

●●● Strong

PR explicitly targets rename/unmapped-path bypasses; this is a direct security gap in that stated
intent.

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The diff collection returns one pathname per output line and classification only evaluates those
returned names against protected prefixes. There is no representation or handling of a rename's old
and new path pair.

scripts/ci/rust_hotpath_ownership.py[133-144]
scripts/ci/rust_hotpath_ownership.py[151-174]
scripts/ci/rust_hotpath_ownership.py[201-235]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
Rename detection discards the mapped source pathname, allowing moves out of protected prefixes to bypass ownership classification.
## Issue Context
Parse `git diff --name-status -z --find-renames` (or equivalent) and classify both source and destination paths for renames and copies; add self-tests for moves into and out of protected prefixes.
## Fix Focus Areas
- scripts/ci/rust_hotpath_ownership.py[133-144]
- scripts/ci/rust_hotpath_ownership.py[151-174]
- scripts/ci/rust_hotpath_ownership.py[201-235]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


19. Observe mode now blocks ✓ Resolved 🐞 Bug ≡ Correctness
Description
HookWorker.review_http_payload() now always sends observe_mode=False, so installations
configured with mode = "observe" will deny secret-bearing PostToolUse output instead of allowing
it while recording the observed block. This removes an existing product mode from the daemon's
now-authoritative path.
Code

src/codex_plugin_scanner/guard/daemon/hook_worker.py[92]

+        response = review_post_tool_native(request, observe_mode=False)
Relevance

●●● Strong

Removing an existing product mode from the authoritative path is a clear semantic regression,
matches accepted fix patterns.

PR-#2266

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The changed worker hardcodes false, while both the former Python engine and Rust core explicitly
project deny responses to allow_original when observe mode is enabled.

src/codex_plugin_scanner/guard/daemon/hook_worker.py[78-92]
src/codex_plugin_scanner/guard/runtime/hook_review_engine.py[123-150]
rust/crates/guard-hook-core/src/lib.rs[400-424]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The Rust-authoritative PostToolUse worker hardcodes enforcement mode and ignores the configured observe mode.
## Issue Context
Load the effective guard configuration as before and pass its observe-mode state to the native runtime; do not restore Python evaluation fallback.
## Fix Focus Areas
- src/codex_plugin_scanner/guard/daemon/hook_worker.py[78-92]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


20. Fail-safe handler now crashes ✓ Resolved 🐞 Bug ☼ Reliability
Description
The PR removes HookWorker.metrics, but the daemon's catch-all failure path still calls
hook_worker.metrics.record_failure() before constructing its block response. Any exception outside
the native wrapper now raises AttributeError in the exception handler instead of returning the
promised deterministic fail-safe block.
Code

src/codex_plugin_scanner/guard/daemon/hook_worker.py[L76-78]

-        from .hook_metrics import HookMetricsRecorder
-
-        self.metrics = HookMetricsRecorder()
Relevance

●●● Strong

Recent reliability findings accept fixes preventing exceptions from escaping daemon failure/repair
paths.

PR-#1853
PR-#1858

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The new constructor no longer initializes metrics, while the unchanged server exception handler
dereferences that attribute before returning its fail-safe response.

src/codex_plugin_scanner/guard/daemon/hook_worker.py[59-65]
src/codex_plugin_scanner/guard/daemon/server.py[6099-6112]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
Removing the worker metrics recorder breaks the daemon's catch-all fail-safe path.
## Issue Context
Keep or replace the recorder used by the server, or make server-side failure recording independently best-effort before returning the block response.
## Fix Focus Areas
- src/codex_plugin_scanner/guard/daemon/hook_worker.py[62-65]
- src/codex_plugin_scanner/guard/daemon/server.py[6099-6112]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


21. Selected jobs are never enforced

Comment on lines +112 to +114
if [[ "${{ needs.ownership.outputs.rust }}" == "true" || "${{ needs.ownership.outputs.resident_integration }}" == "true" ]]; then
test "${{ needs.rust-local-integration.result }}" = "success"
fi

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Action required

1. Required authority jobs ignored 🐞 Bug ≡ Correctness

The classifier selects all manifest required_jobs, but the workflow only runs and validates
rust-local-integration when rust or resident_integration is selected. Changes requiring
all-harness, pretool-integration, command-differential, transport-faults, performance,
native-release, or installed-wheel can therefore pass authority-summary without those declared
gates running.
Agent Prompt
## Issue description
The authority summary ignores most jobs selected from the ownership manifest, allowing protected changes to pass without their declared validation.

## Issue Context
Every `required_jobs` identifier must map to an actual workflow job and its selected result must be enforced by the summary job.

## Fix Focus Areas
- .github/workflows/rust-hotpath-authority.yml[17-114]
- ci/rust-hotpath-ownership.toml[12-102]
- scripts/ci/rust_hotpath_ownership.py[181-198]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

Comment on lines +133 to +136
def _git_paths(root: Path, base: str, head: str) -> list[str]:
completed = subprocess.run(
["git", "diff", "--name-only", "--find-renames", f"{base}...{head}"],
cwd=root,

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Action required

2. Renames bypass path authority 🐞 Bug ⛨ Security

git diff --name-only --find-renames does not independently classify both sides of a detected
rename, while classification only examines the returned names. Renaming a protected hot-path file to
a path outside HOT_PATH_PREFIXES can therefore omit the old protected path and avoid its required
jobs and unmapped-path rejection.
Agent Prompt
## Issue description
Detected renames can hide the protected source path from ownership classification.

## Issue Context
Parse a name-status or raw diff format and add both old and new paths for renames and copies before classifying them; add self-tests for rename-out, rename-in, and deletion cases.

## Fix Focus Areas
- scripts/ci/rust_hotpath_ownership.py[133-174]
- scripts/ci/rust_hotpath_ownership.py[201-235]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

Comment on lines +68 to +70
if: needs.ownership.outputs.rust == 'true' || needs.ownership.outputs.resident_integration == 'true'
runs-on: [self-hosted, guard]
timeout-minutes: 25

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Action required

3. Pr code reaches self-hosted runner 🐞 Bug ⛨ Security

The workflow runs for pull requests and checks out, builds, and executes the proposed revision on a
persistent self-hosted, guard runner. A malicious PR can execute arbitrary Cargo build scripts or
modify the invoked Python integration script, exposing or persisting on the runner despite the
workflow's read-only GitHub token.
Agent Prompt
## Issue description
Untrusted pull-request code is executed directly on a self-hosted runner.

## Issue Context
Use GitHub-hosted or genuinely ephemeral isolated runners for pull-request events, or restrict the self-hosted integration to trusted post-merge/manual revisions while retaining a required safe PR gate.

## Fix Focus Areas
- .github/workflows/rust-hotpath-authority.yml[3-8]
- .github/workflows/rust-hotpath-authority.yml[66-95]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

Comment on lines +115 to +116
response = attach_native_decision_receipt(response, receipt)
record_native_decision(event_name, harness, receipt)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remediation recommended

4. Route evidence is unreachable 🐞 Bug ◔ Observability

The worker stores the receipt only in HookReviewResponse.metrics, which to_harness_json() omits,
and the new aggregate snapshot function has no callers. As a result, the advertised backend receipts
and aggregate route counters never reach any response, telemetry sink, report, or artifact.
Agent Prompt
## Issue description
New route evidence is collected only in process memory and is never exposed to an observability consumer.

## Issue Context
Wire privacy-safe receipts and aggregate snapshots into an existing metrics/health/reporting sink without adding them to user-visible content fields.

## Fix Focus Areas
- src/codex_plugin_scanner/guard/daemon/hook_worker.py[109-135]
- src/codex_plugin_scanner/guard/native_route_metrics.py[95-117]
- src/codex_plugin_scanner/guard/runtime/hook_review_types.py[106-130]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

Comment on lines +89 to +92
if receipt.decision_backend.startswith("rust_"):
_RUST += 1
else:
_PYTHON += 1

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remediation recommended

5. Failures inflate rust decisions 🐞 Bug ◔ Observability

When native review returns no result, Python constructs the fail-safe block and labels it
rust_fail_safe, while the counter treats every rust_ backend as a Rust decision. Native outages
therefore increase rust_decisions and can keep rust_decision_share at 100% even when no Rust
decision was produced.
Agent Prompt
## Issue description
Python-generated fail-safe blocks are counted as successful Rust decisions.

## Issue Context
Separate native decisions, native-unavailable fail-safe outcomes, and Python compatibility decisions in totals and shares so availability failures cannot satisfy Rust decision-share thresholds.

## Fix Focus Areas
- src/codex_plugin_scanner/guard/daemon/hook_worker.py[92-106]
- src/codex_plugin_scanner/guard/native_route_metrics.py[81-117]
- ci/rust-hotpath-ownership.toml[6-10]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

@qodo-code-review

qodo-code-review Bot commented Aug 26, 2026

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (1) 📘 Rule violations (0) 📜 Skill insights (0)

Grey Divider


Action required

1. Selected jobs are never enforced ✓ Resolved 🐞 Bug ≡ Correctness
Description
The classifier selects all-harness, pretool-integration, command-differential,
transport-faults, performance, native-release, and installed-wheel, but this workflow
defines and enforces only rust-local-integration. Changes mapped to those requirements can
therefore pass the authority summary without the manifest-required validation running.
Code

.github/workflows/rust-hotpath-authority.yml[R111-114]

+          test "${{ needs.ownership.result }}" = "success"
+          if [[ "${{ needs.ownership.outputs.rust }}" == "true" || "${{ needs.ownership.outputs.resident_integration }}" == "true" ]]; then
+            test "${{ needs.rust-local-integration.result }}" = "success"
+          fi
Relevance

●●● Strong

Accepted workflow precedents enforce missing or bypassable validation gates; selected manifest jobs
must be checked.

PR-#2151

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
Classification adds every matched surface's required jobs, but the workflow has only one downstream
job and the summary checks only the rust/resident-integration condition. For example, native
packaging explicitly requires two jobs that are absent here.

scripts/ci/rust_hotpath_ownership.py[151-174]
ci/rust-hotpath-ownership.toml[84-102]
.github/workflows/rust-hotpath-authority.yml[17-30]
.github/workflows/rust-hotpath-authority.yml[66-114]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
Most manifest-selected required jobs have no corresponding workflow job or summary assertion.

## Issue Context
Add the missing conditional jobs or invoke reusable workflows for them, and make the summary reject every selected job whose result is not success.

## Fix Focus Areas
- .github/workflows/rust-hotpath-authority.yml[17-30]
- .github/workflows/rust-hotpath-authority.yml[103-114]
- ci/rust-hotpath-ownership.toml[12-120]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


2. Manifest permits authority downgrade ✓ Resolved 🐞 Bug ⛨ Security
Description
validate_manifest() checks only that authority values are members of broad enums and that
python_authority_allowed is a boolean; it does not enforce that PostToolUse remains Rust-owned,
that its Python authority flag remains false, or that its required jobs remain fixed. A PR can
modify the manifest alongside implementation code to remap the surface to migration with only
ownership required, and the new gate will accept the downgrade.
Code

scripts/ci/rust_hotpath_ownership.py[R96-99]

+        if raw.get("authority") not in VALID_AUTHORITY:
+            raise ValueError(f"surface {surface_id} has invalid authority")
+        if raw.get("target_authority") not in VALID_AUTHORITY:
+            raise ValueError(f"surface {surface_id} has invalid target_authority")
Relevance

●●● Strong

Security review history accepts trust-chain hardening; mutable authority and required jobs need
protected invariants.

PR-#2151

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The manifest currently declares PostToolUse as Rust-owned with Python authority forbidden, but
validation allows any authority enum and either boolean value; classification then trusts the
manifest's mutable required_jobs without a protected minimum.

ci/rust-hotpath-ownership.toml[12-39]
scripts/ci/rust_hotpath_ownership.py[85-107]
scripts/ci/rust_hotpath_ownership.py[151-174]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The validator accepts semantically weakened ownership declarations for protected surfaces.

## Issue Context
Encode required authority, target authority, Python-authority prohibition, fallback, and minimum required-job invariants for each protected surface rather than validating only types and enum membership.

## Fix Focus Areas
- scripts/ci/rust_hotpath_ownership.py[74-108]
- ci/rust-hotpath-ownership.toml[12-39]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


3. Renames evade hot-path gate ✓ Resolved 🐞 Bug ⛨ Security
Description
git diff --name-only --find-renames supplies only the destination pathname for a detected rename,
so moving a mapped hot-path file outside HOT_PATH_PREFIXES removes the source path from
classification and leaves the destination ignored. Such a PR can relocate or disable authoritative
code without selecting its required jobs or triggering unknown_hot_paths.
Code

scripts/ci/rust_hotpath_ownership.py[R133-136]

+def _git_paths(root: Path, base: str, head: str) -> list[str]:
+    completed = subprocess.run(
+        ["git", "diff", "--name-only", "--find-renames", f"{base}...{head}"],
+        cwd=root,
Relevance

●●● Strong

PR explicitly targets rename/unmapped-path bypasses; this is a direct security gap in that stated
intent.

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The diff collection returns one pathname per output line and classification only evaluates those
returned names against protected prefixes. There is no representation or handling of a rename's old
and new path pair.

scripts/ci/rust_hotpath_ownership.py[133-144]
scripts/ci/rust_hotpath_ownership.py[151-174]
scripts/ci/rust_hotpath_ownership.py[201-235]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
Rename detection discards the mapped source pathname, allowing moves out of protected prefixes to bypass ownership classification.

## Issue Context
Parse `git diff --name-status -z --find-renames` (or equivalent) and classify both source and destination paths for renames and copies; add self-tests for moves into and out of protected prefixes.

## Fix Focus Areas
- scripts/ci/rust_hotpath_ownership.py[133-144]
- scripts/ci/rust_hotpath_ownership.py[151-174]
- scripts/ci/rust_hotpath_ownership.py[201-235]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


View high (2)
4. Observe mode now blocks ✓ Resolved 🐞 Bug ≡ Correctness
Description
HookWorker.review_http_payload() now always sends observe_mode=False, so installations
configured with mode = "observe" will deny secret-bearing PostToolUse output instead of allowing
it while recording the observed block. This removes an existing product mode from the daemon's
now-authoritative path.
Code

src/codex_plugin_scanner/guard/daemon/hook_worker.py[92]

+        response = review_post_tool_native(request, observe_mode=False)
Relevance

●●● Strong

Removing an existing product mode from the authoritative path is a clear semantic regression,
matches accepted fix patterns.

PR-#2266

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The changed worker hardcodes false, while both the former Python engine and Rust core explicitly
project deny responses to allow_original when observe mode is enabled.

src/codex_plugin_scanner/guard/daemon/hook_worker.py[78-92]
src/codex_plugin_scanner/guard/runtime/hook_review_engine.py[123-150]
rust/crates/guard-hook-core/src/lib.rs[400-424]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The Rust-authoritative PostToolUse worker hardcodes enforcement mode and ignores the configured observe mode.

## Issue Context
Load the effective guard configuration as before and pass its observe-mode state to the native runtime; do not restore Python evaluation fallback.

## Fix Focus Areas
- src/codex_plugin_scanner/guard/daemon/hook_worker.py[78-92]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


5. Fail-safe handler now crashes ✓ Resolved 🐞 Bug ☼ Reliability
Description
The PR removes HookWorker.metrics, but the daemon's catch-all failure path still calls
hook_worker.metrics.record_failure() before constructing its block response. Any exception outside
the native wrapper now raises AttributeError in the exception handler instead of returning the
promised deterministic fail-safe block.
Code

src/codex_plugin_scanner/guard/daemon/hook_worker.py[L76-78]

-        from .hook_metrics import HookMetricsRecorder
-
-        self.metrics = HookMetricsRecorder()
Relevance

●●● Strong

Recent reliability findings accept fixes preventing exceptions from escaping daemon failure/repair
paths.

PR-#1853
PR-#1858

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The new constructor no longer initializes metrics, while the unchanged server exception handler
dereferences that attribute before returning its fail-safe response.

src/codex_plugin_scanner/guard/daemon/hook_worker.py[59-65]
src/codex_plugin_scanner/guard/daemon/server.py[6099-6112]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
Removing the worker metrics recorder breaks the daemon's catch-all fail-safe path.

## Issue Context
Keep or replace the recorder used by the server, or make server-side failure recording independently best-effort before returning the block response.

## Fix Focus Areas
- src/codex_plugin_scanner/guard/daemon/hook_worker.py[62-65]
- src/codex_plugin_scanner/guard/daemon/server.py[6099-6112]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools



Remediation recommended

6. Fallback count is hardcoded 🐞 Bug ◔ Observability
Description
The integration artifact unconditionally emits python_decision_fallbacks: 0 after calling the Rust
binary directly, without exercising HookWorker or reading the new route counters. It will still
report zero if a production Python fallback is reintroduced, so the uploaded evidence cannot
substantiate the claimed routing invariant.
Code

scripts/integration/rust_authority_integration.py[198]

+        "python_decision_fallbacks": 0,
Relevance

●●● Strong

Integration-test history favors real end-to-end evidence over hardcoded/incomplete assertions.

PR-#419

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The integration sends one-shot and resident requests straight to the Rust executable, while route
recording exists only in the Python worker and its snapshot is never read by this script.

scripts/integration/rust_authority_integration.py[154-200]
src/codex_plugin_scanner/guard/daemon/hook_worker.py[92-116]
src/codex_plugin_scanner/guard/native_route_metrics.py[81-117]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The integration report asserts zero Python fallbacks without observing the Python production routing layer.

## Issue Context
Exercise the real HookWorker/daemon route and export or query its route snapshot, then derive the report field from measured counters and fail when Python decisions are nonzero.

## Fix Focus Areas
- scripts/integration/rust_authority_integration.py[154-200]
- src/codex_plugin_scanner/guard/native_route_metrics.py[81-117]
- src/codex_plugin_scanner/guard/daemon/hook_worker.py[92-116]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

Context sources
✅ Compliance rules (platform): 7 rules
Review mode: ⚖️ Balanced: Downgraded extended -> standard: change is below the extended eligibility bar (hunks 16/18, lines 1072/200; both must reach the floor). Router rationale: This is a dense, high-blast-radius authority and fail-safe change spanning runtime routing, authenticated resident transport, privacy metrics, CI workflow selection, and migration governance, with many independent defect opportunities.

Grey Divider

Tip of the day
💡 Did you know, you can ask Qodo to dismiss a finding you disagree with, with your reason on record

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Qodo Logo

Comment thread src/codex_plugin_scanner/guard/daemon/hook_worker.py Outdated
Comment thread src/codex_plugin_scanner/guard/daemon/hook_worker.py
Comment thread .github/workflows/rust-hotpath-authority.yml
Comment thread scripts/ci/rust_hotpath_ownership.py Outdated
Comment thread scripts/ci/rust_hotpath_ownership.py
Comment thread scripts/integration/rust_authority_integration.py

Copy link
Copy Markdown
Member Author

Local integration snapshot source: release/3.0 source archive. This comment will be replaced with the final integration evidence after review remediation.

raise RuntimeError(f"{harness} secret-bearing content was not blocked by Rust")
elif result.get("policy_action") != "block" or result.get("model_output_action") != "block":
raise RuntimeError(f"{harness} secret-bearing content was not blocked by Rust")
if "reviewed_excerpt" in result or _SECRET_TEXT in json.dumps(result):

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

WARNING: JSON-escaped secret text check is ineffective

json.dumps(result) escapes newlines as \n (two characters), but _SECRET_TEXT contains raw newline bytes. The in check will never match, so secret-bearing content leakage in harness responses goes undetected.


Reply with @kilocode-bot fix it to have Kilo Code address this issue.

if report.get("rust_decisions") != expected or report.get("python_decisions") != 0:
raise RuntimeError("persisted native route report did not match all-harness outcomes")
if _SAFE_TEXT in report_text or _SECRET_TEXT in report_text or str(root) in report_text:
raise RuntimeError("aggregate native route report contained request-derived content")

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

WARNING: JSON-escaped content leak check is ineffective

report_text is JSON with escaped newlines, but _SAFE_TEXT and _SECRET_TEXT contain raw newlines. The in checks will never match, so raw content leakage in aggregate reports goes undetected.


Reply with @kilocode-bot fix it to have Kilo Code address this issue.

observe_mode=config.mode == "observe",
observe_mode = self._observe_mode(guard_home=guard_home, workspace=workspace)
try:
response = review_post_tool_native(request, observe_mode=observe_mode)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

WARNING: Native emergency rollback removed

native_mode() is no longer checked before calling review_post_tool_native. When HOL_GUARD_NATIVE=off, native_runtime_status() returns unavailable, so the worker now returns a deterministic fail-safe block instead of falling back to Python. This silently changes behavior for users who relied on the documented off emergency rollback.


Reply with @kilocode-bot fix it to have Kilo Code address this issue.

Comment thread scripts/ci/rust_hotpath_ownership.py Outdated
if not isinstance(surface_id, str) or not surface_id.strip() or surface_id in seen:
raise ValueError(f"surface[{index}].id is missing or duplicated")
if raw.get("authority") not in VALID_AUTHORITY or raw.get("target_authority") not in VALID_AUTHORITY:
raise ValueError(f"surface {surface_id} has invalid authority")

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SUGGESTION: Misleading error message for target_authority validation

The condition validates both authority and target_authority, but the error message only mentions "invalid authority". If only target_authority is invalid, the message is misleading.

Suggested change
raise ValueError(f"surface {surface_id} has invalid authority")
raise ValueError(f"surface {surface_id} has invalid authority or target_authority")

Reply with @kilocode-bot fix it to have Kilo Code address this issue.

@kilo-code-bot

kilo-code-bot Bot commented Aug 26, 2026

Copy link
Copy Markdown

Code Review Summary

Status: 2 Issues Found | Recommendation: Address before merge

Overview

Severity Count
WARNING 2
Issue Details (click to expand)

WARNING

File Line Issue
.github/workflows/finalize-pr-2598.yml 33 Unchecked array access can crash the runner patch
.github/workflows/finalize-pr-2598.yml 22 persist-credentials: true with auto-push exposes the GITHUB_TOKEN
Files Reviewed (1 file)
  • .github/workflows/finalize-pr-2598.yml - 2 issues

Fix these issues in Kilo Cloud

Previous Review Summaries (3 snapshots, latest commit 4a6cdde)

Current summary above is authoritative. Previous snapshots are kept for context only.

Previous review (commit 4a6cdde)

Status: 2 Issues Found | Recommendation: Address before merge

Overview

Severity Count
WARNING 2
Issue Details (click to expand)

WARNING

File Line Issue
.github/workflows/finalize-pr-2598.yml 33 Unchecked array access can crash the runner patch
.github/workflows/finalize-pr-2598.yml 22 persist-credentials: true with auto-push exposes the GITHUB_TOKEN
Files Reviewed (1 file)
  • .github/workflows/finalize-pr-2598.yml - 2 issues

Fix these issues in Kilo Cloud

Previous review (commit ea94f26)

Status: 4 Issues Found | Recommendation: Address before merge

Overview

Severity Count
WARNING 3
SUGGESTION 1
Issue Details (click to expand)

WARNING

File Line Issue
scripts/integration/rust_all_harness_integration.py 78 JSON-escaped secret text check is ineffective — _SECRET_TEXT in json.dumps(result) never matches because json.dumps escapes newlines
scripts/integration/rust_all_harness_integration.py 139 JSON-escaped content leak check is ineffective — _SAFE_TEXT/_SECRET_TEXT in report_text never matches because the report is JSON with escaped newlines
src/codex_plugin_scanner/guard/daemon/hook_worker.py 104 Native emergency rollback removed — native_mode() is no longer checked, so HOL_GUARD_NATIVE=off now returns a fail-safe block instead of falling back to Python

SUGGESTION

File Line Issue
scripts/ci/rust_hotpath_ownership.py 175 Misleading error message — validates both authority and target_authority but message only says "invalid authority"
Files Reviewed (14 files)
  • .github/workflows/pr2598-ci-remediation.yml
  • .github/workflows/rust-hotpath-authority.yml
  • ci/native_runtime/test_guard_native_runtime_resident.py
  • ci/rust-hotpath-ownership-report.json
  • ci/rust-hotpath-ownership.toml
  • docs/guard/rust-data-plane-boundary.md
  • docs/guard/rust-hotpath-todo-001-100.md
  • scripts/ci/pr2598_remediate.py
  • scripts/ci/pr2598_remediate_v2.py
  • scripts/ci/rust_hotpath_ownership.py
  • scripts/integration/rust_all_harness_integration.py
  • scripts/integration/rust_authority_integration.py
  • src/codex_plugin_scanner/guard/daemon/hook_worker.py
  • src/codex_plugin_scanner/guard/native_route_metrics.py

Fix these issues in Kilo Cloud

Previous review (commit 4c41178)

Status: 4 Issues Found | Recommendation: Address before merge

Overview

Severity Count
WARNING 3
SUGGESTION 1
Issue Details (click to expand)

WARNING

File Line Issue
scripts/integration/rust_all_harness_integration.py 78 JSON-escaped secret text check is ineffective — _SECRET_TEXT in json.dumps(result) never matches because json.dumps escapes newlines
scripts/integration/rust_all_harness_integration.py 139 JSON-escaped content leak check is ineffective — _SAFE_TEXT/_SECRET_TEXT in report_text never matches because the report is JSON with escaped newlines
src/codex_plugin_scanner/guard/daemon/hook_worker.py 104 Native emergency rollback removed — native_mode() is no longer checked, so HOL_GUARD_NATIVE=off now returns a fail-safe block instead of falling back to Python

SUGGESTION

File Line Issue
scripts/ci/rust_hotpath_ownership.py 175 Misleading error message — validates both authority and target_authority but message only says "invalid authority"
Files Reviewed (14 files)
  • .github/workflows/pr2598-ci-remediation.yml
  • .github/workflows/rust-hotpath-authority.yml
  • ci/native_runtime/test_guard_native_runtime_resident.py
  • ci/rust-hotpath-ownership-report.json
  • ci/rust-hotpath-ownership.toml
  • docs/guard/rust-data-plane-boundary.md
  • docs/guard/rust-hotpath-todo-001-100.md
  • scripts/ci/pr2598_remediate.py
  • scripts/ci/pr2598_remediate_v2.py
  • scripts/ci/rust_hotpath_ownership.py
  • scripts/integration/rust_all_harness_integration.py
  • scripts/integration/rust_authority_integration.py
  • src/codex_plugin_scanner/guard/daemon/hook_worker.py
  • src/codex_plugin_scanner/guard/native_route_metrics.py

Fix these issues in Kilo Cloud


Reviewed by free · Input: 46.1K · Output: 10.9K · Cached: 86.9K

@kantorcodes
kantorcodes force-pushed the rust/hotpath-authority-t001-t100 branch 2 times, most recently from 660c21b to 73247f9 Compare August 26, 2026 22:08
Remove Python semantic fallback from the supported PostToolUse decision path, preserve observe mode without weakening enforcement, add privacy-safe route evidence, harden mixed target-path handling, and require every manifest-selected native authority gate on GitHub-hosted runners.

Signed-off-by: Michael Kantor <6068672+kantorcodes@users.noreply.github.com>
@kantorcodes
kantorcodes force-pushed the rust/hotpath-authority-t001-t100 branch from 73247f9 to ea94f26 Compare August 26, 2026 22:53

@capy-ai capy-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Capy found 3 potential issues (1 high, 2 medium).

View 2 other findings in Capy.

Open in Capy Review

Comment thread .github/workflows/finalize-pr-2598.yml Outdated
branches:
- rust/hotpath-authority-t001-t100
paths:
- .github/workflows/finalize-pr-2598.yml

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

High: Ownership gate rejects this PR because finalize-pr-2598.yml is an unmapped hot-path file.

scripts/ci/rust_hotpath_ownership.py treats any changed path under .github/workflows/ as a hot path and fails the ownership job when it matches no [[surface]] glob. This PR adds .github/workflows/finalize-pr-2598.yml, which is not listed under migration-governance (or any other surface). Classifying the PR file set yields unknown_hot_paths=['.github/workflows/finalize-pr-2598.yml'] and exit code 1, so the authority workflow cannot pass on this branch. Map the finalizer under migration-governance, exclude it from HOT_PATH_PREFIXES, or remove it after in-tree fixes instead of leaving a self-rejecting workflow file.

Open in Capy Review

notice="warning",
reason_code="native_post_tool_unavailable",
policy_action="block",
)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Medium: PostToolUse native fail-safe ignores observe mode and hard-blocks where the engine and daemon convert to allow.

When Guard config mode is observe and review_post_tool_native returns None or raises (HOL_GUARD_NATIVE=off, missing binary, overload, timeout, invalid response), HookWorker builds a deny/block HookReviewResponse with reason_code native_post_tool_unavailable and never applies the observe conversion that HookReviewEngine.review and server.runtime_hook_fail_safe_response still perform (allow with observed_policy_action/observe* reason). Observe-mode users therefore get a hard PostToolUse block on any native outage after this cutover, instead of allow-and-record. After building the fail-safe response, apply the same observe-only rewrite the engine uses when _observe_mode is true, or route fail-safe through that helper before harness mapping.

Open in Capy Review

fi
if [[ -z "$BASE" || "$BASE" == "0000000000000000000000000000000000000000" ]]; then
BASE="${{ github.sha }}^"
fi

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Medium: Authority workflow still uses fragile BASE resolution; the hardening only exists in an unapplied finalizer patch.

rust-hotpath-authority.yml currently sets BASE to github.sha^ when before is empty or all-zeros, without ensuring HEAD/BASE commits are present in the shallow checkout. The finalizer would replace that with cat-file checks and a fetch of HEAD, but that edit is not in the tree—only in finalize-pr-2598.yml string surgery—and the finalizer itself is blocked by the ownership unmapped-path failure above. On workflow_dispatch or first-push edge cases where before is unavailable and parent history is missing, ownership classification can fail or classify the wrong range until the patch is committed in-tree. Put the BASE/HEAD reachability fix directly in rust-hotpath-authority.yml in this PR.

Open in Capy Review

@capy-ai capy-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Capy found no issues.

Open in Capy Review

Comment thread .github/workflows/finalize-pr-2598.yml Outdated
runner_lines = runner_path.read_text(encoding="utf-8").splitlines()
runner_anchor = " adaptive_capacity.observe_load(queue_p95_ms=queue_p95_ms, queued=queued)"
runner_index = runner_lines.index(runner_anchor)
if runner_lines[runner_index + 1] != " self._refresh_capacity_policy()":

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[WARNING]: Unchecked array access can crash the runner patch

runner_lines[runner_index + 1] is accessed without verifying runner_index + 1 < len(runner_lines). If the anchor is the last line in hook_process_runner.py, this raises IndexError and aborts the remediation workflow.

Suggested change
if runner_lines[runner_index + 1] != " self._refresh_capacity_policy()":
if runner_index + 1 >= len(runner_lines) or runner_lines[runner_index + 1] != " self._refresh_capacity_policy()":
raise SystemExit("hook runner patch anchor changed")

Reply with @kilocode-bot fix it to have Kilo Code address this issue.

Comment thread .github/workflows/finalize-pr-2598.yml Outdated
with:
ref: rust/hotpath-authority-t001-t100
fetch-depth: 0
persist-credentials: true

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[WARNING]: persist-credentials: true with auto-push exposes the GITHUB_TOKEN

The checkout step persists the GITHUB_TOKEN, and the workflow later pushes directly to the branch without human review. If the runner environment is compromised, the token can be exfiltrated and used to push arbitrary code.


Reply with @kilocode-bot fix it to have Kilo Code address this issue.

@kantorcodes

Copy link
Copy Markdown
Member Author

Unique-diff vs current main: this branch still carries route metrics, hotpath ownership TOML/scripts, all-harness integration, and data-plane path work that are not in main.

Supported PreToolUse/PostToolUse fail-closed auto behavior and stable native-wheel publication are now on #2652. Leaving this PR open until that unique evidence/metrics surface is either ported or explicitly dropped.

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.

1 participant