MAL-Updater
Treat {baseDir} as the skill root. This repository is the skill package.
Core model
- - Keep business logic in the repo-local Python CLI.
- Keep runtime state outside the skill tree under the workspace runtime root
.MAL-Updater/ unless the operator explicitly overrides paths. - Do not assume host-specific absolute paths, IPs, or preexisting local copies under
~/.openclaw/workspace/skills/. - For new installs or portability audits, start with
bootstrap-audit before doing any live auth or sync work. - Prefer the long-lived user-systemd daemon over timers or OpenClaw cron for unattended operation.
Bootstrap / onboarding workflow
- 1. INLINECODE4
- Run INLINECODE5
- Read INLINECODE6
- Use the audit output to:
- verify required binaries
- check whether provider-specific optional transport/runtime extras are missing
- confirm the external runtime layout under
.MAL-Updater/
- identify which user-provided secrets/app settings are still missing for MAL and any enabled source providers
- verify the secrets location is outside version control and suitable for restrictive local permissions
- decide whether the repo-owned user-systemd daemon can be installed on this host
- 5. If bootstrap is incomplete, guide the user through the missing steps instead of pretending install is finished.
- Prompt for provider credentials only when the workflow reaches that provider's bootstrap step; do not request Crunchyroll or HIDIVE secrets preemptively if the user has not chosen or enabled that provider yet.
How to access backend data / operator surfaces
For the most common operator/data tasks, use the repo-local CLI from {baseDir}:
Read-only inspection
- - INLINECODE9
- INLINECODE10
- INLINECODE11
- INLINECODE12
- INLINECODE13
Recommendations / recommendation-related data
- - INLINECODE14
- INLINECODE15
- INLINECODE16
Review queue / mapping triage
- - INLINECODE17
- INLINECODE18
- INLINECODE19
- INLINECODE20
Sync planning / guarded execution
- - INLINECODE21
- INLINECODE22
- INLINECODE23
- INLINECODE24
Operational workflow
Prefer read-only inspection before live writes.
Read-only first:
- - INLINECODE25
- INLINECODE26
- INLINECODE27
- INLINECODE28
- INLINECODE29
- INLINECODE30
- INLINECODE31
- INLINECODE32
- INLINECODE33
Treat these as state-changing:
- - INLINECODE34
- INLINECODE35
- INLINECODE36
- INLINECODE37
- INLINECODE38
- INLINECODE39
- INLINECODE40
- INLINECODE41
- INLINECODE42
High-value references
- - Read
{baseDir}/references/bootstrap-onboarding.md for install/onboarding/bootstrap expectations. - Read
{baseDir}/references/cli-recipes.md for copy/paste command patterns. - Read
{baseDir}/references/data-surfaces.md for a concise map of which backend commands expose recommendations, review-queue state, service/runtime state, and guarded sync surfaces.
Guardrails
- - Keep sync behavior conservative; do not invent broader write scope than the CLI already supports.
- Prefer
dry-run-sync before apply-sync --execute unless the task explicitly asks for a live apply. - Treat Crunchyroll auth/fetch instability as real residue; document it plainly.
- Treat staged provider credentials and long-lived tokens as sensitive local files; keep them out of version control and prefer restrictive local permissions.
- When a host cannot satisfy the unattended daemon path, say so clearly instead of silently skipping service setup.
- Recommend manual review before enabling unattended daemon operation on a host that matters.
- Keep outputs short and actionable: counts, blockers, next command, and whether user input is needed.
MAL-Updater
将{baseDir}视为技能根目录。此仓库即为技能包。
核心模型
- - 将业务逻辑保留在仓库本地的Python CLI中。
- 除非操作员明确覆盖路径,否则将运行时状态保留在技能树外部的工作区运行时根目录.MAL-Updater/下。
- 不要假定主机特定的绝对路径、IP地址或~/.openclaw/workspace/skills/下已存在的本地副本。
- 对于新安装或可移植性审计,在进行任何实时认证或同步工作之前,先运行bootstrap-audit。
- 对于无人值守操作,优先使用长期运行的用户systemd守护进程,而非定时器或OpenClaw cron。
引导/入职工作流程
- 1. cd {baseDir}
- 运行PYTHONPATH=src python3 -m mal_updater.cli bootstrap-audit
- 阅读{baseDir}/references/bootstrap-onboarding.md
- 使用审计输出来:
- 验证所需的二进制文件
- 检查是否缺少特定提供商的可选传输/运行时扩展
- 确认.MAL-Updater/下的外部运行时布局
- 识别MAL及任何已启用的源提供商仍缺少哪些用户提供的密钥/应用设置
- 验证密钥位置是否在版本控制之外,并适合限制性本地权限
- 决定是否可以在该主机上安装仓库自带的用户systemd守护进程
- 5. 如果引导不完整,引导用户完成缺失步骤,而不是假装安装已完成。
- 仅在工作流程到达该提供商的引导步骤时才提示输入提供商凭据;如果用户尚未选择或启用该提供商,不要抢先请求Crunchyroll或HIDIVE密钥。
如何访问后端数据/操作界面
对于最常见的操作/数据任务,从{baseDir}使用仓库本地CLI:
只读检查
- - PYTHONPATH=src python3 -m malupdater.cli status
- PYTHONPATH=src python3 -m malupdater.cli bootstrap-audit
- PYTHONPATH=src python3 -m malupdater.cli service-status
- PYTHONPATH=src python3 -m malupdater.cli service-run-once
- PYTHONPATH=src python3 -m mal_updater.cli health-check --format summary
推荐/推荐相关数据
- - PYTHONPATH=src python3 -m malupdater.cli recommend --limit 20
- PYTHONPATH=src python3 -m malupdater.cli recommend --limit 20 --flat
- PYTHONPATH=src python3 -m mal_updater.cli recommend-refresh-metadata
审查队列/映射分类
- - PYTHONPATH=src python3 -m malupdater.cli list-review-queue --summary
- PYTHONPATH=src python3 -m malupdater.cli review-queue-next --issue-type mappingreview
- PYTHONPATH=src python3 -m malupdater.cli review-queue-worklist --issue-type mappingreview --limit 5
- PYTHONPATH=src python3 -m malupdater.cli list-mappings
同步规划/受控执行
- - PYTHONPATH=src python3 -m malupdater.cli dry-run-sync --provider all --limit 20 --approved-mappings-only
- PYTHONPATH=src python3 -m malupdater.cli apply-sync --limit 0 --exact-approved-only --execute
- PYTHONPATH=src python3 -m malupdater.cli provider-fetch-snapshot --provider crunchyroll --out .MAL-Updater/cache/live-crunchyroll-snapshot.json --ingest
- PYTHONPATH=src python3 -m malupdater.cli provider-fetch-snapshot --provider hidive --out .MAL-Updater/cache/live-hidive-snapshot.json --ingest
操作工作流程
在进行实时写入之前,优先进行只读检查。
先只读:
- - status
- bootstrap-audit
- health-check
- service-status
- service-run-once
- list-mappings
- list-review-queue --summary
- dry-run-sync
- recommend
将这些视为状态变更操作:
- - mal-auth-login
- mal-refresh
- provider-auth-login --provider crunchyroll
- provider-auth-login --provider hidive
- provider-fetch-snapshot --provider --ingest
- apply-sync --execute
- scripts/installusersystemd_units.sh
- install-service
- restart-service
高价值参考资料
- - 阅读{baseDir}/references/bootstrap-onboarding.md了解安装/入职/引导预期。
- 阅读{baseDir}/references/cli-recipes.md获取可复制粘贴的命令模式。
- 阅读{baseDir}/references/data-surfaces.md获取后端命令暴露推荐、审查队列状态、服务/运行时状态和受控同步界面的简明映射。
防护措施
- - 保持同步行为保守;不要发明比CLI已支持的更广泛的写入范围。
- 除非任务明确要求实时应用,否则优先使用dry-run-sync而非apply-sync --execute。
- 将Crunchyroll认证/获取的不稳定性视为真实存在的残留问题;如实记录。
- 将分阶段提供的提供商凭据和长期令牌视为敏感的本地文件;将其排除在版本控制之外,并优先使用限制性本地权限。
- 当主机无法满足无人值守守护进程路径时,明确说明,而不是静默跳过服务设置。
- 在重要的主机上启用无人值守守护进程操作之前,建议进行手动审查。
- 保持输出简短且可操作:计数、阻塞项、下一步命令以及是否需要用户输入。