Repository navigation
Description
All symbols have no src caller (ranker grep found only definitions and export maps), the last caller of extract_dependencies_from_text was removed in v0.2.38 (#1799), and nothing here shares files with the other first-wave items.
Existing tool considered: Nothing: osv-scanner (security/osv_scanner.py) and trivy already scan lockfiles, and run_subprocess in core/process.py and typer's own exit handling serve every caller. The code to delete is about 760 lines of source and tests (audit of 2026-10-22, spot-checked by the ranker and re-checked by an adversarial verifier). Keeping it means carrying it through every gate run, every refactor and every review, and fixing the defects it produces, for no caller.
Evidence (verifier, 2026-10-22):
- Deadness verified. git grep over src and tests finds only definitions, export maps and their own tests for extract_dependencies_from_text and its five extractors, transit_encrypt, transit_decrypt, CallableProvider, ProcessExecutionPipeline, ProcessExecutionResult and cli_command_handler. No @cli_command_handler decorator use exists. The last extract_dependencies_from_text caller was removed in 1a8b26c (v0.2.38), where pipeline.py dropped its import and both call sites. Dashboards and docs use main.py's devops_cli_command_total and devops_cli_command_duration_seconds, not cli.command.* or subprocess.execution.duration_seconds. run_subprocess already handles TRACEPARENT. No symbol becomes newly orphaned except two Vault path constants (correction 3).
- Experiment in /tmp/open-libs-audit/verify-R09/: I applied the whole deletion to a git-archive copy with corrections 1-8. ruff check and format pass on src and tests. mypy on the touched src files is clean; its one error, at tests/test_secret_resolution.py:411, is in unchanged code, and the gate type-checks src only. The 283 tests in the touched and invariant files pass, including test_public_export_surface, test_architectural_invariants (C901 ceiling), test_codebase_hygiene_and_shims and test_agent_invariants. The full suite gives 11379 passed and 9 failed. Seven of the 9 pass once the copy is a git repo; the other two (test_roadmap_reprioritize telemetry gauges and test_host_sandbox) also fail on the unmodified archive, so none are caused by the change. The deletion only removes code and tests, so it cannot slow the gate or the hooks. It touches no pyproject.toml or uv.lock entry: packaging is still used by kb.py, pr.py, roadmap/store.py and others.
- The ratchet fixture edit is mandatory. With secrets.py left at 4, tests/test_swallowed_failures_ratchet.py fails with {'src/devops_cli/security/secrets.py': (3, 4)}, because CallableProvider carried one swallowed except Exception. No other deleted file is in that fixture.
Proposed change: Delete security/reference_extractor.py lines 751-946 (the pip, pyproject, package.json, Cargo and go.mod extractors and extract_dependencies_from_text, with the packaging.requirements import); security/vault_lease.py transit_encrypt and transit_decrypt (47 lines); security/secrets.py CallableProvider (19 lines); core/process_pipeline.py (143) and core/command_decorator.py (111); their export-map entries in security/init.py and core/init.py. Leave validate_session_id and validate_file for the next PR (tests/test_validation.py is edited by R01). Leave the review pipeline's now-empty file_deps chain alone (#771).
Corrections found by the verifier (the change includes them):
-
- tests/test_reference_extractor.py: the dependency tests are not only lines 179-226. Seven functions use the deleted code, 182 lines in total, at 179-228 (three tests), 456-497 (test_extract_dependencies_pep621_and_extras), 744-763 (test_extract_dependencies_various_ecosystems), 890-930 (test_dependency_extractors_cargo_go_and_package_assets) and 933-965 (test_extract_package_json_and_manifest_dispatch). Also drop the extract_dependencies_from_text import. Leave test_dependency_and_network_reference_canonical_location_formatting; it only builds DependencySpec from models.
-
- tests/test_secret_resolution.py: the remaining tests do NOT all pass unchanged. test_providers_satisfy_the_protocol builds CallableProvider('tool', lambda ref: None) in its provider tuple, so remove that entry and keep the test. Delete test_callable_provider_wraps_bespoke_lookups, the whole 'Transit envelope encryption' section (three tests, about 40 lines) and the CallableProvider, transit_encrypt and transit_decrypt imports. Reword the acceptance bullet to 'the other tests in both files pass; the only edit to a surviving test is the one tuple entry'.
-
- Add src/devops_cli/config/constants.py to files_owned and delete CONST_VAULT_PATH_TRANSIT_ENCRYPT and CONST_VAULT_PATH_TRANSIT_DECRYPT (lines 2317-2318), which are orphaned once vault_lease.py stops importing them; also drop the two imports in vault_lease.py. R01 edits constants.py too (CONST_DOMAIN_EXCEPTION_MODULES near line 122 and harness constants), but the lines are far apart.
-
- The VaultLeaseError docstring at src/devops_cli/exceptions/vault.py:118 says 'lease, login, token or Transit call fails' and feeds docs/ERRORS.md line 150 (generated by docs generate). Remove 'or Transit' and regenerate. Add exceptions/vault.py to files_owned, and note R01 also owns docs/ERRORS.md (different rows; whichever merges second regenerates).
-
- reference_extractor.py: besides deleting lines 751-946, remove the Requirement/InvalidRequirement import and DependencySpec from the models import (otherwise ruff F401), the extract_dependencies_from_text entry in all, and fix the module docstring line 1 ('Extractors for software dependencies (manifests) and network references'). json, tomllib, Path and logger stay in use.
-
- Export maps: security/init.py holds entries only for extract_dependencies_from_text, in three places (TYPE_CHECKING import at line 25, lazy map at lines 83-86, all at line 174). CallableProvider and the transit helpers are not exported there. core/init.py needs three map entries and three all entries removed (cli_command_handler, ProcessExecutionPipeline, ProcessExecutionResult).
-
- tests/fixtures/swallowed_failures_ceilings.json: set security/secrets.py to 3 (verified required); use
uv run python -m tests.test_swallowed_failures_ratchet --lowerrather than hand-editing.
- tests/fixtures/swallowed_failures_ceilings.json: set security/secrets.py to 3 (verified required); use
-
- Optional, since the owner rule is to fix docs a change makes stale: src/devops_cli/ai/knowledge_base/devops_cli/tasks/ai_code_review.md:25 says the static scan does 'dependency extraction with OSV advisories'. It describes the pipeline that feat(release): v0.2.38 #1799 already changed to offline osv-scanner over lockfiles; reword it to the lockfile scan. No other first-wave item owns that file.
-
- Correct deletes_loc to about 995 (src 551 plus tests about 450, minus 2 added) and state the replacement as 'none: zero callers (dead since feat(release): v0.2.38 #1799)' instead of naming osv-scanner and trivy as equivalents.
-
- The delivering PR also carries the usual changelog.d/.md fragment and task file. Leave docs/agent/tasks/task-311 and task-709, which describe delivered history, and docs/SELF_IMPROVEMENT.md lines 310 and 341, which cite older sessions.
Acceptance criteria:
- extract_dependencies_from_text and its five extractors, transit_encrypt, transit_decrypt, CallableProvider, ProcessExecutionPipeline and cli_command_handler are deleted with every test that exists only for them; a grep of src and tests for those names returns nothing.
- security/init.py and core/init.py export maps list no deleted name, and tests/test_public_export_surface.py passes.
- The network-reference tests in tests/test_reference_extractor.py and the remaining tests in tests/test_secret_resolution.py pass unchanged.
- uv run devops ci passes in full.
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsDone
Activity
dan-petty commentedon Oct 22, 2026
Intake placed this item to the backlog: at intake only a critical fix goes into a release; a release start pulls Ready items in, P0 features first.
The candidate proposes deleting unused code, which is a refactor.This is a cleanup of dead code that improves maintainability but does not address an urgent issue.Removing dead code improves clarity and reduces risk, but the impact to users is limited.The deletion is well-scoped and verified with automated checks, indicating low implementation effort.refactor(security): delete the dependency-manifest parsers, Vault tra…
dan-petty commentedon Oct 22, 2026
What changed
#1850, merged into
release/v0.2.39as b0fdd8d.20 file(s) changed.
How it was verified
Check runs at 293caf8:
Acceptance Criteria of
docs/agent/tasks/task-1841-orphan-parsers-and-helpers.md:extract_dependencies_from_textand its five extractors,transit_encrypt,transit_decrypt,CallableProvider,ProcessExecutionPipeline,ProcessExecutionResultandcli_command_handlerare deleted with every test that existed only for them; agit grepofsrcandtestsfor those names returns nothing.security/__init__.pyandcore/__init__.pylist no deleted name, andtests/test_public_export_surface.pypasses.tests/test_reference_extractor.pyandtests/test_secret_resolution.pypass; the only edit to a surviving test is the one tuple entry intest_providers_satisfy_the_protocol.docs/ERRORS.mdrow, the ratchet ceiling and the knowledge-base line that only the deleted code made true are removed or corrected.feat(release): v0.2.39 (#1947)