Skip to content

fix(security): close Lane B findings from adversarial review c6c486 - #148

Merged
ravidsrk merged 8 commits into
mainfrom
cursor/lane-b-remediation-256a
Jul 9, 2026
Merged

fix(security): close Lane B findings from adversarial review c6c486#148
ravidsrk merged 8 commits into
mainfrom
cursor/lane-b-remediation-256a

Conversation

@ravidsrk

@ravidsrk ravidsrk commented Jul 8, 2026

Copy link
Copy Markdown
Owner

Summary

Closes the six Lane B findings from adversarial review c6c486, plus post-fix doc-sync, CI green-up, and Greptile review fixes.

Integration PR #134 (Lane A) is already on main.

Lane B (recommended variants)

ID Change
SEC-004 SHA-pin third-party Actions in action.yml, .github/workflows/ci.yml, docs-site.yml
SEC-005 Reviewer role refuses without sandbox-exec/bwrap unless FLEET_SECURITY_OVERRIDE_ACK=1
SEC-009 FLEET_DISABLE_REGISTRY_LINT fail-closed without ack
ARCH-004 Register exploratory missions scaffold-align, contract-first-build, agents-layer + on-disk registry lint
ARCH-005 Shared collect_run_archives(); validate CLIs use RUN_ID_PATTERN
SEC-010 FLEET_STOP_VERIFY_STRICT=1 → BLOCK JSON on missing repo (exit still 0 for CC hook contract)

Review fixes (Greptile)

  • Duplicate lintscripts/registry_lint.py now calls lint_registry() once (no double lint_exploratory_on_disk_registered)
  • Hook exit zero — substrate stop_verify strict path already returns 0 (synced with scripts/)

Local verification

  • ./scripts/validate-all.sh — pass (100% coverage)
  • ./scripts/mutation-check.sh — 72/72 caught
  • CI validate — green on tip

Ready for human merge.

Open in Web Open in Cursor 

Greptile Summary

This PR hardens the fleet validation substrate and syncs the related docs, assets, and tests. The main changes are:

  • SHA-pins third-party GitHub Actions in CI, docs-site, and the composite action.
  • Makes registry_lint.py fail closed for bare FLEET_DISABLE_REGISTRY_LINT without FLEET_SECURITY_OVERRIDE_ACK.
  • Makes reviewer sandbox execution refuse without sandbox-exec or bwrap unless the security override ack enables the detect-only fallback.
  • Adds strict missing-repo blocking for stop_verify.py while preserving the hook exit-zero contract.
  • Registers the remaining exploratory missions and adds shared canonical run archive discovery.
  • Syncs substrate assets, lock metadata, documentation, and regression tests for the new behavior.

Confidence Score: 5/5

Safe to merge with minimal risk.

The security-sensitive scripts, shared helpers, substrate mirrors, and related tests are consistent with the intended behavior. The earlier duplicate registry lint and hook exit-code issues are addressed. No remaining runtime bugs were identified in the changed paths.

No files require special attention.

T-Rex T-Rex Logs

What T-Rex did

  • T-Rex ran the full gate blocker contract validation and recorded the result, which exited with code 1 due to a missing skill-creator validator.
  • T-Rex ran the passing substitute gate validation, which completed with exit code 0 and reported 177 tests passed in 0.91 seconds.
  • Artifacts were created to capture both runs for reviewer inspection, linking the blocker and substitute gate logs to the review.

View all artifacts

T-Rex Ran code and verified through T-Rex

Important Files Changed

Filename Overview
.github/workflows/ci.yml Pins third-party CI actions to full commit SHAs while preserving the validation workflow.
.github/workflows/docs-site.yml Pins docs-site workflow actions to full commit SHAs with no functional workflow regressions found.
action.yml Pins the composite action setup-python dependency to a full commit SHA.
scripts/run-sandboxed.sh Reviewer role now refuses without a real sandbox unless the security override ack enables the detect-only fallback.
scripts/registry_lint.py Registry lint now fails closed for bare disables and delegates to the shared library aggregator once.
scripts/stop_verify.py Adds strict missing-repo blocking via JSON decision while preserving hook exit-zero behavior.
scripts/lib/fleet_run.py Adds shared canonical run archive discovery used by run archive and namespacing validators.
scripts/validate_namespacing.py Uses the shared canonical run archive collector and retains fail-closed disable semantics.
scripts/validate_run_archive.py Uses the shared canonical run archive collector without changing explicit archive validation.
scripts/lib/registry_lint.py Adds an on-disk exploratory mission registration lint and includes it once in the aggregate registry lint.
skills/autonomous-fleet-core/assets/substrate/substrate-manifest.json Updates substrate asset hashes and version metadata for the synchronized asset changes.
tests/test_reviewer_sandbox.py Adds coverage for reviewer sandbox refusal without ack and fallback detection with ack.
tests/test_registry_lint_cli.py Adds CLI coverage for registry-lint fail-closed disables and single aggregator delegation behavior.
tests/test_stop_verify.py Covers strict missing-repo JSON blocking while preserving exit-zero hook semantics.

