Skip to content

Sweep filing: seed code-scanning and Dependabot tasks' context_files from their alert locations - #9786

Merged
orbit-agent-01 merged 1 commit into
agent-mainfrom
orbit/ORB-25214-aa7efcc5
Nov 16, 2026
Merged

orbit-agent-01 merged 1 commit into
agent-mainfrom
orbit/ORB-25214-aa7efcc5

Conversation

@orbit-agent-01

Copy link
Copy Markdown
Contributor

Task

ORB-25214 — Sweep filing: seed code-scanning and Dependabot tasks' context_files from their alert locations

Description

Daniel's direction (session f09993e5, 2026-11-16), on ORB-25213: "can't we extract the context_files?"

Observed

Code-scanning tasks are filed with context_files: Vec::new() (crates/orbit-core/src/application/sweep_filing/dependabot/code_groups.rs, comment "Scanner locations are evidence about where the finding was observed, not a reliable claim about which files the repair will modify. Task-pilot resolves those selectors from its pinned checkout."). Dependabot dependency tasks (sweep_filing/dependabot/filing.rs) set none either, though each alert names its manifest.

Until the task pilot runs, such a task has an unknown footprint and holds no file lock. ORB-25213 (alert #501, crates/orbit-registry/src/machine_identity.rs:109) was filed at 03:54:49Z and shipped from the dashboard two minutes later with readiness waived, so it is running beside other work with no lock, although its alert names the file it will almost certainly touch. The CI-failure sweep already seeds file: selectors from log locations (ci_failure/cluster.rs context_files()), so this is the one sweep path that files empty.

End state

A code-scanning task is filed with a file: selector for every distinct alert path in its group, and a Dependabot dependency task with its alert's manifest (and lockfile, where the alert names one). Paths that do not exist at the filing base, or fall in .git/.orbit, are dropped rather than filed. The seeded list is a starting footprint: the task pilot and the run's own widening still add the real repair site, and nothing here stops them. The comment in code_groups.rs is updated to say why the seed exists.

Behaviour change: newly filed sweep tasks carry context_files and a footprint; existing tasks are not rewritten.

Acceptance Criteria

  • A code-scanning group filed from alerts in two files carries a file: selector for each of those paths, and a Dependabot dependency task carries its alert's manifest path.
  • An alert path missing at the filing base, or inside .git or .orbit, is not filed as a selector.
  • The task pilot can still add selectors to a seeded sweep task, shown by an existing or updated pilot test.

Execution Summary

Click to expand

Implemented sweep context_files seeding.

Changes:

  • crates/orbit-core/src/application/sweep_filing/mod.rs: new seeded_file_selectors(paths, repo_root) helper. Canonicalizes each candidate against the filing base (runtime.paths().repo_root), drops unparseable/outside-workspace anchors, drops anchors with any .git/.orbit path component, drops targets that are not files at the base, sorts and dedupes to file: selectors.
  • crates/orbit-core/src/application/sweep_filing/dependabot/code_groups.rs: CodeGroupTaskRequest gains repo_root; code_group_task_params seeds context_files from distinct alert paths; comment updated to say the seed is the starting footprint and the pilot/run widening still adds the repair site.
  • crates/orbit-core/src/application/sweep_filing/dependabot/filing.rs: Dependabot clusters seed manifest_path plus any alert-named lockfile (keys: lockfile_path, lock_file_path, lockfile, lock_file, lock_path, manifest_lock_path) filtered at the filing base; code groups pass repo_root.
  • crates/orbit-core/src/application/sweep_filing/dependabot/consolidate.rs: replacement_params takes repo_root, seeds from alert paths, then unions with source selectors so pilot-widened scope survives consolidation.
  • crates/orbit-core/src/application/task/pilot/tests/persist.rs: new seeded_scope_is_retained_when_pilot_widens_selectors proves explicit pilot keeps the seed and adds the repair site.
  • crates/orbit-core/tests/runtime/security_alert_sweep.rs: new sweep_tasks_seed_file_selectors_from_alert_locations (group across two files seeds both; Dependabot manifest plus alert-named lockfile seeds both) and sweep_tasks_drop_missing_and_git_orbit_paths (missing and .git/.orbit dropped; missing manifest seeds empty).
  • scripts/unit-test-baseline.json: admitted the one new orbit-core unit test (minimal +1).

Acceptance criteria:

  1. Code-scanning group in two files carries both file: selectors; Dependabot task carries manifest (and lockfile where named) - PASS (new sweep seed test).
  2. Missing-base and .git/.orbit paths not filed - PASS (new sweep drop test).
  3. Pilot can still add selectors to a seeded task - PASS (new pilot persist test; explicit prepare/apply retains SEED.md and adds README.md). Note: Dependabot Low+seeded tasks stay excluded from automatic discovery by the existing context_files_not_empty rule; explicit pilot still widens, and code-scanning Unassessed+seeded tasks remain auto-selectable.

Validation (all passed):

  • cargo test -p orbit-core --test runtime security_alert_sweep (full table incl. 2 new rows)
  • cargo test -p orbit-core --lib task::pilot (14 passed incl. new test)
  • make ci-guards (incl. unit-test ratchet)
  • cargo fmt --all -- --check; rustfmt --edition 2024 on changed test file
  • cargo clippy -p orbit-core --lib --bins and --all-targets (-D warnings)
  • cargo doc --no-deps -p orbit-core (RUSTDOCFLAGS -D warnings)
  • git diff --check clean
  • No pipeline final_validation_commands to defer; owned every check.

Reconciliation vs step-3 baseline (was clean):

  • Modified (deliverable): sweep_filing/mod.rs, dependabot/code_groups.rs, dependabot/filing.rs, dependabot/consolidate.rs, task/pilot/tests/persist.rs, tests/runtime/security_alert_sweep.rs, scripts/unit-test-baseline.json.
  • Untracked/deleted/renamed: none. git diff --check: clean. No .orbit/tmp leftovers created (only the update-input helper, gitignored).
  • Did not touch the task's own context_files selectors.

Risks/deviations:

  • Lockfile support is key-based; unknown future lockfile keys seed nothing until added to dependabot_seed_paths.
  • Absolute or outside-workspace alert paths are dropped by canonicalization, treated as missing.
  • Existing tasks are not rewritten (filing-time only).

Validation

  • Not reported

Branch Freshness

  • Base ref: refs/remotes/origin/agent-main
  • Head ref: orbit/ORB-25214-aa7efcc5
  • Behind base: 0
  • Ahead of base: 1

Sweep filing: seed code-scanning and Dependabot tasks' context_files from their alert locations

Implemented sweep context_files seeding.

Orbit-Task: ORB-25214
@orbit-agent-01 orbit-agent-01 added the orbit orbit related label Nov 16, 2026
@orbit-agent-01
orbit-agent-01 merged commit 37ac870 into agent-main Nov 16, 2026
19 checks passed
@orbit-agent-01
orbit-agent-01 deleted the orbit/ORB-25214-aa7efcc5 branch November 16, 2026 04:38
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