Skip to content

[code-review] Repair script guards and behavioral QA claims - #7679

Merged
orbit-agent-01 merged 1 commit into
agent-mainfrom
orbit/ORB-21222-62ae5e0d
Nov 2, 2026
Merged

orbit-agent-01 merged 1 commit into
agent-mainfrom
orbit/ORB-21222-62ae5e0d

Conversation

@orbit-agent-01

Copy link
Copy Markdown
Contributor

Task

ORB-21222 — [code-review] Repair script guards and behavioral QA claims

Description

Confirmed at pinned agent-main b7d7595 by ORB-21204. This is the single medium/low cleanup bug for module file:scripts/agent-corpus.py,file:scripts/audit_panics.py,file:scripts/audit_panics.sh,file:scripts/bench-build-budget.sh,file:scripts/bench-compiler-cache.sh,file:scripts/build-budget.py,file:scripts/build-bundled-bwrap.sh,file:scripts/cargo-deny.sh,file:scripts/check-artifact-redaction-guardrail.sh,file:scripts/check-changelog-style.sh,file:scripts/check-ci-failure-reporting.sh,file:scripts/check-ci-macos.sh,file:scripts/check-cli-imports.sh,file:scripts/check-codeql-extension-schema.py,file:scripts/check-codeql-production-paths.py,file:scripts/check-crate-agent-guides.sh,file:scripts/check-dashboard-browser-fixtures.py,file:scripts/check-dashboard-vendor.py,file:scripts/check-dependency-direction.sh,file:scripts/check-desktop-ui.sh,file:scripts/check-doc-links.py,file:scripts/check-durability-syncs.py,file:scripts/check-embedded-asset-portability.py,file:scripts/check-error-translation.sh,file:scripts/check-goldens.sh,file:scripts/check-history-note-size.sh,file:scripts/check-installer-pubkey.sh,file:scripts/check-linux-gated-test-items.py,file:scripts/check-nextest-partitions.py,file:scripts/check-orphan-modules.sh,file:scripts/check-public-artifact-ids.py,file:scripts/check-stability.sh,file:scripts/check-terminal-state-guard.sh,file:scripts/check-test-shell-waits.py,file:scripts/check-unused-dependencies.py,file:scripts/check-web-blocking-handlers.py,file:scripts/check-windows-portability.py,file:scripts/check-workflow-action-pins.sh,file:scripts/check-workflow-yaml.py,file:scripts/check_npm_package.py,file:scripts/ci-await-jobs.py,file:scripts/ci-change-scope.sh,file:scripts/ci-download-verified.sh,file:scripts/ci-guardrails.sh,file:scripts/ci-p90.py,file:scripts/ci-repack-nextest.py,file:scripts/ci-test-affected.py,file:scripts/ci_cache_workflow_tests.py,file:scripts/cleanup-branches.sh,file:scripts/codeql-rust-local.sh,file:scripts/compiler-cache.sh,file:scripts/compiler_cache_process_regression.py,file:scripts/cpu-utilisation.sh,file:scripts/cross-revision-check.sh,file:scripts/delivery_quality_eval.py,file:scripts/delivery_quality_sampling.py,file:scripts/delivery_quality_seed.py,file:scripts/delivery_quality_study.py,file:scripts/evaluate-decision-assistance.py,file:scripts/extract_agent_log.sh,file:scripts/generate-doc-indexes.sh,file:scripts/measure-history-signal.py,file:scripts/precedent_decision_eval.py,file:scripts/probe-mcp-apps.py,file:scripts/qa-full-sweep-inventory.json,file:scripts/qa-full-sweep.sh,file:scripts/qa_full_sweep_regression.py,file:scripts/refresh-dashboard-vendor.sh,file:scripts/release-breaking-changes.py,file:scripts/release-check.sh,file:scripts/release_schema_oracle.py,file:scripts/require-python.sh,file:scripts/rustc-compiler-cache.sh,file:scripts/self_test_hang.py,file:scripts/self_test_hang_regression.py,file:scripts/smoke-claude-mcp-sandbox.sh,file:scripts/smoke-claude-mcp.sh,file:scripts/smoke-npm-install.sh,file:scripts/smoke-plugin-install.sh,file:scripts/sync-plugin-skills.sh,file:scripts/test-agent-corpus.py,file:scripts/test-audit-panics.py,file:scripts/test-auto-task-body-history.py,file:scripts/test-bench-build-budget.py,file:scripts/test-bench-compiler-cache.py. Every finding below is verified against that tree. Evidence artifacts belong to ORB-21204. No high/critical finding is grouped here.

  1. Medium — Error-translation guard silently skips paths containing whitespace. scripts/check-error-translation.sh:115-123 emits newline paths, then :186, :201 and :215 pass them to plain xargs, discard errors and swallow failures. The identical minimal crates tree with an unregistered translator, AutomationError mapping and TaskError mapping exits 1 under plain-root but exits 0 with "error translation guard passed" under "space root". The quoted registry checks still succeed. Workaround: a whitespace-free root. Evidence: error-path-reproduction.json and audit-scripts/reproduce-error-paths.py. Blame traces the producer and original xargs consumers to 4bf554a [ORB-10013]; task exists/done and introduced this lint. Classification defect_in_new/no_test/medium: the introducing commit has no public guard filename regression; current ErrorTranslationGuardTests also uses a whitespace-free root. Shared invariant: update all three filename-consuming scans together and fail closed on scan failures. Public callers are Makefile's ci-guards/ci-fast route through scripts/ci-guardrails.sh; fixtures are ErrorTranslationGuardTests in scripts/test-ci-fast-guards.py. docs/design-patterns/error_translation.md:118-157 promises these scans prevent caller-local translators and ad hoc foreign mapping.

  2. Medium — QA claims invalid-plugin refusal without exercising it. scripts/qa-full-sweep-inventory.json:122 declares plugin-invalid-install-is-refused for smoke-plugin-install.sh, but scripts/smoke-plugin-install.sh:10-12 validates only the valid candidate; :14-68 copies/checks only valid assets. scripts/test-qa-full-sweep.py:3777-3789 copies that assertion into a PASS after exit 0 (the only special non-Cargo assertion validator there is npm-package). A mutation reproduction ran the exact pinned smoke with unconditional-success validator recorders and minimal valid manifests: it still exited 0 and earned invalid-plugin refusal, with no invalid fixture supplied. Evidence: plugin-assertion-reproduction.json and audit-scripts/reproduce-plugin-assertion.py. This proves missing negative coverage, not a currently broken validator. Workaround: run the existing negative validator suites separately. Culprit 53c854d [ORB-12047] added this unsupported inventory claim while requiring behavioral QA assertions. Classification incomplete/no_test/medium: its self-tests checked missing assertion labels but did not require this command to exercise a refusal. Update inventory, smoke behavior and the QA assertion/evidence fixture together; do not drop the required negative behavior to make a green report.

  3. Low — Ordinary benchmark cancellation fixture can signal a reused PID. scripts/test-bench-build-budget.py:565 saves shim/child PID numbers, :568 communicates/reaps the completed benchmark, then :584-590 calls pid_alive followed by numeric os.kill(SIGKILL) without reserving an incarnation. The existing pidfd identity regression at :931-934 covers only spawn-window and flag-clear, not this ordinary scenario. An exact-function intercepted-process harness models successful cancellation, original PIDs disappearing before survivor inspection, then replacements appearing before finally; errors=[] while two SIGKILLs target the replacement identities after owner reaping. No real signals, PID churn or host incident were used or claimed. Evidence: examination-reproductions.json / benchmark_cancel and audit-scripts/reproduce-review-leads.py. Culprit 4a859fd [ORB-20389] introduced this scenario and raw finally loop; defect_in_new/no_test/low. ORB-21023 and ORB-21054 repair the two different window scenarios and do not cover this remaining site. Audit all three cancellation scenarios, pid_alive uses, reservation helpers and main's scenario list together; preserve timeout/assertion cleanup and descendant termination.

  4. Medium — Precedent evaluator admits recorded labels without automation=false. scripts/precedent_decision_eval.py:159-167 rejects only the singleton True; :342-355 does not require/type-check automation. The public /4 score CLI on the seeded ar-correct-a case, changed to recorded_human_decision/answered_by=human, exits 2 for automation=true but exits 0 for 1, "true", null and omission, as well as the valid false control. Its own precedent-schema output at :236-238 and docs/design/decision-assistance/2_evaluation.md:514-519 require automation=false. Evidence: examination-reproductions.json / actor_eligibility (public CLI cases). Workaround: validate/normalize imported labels separately. Culprit cde2eb9 [ORB-21096] introduced /4 and its non-automation writer requirement; incomplete/no_test/medium. Its tests cover model actors/JSON refusal, not malformed or missing automation. Shared predicate callers include _recorded_field_errors, validate_precedent_dataset and window_label_errors; check score, validate, precedent-schema and the /4 fixtures in test-evaluate-decision-assistance.py together. Preserve the explicitly documented pre-window actor exemption and /1-/3 behavior. ORB-21149/ORB-21177 concern different pre-window behavior, not this in-window input defect.

  5. Low — Equivalent numeric enums produce a false breaking signal. scripts/release-breaking-changes.py:235-236 stores enum values with json.dumps; :724-731 compares those lexical sets. A public --offline --json survey of a tiny fixture repo changing only an MCP enum [1] to [1.0] reports "enum value 1 removed" and bump=minor although accepted values are identical. The same script already uses semantic _json_value_key for const and disjointness; test-release-breaking-changes.py:807-818 explicitly recognizes mathematical JSON enum equality, but only tests overlap, not replacement. Evidence: examination-reproductions.json / numeric_enum (full CLI report). Culprit 4d3aea3 [ORB-19278] introduced the lexical enum facts; defect_in_new/no_test/low (its tests remove string enums, not semantically equal numeric representations). Reuse one JSON equality rule across enum fact comparison, const and oneOf overlap; preserve bool-vs-number distinctions and real removals. This is an unnecessary bump/migration warning, not missed breaking behavior.

