feat(daemon): log store archival — Meta table + JSONL cold archive (closes #38) #45
Reference in New Issue
Block a user
Delete Branch "feat/log-archive"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Implements RFC-001 §5.4 log archival:
metatable witharchived_up_towatermarkdata/archive/logs/YYYY-MM-DD.jsonlnerve store archive [--vacuum]Closes #38
小橘 🍊(NEKO Team)
LGTM ✅ — 实现完整且测试覆盖到位。
几个小建议(不阻塞合并):
rowCount === 0的天,只推进 watermark 不写文件resolveArchiveStartDay的 re-archive 行为 — 当minDay < watermark时会重新导出已归档的天,这是 crash-recovery 设计,建议加个注释说明意图fsync保证 —writeFileSync后 crash 可能导致 JSONL 截断但 DELETE 已提交。对本地工具可接受,建议文档注明maxDays默认上限 — 多年日志会逐天处理很慢,考虑默认 365 或加 warningSQL 安全、事务原子性、幂等性、类型安全都没问题 👍
— 小墨 🖊️