[codex] Tighten explicit scan target and harness resolution - #6
Draft
teilomillet wants to merge 1 commit into
Draft
[codex] Tighten explicit scan target and harness resolution#6teilomillet wants to merge 1 commit into
teilomillet wants to merge 1 commit into
Conversation
Reviewer's GuideTightens ordeal’s explicit-target selection, harness hint mining, and CLI metadata-only behavior so that exact scan targets are resolved directly, weak state_factory fixtures are filtered out, metadata-only hooks remain read-only during --list-targets, and zero-arg stateful wrappers stay runnable; adds focused tests around these behaviors. Sequence diagram for explicit target resolution with exact selectorssequenceDiagram
actor User
participant CLI as CLI_scan_command
participant Auto as auto_selected_public_functions
participant Local as auto_resolve_local_target
participant Explicit as auto_resolve_explicit_target
User->>CLI: run ordeal scan --targets exact_selector
CLI->>Auto: _selected_public_functions(mod, targets)
Auto->>Auto: normalize targets
Auto->>Auto: check _is_exact_target_selector for each
alt all selectors exact
loop for each target
alt target contains_colon
Auto->>Explicit: _resolve_explicit_target(module_target, harness_maps)
Explicit-->>Auto: name, func
else local selector
Auto->>Local: _resolve_local_target(mod, target, harness_maps)
Local->>Explicit: _resolve_explicit_target(mod_name_colon_selector, harness_maps)
Explicit-->>Local: name, func
Local-->>Auto: name, func
end
Auto->>Auto: deduplicate by name
end
Auto-->>CLI: selected[name, func]
else non_exact_selector_present
Auto->>Auto: discovered = _get_public_functions(mod, harness_maps)
Auto->>Auto: filter discovered by glob targets
Auto-->>CLI: selected[name, func]
end
CLI-->>User: run scan on selected callables
Sequence diagram for metadata-only hooks during --list-targetssequenceDiagram
actor User
participant CLI as cli_list_targets
participant Placeholder as cli_placeholder
participant Auto as auto_verify_auto_object_runtime
User->>CLI: run ordeal scan --list-targets
CLI->>Placeholder: _placeholder(kind)
Placeholder-->>CLI: function with __ordeal_metadata_only__ True
CLI->>Auto: _verify_auto_object_runtime(factory, setup, scenarios, state_factory, sources)
Auto->>Auto: check any mined sources
alt no mined_sources
Auto-->>CLI: True, None
else mined_sources_present
Auto->>Auto: _is_metadata_only_hook on configured factory, setup, scenarios, state_factory
alt any configured hook is_metadata_only_hook
Auto-->>CLI: True, None (skip dry-run)
else real configured hooks
Auto->>Auto: call factory and setup for dry-run
Auto-->>CLI: result, error_message_or_None
end
end
CLI-->>User: print targets metadata without mutating runtime state
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed
This PR tightens the explicit-target scan path and harness hint resolution in
ordeal.state_factoryhints are more conservative and no longer auto-promote pytest fixtures that require injected arguments--list-targetsWhy
Focused scans of explicit
verifierstargets were still paying full-module discovery cost, and weak mined state-factory hints were overriding configured state setup with bad pytest fixtures. The follow-up rerun also exposed two adjacent engine issues in read-only metadata listing and zero-arg wrapper strategy inference.Impact
--list-targetsand targeted scan probesverifiersRLM explicit-target probes now resolve as runnable instead of blocking on false harness issuesValidation
Local checks run:
uv lock --checkuv sync --locked --extra devuv run ruff check --fix .uv run ruff format .tests/test_auto.py,tests/test_cli.py,tests/test_cli_agent_json.py, andtests/test_state.pyuv run ordeal benchmark --perf-contract ordeal.perf.toml --tier pr --check --output-json .artifacts/perf-contract-pr.jsonuv sync --locked --extra docsuv run mkdocs build --strictuv run --with build python -m buildAdditional targeted external verification:
ordeal cli scan ... --list-targets --jsonagainst theverifiersRLM targets using the local checkout onPYTHONPATHRLMEnv._setup_interception_and_registerandRLMExecutor.create_rollout_dirsboth now report runnable with configured state factories and no dry-run errorSummary by Sourcery
Tighten explicit target resolution and harness handling for ordeal scans and CLI listing.
Bug Fixes:
Enhancements:
Tests: