Files
archer/openspec/changes/allow-date-bulk-delete/tasks.md
T
voidandClaude Sonnet 4.6 366d61ca25 Add archer import and allow date-mode bulk delete
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>
2026-11-08 21:14:23 +08:00

1.4 KiB

1. 校验与启动提示

  • 1.1 删除 validate.go 中“--bulk-delete 不能与 --shard-by date 同时使用”的校验
  • 1.2 更新 cli_test.go:日期模式 + --bulk-delete 现在应校验通过
  • 1.3 在 App.execute 中为日期模式 + --bulk-delete 增加前提警告

2. 区间删除

  • 2.1 deleteRange 的区间边界改为 chunk.Keys 首尾,避免使用被日期扫描器改写为复合游标的 LastKey
  • 2.2 --safe-auto-increment 生效时,区间 SQL 追加 AND <key> <> ? 排除当前最大键,不再退回 IN 列表

3. 测试

  • 3.1 单元测试:日期式 chunk 下单列主键生成裸键 BETWEEN
  • 3.2 单元测试:日期式 chunk 下复合键生成正确的元组区间与参数个数
  • 3.3 单元测试:--safe-auto-increment 下区间删除附带最大键排除条件
  • 3.4 集成测试 TestIntegrationDateBulkDelete:安全开关关闭时全删、默认开启时保留最大行
  • 3.5 gofmt、go build ./...、go vet ./...、go test ./... 通过

4. 文档与 OpenSpec

  • 4.1 更新 openspec/specs/archive-core/spec.md 的删除语义与日期模式场景
  • 4.2 更新 openspec/specs/cli-contract/spec.md 的参数依赖与互斥规则
  • 4.3 更新 README 安全说明
  • 4.4 运行 openspec validate allow-date-bulk-delete --strict
  • 4.5 在具备 MySQL 的环境中运行集成测试并完成归档