← Back to Pull requests

feat(instagram): official Like Media API lane + engagement scope #2979

Open
unknown opened this pull request with 166 lines diff across 2 files
View on GitHub
unknown unknown commented on Dec 02, 2026 20:54 UTC
Author

Summary


  • Official likes lane: InstagramAPIClient.like/unlike implement the Like Media and Comments API (shipped 2026-04-22) — POST/DELETE /{ig-user-id}/likes with media_id or comment_id, Facebook-Login lane only.

  • API-first actor: ig_actor likes through the official endpoint when a Facebook-Login account exists, resolving browser-ingested shortcodes to Graph media ids via business_discovery permalink matching (cached in action meta). Missing-scope errors fall back to the legacy browser lane only until re-consent; private/deleted media fails permanently.

  • OAuth scopes: instagram_manage_engagement + instagram_manage_comments added to the IG_API_ONBOARDING authorize URL and the legacy facebook-dialog flow — the next reconnect arms the compliant lane.

  • 13 new unit tests (132 passing in the two touched files); ruff clean.
  • Test plan


  • pytest tests/unit/test_instagram_api.py tests/unit/test_engagement_actors.py — 132 passed (host venv)

  • ruff check on all touched files

  • CI validate + secret-scan

  • After merge: reconnect @cloudless.gr via /api/v1/auth/oauth/instagram-onboarding/authorize so the token carries instagram_manage_engagement
  • Generated with Devin

    Diff: 166 lines (+124 / -42) across 2 files Reviewer: copilot-pull-request-reviewer[bot] Review duration: 3m
    All Vouch review confidence checks passed
    Residual risk 0.20 = Change Risk (0.35) × (1 − Review Confidence (0.43)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.35 · 166 lines diff across 2 files
    0.35
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.02 · 1 substantive comment(s)
    0.02
    Model 3 · Review Timing & Attention
    Session adequacy: 85% · Reviewer familiarity: 35%
    43%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Shallow Review Depth shallow_review_depth
    0.344
    Diff Size diff_size
    0.306
    Real PR Conversation Timeline
    1 comments
    "Review active on #2979"
    general weight: 0.35
    Assignees
    Unassigned
    Labels
    risk: low confidence: 43.1% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 35.1% (MEDIUM) · Higher = larger blast radius
    35.1%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 43.1% · Lower = rushed or shallow review
    43.1%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 20.0% · Safe to merge
    20.0%