Dependency-aware version propagation done

← Artifact Lifecycle
When artifact B (dependency) gets new version, create recommendations for artifacts that depend on B to update. get_dependents() function. ## REOPENED TASK — CRITICAL CONTEXT This task was previously marked 'done' but the audit could not verify the work actually landed on main. The original work may have been: - Lost to an orphan branch / failed push - Only a spec-file edit (no code changes) - Already addressed by other agents in the meantime - Made obsolete by subsequent work **Before doing anything else:** 1. **Re-evaluate the task in light of CURRENT main state.** Read the spec and the relevant files on origin/main NOW. The original task may have been written against a state of the code that no longer exists. 2. **Verify the task still advances SciDEX's aims.** If the system has evolved past the need for this work (different architecture, different priorities), close the task with reason "obsolete: " instead of doing it. 3. **Check if it's already done.** Run `git log --grep=''` and read the related commits. If real work landed, complete the task with `--no-sha-check --summary 'Already done in '`. 4. **Make sure your changes don't regress recent functionality.** Many agents have been working on this codebase. Before committing, run `git log --since='24 hours ago' -- ` to see what changed in your area, and verify you don't undo any of it. 5. **Stay scoped.** Only do what this specific task asks for. Do not refactor, do not "fix" unrelated issues, do not add features that weren't requested. Scope creep at this point is regression risk. If you cannot do this task safely (because it would regress, conflict with current direction, or the requirements no longer apply), escalate via `orchestra escalate` with a clear explanation instead of committing.

Completion Notes

Auto-completed by supervisor after successful deploy to main

Git Commits (4)

[Atlas] Add dependency-aware version propagation via get_dependents()2026-04-20
[Atlas] Add dependency-aware version propagation via get_dependents()2026-04-20
[Atlas] Add dependency-aware version propagation via get_dependents()2026-04-20
Squash merge: orchestra/task/50b2dc6c-hypothesis-and-experiment-dependency-gra (1 commits)2026-04-18
Spec File

Goal

When artifact B gets a new version via create_artifact_version(), automatically create update recommendations for all artifacts that depend on B (found via get_dependents()).

Acceptance Criteria

create_artifact_version() calls a new _notify_dependents() helper after creating a new version
_notify_dependents() uses get_dependents() to find all dependent artifacts
☑ For each dependent, a row is inserted into dedup_recommendations table with recommendation_type='version_update'
☑ Route GET /api/artifacts/{artifact_id}/update-recommendations returns pending update recommendations
☑ API route to dismiss or act on an update recommendation

Approach

  • Add _notify_dependents(db, new_artifact_id, old_artifact_id, reason, actor_id) function in artifact_registry.py
  • Call _notify_dependents() at the end of create_artifact_version()
  • Add GET /api/artifacts/{artifact_id}/update-recommendations route in api_routes/dedup.py
  • Add POST /api/artifacts/update-recommendations/{rec_id}/dismiss and act routes
  • Dependencies

    • get_dependents() already exists in artifact_registry.py

    Work Log

    2026-04-20 13:45 PT — Implementation

    • Added _notify_dependents() function to scidex/atlas/artifact_registry.py — finds dependents via get_dependents(), inserts/updates dedup_recommendations rows with recommendation_type='version_update'
    • Called _notify_dependents() at end of create_artifact_version() before returning
    • Added three API routes to api_routes/dedup.py:
    - GET /api/artifacts/{id}/update-recommendations
    - POST /api/artifacts/update-recommendations/{id}/dismiss
    - POST /api/artifacts/update-recommendations/{id}/act
    • Note: Remote branch commits 2323be1b2, 93d18920a, 9cbe02eea had SQLite regressions and could not be merged; this implementation is fresh from current main

    Payload JSON
    {
      "completion_shas": [
        "9cbe02eea2ed60bf5ef3bbf8f4e3a7c0c9e2f1d3b",
        "93d18920a962e706e96437109d9c45c544495bf",
        "2323be1b2a8d7aaf2f3f313e1fd27d05d813675"
      ],
      "completion_shas_checked_at": "2026-04-17T15:32:14.729290+00:00",
      "_reset_note": "This task was reset after a database incident on 2026-04-17.\n\n**Context:** SciDEX migrated from SQLite to PostgreSQL after recurring DB\ncorruption. Some work done during Apr 16-17 may have been lost.\n\n**Before starting work:**\n1. Check if the task's goal is ALREADY satisfied (run the relevant checks)\n2. Check `git log --all --grep=task:YOUR_TASK_ID` for prior commits\n3. If complete, verify and mark done. If partial, continue. If not done, proceed.\n\n**DB change:** SciDEX now uses PostgreSQL. `get_db()` auto-detects via\nSCIDEX_DB_BACKEND=postgres env var.",
      "_reset_at": "2026-04-18T06:29:22.046013+00:00",
      "_reset_from_status": "done"
    }

    Sibling Tasks in Quest (Artifact Lifecycle) ↗