Skip to content

refactor!: remove generated ProviderName and stale generated artifacts (ROADMAP A2–A5) - #203

Draft
cunninghamcard-bit wants to merge 10 commits into
masterfrom
chore/deletion-batch
Draft

cunninghamcard-bit wants to merge 10 commits into
masterfrom
chore/deletion-batch

Conversation

@cunninghamcard-bit

@cunninghamcard-bit cunninghamcard-bit commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

Summary

ROADMAP A2–A5 mechanical cleanup, now based on master and independent of #200: cleanup of generated and superseded artifacts (~171k lines deleted, ~3.6k of them real code/doc changes), plus removal of the generated ProviderName type. Supersedes #202 (same commits, rebased).

Removed

  • docs/quality-audit/round4 generated artifacts (lcov/logs); .gitignore now keeps raw output out, conclusions stay in Markdown.
  • provider-inventory/providers.json + raw records (superseded; doc links now point at the fixed historical commit 892a351).
  • Flutter example linux/macos/windows runners (unused).
  • Breaking: generated ProviderName in every binding (Rust enum, TS const, Go/Java/Kotlin consts, Swift enum, Dart consts, Python Literal) and scripts/gen_provider_names.py. Provider names are plain strings: provider("groq", ...). Built-in and overlay-registered names share one string path. Rust keeps provider_names() (the web console's GET /api/providers needs a runtime list). Recorded in CHANGELOG [Unreleased].
  • Stale provider_name references left behind in scripts/gen_providers_doc.py and docs/internal/phase4-audit.md.

Changed (aimux-web frontend types)

  • The 139 ts-rs copies under web/src/types/ are gone; core types resolve through an @aimux/types/* tsconfig alias (type-only, erased at build).
  • Wire*.ts were hand-maintained mirrors of wire.rs and had already drifted (WireContentPart lacked provider_executed). They are now generated by ts-rs into web/src/types/generated/.
  • scripts/gen_ts_types.py handles two targets (aimux-core → bindings/node/src/types, aimux-web → web/src/types/generated); --check covers both. The wire export tests sit behind a ts-export feature so a plain cargo test never writes into the node bindings. sync no longer rewrites files that differ only by ts-rs end-of-line spaces.

Node string-literal union (review question)

Intentional. ROADMAP's A2 line said Node would keep a generated string-literal union for completion; that sentence was wrong and the last commit corrects it. Overlay-registered provider names can never be part of a compile-time union, so a union would only ever describe the built-in subset and would keep the second name path this PR removes. Node takes plain string like every other binding.

Review notes

  • Most of the diff is deletions; real logic is in aimux-providers/src/{lib,provider}.rs, scripts/gen_ts_types.py, tools/aimux-web/src/wire.rs, tools/aimux-web/web/{tsconfig.json,src/**} and bindings/node/{package.json,src/index.ts}.
  • Independent Codex review found two issues (redundant #[must_use] tripping clippy::double_must_use; plain cargo test exporting wire types into the node bindings); both fixed.

Test plan

  • Rebased onto master (72a37b5) without conflicts; CI now runs on this PR.
  • cargo clippy -p aimux-providers -p aimux-web --all-targets -- -D warnings
  • cargo test -p aimux-providers
  • python3 scripts/gen_ts_types.py --check, python3 scripts/gen_providers_doc.py --check
  • CI on the current head (24 jobs) — see checks below

🤖 Generated with Claude Code

https://claude.ai/code/session_01WGwanvo9WLU9HWD7sRR8TS

@eric8810

eric8810 commented Oct 3, 2026

Copy link
Copy Markdown
Contributor

这批清理与现有 ROADMAP 的 A2–A5 有重合,可以先明确哪些内容能独立于 #200 推进。

  • 当前 head 3521d5d 没有 CI checks;描述里的 24/24 是重排前的 2d0165c。工作流只覆盖 base 为 master 的 PR,当前堆叠 base 不会触发。后续调整 base / 重排后,需要补当前候选提交的验证结果。
  • ROADMAP 原先要求 Node 保留生成的 string-literal union 补全;这里连同 ProviderName 类型导出一起移除了。请明确这是有意变更要求,还是另行补上。
  • 在 docs: full-chain AI SDK alignment design and impact map #200 与已合入 ROADMAP 的关系及已有决策记录澄清前,建议保持 draft;若这批只做既定清理,可以讨论解除文档 PR 的依赖,避免把清理合入等同于接受整套新架构。

chenhaonan and others added 10 commits October 3, 2026 04:49
…ia alias

- Wire*.ts were hand-maintained mirrors of wire.rs and had already drifted
  (WireContentPart lacked provider_executed). Derive TS on the wire structs
  and export them to web/src/types/generated/ through gen_ts_types.py, which
  now handles two targets and checks both in CI.
- Core types resolve through the @aimux/types tsconfig alias instead of
  five-level relative paths into bindings/node.
- gen_ts_types.py sync no longer rewrites files that differ only by ts-rs
  end-of-line spaces.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
- Drop the redundant #[must_use] on provider_names(); the returned
  impl Iterator is already must_use, so clippy::double_must_use failed CI.
- Gate the wire types' ts-rs export tests behind a ts-export feature that
  only gen_ts_types.py enables. A plain cargo test previously wrote
  Wire*.ts into bindings/node/src/types via the workspace-wide
  TS_RS_EXPORT_DIR, which made gen_ts_types.py --check fail on stale files.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…e removal

- scripts/gen_providers_doc.py: the `provider_name` module no longer exists;
  the docstrings and the section-header guard now name only `provider`.
  `--check` output is unchanged.
- docs/internal/phase4-audit.md: add a follow-up note (same style as
  RFC-0020) so the historical audit no longer reads as if the generated
  ProviderName types and their drift tests still exist.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01WGwanvo9WLU9HWD7sRR8TS
The A2 line said Node would keep a generated string-literal union for
completion. It does not: overlay-registered provider names can never be
part of a compile-time union, so keeping one would keep the second name
path this PR removes. Record the actual A2 scope.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01WGwanvo9WLU9HWD7sRR8TS
@cunninghamcard-bit
cunninghamcard-bit force-pushed the docs/rfc-0036-aisdk-alignment branch from d8c3d15 to 78a2876 Compare October 3, 2026 16:36
@cunninghamcard-bit
cunninghamcard-bit changed the base branch from docs/rfc-0036-aisdk-alignment to master October 3, 2026 16:37
@cunninghamcard-bit cunninghamcard-bit changed the title refactor!: remove generated ProviderName and stale generated artifacts refactor!: remove generated ProviderName and stale generated artifacts (ROADMAP A2–A5) Oct 3, 2026
@cunninghamcard-bit

Copy link
Copy Markdown
Contributor Author

已按建议解耦:base 改为 master,9 个提交在 72a37b5 上重放无冲突,CI 现在会跑;描述里的验证结果以当前 head 为准。

Node string-literal union:是有意去掉。ROADMAP 那句是写错的——overlay 注册的 provider 名字进不了编译期联合类型,保留 union 只能覆盖内置子集,等于保留了本 PR 要删掉的第二条路径。末尾加了一个提交把 ROADMAP A2 那行改成实际范围。

这批只做既定的 A2–A5 清理,不依赖 #200;合入不代表接受那套架构。


Generated by Claude Code

This branch has not been deployed

No deployments
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.

3 participants