Sequence Diagram

%%{init: {'theme': 'neutral'}}%%
sequenceDiagram
participant Operator
participant ReviewerCLI as run-sandboxed.sh --role reviewer
participant RegistryCLI as registry_lint.py
participant StopHook as stop_verify.py
participant SharedLib as Shared substrate helpers

Operator->>ReviewerCLI: Run reviewer command
ReviewerCLI->>ReviewerCLI: Prefer sandbox-exec, then bwrap
alt Real sandbox available
    ReviewerCLI-->>Operator: Execute in read-only reviewer sandbox
else No sandbox binary
    ReviewerCLI->>SharedLib: Check FLEET_SECURITY_OVERRIDE_ACK
    alt Ack present
        ReviewerCLI-->>Operator: Execute with post-exec hash audit
    else Ack missing
        ReviewerCLI-->>Operator: Refuse with exit 4
    end
end

Operator->>RegistryCLI: Run registry lint
RegistryCLI->>SharedLib: Check FLEET_DISABLE_REGISTRY_LINT and ack
alt Bare disable
    RegistryCLI-->>Operator: Fail closed
else Acked disable
    RegistryCLI-->>Operator: Disabled notice, exit 0
else Enabled
    RegistryCLI->>SharedLib: lint_registry() including exploratory SKILL registration
    RegistryCLI-->>Operator: Report lint result
end

Operator->>StopHook: Claude Code stop hook
StopHook->>SharedLib: Check FLEET_STOP_VERIFY_STRICT when repo missing
alt Strict missing repo
    StopHook-->>Operator: JSON block decision, exit 0
else Default missing repo
    StopHook-->>Operator: JSON allow decision, exit 0
end
Loading
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
sequenceDiagram
participant Operator
participant ReviewerCLI as run-sandboxed.sh --role reviewer
participant RegistryCLI as registry_lint.py
participant StopHook as stop_verify.py
participant SharedLib as Shared substrate helpers

Operator->>ReviewerCLI: Run reviewer command
ReviewerCLI->>ReviewerCLI: Prefer sandbox-exec, then bwrap
alt Real sandbox available
    ReviewerCLI-->>Operator: Execute in read-only reviewer sandbox
else No sandbox binary
    ReviewerCLI->>SharedLib: Check FLEET_SECURITY_OVERRIDE_ACK
    alt Ack present
        ReviewerCLI-->>Operator: Execute with post-exec hash audit
    else Ack missing
        ReviewerCLI-->>Operator: Refuse with exit 4
    end
end

Operator->>RegistryCLI: Run registry lint
RegistryCLI->>SharedLib: Check FLEET_DISABLE_REGISTRY_LINT and ack
alt Bare disable
    RegistryCLI-->>Operator: Fail closed
else Acked disable
    RegistryCLI-->>Operator: Disabled notice, exit 0
else Enabled
    RegistryCLI->>SharedLib: lint_registry() including exploratory SKILL registration
    RegistryCLI-->>Operator: Report lint result
end

Operator->>StopHook: Claude Code stop hook
StopHook->>SharedLib: Check FLEET_STOP_VERIFY_STRICT when repo missing
alt Strict missing repo
    StopHook-->>Operator: JSON block decision, exit 0
else Default missing repo
    StopHook-->>Operator: JSON allow decision, exit 0
end
Loading

