Skip to content

docs: update REPO_SNAPSHOT for config validation#40

Merged
tongsh6 merged 1 commit intodevfrom
docs/update-snapshot-config-validation
Feb 11, 2026
Merged

docs: update REPO_SNAPSHOT for config validation#40
tongsh6 merged 1 commit intodevfrom
docs/update-snapshot-config-validation

Conversation

@tongsh6
Copy link
Owner

@tongsh6 tongsh6 commented Feb 11, 2026

Summary

  • 更新 context/tech/REPO_SNAPSHOT.md,补充 config validation 相关内容
  • lib/shared.ts 模块描述中添加新增的类型和函数
  • 在维护提醒中添加配置验证相关说明

- Add TrackerConfig, ToastConfig, BudgetConfig types to shared module description
- Add validateConfig() and DEFAULT_CONFIG to shared module description
- Add config validation maintenance notes
Copilot AI review requested due to automatic review settings February 11, 2026 05:41
@tongsh6 tongsh6 merged commit f938753 into dev Feb 11, 2026
6 checks passed
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

该 PR 更新了仓库技术快照文档(REPO_SNAPSHOT),补充并强调 lib/shared.ts 中新增的配置类型、默认配置与配置校验能力,以及相关维护注意事项,便于后续维护与协作对齐。

Changes:

  • REPO_SNAPSHOT.md 的关键模块描述中补充 TrackerConfig/ToastConfig/BudgetConfig/ConfigValidationResultvalidateConfig()DEFAULT_CONFIG
  • 在维护提醒中增加配置验证与告警展示/输出渠道说明

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

## 维护提醒

- `BUILTIN_PRICING` 已统一到 `lib/shared.ts`,修改定价只需改一处
- 配置验证统一在 `lib/shared.ts` 的 `validateConfig()`,无效字段静默修正为默认值
Copy link

Copilot AI Feb 11, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里的描述“无效字段静默修正为默认值”与实际实现不完全一致:validateConfig() 对部分无效字段是“忽略/丢弃”(例如 budget.daily/weekly/monthly 非法时会忽略该字段;pricing map 中非法条目会跳过),同时会在 warnings 中记录提示。建议把措辞改为“无效字段会被忽略或回退到默认值,并记录 warnings(不抛错)”以避免误导维护者。

Suggested change
- 配置验证统一在 `lib/shared.ts``validateConfig()`无效字段静默修正为默认值
- 配置验证统一在 `lib/shared.ts``validateConfig()`无效字段会被忽略或回退到默认值,并记录 warnings(不抛错)

Copilot uses AI. Check for mistakes.
@tongsh6 tongsh6 deleted the docs/update-snapshot-config-validation branch February 11, 2026 05:43
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.

2 participants