Phase 2: 简单命令信封改造 — put/get/has/hash/verify/list #70

Closed
opened 2026-05-31 12:05:20 +00:00 by xiaoju · 0 comments
Owner

Parent: #67

Depends: Phase 1

Scope

改造以下命令输出为 { type, value } 信封:

命令 Schema value 类型
put <type> <file> @output/put string (hash)
get <hash> @output/get { type, payload, timestamp }
has <hash> @output/has boolean
hash <type> <file> @output/hash string (hash)
verify <hash> @output/verify string ("ok"/"corrupted"/"invalid")
list --type <hash> @output/list string[] (hashes)

新增 list 命令

  • ucas list --type <hash-or-alias> — 列出指定类型的所有 node hash
  • 替代原 schema list(用 ucas list --type @schema

verify 增强

  • 合并原 schema validate 功能
  • 同时验证 hash 完整性 + payload 符合 schema

Verification

  • 每个命令输出都是 { type, value } JSON
  • ucas put ... | ucas render -p 管道可工作
  • ucas list --type @schema 能列出所有 schema
  • 所有现有测试通过 + 新增测试

Ref

Implements Phase 2 of #67

## Parent: #67 ## Depends: Phase 1 ## Scope 改造以下命令输出为 `{ type, value }` 信封: | 命令 | Schema | value 类型 | |------|--------|-----------| | `put <type> <file>` | `@output/put` | `string` (hash) | | `get <hash>` | `@output/get` | `{ type, payload, timestamp }` | | `has <hash>` | `@output/has` | `boolean` | | `hash <type> <file>` | `@output/hash` | `string` (hash) | | `verify <hash>` | `@output/verify` | `string` ("ok"/"corrupted"/"invalid") | | `list --type <hash>` | `@output/list` | `string[]` (hashes) | ### 新增 `list` 命令 - `ucas list --type <hash-or-alias>` — 列出指定类型的所有 node hash - 替代原 `schema list`(用 `ucas list --type @schema`) ### verify 增强 - 合并原 `schema validate` 功能 - 同时验证 hash 完整性 + payload 符合 schema ### Verification - 每个命令输出都是 `{ type, value }` JSON - `ucas put ... | ucas render -p` 管道可工作 - `ucas list --type @schema` 能列出所有 schema - 所有现有测试通过 + 新增测试 ## Ref Implements Phase 2 of #67
This repo is archived. You cannot comment on issues.
No Label
1 Participants
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: uncaged/json-cas#70