Comments Outside Diff (3)

  1. General comment

    P1 Focused Python/security test plan fails on PR head

    • Bug
      • The requested focused pytest command exits nonzero with 3 failures out of 338 tests. The failed assertions cover registry lint kill-switch behavior, fleet registry derived public values, and reviewer sandbox fallback behavior.
    • Cause
      • The PR head behavior does not match the focused tests' expectations: FLEET_DISABLE_REGISTRY_LINT=1 still yielded CLI rc 1, MISSION_DOCS contains extra agents-layer, contract-first-build, and scaffold-align entries compared with the expected public values fixture, and the reviewer sandbox fallback test receives a hard refusal about missing sandbox-exec/bwrap instead of the expected hash-audit fallback detection message.
    • Fix
      • Align the implementation and tests for these changed controls: ensure the registry lint kill switch exits successfully when explicitly disabled, update or correct the fleet registry public-values expectation/source of truth for the three mission docs entries, and either make the reviewer fallback path reachable under the test's fallback-only PATH/override assumptions or update the test if hard refusal is now intended.

    T-Rex Ran code and verified through T-Rex

  2. General comment

    P1 Registry lock hash is stale for autonomous-fleet-core

    • Bug
      • The focused registry lint tests and the standalone registry lint CLI fail on the current checkout because skills-lock.json records autonomous-fleet-core with locked hash 4cf401591b7d…, while the recomputed on-disk skill hash is 84bbd3e0c182…. This breaks the PR's stated security/registry validation path.
    • Cause
      • The committed skills-lock.json was not refreshed after changes to the autonomous-fleet-core skill contents, or the content change was not reverted.
    • Fix
      • Refresh the autonomous-fleet-core computedHash entry in skills-lock.json using the repo's intended lock update flow, or revert the uncommitted/unlocked skill content change so the lock and on-disk files match.

    T-Rex Ran code and verified through T-Rex

  3. General comment

    P1 Bundled substrate assets are out of sync with source substrate files

    • Bug
      • The dedicated substrate sync check python3 scripts/sync_substrate_assets.py --check fails, reporting that bundled stop_verify.py differs from the scripts source and that lib/__pycache__/*.pyc files are orphaned inside the substrate bundle. This means the substrate assets shipped with the skill are not a clean synchronized copy.
    • Cause
      • The substrate bundle under skills/autonomous-fleet-core/assets/substrate was not regenerated/cleaned after source changes, and generated Python bytecode cache files are present in the bundle.
    • Fix
      • Run the repo's substrate sync/update command (scripts/sync_substrate_assets.py) and commit the resulting source/bundle parity changes; remove generated __pycache__ files from the bundled substrate and ensure they are ignored going forward.

    T-Rex Ran code and verified through T-Rex

Reviews (9): Last reviewed commit: "fix(registry-lint): drop duplicate explo..." | Re-trigger Greptile

Apply recommended variants for SEC-004/005/009/010 and ARCH-004/005:
SHA-pin Actions, fail-closed reviewer sandbox without bwrap/sandbox-exec,
registry-lint security ack, register exploratory missions, unify archive
collectors, and opt-in strict stop-verify on missing repo.
Comment thread scripts/registry_lint.py Outdated
Close P0/P1 doc-sync drifts from the adversarial review (fail-closed
kill switches, reviewer refuse-without-sandbox, exploratory count,
skills CLI pin). Sync Starlight generated copy. Add/adjust tests for
Lane B remediation and keep stop-verify hook exit 0 on strict block.
Comment thread skills/autonomous-fleet-core/assets/substrate/stop_verify.py Outdated
@ravidsrk
ravidsrk marked this pull request as ready for review July 8, 2026 19:54
ravidsrk added 2 commits July 8, 2026 19:57
Update action.yml assertion for setup-python SHA pin, bump README/CHANGELOG
test counts to 73/1576, use <SUBSTRATE> path in knobs docs, sync substrate
stop_verify + bump autonomous-fleet-core to 1.3.4 with refreshed lock hash.
Cover non-positive auth timeout, invalid UTF-8 findings docs,
ARCH-004 exploratory registry orphans, and BUG-004 table resume
edge cases so the fail-under=100 gate passes.
@greptile-apps

greptile-apps Bot commented Jul 8, 2026

Copy link
Copy Markdown

Want your agent to iterate on Greptile's feedback? Try greploops.

ravidsrk added 4 commits July 8, 2026 20:06
Cover recovery_scan.py:548 so the 100% coverage gate passes after
Lane A table-format resume counting.
Make the keyed readiness file strictly newer so the
promotion-readiness-prefers-canonical mutation cannot survive via
same-second name-sort falling back to the canonical path.
Route the CLI through lint_registry() so ARCH-004's on-disk exploratory
check runs once (matching the library aggregator) and cannot drift.
@ravidsrk
ravidsrk force-pushed the cursor/lane-b-remediation-256a branch from e8e0164 to 8a42ce8 Compare July 9, 2026 07:02
@ravidsrk
ravidsrk merged commit 66b4ed1 into main Jul 9, 2026
3 checks passed
@ravidsrk
ravidsrk deleted the cursor/lane-b-remediation-256a branch July 9, 2026 09:39
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