All culprit tasks were confirmed with task.show; introducing diffs/blame and relevant test/gate selection were inspected. No covering open code-review work existed before filing; exact plugin assertion and ownership-symbol searches plus all-status symptom searches found no duplicate. These grouped sites have distinct culprit tasks, so each relation is separately classified. No implementation changes or dispatch are authorized by this review task. Repair through ordinary delivery and update affected docs with the same change.

Acceptance Criteria

  • The public error-translation guard rejects the same translator-locality and both mapping violations under roots and source filenames containing spaces/quotes, and scan failures cannot yield success; all three scans and existing guard fixtures change together.
  • The plugin-install QA command actually exercises and asserts invalid-install refusal before that assertion can appear in PASS; a deterministic refusal-disabled mutation prevents earning it while valid installs and explicit Cursor limitations remain correct.
  • The ordinary cancellation scenario never signals a recycled PID after its arm exits, including success, timeout and assertion paths; deterministic intercepted-identity coverage exercises the real scenario and preserves owned-child termination without PID churn or stress.
  • The /4 public score/validate boundaries reject in-window recorded-human labels unless automation is explicitly boolean false, including omitted/null/numeric/string values; retain valid false, pre-window exemptions and /1-/3 behavior across every predicate caller and fixture.
  • The release survey treats [1] and [1.0] (including nested numeric enum values) as semantically unchanged, while real enum removals and boolean-vs-number distinctions remain detected; demonstrate this through fixture-repo CLI regressions.
  • Update affected documentation and regression fixtures with each repair. If a repair shares its narrowed invariant with in-flight work, compare the integration-branch per-commit suite with its parent, in addition to validation on the PR base.

