Skip to content

fix(ci): add missing migration artifacts and fix CodeQL path-traversal alerts in a2a_router#588

Open
mick-gsk with Copilot wants to merge 100 commits into
mainfrom
copilot/fix-workflow-failures-pr-576
Open

fix(ci): add missing migration artifacts and fix CodeQL path-traversal alerts in a2a_router#588
mick-gsk with Copilot wants to merge 100 commits into
mainfrom
copilot/fix-workflow-failures-pr-576

Conversation

Copilot AI commented May 2, 2026

Copy link
Copy Markdown
Contributor

Summary

Fixes all 8 failing CI checks on PR #576 (feat/adr100-phase7a-cleanup).

Root Causes & Fixes

1. Test failures (6× matrix + "Required checks passed")

Root cause: Two required migration tracking artifacts were missing from the repo:

  • work_artifacts/vsa_migration_inventory.md — required by tests/migration/test_migration_contract.py::test_migration_inventory_exists
  • work_artifacts/vsa_import_mapping.csv — required by tests/migration/test_migration_models.py::test_import_mapping_csv_exists (second failure, previously hidden by --maxfail=1)

Both files were also excluded from git tracking by the work_artifacts/ .gitignore rule.

Fix:

  • Created work_artifacts/vsa_migration_inventory.md with VSA migration inventory documenting all completed capability packages and phases
  • Created work_artifacts/vsa_import_mapping.csv with 320 legacy→canonical import mappings (T002 artifact)
  • Added gitignore exceptions (!work_artifacts/vsa_migration_inventory.md, !work_artifacts/vsa_import_mapping.csv) so the files are tracked

2. CodeQL check failure (1 critical + 5 high alerts)

Root cause: packages/drift-mcp/src/drift_mcp/serve/a2a_router.py exposed a CWE-22 path traversal vulnerability. Three FastAPI A2A handlers passed user-controlled HTTP request parameters (path, artifact_path) directly to file-system operations without sanitization:

  • _handle_capture_intent — user pathsave_intent(repo_root=Path(path)) (file write)
  • _handle_verify_intent — user artifact_pathPath(artifact_path).read_text() (arbitrary file read — critical)
  • _handle_feedback_for_agent — user artifact_path → same sink

While 13 other handlers in the same file correctly called _validate_repo_path(), these 3 were missed.

Fix:

  • Added _validate_artifact_path(path: str) -> str helper (mirrors _validate_repo_path but accepts files, not just dirs)
  • Applied _validate_repo_path() to the path parameter of all 3 handlers
  • Applied _validate_artifact_path() to the artifact_path parameter of _handle_verify_intent and _handle_feedback_for_agent

Verification

All 18 migration tests pass locally:

tests/migration/test_import_boundaries.py  3 passed
tests/migration/test_migration_contract.py  6 passed
tests/migration/test_migration_models.py   5 passed
tests/migration/test_no_active_src_drift.py  3 passed
18 passed in 0.70s

sauremilk and others added 30 commits May 1, 2026 10:35
…d failed-turn repro bundle

- FU-002 CLOSED: make ab-harness now passes --mock-mode neutral; reports record
  mock_mode and mock_mode_interpretation; HARNESS008 enforces the target contract
- FU-004 CLOSED: scripts/agent_repro_bundle.py with required-fields contract;
  make repro-bundle is the standard workflow entry; HARNESS009 enforces both
  script existence and Makefile target
- 41 tests pass (test_agent_harness_contract, test_agent_repro_bundle, test_ab_harness)
- audit/follow-up.md marks FU-002 and FU-004 as closed 2026-04-30
…at in tests

- brief.py: save/restore drift.commands.console in try/finally to prevent
  stream corruption after CliRunner.invoke() in test environments
- tests/test_brief.py: update _extract_json() to strip JSON-lines progress
  events (type=progress) before parsing; handles Click 8.3+ where stderr
  merges into stdout in CliRunner
- tests/test_calibration_cli.py: remove mix_stderr kwarg (removed in Click 8.2+)
…outcome/reward, ADR-100)

- Extract session.py, session_handover.py, session_queue_log.py, session_writer_lock.py,
  outcome_tracker.py, reward_chain.py and outcome_ledger/ into packages/drift-session
- Convert src/drift session and outcome files to compat re-export stubs
- Register drift-session as workspace member in pyproject.toml
…gration and CLI

- adds scripts/outcome_first_validation.py: standalone 14-day outcome-first study runner
- implements TaskManifestEntry, TaskRecord, CohortMetrics, Go/No-Go evaluator
- session_summary_to_task_record() derives TaskRecord from DriftSession.summary()
- CLI subcommands: validate, report, ingest-session
- 16 tests passing in tests/test_outcome_first_validation.py
- adds docs/concepts/outcome-first-validation.md metric contract spec
- evidence: benchmark_results/v2.50.0_outcome-first-validation_feature_evidence.json
…dge conflict)

Co-authored-by: mick-gsk <270290541+mick-gsk@users.noreply.github.com>
Copilot AI and others added 9 commits May 2, 2026 21:19
Co-authored-by: mick-gsk <270290541+mick-gsk@users.noreply.github.com>
…nstall-dependencies

[WIP] Fix CI test job missing packages/drift in dependencies
- Add -e packages/drift to test job and smoke-pr job Install dependencies
  steps (was present in version-check but missing elsewhere)
- Add shell: bash to 'Run tests with coverage', 'Ensure deterministic
  coverage.xml', 'Validate coverage.xml structure' and 'Pre-Codecov
  diagnostics' steps (used $PYTHON_BIN bash syntax without explicit shell)
…ft/src/drift

Agent-Logs-Url: https://github.com/mick-gsk/drift/sessions/aa0b8761-2f7f-4c84-9486-7085ca967017

Co-authored-by: mick-gsk <270290541+mick-gsk@users.noreply.github.com>
…rts in a2a_router

Agent-Logs-Url: https://github.com/mick-gsk/drift/sessions/b6800ee1-f13d-45b5-97c0-91277a1776d2

Co-authored-by: mick-gsk <270290541+mick-gsk@users.noreply.github.com>
Copilot AI requested a review from mick-gsk May 2, 2026 22:30
@github-actions github-actions Bot added documentation Improvements or additions to documentation signals Changes to signal detection logic tests Test coverage or fixture improvements ci Changes to CI/CD workflows or tooling security Security-related changes labels May 2, 2026

@github-advanced-security github-advanced-security AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CodeQL found more than 20 potential problems in the proposed changes. Check the Files changed tab for more details.

@mick-gsk
mick-gsk marked this pull request as ready for review May 3, 2026 15:26
Copilot AI review requested due to automatic review settings May 3, 2026 15:26
@github-actions github-actions Bot added the agent-review-requested Agent review was requested automatically label May 3, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot wasn't able to review this pull request because it exceeds the maximum number of files (300). Try reducing the number of changed files and requesting a review from Copilot again.

@sauremilk
sauremilk self-requested a review May 3, 2026 15:27
@mick-gsk mick-gsk added release:fix Include this PR under Fixes in release notes size/XL Diff ≥ 500 lines — consider splitting labels May 4, 2026
@github-actions github-actions Bot added the has-conflicts PR has merge conflicts with the base branch label May 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agent-review-requested Agent review was requested automatically ci Changes to CI/CD workflows or tooling documentation Improvements or additions to documentation has-conflicts PR has merge conflicts with the base branch release:fix Include this PR under Fixes in release notes security Security-related changes signals Changes to signal detection logic size/XL Diff ≥ 500 lines — consider splitting tests Test coverage or fixture improvements

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants