Skip to content

fix(ai): restore shared CLI helper contracts - #1553

Merged
lusoris merged 1 commit into
fix/mypy-prepush-config-baseline-rc1from
fix/bug048-ai-cli-helpers
Sep 24, 2026
Merged

lusoris merged 1 commit into
fix/mypy-prepush-config-baseline-rc1from
fix/bug048-ai-cli-helpers

Conversation

@lusoris

@lusoris lusoris commented Sep 24, 2026

Copy link
Copy Markdown
Contributor

Summary

Restores the accepted ADR-0680/0681 shared bootstrap, parser, and replay-argv
contract across twelve current tiny-AI evaluation, quantization, and export
scripts without replacing their later CLI or provenance behavior. Adds an AST
red-cap plus direct-file/module probes so a future silent revert fails closed.

This is intentionally stacked on #1552: that parent repairs the fail-closed
pre-push mypy baseline/configuration gate used to validate this Python-heavy
restoration.

Type

  • feat — new feature
  • fix — bug fix
  • perf — performance improvement
  • refactor — no behavior change
  • docs — documentation only
  • test — test-only
  • build / ci — tooling / infra
  • port — cherry-pick from upstream Netflix/vmaf
  • sycl / cuda / simd — backend-specific

Checklist

  • Commits follow Conventional Commits and are signed.
  • make format && make lint — aggregate targets not run; Black 26.5.1,
    Ruff 0.16.8, changed-file pre-commit, make verify-all, and the complete
    normal pre-push gate are green.
  • Unit tests pass: meson test -C build — no native/Meson code changed;
    the affected Python suites are green below.
  • Cross-backend diff — not applicable: no SIMD/GPU implementation changed.
  • Feature-extractor twin update — not applicable: no extractor changed.
  • New native-file license header — not applicable: no native file added.
  • This is not a breaking change.
  • ADR index update — not applicable: bug-fix implementation restores two
    already-accepted ADRs and makes no new architectural decision.

Bug-status hygiene

  • docs/state.md records
    T-BUG048-AI-CLI-HELPERS-REVERTED-2026-09-24 as closed while explicitly
    keeping BUG-048 open for its remaining restoration sections.

Netflix golden-data gate

  • No Netflix assertAlmostEqual(...) golden score was modified.
  • Golden-value exception — not applicable.

Cross-backend numerical results

Not applicable; this change touches Python CLI/bootstrap behavior only.

Performance

Not applicable; no benchmark, tuning, training, or inference hot path changed.

Deep-dive deliverables

  • Research digest — docs/research/2088-bug048-ai-cli-helper-restoration.md.
  • Decision matrix — digest records the only-way restoration and rejects
    whole-commit replay and globally widening the bootstrap default.
  • AGENTS.md invariant note — ai/AGENTS.md pins the twelve-script
    bootstrap/parser/replay contract and include_repo_root=True boundary.
  • Reproducer / smoke-test command — pasted below under Reproducer.
  • CHANGELOG fragment —
    changelog.d/fixed/bug048-ai-cli-helper-restoration.md plus its generated
    Unreleased rendering.
  • Rebase note — docs/rebase-notes.md records the preserved seam and
    semantic regression.

Reproducer

python -m pytest \
  ai/tests/test_ai_cli_helper_restoration.py \
  ai/tests/test_eval_report_run_provenance.py \
  ai/tests/test_legacy_eval_report_run_provenance.py \
  ai/tests/test_qat_smoke.py \
  ai/tests/test_ptq_scripts.py \
  ai/tests/test_measure_quant_drop_per_ep.py \
  ai/tests/test_dnn_exporter_run_provenance.py -q

Validation

  • focused helper/provenance/QAT/PTQ/exporter suite: 34 passed after the final
    writable AGY corrections;
  • semantic restoration red-cap: 12 passed;
  • direct-file and python -m --help: 24/24 passed;
  • complete ai/ package before publication: 1,315 passed, 1 skipped;
  • fail-closed pre-push mypy: 0 introduced findings, 601 inherited findings;
  • Black and Ruff: clean;
  • make verify-all: green, HISS 264 within the 276 baseline;
  • writable AGY final audit: PASS after correcting seven introduced mypy
    findings; and
  • normal pre-push: green in 240.32 seconds, including strict MkDocs, security,
    HISS, dedupe, formatting, and PR-body governance.

Known follow-ups

  • This PR is stacked on fix: restore AI CLI helpers and align mypy pre-push gate #1552 and must merge after it.
  • BUG-048 remains open for its other independently reviewed restoration chunks.
  • Benchmarking, performance tuning, and retraining remain deliberately out of
    scope until correctness and security cleanup completes.

Breaking changes / migration

None.

@github-actions github-actions Bot added the type:bug Something isn't working label Sep 24, 2026
@lusoris
lusoris merged commit 862e1b0 into fix/mypy-prepush-config-baseline-rc1 Sep 24, 2026
13 checks passed
@lusoris
lusoris deleted the fix/bug048-ai-cli-helpers branch September 24, 2026 11:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type:bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant