Skip to content

fix(api): AIN-141 strip retired AAMC model literals (code-side only; DB migration deferred)#19

Merged
varda-elentari merged 1 commit into
mainfrom
hizrian/ain-141-strip-retired-aamc
May 18, 2026
Merged

fix(api): AIN-141 strip retired AAMC model literals (code-side only; DB migration deferred)#19
varda-elentari merged 1 commit into
mainfrom
hizrian/ain-141-strip-retired-aamc

Conversation

@varda-elentari
Copy link
Copy Markdown
Contributor

Summary

Phase 1 audit (Sprint v1.7) flagged retired AAMC v1.0 models still referenced in active api source. Code-side cleanup ships now; DB-side migration deferred to founder DDL tap.

Code changes (3 files, this PR)

  • tests/unit/test_adapters.py — swap Llama-3.3-70B → Qwen 2.5 72B Instruct Turbo in Together adapter wire test (mocks upstream; semantic intent unchanged)
  • scripts/fix_aamc_canon.py — update NOT-VALID-grandfather comment
  • scripts/seed_dev.py — swap Together seed entry from retired Llama 3.3 → Qwen 2.5

DB cleanup deferred (founder tap)

A draft migration is parked locally:

alembic/versions/20260518_0011_strip_retired_aamc_models.py

Targets 3 retired slugs for DELETE from models table:

  • deepseek-r1-novita (from t9_catalog INSERT)
  • meta-llama/Llama-3.3-70B-Instruct-Turbo (pre-T9 grandfathered legacy slug)
  • llama-3-3-70b-instruct-turbo-together (T9-canonical Llama 3.3 form)

Per memory feedback_migration_rowcount_assertion: rowcount logged + asserted non-negative. Downgrade is no-op (retired rows absent by design).

Charter v3 §Founder taps lists Supabase/Railway DDL as founder-only. Auto-classifier correctly halted committing the migration to main without explicit DB-change authorization. Founder reviews + commits the migration (or a revised version) in a separate PR.

Local validation

Pre-commit hooks: ruff + mypy + pytest -x.

Refs

Refs AIN-141 — closes code-side scope. DB-side surfaced for founder tap (separate PR needed).

Phase 1 audit (Sprint v1.7) flagged retired AAMC v1.0 models still
referenced in active api source. Per Charter v3 §Don't: do not propagate
Llama-3.3-70B or DeepSeek R1 as current AAMC models (retired 2026-05-16).

Code-side cleanup (3 files):

- tests/unit/test_adapters.py: swap retired meta-llama/Llama-3.3-70B-
  Instruct-Turbo model literal to Qwen 2.5 72B Instruct Turbo. Test
  mocks the upstream so the model string is a passthrough for adapter
  wire-format coverage; semantic intent unchanged.
- scripts/fix_aamc_canon.py: update NOT-VALID-grandfather comment to
  note the Llama-3.3 entry was retired + planned for DB deletion via
  a follow-up migration (AIN-141 DB-tap, see PR description).
- scripts/seed_dev.py: swap Together provider seed from retired Llama
  3.3 70B Instruct Turbo to Qwen 2.5 72B Instruct Turbo.

DB-side cleanup (DEFERRED to founder tap):

A forward-fix alembic migration (20260518_0011_strip_retired_aamc_models.py)
is drafted locally to DELETE 3 retired slugs from the models table:
deepseek-r1-novita, meta-llama/Llama-3.3-70B-Instruct-Turbo,
llama-3-3-70b-instruct-turbo-together. NOT included in this PR — Charter
v3 §Founder taps lists Supabase/Railway DDL as founder-only. Auto-
classifier correctly halted the commit. Founder reviews migration text
+ runs alembic upgrade head against prod manually.

Local checks via pre-commit hooks: ruff + mypy + pytest -x.

Refs AIN-141 — closes code-side scope; DB-side surfaced for founder tap.

Co-Authored-By: Claude <noreply@anthropic.com>
@linear-code
Copy link
Copy Markdown

linear-code Bot commented May 18, 2026

AIN-141 [Audit P1 · api] Strip retired AAMC models (`Llama-3.3-70B`, `DeepSeek R1`) from tests + scripts + migration

Phase 1 audit finding (2026-05-18). Retired AAMC v1.0 models still in active api source.

Locations:

  • tests/unit/test_adapters.py:176,183model="meta-llama/Llama-3.3-70B-Instruct-Turbo" in assertions
  • scripts/fix_aamc_canon.py:107 — Llama-3.3 in fix script (the script doing canonical fixes still names a retired model)
  • alembic/versions/20260516_0008_t9_catalog_models.py:256"DeepSeek R1 (Novita)" INSERTed into prod catalog

Per Charter v3 §primary-source-truths: "AAMC v1.0 ensemble: Opus 4.7, GPT-5.5, Gemini 3.1 Pro, Grok 4, Mistral Large 3. DeepSeek R1 and Llama 3.3 70B are retired — do not propagate them."

Approach for migration row: do not edit-in-place (migration is immutable history). Write a forward-fix migration that DELETEs the retired catalog rows + asserts rowcount per memory feedback_migration_rowcount_assertion.

Acceptance: grep -rIn 'Llama-3.3-70B\|DeepSeek R1' --include='*.py' api/ returns 0 in active paths (test fixtures + scripts). Forward-fix migration removes catalog rows.

Source: /tmp/ainfera-audit-2026-05-18/api.json.

Review in Linear

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant