archer import replays a sealed archive into an existing table: shard selection (`--select`), SHA-256 pre-verification, idempotent modes (`ignore`/`insert`/`replace`), and both LOAD DATA and batched-INSERT engines. It reads manifest.jsonl strictly so corruption is reported instead of skipped, and supports --dry-run, --allow-partial, and per-shard workers. --bulk-delete no longer rejects --shard-by date. Range deletion now derives its bounds from the chunk's actual keys (date scanners rewrite LastKey into a resumption cursor) and keeps safe-auto-increment semantics by excluding the current max key. A startup warning documents the monotonic-shard-column assumption. Also splits CLI/format/sharding/progress/safety reference docs out of the README, and adds the corresponding OpenSpec change artifacts. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
27 lines
1.4 KiB
Markdown
27 lines
1.4 KiB
Markdown
## 1. 校验与启动提示
|
|
|
|
- [x] 1.1 删除 `validate.go` 中“`--bulk-delete` 不能与 `--shard-by date` 同时使用”的校验
|
|
- [x] 1.2 更新 `cli_test.go`:日期模式 + `--bulk-delete` 现在应校验通过
|
|
- [x] 1.3 在 `App.execute` 中为日期模式 + `--bulk-delete` 增加前提警告
|
|
|
|
## 2. 区间删除
|
|
|
|
- [x] 2.1 `deleteRange` 的区间边界改为 `chunk.Keys` 首尾,避免使用被日期扫描器改写为复合游标的 `LastKey`
|
|
- [x] 2.2 `--safe-auto-increment` 生效时,区间 SQL 追加 `AND <key> <> ?` 排除当前最大键,不再退回 IN 列表
|
|
|
|
## 3. 测试
|
|
|
|
- [x] 3.1 单元测试:日期式 chunk 下单列主键生成裸键 `BETWEEN`
|
|
- [x] 3.2 单元测试:日期式 chunk 下复合键生成正确的元组区间与参数个数
|
|
- [x] 3.3 单元测试:`--safe-auto-increment` 下区间删除附带最大键排除条件
|
|
- [x] 3.4 集成测试 `TestIntegrationDateBulkDelete`:安全开关关闭时全删、默认开启时保留最大行
|
|
- [x] 3.5 `gofmt`、`go build ./...`、`go vet ./...`、`go test ./...` 通过
|
|
|
|
## 4. 文档与 OpenSpec
|
|
|
|
- [x] 4.1 更新 `openspec/specs/archive-core/spec.md` 的删除语义与日期模式场景
|
|
- [x] 4.2 更新 `openspec/specs/cli-contract/spec.md` 的参数依赖与互斥规则
|
|
- [x] 4.3 更新 README 安全说明
|
|
- [x] 4.4 运行 `openspec validate allow-date-bulk-delete --strict`
|
|
- [ ] 4.5 在具备 MySQL 的环境中运行集成测试并完成归档
|