Skip to content

Chore: add CI check for Ansible slm_agent role code drift #1629

Closed

Description

@mrveiss

Problem

The SLM agent code exists in two locations:

  • autobot-slm-backend/slm/agent/ — canonical source (actively developed)
  • autobot-slm-backend/ansible/roles/slm_agent/files/slm/agent/ — Ansible role copy (deployed to new nodes)

These copies WILL drift again after #1623 synced them. Any future change to the canonical agent will silently leave the Ansible copy stale until someone manually notices.

Impact

Proposed Fix

Option A (recommended): CI check
Add a GitHub Actions step or pre-commit hook that compares the two directories:

diff -r autobot-slm-backend/slm/agent/ \
       autobot-slm-backend/ansible/roles/slm_agent/files/slm/agent/ \
       --exclude='__pycache__' --exclude='*_test.py'

Fail CI if they diverge.

Option B: Eliminate the copy
Modify deploy-slm-agent.yml to rsync from the canonical source instead of bundling a static copy in the role.

Option C: Symlink
Replace the Ansible role copy with a symlink to the canonical source (requires adjusting the Ansible role to resolve symlinks).

Discovered During

Implementing #1623 (sync stale agent code).

Activity

  1. mrveiss commented on Mar 13, 2026

    @mrveiss
    OwnerAuthor

    Implemented in PR #1634

    Changes:

    • Created pipeline-scripts/detect-agent-code-drift.sh — compares canonical slm/agent/ with Ansible role copy
    • Added step to .github/workflows/code-quality.yml — CI fails if agent code drifts
    • Script excludes __pycache__, test files, and .pyc files
  2. added 2 commits that reference this issue on Jun 22, 2026
    1fe6d8e
    6374984
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions