Skip to content

refactor(maa): 解耦宿主遗留配置模型 - #2

Open
qiyinxi wants to merge 2 commits into
masterfrom
alpha/v6-sync-20260726
Open

refactor(maa): 解耦宿主遗留配置模型#2
qiyinxi wants to merge 2 commits into
masterfrom
alpha/v6-sync-20260726

Conversation

@qiyinxi

@qiyinxi qiyinxi commented Jul 26, 2026

Copy link
Copy Markdown
  • MultipleConfig → Mapping[uuid.UUID, Any],adapter 改用 runtime.type_key 校验
  • 防回归测试;版本 0.0.5→0.0.6;.gitignore 增补(debug/、*.log)

配套主仓 alpha 批次:AUTO-MAS#305

🤖 Generated with Claude Code

Summary by Sourcery

将 MAA 任务和适配器代码从旧版配置模型中解耦,并使其与新的用户配置映射以及基于运行时 type_key 的校验机制保持一致。

Enhancements:

  • 更新 MAA 任务构造函数,使其接受从用户 UUID 到配置对象的映射,而不是使用 MultipleConfig 模型。
  • 调整 MAA 适配器检查逻辑,使用运行时的 runtime.type_key 值来验证脚本类型,而不是依赖旧版的兼容性辅助函数。

Build:

  • automas_script_maa 包版本从 0.0.5 提升到 0.0.6,并扩展 .gitignore,以排除调试产物和日志文件。

Tests:

  • 添加边界和回归测试,以确保任务使用基于映射的用户配置,适配器依赖 runtime.type_key,且不会导入任何旧版配置模型或兼容性查找逻辑。
Original summary in English

Summary by Sourcery

Decouple MAA task and adapter code from legacy configuration models and align them with the new user-config mapping and runtime type_key-based validation.

Enhancements:

  • Update MAA task constructors to accept a mapping from user UUIDs to configuration objects instead of the MultipleConfig model.
  • Adjust the MAA adapter check logic to validate script type using the runtime.type_key value rather than legacy compatibility helpers.

Build:

  • Bump the automas_script_maa package version from 0.0.5 to 0.0.6 and extend .gitignore to exclude debug artifacts and log files.

Tests:

  • Add boundary and regression tests to ensure tasks use mapping-based user configs, the adapter relies on runtime.type_key, and no legacy config models or compatibility lookups are imported.
Original summary in English

Summary by Sourcery

将 MAA 任务和适配器代码从旧版配置模型中解耦,并使其与新的用户配置映射以及基于运行时 type_key 的校验机制保持一致。

Enhancements:

  • 更新 MAA 任务构造函数,使其接受从用户 UUID 到配置对象的映射,而不是使用 MultipleConfig 模型。
  • 调整 MAA 适配器检查逻辑,使用运行时的 runtime.type_key 值来验证脚本类型,而不是依赖旧版的兼容性辅助函数。

Build:

  • automas_script_maa 包版本从 0.0.5 提升到 0.0.6,并扩展 .gitignore,以排除调试产物和日志文件。

Tests:

  • 添加边界和回归测试,以确保任务使用基于映射的用户配置,适配器依赖 runtime.type_key,且不会导入任何旧版配置模型或兼容性查找逻辑。
Original summary in English

Summary by Sourcery

Decouple MAA task and adapter code from legacy configuration models and align them with the new user-config mapping and runtime type_key-based validation.

Enhancements:

  • Update MAA task constructors to accept a mapping from user UUIDs to configuration objects instead of the MultipleConfig model.
  • Adjust the MAA adapter check logic to validate script type using the runtime.type_key value rather than legacy compatibility helpers.

Build:

  • Bump the automas_script_maa package version from 0.0.5 to 0.0.6 and extend .gitignore to exclude debug artifacts and log files.

Tests:

  • Add boundary and regression tests to ensure tasks use mapping-based user configs, the adapter relies on runtime.type_key, and no legacy config models or compatibility lookups are imported.

增强:

  • 更新 MAA 任务构造函数,使其接受「用户 UUID 到配置对象」的映射,而不是 MultipleConfig 模型。
  • 调整适配器脚本类型验证,直接依赖运行时的 runtime.type_key,而不是兼容性辅助方法。
  • 添加以回归为重点的测试,用于验证任务和适配器不再依赖旧版配置模型或兼容性查找。

构建:

  • 将包版本从 0.0.5 提升到 0.0.6,并扩展 .gitignore 以排除调试产物和日志文件。

测试:

  • 扩展适配器边界测试,以覆盖基于 runtime.type_key 的检查和「映射式」用户配置处理。
  • 添加测试,断言任务模块和适配器源码不再导入与旧版配置相关的模块。
Original summary in English

Summary by Sourcery

将 MAA 任务和适配器代码从旧版配置模型中解耦,并使其与新的用户配置映射以及基于运行时 type_key 的校验机制保持一致。

Enhancements:

  • 更新 MAA 任务构造函数,使其接受从用户 UUID 到配置对象的映射,而不是使用 MultipleConfig 模型。
  • 调整 MAA 适配器检查逻辑,使用运行时的 runtime.type_key 值来验证脚本类型,而不是依赖旧版的兼容性辅助函数。

Build:

  • automas_script_maa 包版本从 0.0.5 提升到 0.0.6,并扩展 .gitignore,以排除调试产物和日志文件。

Tests:

  • 添加边界和回归测试,以确保任务使用基于映射的用户配置,适配器依赖 runtime.type_key,且不会导入任何旧版配置模型或兼容性查找逻辑。
Original summary in English

Summary by Sourcery

Decouple MAA task and adapter code from legacy configuration models and align them with the new user-config mapping and runtime type_key-based validation.

Enhancements:

  • Update MAA task constructors to accept a mapping from user UUIDs to configuration objects instead of the MultipleConfig model.
  • Adjust the MAA adapter check logic to validate script type using the runtime.type_key value rather than legacy compatibility helpers.

Build:

  • Bump the automas_script_maa package version from 0.0.5 to 0.0.6 and extend .gitignore to exclude debug artifacts and log files.

Tests:

  • Add boundary and regression tests to ensure tasks use mapping-based user configs, the adapter relies on runtime.type_key, and no legacy config models or compatibility lookups are imported.
Original summary in English

Summary by Sourcery

将 MAA 任务和适配器代码从旧版配置模型中解耦,并使其与新的用户配置映射以及基于运行时 type_key 的校验机制保持一致。

Enhancements:

  • 更新 MAA 任务构造函数,使其接受从用户 UUID 到配置对象的映射,而不是使用 MultipleConfig 模型。
  • 调整 MAA 适配器检查逻辑,使用运行时的 runtime.type_key 值来验证脚本类型,而不是依赖旧版的兼容性辅助函数。

Build:

  • automas_script_maa 包版本从 0.0.5 提升到 0.0.6,并扩展 .gitignore,以排除调试产物和日志文件。

Tests:

  • 添加边界和回归测试,以确保任务使用基于映射的用户配置,适配器依赖 runtime.type_key,且不会导入任何旧版配置模型或兼容性查找逻辑。
Original summary in English

Summary by Sourcery

Decouple MAA task and adapter code from legacy configuration models and align them with the new user-config mapping and runtime type_key-based validation.

Enhancements:

  • Update MAA task constructors to accept a mapping from user UUIDs to configuration objects instead of the MultipleConfig model.
  • Adjust the MAA adapter check logic to validate script type using the runtime.type_key value rather than legacy compatibility helpers.

Build:

  • Bump the automas_script_maa package version from 0.0.5 to 0.0.6 and extend .gitignore to exclude debug artifacts and log files.

Tests:

  • Add boundary and regression tests to ensure tasks use mapping-based user configs, the adapter relies on runtime.type_key, and no legacy config models or compatibility lookups are imported.

qiyinxi and others added 2 commits July 26, 2026 21:56
- 任务构造签名由 MultipleConfig 改为 Mapping[uuid.UUID, Any]
- adapter 类型校验改用 runtime.type_key,移除 script_types 兼容查询
- 补充存储边界与遗留导入防回归测试

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
- .gitignore 新增 debug/ 与 *.log

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@sourcery-ai

sourcery-ai Bot commented Jul 26, 2026

Copy link
Copy Markdown

🧙 Sourcery 正在审查你的 Pull Request!


提示与命令

与 Sourcery 互动

  • 触发一次新的审查: 在 Pull Request 中评论 @sourcery-ai review
  • 继续讨论: 直接回复 Sourcery 的审查评论。
  • 从审查评论生成 GitHub Issue: 通过回复某条审查评论,请 Sourcery 从该评论创建一个 issue。你也可以回复审查评论并使用 @sourcery-ai issue 来从该评论创建 issue。
  • 生成 Pull Request 标题: 在 Pull Request 标题中任意位置写上 @sourcery-ai,即可随时生成标题。你也可以在 Pull Request 中评论 @sourcery-ai title 来在任何时候(重新)生成标题。
  • 生成 Pull Request 摘要: 在 Pull Request 描述正文中的任意位置写上 @sourcery-ai summary,即可在你想要的位置随时生成 PR 摘要。你也可以在 Pull Request 中评论 @sourcery-ai summary 来在任何时候(重新)生成摘要。
  • 生成审阅者指南: 在 Pull Request 中评论 @sourcery-ai guide,即可在任何时候(重新)生成审阅者指南。
  • 解决所有 Sourcery 评论: 在 Pull Request 中评论 @sourcery-ai resolve,即可标记所有 Sourcery 评论为已解决。如果你已经处理完所有评论且不想再看到它们,这将非常有用。
  • 撤销所有 Sourcery 审查: 在 Pull Request 中评论 @sourcery-ai dismiss,即可撤销所有现有的 Sourcery 审查。如果你想用一次全新的审查重新开始,这会特别有用——别忘了再评论 @sourcery-ai review 来触发新的审查!

自定义你的体验

打开你的 控制面板 来:

  • 启用或禁用审查功能,例如 Sourcery 自动生成的 Pull Request 摘要、审阅者指南等。
  • 更改审查语言。
  • 添加、删除或编辑自定义审查说明。
  • 调整其他审查设置。

获取帮助

Original review guide in English

🧙 Sourcery is reviewing your pull request!


Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

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