Execution Summary

Click to expand

Implemented all five repairs:

  1. Error-translation (scripts/check-error-translation.sh): rust_sources now emits NUL-delimited paths and run_rg_scan passes filenames as an rg argument array, so space/quote roots and filenames are scanned; rg exit >1 fails closed (missing crates dir also exits 1). Added ErrorTranslationGuardTests space-root/spaced+quoted filename (translator + AutomationError + TaskError mappings) and broken-symlink scan-failure cases in scripts/test-ci-fast-guards.py.
  2. Plugin QA: scripts/smoke-plugin-install.sh builds an invalid candidate (non-semver versions) and requires both validate-codex-plugin.sh and validate-agent-plugin.sh to refuse it, printing plugin-invalid-install-is-refused only then; valid installs and Cursor limitation lines unchanged. scripts/test-qa-full-sweep.py adds validate_plugin_result (plugin-install earns assertions only with both exercised markers, mirroring npm), wires it in the main loop, and adds plugin_install_self_test (valid PASS, synthetic exit-0 without refusal earns nothing, refusal-disabled stub-validator mutation makes copied smoke fail). Updated docs/runbooks/release.md.
  3. Bench cancellation (scripts/test-bench-build-budget.py): scenario_cancellation now pins the blocked arm via OwnedArmIdentity (pid from ready.json -> pgrp via read_arm_proc_identity) before SIGTERM and finally uses retire_cancellation_processes (pidfd-only), removing numeric os.kill; extended scenario_cancellation_identity to the ordinary scenario (success/timeout/assertion/early-exit) alongside spawn-window/flag-clear. Regression marks: file has no_test/test_not_selected history - added deterministic intercepted-identity coverage at the public scenario boundary and ran the whole file by name; no PID churn/stress.
  4. Precedent /4 (scripts/precedent_decision_eval.py): _ineligible_actor_message and _recorded_field_errors now require automation to be explicitly boolean false for recorded labels (omitted/null/numeric/string/true rejected), shared by validate/score/window callers; pre-window exemption and /1-/3 preserved (seed synthetic labels carry automation:false). Added CLI test covering false/true/1/0/string/null/omitted plus pre-window control in scripts/test-evaluate-decision-assistance.py.
  5. Release enums (scripts/release-breaking-changes.py): enum facts now store _json_value_key (same semantic rule as const/disjointness), branch matching/shapes and surviving-content dedupe also use that key, and reports render keys via _json_key_display so real removals keep JSON spelling; bool-vs-number stays distinct. Added fixture-repo CLI test for [1]->[1.0] including nested [2,{depth:3}] (patch) plus real removal and true->[1] (minor) in scripts/test-release-breaking-changes.py. Regression marks (defect_in_new/broke_existing, no_test/review_missed): re-read diff against criteria/callers and ran the full file.
    Docs: docs/design-patterns/error_translation.md and docs/design/decision-assistance/2_evaluation.md already state the repaired contracts, so no text change needed there; release runbook updated for the new smoke behavior.
    Validation: python3 scripts/test-ci-fast-guards.py (101 tests OK, from repo root); python3 scripts/test-qa-full-sweep.py --self-test (ok, includes plugin_install_self_test); python3 scripts/test-bench-build-budget.py (all 11 scenarios passed); precedent suite 34 tests OK; release suite 43 tests OK (run from scripts/ so sibling imports resolve); bash scripts/smoke-plugin-install.sh (valid + refusal markers, exit 0); bash scripts/check-error-translation.sh (passed); make ci-guards (exit 0). task.final_validation_commands: none present in envelope (final_validation flag only), so owned checks above are reported as run. No .rs files changed, so cargo fmt/clippy/doc gates not applicable. Reconciliation: 10 modified paths, all deliverable and within task intent (8 task-declared plus companion test/docs paths); git diff --check clean; scratch only under .orbit/tmp/.

Validation

  • Not reported

Branch Freshness

  • Base ref: origin/agent-main
  • Head ref: orbit/ORB-21222-62ae5e0d
  • Behind base: 0
  • Ahead of base: 1

@orbit-agent-01 orbit-agent-01 added the orbit orbit related label Nov 2, 2026
@orbit-agent-01
orbit-agent-01 merged commit 1ef9830 into agent-main Nov 2, 2026
12 checks passed
@orbit-agent-01
orbit-agent-01 deleted the orbit/ORB-21222-62ae5e0d branch November 2, 2026 03:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

orbit orbit related

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant