pomaster 0.1.0 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (55) hide show
  1. package/README.md +393 -396
  2. package/TRADEMARKS.md +2 -2
  3. package/catalog/archetypes/archetype.api.error.json +55 -0
  4. package/catalog/archetypes/archetype.api.pagination.json +68 -0
  5. package/catalog/archetypes/archetype.api.resource.json +45 -0
  6. package/catalog/archetypes/archetype.backend.approval_workflow.json +63 -0
  7. package/catalog/archetypes/archetype.backend.audit.json +44 -0
  8. package/catalog/archetypes/archetype.backend.crud_resource.json +56 -0
  9. package/catalog/archetypes/archetype.backend.export.json +40 -0
  10. package/catalog/archetypes/archetype.backend.external_integration.json +89 -0
  11. package/catalog/archetypes/archetype.backend.idempotent_command.json +65 -0
  12. package/catalog/archetypes/archetype.backend.import.json +47 -0
  13. package/catalog/archetypes/archetype.backend.master_data.json +45 -0
  14. package/catalog/archetypes/archetype.backend.outbox_event.json +80 -0
  15. package/catalog/archetypes/archetype.backend.query_resource.json +40 -0
  16. package/catalog/archetypes/archetype.backend.scheduled_job.json +69 -0
  17. package/catalog/archetypes/archetype.backend.transactional_write.json +79 -0
  18. package/catalog/archetypes/archetype.component.button.json +53 -0
  19. package/catalog/archetypes/archetype.component.data_grid.json +78 -0
  20. package/catalog/archetypes/archetype.component.dialog.json +52 -0
  21. package/catalog/archetypes/archetype.component.search_input.json +34 -0
  22. package/catalog/archetypes/archetype.component.search_select.json +77 -0
  23. package/catalog/archetypes/archetype.data.hierarchy.json +71 -0
  24. package/catalog/archetypes/archetype.data.ledger.json +40 -0
  25. package/catalog/archetypes/archetype.data.master_data.json +43 -0
  26. package/catalog/archetypes/archetype.data.transaction.json +42 -0
  27. package/catalog/archetypes/archetype.data.versioned.json +43 -0
  28. package/catalog/archetypes/archetype.frontend.error_taxonomy.json +99 -0
  29. package/catalog/archetypes/archetype.frontend.feature_oriented.json +59 -0
  30. package/catalog/archetypes/archetype.frontend.modular.json +37 -0
  31. package/catalog/archetypes/archetype.frontend.spa_layered.json +48 -0
  32. package/catalog/archetypes/archetype.page.analysis.json +39 -0
  33. package/catalog/archetypes/archetype.page.master_data.json +63 -0
  34. package/catalog/archetypes/archetype.runtime.environment_parity.json +178 -0
  35. package/catalog/archetypes/archetype.runtime.observability_binding.json +93 -0
  36. package/catalog/archetypes/archetype.state.async_command.json +63 -0
  37. package/catalog/archetypes/archetype.state.background_refresh.json +45 -0
  38. package/catalog/archetypes/archetype.state.form_edit.json +45 -0
  39. package/catalog/archetypes/archetype.state.optimistic_mutation.json +48 -0
  40. package/catalog/archetypes/archetype.state.selection.json +35 -0
  41. package/catalog/archetypes/archetype.state.server_query.json +60 -0
  42. package/catalog/archetypes/archetype.state.url_filter.json +47 -0
  43. package/catalog/archetypes/archetype.state.wizard.json +46 -0
  44. package/catalog/catalog-lock.draft.json +349 -5
  45. package/catalog/gates/gate.new-entity.checks.json +106 -0
  46. package/catalog/knowledge/knowledge.web.browser.mcp_eyes.json +99 -0
  47. package/catalog/sensors/sensor.browser.deterministic.json +17 -6
  48. package/catalog/sensors/sensor.browser.interactive.json +16 -6
  49. package/catalog/tools/materialize_v06_relock.py +218 -0
  50. package/catalog/tools/seed_v06_archetypes.py +283 -0
  51. package/catalog/tools/seed_v06_batch2_materials.py +504 -0
  52. package/catalog/tools/seed_v06_batch3_materials.py +756 -0
  53. package/catalog/tools/seed_v06_batch4_materials.py +353 -0
  54. package/dist/bin.js +2920 -331
  55. package/package.json +1 -1
package/TRADEMARKS.md CHANGED
@@ -3,10 +3,10 @@
3
3
  **POMaster** 名称、POMaster logo 及其他项目标识(合称「项目标识」)归项目版权所有者所有。
4
4
 
5
5
  - 版权与许可主体署名见根目录 [`LICENSE`](./LICENSE) 的 Required Notice 行:Copyright (c) 2026 River-Singer。
6
- - Owner 署名主体占位:TODO(Owner): 如以法人/其他主体持有商标,在此补全法定主体名称。
6
+ - Owner 署名主体占位:Xu Jianyang: 如以法人/其他主体持有商标,在此补全法定主体名称。
7
7
 
8
8
  项目标识**不在** PolyForm Noncommercial 1.0.0 或商业授权协议的授权范围内;上述许可仅覆盖代码与文档等版权客体,不授予任何商标权。
9
9
 
10
10
  未经事先书面许可,不得在可能引起来源混淆的方式下使用项目标识。对 POMaster 原始代码的如实、指明来源的分发与描述性提及(nominative fair use)不在此限。
11
11
 
12
- **商标授权联系**:TODO(Owner): 填联系邮箱/渠道
12
+ **商标授权联系**:allenxujianyang@outlook.com
@@ -0,0 +1,55 @@
1
+ {
2
+ "id": "ARCHETYPE.API.ERROR",
3
+ "kind": "archetype",
4
+ "layer": "ARCHETYPE",
5
+ "title_zh": "API 错误契约原型",
6
+ "summary_zh": "问题细节标准错误信封原型(PRD §44):五个标准成员逐字(type/title/status/detail/instance);业务码/链路追踪/字段级错误如实定位为扩展成员(客户端必须忽略未识别扩展——RFC 9457 §3.2 语义),以 application/problem+json 承载。",
7
+ "semantic": {
8
+ "responsibility": "错误响应的形状与语义单点:五个标准成员承载问题类型/概要/状态/详情/实例定位,扩展成员承载机器码与字段级错误——机器可判卷与人可读分层",
9
+ "when_to_use": "所有 HTTP 错误响应的信封(与 API 资源原型 error 绑定位配对);前后端错误分型映射的契约源(前端错误目录的消费面对齐本原型)",
10
+ "when_not_to_use": "成功响应的包装信封(本原型只管错误面);前端错误呈现分型本身(前端错误目录承载)"
11
+ },
12
+ "composition": {
13
+ "requires": [],
14
+ "optional": [],
15
+ "incompatible": []
16
+ },
17
+ "standard_members": {
18
+ "type": "URI 引用标识问题类型;建议绝对 URI;缺省 about:blank(注册类型:无超出 HTTP 状态码的额外语义)",
19
+ "title": "问题类型的简短人读概要——不应随出现次数变化(本地化除外)",
20
+ "status": "JSON 数字,仅建议性;必须与真实 HTTP 状态码一致(规范 MUST:Generators MUST use the same status code in the actual HTTP response)",
21
+ "detail": "本次出现的人读解释——消费者不应解析 detail 提取信息(扩展成员更适合机器消费)",
22
+ "instance": "标识本次问题具体发生处的 URI 引用;不可解引用时作不透明唯一标识"
23
+ },
24
+ "extensions": {
25
+ "members": [
26
+ "code",
27
+ "trace_id",
28
+ "field_errors"
29
+ ],
30
+ "positioning": "扩展成员(非标准成员)——规范 §3.2:问题类型定义可扩展附加成员,客户端 MUST ignore 未识别扩展",
31
+ "field_errors_note": "字段级错误建议对齐官方校验示例的 errors[] 数组形态(每条含 detail 与位置指针)"
32
+ },
33
+ "constraints": [
34
+ "status 必须与真实 HTTP 状态码一致(MUST)",
35
+ "media type 用 application/problem+json(canonical 形态)",
36
+ "引用现行规范 RFC 9457(已取代 RFC 7807——Appendix D 自述相对 7807 的变更)"
37
+ ],
38
+ "x-research-anchors": {
39
+ "note": "【研究纠偏·差异表 §44 行】PRD 把 code/trace_id/field_errors 与五成员并列列出,但三者不是标准成员而是扩展成员(客户端 MUST ignore 未识别扩展语义如实落位);五成员逐字定义与 about:blank 注册类型为 RFC 9457 官方文本 2026-09-03 实抓",
40
+ "sources": [
41
+ {
42
+ "url": "https://www.rfc-editor.org/rfc/rfc9457.html",
43
+ "fetched": "2026-09-03"
44
+ },
45
+ {
46
+ "url": "doc/POMaster-vNext-PRD-v0.6.1-Engineering-Substrate-Archetype-Catalog.md §44",
47
+ "fetched": "2026-09-03"
48
+ },
49
+ {
50
+ "url": ".trellis/tasks/09-02-vnext-prd-v06-governed-substrate/research/backend-references.md 题 4",
51
+ "fetched": "2026-09-03"
52
+ }
53
+ ]
54
+ }
55
+ }
@@ -0,0 +1,68 @@
1
+ {
2
+ "id": "ARCHETYPE.API.PAGINATION",
3
+ "kind": "archetype",
4
+ "layer": "ARCHETYPE",
5
+ "title_zh": "API 分页原型",
6
+ "summary_zh": "分页三批准模式原型(PRD §45 逐字闭包):OFFSET/CURSOR/KEYSET 三选一;业界现行对照锚——Azure 服务端分页 value[]+nextLink、Stripe 对象 ID 游标、Relay Connections 不透明游标;Microsoft 原单一 REST 指南已废弃分拆(差异注记在场)。",
7
+ "semantic": {
8
+ "responsibility": "集合读取的分页契约单点:模式从批准闭包内选择、页大小有界、排序稳定、续页位形(has_more 或 next_link 二选一)固定",
9
+ "when_to_use": "任何列表/检索面的分页契约(与查询面原型配对);深分页代价需要预先声明时(OFFSET 深翻页代价、KEYSET 需稳定排序键、CURSOR 需不透明令牌语义)",
10
+ "when_not_to_use": "一次性全量小数据(可不分页但须显式声明上界);单体读取(API 资源原型 GET item 承载)"
11
+ },
12
+ "composition": {
13
+ "requires": [],
14
+ "optional": [],
15
+ "incompatible": []
16
+ },
17
+ "approved_modes": [
18
+ "OFFSET",
19
+ "CURSOR",
20
+ "KEYSET"
21
+ ],
22
+ "defaults": {
23
+ "page_size_bounded": true,
24
+ "stable_sort_required": true,
25
+ "continuation_field": "has_more 或 next_link 二选一的约定位",
26
+ "total_count": "不默认返回全量计数(Azure SHOULD NOT——全量计数可能代价高昂)"
27
+ },
28
+ "industry_anchors": {
29
+ "azure": "服务端分页:顶层 value[] + nextLink(绝对 URL、不透明续页令牌);最后一页不返回 nextLink 字段(禁 null 值形态);文档必须声明跨页可能跳过或重复;未支持查询参数必须报错",
30
+ "stripe": "cursor=对象 ID(按稳定序的 KEYSET——keyset-by-id 形态);响应形 data[]+has_more;参数 limit/starting_after/ending_before;默认新→旧排序",
31
+ "relay": "GraphQL Relay Connections:Connection 必含 edges 与 pageInfo;Edge 必含 node 与 cursor;前向 first/after、后向 last/before;cursor 是不透明字符串"
32
+ },
33
+ "deprecation_note": "Microsoft 原单一 REST Guidelines 已废弃分拆(2026-09-03 实抓:原文档头部声明 deprecated,分拆为 Azure 与 Graph 两份现行指南)——引用时改引 Azure REST API Guidelines 并注明原文档已废弃",
34
+ "mode_note": "nextLink = CURSOR 的不透明服务端形态(opaque continuation token)——三批准模式闭包容纳业界现行形态(Azure/Stripe/Relay 对照均落回三模式之一)",
35
+ "constraints": [
36
+ "模式只能从三批准模式闭包内选择(PRD §45:项目只能选择批准模式)",
37
+ "最后一页禁返回 null 值 nextLink(Azure DO NOT 逐字)"
38
+ ],
39
+ "x-research-anchors": {
40
+ "note": "【差异注记·差异表 §45 行】三模式与业界现行实践兼容;Microsoft 现行形态是 opaque nextLink(CURSOR 的服务端形态),且原单一 REST Guidelines 已 deprecated 分拆为 Azure/Graph 两份——注记随物料在场。Azure/Stripe/Relay 三处词形为官方文档 2026-09-03 实抓",
41
+ "sources": [
42
+ {
43
+ "url": "https://github.com/microsoft/api-guidelines/blob/vNext/Guidelines.md",
44
+ "fetched": "2026-09-03"
45
+ },
46
+ {
47
+ "url": "https://raw.githubusercontent.com/microsoft/api-guidelines/vNext/azure/Guidelines.md",
48
+ "fetched": "2026-09-03"
49
+ },
50
+ {
51
+ "url": "https://docs.stripe.com/pagination",
52
+ "fetched": "2026-09-03"
53
+ },
54
+ {
55
+ "url": "https://relay.dev/graphql/connections.htm",
56
+ "fetched": "2026-09-03"
57
+ },
58
+ {
59
+ "url": "doc/POMaster-vNext-PRD-v0.6.1-Engineering-Substrate-Archetype-Catalog.md §45",
60
+ "fetched": "2026-09-03"
61
+ },
62
+ {
63
+ "url": ".trellis/tasks/09-02-vnext-prd-v06-governed-substrate/research/backend-references.md 题 4",
64
+ "fetched": "2026-09-03"
65
+ }
66
+ ]
67
+ }
68
+ }
@@ -0,0 +1,45 @@
1
+ {
2
+ "id": "ARCHETYPE.API.RESOURCE",
3
+ "kind": "archetype",
4
+ "layer": "ARCHETYPE",
5
+ "title_zh": "API 资源原型",
6
+ "summary_zh": "REST 风格标准端点五操作原型(PRD §43 逐字):集合读取/单体读取/新建/单体修改/移除;授权/错误/分页/校验/兼容性五绑定必须配置——绑定缺失即契约不完整。",
7
+ "semantic": {
8
+ "responsibility": "单体实体的 HTTP 面形状基线:五操作闭包 + 五项强制绑定(authorization/error/pagination/validation/compatibility)——绑定面显式声明而非隐式约定",
9
+ "when_to_use": "实体需要标准 HTTP 面时(与后端标准写读面原型配对:操作闭包与其五操作一一对应)",
10
+ "when_not_to_use": "动词语义的业务命令面(配幂等命令原型);事件订阅面(走发件箱事件原型的通道侧)"
11
+ },
12
+ "composition": {
13
+ "requires": [],
14
+ "optional": [],
15
+ "incompatible": []
16
+ },
17
+ "operations": [
18
+ "GET collection",
19
+ "GET item",
20
+ "POST item",
21
+ "PUT/PATCH item",
22
+ "DELETE item"
23
+ ],
24
+ "bindings": [
25
+ "authorization",
26
+ "error",
27
+ "pagination",
28
+ "validation",
29
+ "compatibility"
30
+ ],
31
+ "bindings_source": "PRD §43 逐字:必须绑定 authorization / error / pagination / validation / compatibility。",
32
+ "x-research-anchors": {
33
+ "note": "五操作与五绑定为 PRD §43 逐字(2026-09-03 对照 backend-references.md 题 4/差异表 §44-§45 行核实链);error 绑定与 API 错误契约原型互链、pagination 绑定与分页原型互链",
34
+ "sources": [
35
+ {
36
+ "url": "doc/POMaster-vNext-PRD-v0.6.1-Engineering-Substrate-Archetype-Catalog.md §43",
37
+ "fetched": "2026-09-03"
38
+ },
39
+ {
40
+ "url": ".trellis/tasks/09-02-vnext-prd-v06-governed-substrate/research/backend-references.md 题 4",
41
+ "fetched": "2026-09-03"
42
+ }
43
+ ]
44
+ }
45
+ }
@@ -0,0 +1,63 @@
1
+ {
2
+ "id": "ARCHETYPE.BACKEND.APPROVAL_WORKFLOW",
3
+ "kind": "archetype",
4
+ "layer": "ARCHETYPE",
5
+ "title_zh": "审批流原型",
6
+ "summary_zh": "标准审批状态机原型(PRD §31 逐字链):草稿经递交事件进入已递交态,审批通过转通过、驳回转驳回;可选撤回/重开转移与多级会签变体。",
7
+ "semantic": {
8
+ "responsibility": "审批单生命周期与合法转移的单点声明:四态两事件为标准链,扩展转移(撤回/重开)与多级会签变体为可选档——合法转移之外无隐式状态",
9
+ "when_to_use": "需要人审的单据类写流程(请假/报销/变更单等)——状态闭包显式登记,审批动作留痕进审计",
10
+ "when_not_to_use": "无审批环节的直写流程(走事务性写原型);自由流程编排诉求(本原型是闭包状态机,非流程引擎)"
11
+ },
12
+ "composition": {
13
+ "requires": [],
14
+ "optional": [],
15
+ "incompatible": []
16
+ },
17
+ "states": [
18
+ "DRAFT",
19
+ "SUBMITTED",
20
+ "APPROVED",
21
+ "REJECTED"
22
+ ],
23
+ "transitions": [
24
+ {
25
+ "from": "DRAFT",
26
+ "event": "SUBMIT",
27
+ "to": "SUBMITTED"
28
+ },
29
+ {
30
+ "from": "SUBMITTED",
31
+ "event": "APPROVE",
32
+ "to": "APPROVED"
33
+ },
34
+ {
35
+ "from": "SUBMITTED",
36
+ "event": "REJECT",
37
+ "to": "REJECTED"
38
+ }
39
+ ],
40
+ "optional": {
41
+ "transitions": [
42
+ "WITHDRAW",
43
+ "REOPEN"
44
+ ],
45
+ "variants": [
46
+ "MULTI_STAGE"
47
+ ],
48
+ "source": "PRD §31 逐字:可选:WITHDRAW / REOPEN / MULTI_STAGE。"
49
+ },
50
+ "x-research-anchors": {
51
+ "note": "四态两事件链与三可选位为 PRD §31 逐字(2026-09-03 对照 backend-references.md 差异表无冲突确认);状态机闭包词形与前端状态机原型(STATE_ARCHETYPE 族)同构,本原型是后端单据域实例化",
52
+ "sources": [
53
+ {
54
+ "url": "doc/POMaster-vNext-PRD-v0.6.1-Engineering-Substrate-Archetype-Catalog.md §31",
55
+ "fetched": "2026-09-03"
56
+ },
57
+ {
58
+ "url": ".trellis/tasks/09-02-vnext-prd-v06-governed-substrate/research/backend-references.md",
59
+ "fetched": "2026-09-03"
60
+ }
61
+ ]
62
+ }
63
+ }
@@ -0,0 +1,44 @@
1
+ {
2
+ "id": "ARCHETYPE.BACKEND.AUDIT",
3
+ "kind": "archetype",
4
+ "layer": "ARCHETYPE",
5
+ "title_zh": "审计原型",
6
+ "summary_zh": "审计两档原型(PRD §41 逐字):基础档四字段(创建/更新的时间与操作人);严格档六要素(变更前后值/操作类型/理由/操作者/链路追踪)——档位由数据分级决定而非默认全量。",
7
+ "semantic": {
8
+ "responsibility": "『谁在何时对什么做了什么改动』的可回答性:基础档回答元数据层,严格档回答逐字段前后值与理由链——两档显式分档,禁默认全量严格审计",
9
+ "when_to_use": "任何标准写面的默认基础档(对应后端标准写读面物料的审计默认档);台账/财务/权限类数据升级严格档",
10
+ "when_not_to_use": "外部系统调用的遥测(走外部集成原型可观测位);只读检索面"
11
+ },
12
+ "composition": {
13
+ "requires": [],
14
+ "optional": [],
15
+ "incompatible": []
16
+ },
17
+ "basic_fields": [
18
+ "created_at",
19
+ "created_by",
20
+ "updated_at",
21
+ "updated_by"
22
+ ],
23
+ "strict_fields": [
24
+ "before",
25
+ "after",
26
+ "action",
27
+ "reason",
28
+ "actor",
29
+ "trace"
30
+ ],
31
+ "x-research-anchors": {
32
+ "note": "基础四字段与严格六要素为 PRD §41 逐字(2026-09-03 对照 backend-references.md 差异表无冲突确认);与主数据表原型的审计四字段(批次 1 recommended_fields)同源",
33
+ "sources": [
34
+ {
35
+ "url": "doc/POMaster-vNext-PRD-v0.6.1-Engineering-Substrate-Archetype-Catalog.md §41",
36
+ "fetched": "2026-09-03"
37
+ },
38
+ {
39
+ "url": ".trellis/tasks/09-02-vnext-prd-v06-governed-substrate/research/backend-references.md",
40
+ "fetched": "2026-09-03"
41
+ }
42
+ ]
43
+ }
44
+ }
@@ -0,0 +1,56 @@
1
+ {
2
+ "id": "ARCHETYPE.BACKEND.CRUD_RESOURCE",
3
+ "kind": "archetype",
4
+ "layer": "ARCHETYPE",
5
+ "title_zh": "标准企业 CRUD 资源",
6
+ "summary_zh": "Create/Read/Update/Delete/List 五操作的标准资源原型:分页/校验/审计/乐观锁为默认档,软删/批量/导入/导出为可选档;错误契约与授权为强制约束。",
7
+ "semantic": {
8
+ "responsibility": "单实体的标准写面与单点读面(get)",
9
+ "when_to_use": "实体需要标准维护 API 时;业务决定字段/权限/删除策略(v0.6.1 §70)",
10
+ "when_not_to_use": "纯查询报表资源(配 QUERY_RESOURCE);事件驱动写路径"
11
+ },
12
+ "composition": {
13
+ "requires": [],
14
+ "optional": [
15
+ "ARCHETYPE.BACKEND.QUERY_RESOURCE",
16
+ "DATA_ARCHETYPE.MASTER_DATA"
17
+ ],
18
+ "incompatible": []
19
+ },
20
+ "operations": [
21
+ "create",
22
+ "get",
23
+ "list",
24
+ "update",
25
+ "delete"
26
+ ],
27
+ "defaults": {
28
+ "pagination": true,
29
+ "validation": true,
30
+ "audit": true,
31
+ "optimistic_lock": true
32
+ },
33
+ "optional_capabilities": {
34
+ "soft_delete": null,
35
+ "batch": null,
36
+ "import": null,
37
+ "export": null
38
+ },
39
+ "constraints": [
40
+ "api_error_contract",
41
+ "authorization_required"
42
+ ],
43
+ "verification": [
44
+ "unit",
45
+ "contract",
46
+ "persistence"
47
+ ],
48
+ "x-research-anchors": {
49
+ "sources": [
50
+ {
51
+ "url": "doc/POMaster-vNext-PRD-v0.6.1-Engineering-Substrate-Archetype-Catalog.md §26-§27/§83",
52
+ "fetched": "2026-09-02"
53
+ }
54
+ ]
55
+ }
56
+ }
@@ -0,0 +1,40 @@
1
+ {
2
+ "id": "ARCHETYPE.BACKEND.EXPORT",
3
+ "kind": "archetype",
4
+ "layer": "ARCHETYPE",
5
+ "title_zh": "导出原型",
6
+ "summary_zh": "数据导出双档原型(PRD §33 逐字):小量同步直出(SYNC_SMALL);大量异步三段(ASYNC_LARGE)——请求立任务、产物落对象存储、下载凭据交付。",
7
+ "semantic": {
8
+ "responsibility": "导出的量级分档与产物生命周期单点化:异步档把长耗时产物移出请求生命周期,凭据化下载替代大文件直传",
9
+ "when_to_use": "列表/报表数据导出文件——按量级选档(小量同步、大量异步),异步档任务态可查询可重试",
10
+ "when_not_to_use": "系统间数据同步(走外部集成/发件箱事件原型);实时流式取数(走查询面)"
11
+ },
12
+ "composition": {
13
+ "requires": [],
14
+ "optional": [],
15
+ "incompatible": []
16
+ },
17
+ "modes": [
18
+ "SYNC_SMALL",
19
+ "ASYNC_LARGE"
20
+ ],
21
+ "async_chain": [
22
+ "Request",
23
+ "Job",
24
+ "Object Storage",
25
+ "Download Token"
26
+ ],
27
+ "x-research-anchors": {
28
+ "note": "双档词形与异步四段链为 PRD §33 逐字(2026-09-03 对照 backend-references.md 差异表无冲突确认);产物落对象存储与文件二进制不入关系库字段同向(§40 File Resource 原型边界)",
29
+ "sources": [
30
+ {
31
+ "url": "doc/POMaster-vNext-PRD-v0.6.1-Engineering-Substrate-Archetype-Catalog.md §33",
32
+ "fetched": "2026-09-03"
33
+ },
34
+ {
35
+ "url": ".trellis/tasks/09-02-vnext-prd-v06-governed-substrate/research/backend-references.md",
36
+ "fetched": "2026-09-03"
37
+ }
38
+ ]
39
+ }
40
+ }
@@ -0,0 +1,89 @@
1
+ {
2
+ "id": "ARCHETYPE.BACKEND.EXTERNAL_INTEGRATION",
3
+ "kind": "archetype",
4
+ "layer": "ARCHETYPE",
5
+ "title_zh": "外部集成原型",
6
+ "summary_zh": "外部系统调用八要素原型(PRD §38 逐字):超时/重试/断路器/限流感知/鉴权/错误映射/可观测/回退;韧性默认档锚 Resilience4j 2.4.0 六模块现行文档——限流以『周期时长+每周期许可数』二元组显式给定(库默认周期是纳秒级形参,禁照抄)。",
7
+ "semantic": {
8
+ "responsibility": "把对外部系统每次调用的失效模式显式化:超时有时限、重试有上界、故障有熔断、过载有限流、失败有映射与回退——每一项都是显式配置而非默认假设",
9
+ "when_to_use": "同步/异步调用外部系统(第三方服务/跨域内部服务)的集成点——每个远端被调方一个独立韧性实例(官方 Golden Rule:MUST NOT share)",
10
+ "when_not_to_use": "进程内函数调用;库与事件最终一致的可靠外发(走发件箱事件原型);用户交互内的本域写路径(走事务性写原型)"
11
+ },
12
+ "composition": {
13
+ "requires": [],
14
+ "optional": [],
15
+ "incompatible": []
16
+ },
17
+ "eight_elements": {
18
+ "timeout": {
19
+ "timeout_duration": "1s",
20
+ "cancel_running_future": true
21
+ },
22
+ "retry": {
23
+ "max_attempts": 3,
24
+ "wait_duration": "500ms",
25
+ "backoff": "fixed(指数退避为可选位,需显式启用退避与抖动配置)"
26
+ },
27
+ "circuit_breaker": {
28
+ "failure_rate_threshold": "50%",
29
+ "sliding_window": "COUNT_BASED 100 次",
30
+ "minimum_number_of_calls": 100,
31
+ "wait_duration_in_open_state": "60s",
32
+ "permitted_number_of_calls_in_half_open_state": 10
33
+ },
34
+ "bulkhead": {
35
+ "max_concurrent_calls": 25,
36
+ "max_wait_duration": "0(快失败默认)"
37
+ },
38
+ "rate_limit_awareness": {
39
+ "form": "period_and_permits_pair——『周期时长 + 每周期许可数』二元组必须显式给定",
40
+ "note": "库默认周期是纳秒级形参(词形误导),禁照抄默认值;且此限流是客户端本侧限速(许可桶),不是对端服务保护"
41
+ },
42
+ "auth": "凭据注入与刷新单点",
43
+ "error_mapping": "外部错误到本域错误分型的单点映射链",
44
+ "observability": "每次调用埋点(时延/结果/重试次数/熔断态)",
45
+ "fallback": "降级回退(recover 语义承接)"
46
+ },
47
+ "constraints": [
48
+ "每个远端服务一个独立韧性实例(官方 Golden Rule 逐字:\"Create a unique instance (with a unique ID) for each protected remote service or backend you communicate with.\"——CircuitBreaker 属实例感知模式 MUST NOT share)",
49
+ "限流语义是客户端本侧限速,非对端服务保护"
50
+ ],
51
+ "module_map_note": "Resilience4j 2.4.0 六核心模块对照:circuitbreaker/ratelimiter/bulkhead/retry/timelimiter/cache(另有 hedge 与 spring-boot3/spring-boot4 等适配模块);2.4.0(2026-03-14)起基线 JDK 17→21",
52
+ "x-research-anchors": {
53
+ "note": "六模块清单与五模块全部默认值为官方 README/docs 2026-09-03 逐字实抓;RateLimiter 默认值按研究裁定不照抄(纳秒级周期形参误导)——改写为显式二元组要求;版本 2.4.0 与 JDK 21 基线取自 repo1.maven.org 官方 metadata 与 release notes",
54
+ "sources": [
55
+ {
56
+ "url": "https://github.com/resilience4j/resilience4j",
57
+ "fetched": "2026-09-03"
58
+ },
59
+ {
60
+ "url": "https://resilience4j.readme.io/docs/circuitbreaker",
61
+ "fetched": "2026-09-03"
62
+ },
63
+ {
64
+ "url": "https://resilience4j.readme.io/docs/retry",
65
+ "fetched": "2026-09-03"
66
+ },
67
+ {
68
+ "url": "https://resilience4j.readme.io/docs/ratelimiter",
69
+ "fetched": "2026-09-03"
70
+ },
71
+ {
72
+ "url": "https://resilience4j.readme.io/docs/bulkhead",
73
+ "fetched": "2026-09-03"
74
+ },
75
+ {
76
+ "url": "https://resilience4j.readme.io/docs/timeout",
77
+ "fetched": "2026-09-03"
78
+ },
79
+ {
80
+ "url": "https://repo1.maven.org/maven2/io/github/resilience4j/resilience4j-bom/maven-metadata.xml",
81
+ "fetched": "2026-09-03"
82
+ },
83
+ {
84
+ "url": ".trellis/tasks/09-02-vnext-prd-v06-governed-substrate/research/backend-references.md 题 6a",
85
+ "fetched": "2026-09-03"
86
+ }
87
+ ]
88
+ }
89
+ }
@@ -0,0 +1,65 @@
1
+ {
2
+ "id": "ARCHETYPE.BACKEND.IDEMPOTENT_COMMAND",
3
+ "kind": "archetype",
4
+ "layer": "ARCHETYPE",
5
+ "title_zh": "幂等命令原型",
6
+ "summary_zh": "非幂等操作的容错重试原型(PRD §35 四件套):键/作用域/过期/结果重放;标准现状如实锚定——IETF 草案 draft-ietf-httpapi-idempotency-key-header -07(2025-10-15)已过期未成标准,实践口径锚 Stripe 幂等请求与 Smithy 幂等令牌特质。",
7
+ "semantic": {
8
+ "responsibility": "以客户端生成键识别并丢弃重放请求:首个请求的结果(含失败形态)被保存,同键重放返回同一结果——幂等性是服务端承诺而非重试端自觉",
9
+ "when_to_use": "支付/递交/审批/导入/外部回调等非幂等写操作需要容错重试时(PRD §35 适用清单:payment/submit/approve/import/external callback)",
10
+ "when_not_to_use": "天然幂等的读操作;键无存储载体的纯内存操作;GET/删除类方法(收键无效果)"
11
+ },
12
+ "composition": {
13
+ "requires": [],
14
+ "optional": [],
15
+ "incompatible": []
16
+ },
17
+ "structure": {
18
+ "idempotency_key": "字符串 ≤255 字符,建议 UUID 或熵充足随机串(IETF RECOMMENDED + Stripe 建议 + Smithy 客户端自动填 UUID 三源一致)",
19
+ "scope": "唯一性作用域 + 载荷指纹(指纹候选枚举——IETF §2.4:整包校验和/选中元素校验和/字段值匹配/请求摘要或签名)",
20
+ "expiry": "默认 24h 保留窗口(Stripe 实践:键至少 24 小时后可自动清除);过期策略必须写入 API 文档(IETF SHOULD)",
21
+ "result_replay": "保存首个请求的状态码与响应体(无论成败,含 5xx——Stripe 逐字口径:saving the resulting status code and body of the first request ... regardless of whether it succeeds or fails)"
22
+ },
23
+ "error_semantics": {
24
+ "missing_key": 400,
25
+ "in_flight_conflict": 409,
26
+ "payload_mismatch": 422,
27
+ "source": "IETF -07 正文错误语义(缺键 400;同键仍在处理中 409 Conflict;同键载荷不同 422——键不得跨不同载荷复用)"
28
+ },
29
+ "constraints": [
30
+ "仅对非幂等方法(POST/PATCH 类命令)启用;GET/删除类不收键(Stripe:Don't send idempotency keys in GET and DELETE requests because it has no effect.)",
31
+ "校验失败/并发冲突不落结果、可安全重试(Stripe:只在端点执行开始后才保存结果)",
32
+ "键禁含敏感数据(email/个人标识——Stripe)",
33
+ "标准状态如实引用:expired Internet-Draft(-07,2025-10-15,Intended status 字段为 None、无正式编号)+ Stripe/Smithy 实践——引用词形禁冒称已成正式标准"
34
+ ],
35
+ "optional": {
36
+ "fail_closed_on_missing_key": "缺键时拒绝(400)或忽略——服务自定(IETF SHOULD 级别留白)",
37
+ "retry_safety_baseline": "未标幂等令牌特质的操作默认应视为不可安全重试(Smithy 行为特质规范同页基线)",
38
+ "auto_client_key": "客户端实现可自动填键(Smithy MAY;AWS SDK 自动填 v4 UUID 先例)"
39
+ },
40
+ "x-research-anchors": {
41
+ "note": "【研究纠偏】任务问的 draft-ietf-httpapi-idempotency-key-resources 在 IETF datatracker 不存在(404);真实词形为 draft-ietf-httpapi-idempotency-key-header,最新版 -07(2025-10-15)状态 Expired & archived、无正式编号——本物料全文不冒称已成正式标准(集成 spec 断言全文无该缩写词形)。Stripe(首个结果保存+24h 窗口+255 字符)与 Smithy idempotencyToken trait(服务端 MUST 在服务定义时段内防重放)为官方文档 2026-09-03 实抓",
42
+ "sources": [
43
+ {
44
+ "url": "https://datatracker.ietf.org/doc/draft-ietf-httpapi-idempotency-key-header/",
45
+ "fetched": "2026-09-03"
46
+ },
47
+ {
48
+ "url": "https://datatracker.ietf.org/doc/html/draft-ietf-httpapi-idempotency-key-header-07",
49
+ "fetched": "2026-09-03"
50
+ },
51
+ {
52
+ "url": "https://docs.stripe.com/api/idempotent_requests",
53
+ "fetched": "2026-09-03"
54
+ },
55
+ {
56
+ "url": "https://smithy.io/2.0/spec/behavior-traits.html",
57
+ "fetched": "2026-09-03"
58
+ },
59
+ {
60
+ "url": ".trellis/tasks/09-02-vnext-prd-v06-governed-substrate/research/backend-references.md 题 3",
61
+ "fetched": "2026-09-03"
62
+ }
63
+ ]
64
+ }
65
+ }
@@ -0,0 +1,47 @@
1
+ {
2
+ "id": "ARCHETYPE.BACKEND.IMPORT",
3
+ "kind": "archetype",
4
+ "layer": "ARCHETYPE",
5
+ "title_zh": "批量导入原型",
6
+ "summary_zh": "文件批量导入七步链原型(PRD §32 逐字):上传→解析→校验→预览→确认→执行→结果;行级错误/部分失败/幂等/事务/审计五项必须预定义。",
7
+ "semantic": {
8
+ "responsibility": "把『文件进库』标准化为预览确认两段式:校验先行、人确认后才执行——执行形态(全量事务/部分失败)与行级错误报告显式预定义而非事后补",
9
+ "when_to_use": "电子表格/CSV 类批量建档与更新(参照数据初始化、期初导入等)——预定义五项缺一即契约不完整",
10
+ "when_not_to_use": "单条建档(走标准写面);系统间定期同步(走外部集成/发件箱事件原型)"
11
+ },
12
+ "composition": {
13
+ "requires": [],
14
+ "optional": [],
15
+ "incompatible": []
16
+ },
17
+ "pipeline": [
18
+ "Upload",
19
+ "Parse",
20
+ "Validate",
21
+ "Preview",
22
+ "Confirm",
23
+ "Apply",
24
+ "Result"
25
+ ],
26
+ "predefined": [
27
+ "row_error",
28
+ "partial_failure",
29
+ "idempotency",
30
+ "transaction",
31
+ "audit"
32
+ ],
33
+ "predefined_source": "PRD §32 逐字:必须预定义:row error / partial failure / idempotency / transaction / audit。",
34
+ "x-research-anchors": {
35
+ "note": "七步链与预定义五项为 PRD §32 逐字(2026-09-03 对照 backend-references.md 差异表无冲突确认);幂等项与幂等命令原型语义互链(重复导入以键防重)",
36
+ "sources": [
37
+ {
38
+ "url": "doc/POMaster-vNext-PRD-v0.6.1-Engineering-Substrate-Archetype-Catalog.md §32",
39
+ "fetched": "2026-09-03"
40
+ },
41
+ {
42
+ "url": ".trellis/tasks/09-02-vnext-prd-v06-governed-substrate/research/backend-references.md",
43
+ "fetched": "2026-09-03"
44
+ }
45
+ ]
46
+ }
47
+ }
@@ -0,0 +1,45 @@
1
+ {
2
+ "id": "ARCHETYPE.BACKEND.MASTER_DATA",
3
+ "kind": "archetype",
4
+ "layer": "ARCHETYPE",
5
+ "title_zh": "后端主数据原型",
6
+ "summary_zh": "标准主数据域后端原型(PRD §29):增删改查写面与列表检索读面为基座,叠加审计、状态位、业务唯一键与可选版本位的六件套组合语义——组合语义定义住主数据域的标准后端形态。",
7
+ "semantic": {
8
+ "responsibility": "以六件套组合语义承载主数据域的标准后端形态:写面(新增/修改/删除)与读面分离,公共横切面(审计/状态/唯一键/版本)显式组合而非各自发明",
9
+ "when_to_use": "新建主数据域(组织/客商/物料字典等共享参照数据)的后端时——六件套组合即标准答案,不需要从零设计(v0.6.1 §90 Tracer:AI 不需要从零设计标准表结构)",
10
+ "when_not_to_use": "交易流水类(走交易流水数据原型——不默认软删);纯一次性批量导入场景(导入原型承载流程而非实体形状)"
11
+ },
12
+ "composition": {
13
+ "requires": [
14
+ "ARCHETYPE.BACKEND.CRUD_RESOURCE",
15
+ "ARCHETYPE.BACKEND.QUERY_RESOURCE"
16
+ ],
17
+ "optional": [
18
+ "ARCHETYPE.BACKEND.AUDIT",
19
+ "DATA_ARCHETYPE.MASTER_DATA"
20
+ ],
21
+ "incompatible": []
22
+ },
23
+ "prd_combination": [
24
+ "CRUD_RESOURCE",
25
+ "QUERY_RESOURCE",
26
+ "AUDIT",
27
+ "STATUS",
28
+ "UNIQUE_BUSINESS_KEY",
29
+ "OPTIONAL_VERSION"
30
+ ],
31
+ "prd_combination_note": "PRD §29 组合清单逐字(CRUD_RESOURCE/QUERY_RESOURCE/AUDIT 三件为在册 catalog 物料——requires/optional 槽承载;STATUS/UNIQUE_BUSINESS_KEY/OPTIONAL_VERSION 三件为组合位词形,物理载体归 CRUD 物料的 defaults 审计/唯一约束/版本位)",
32
+ "x-research-anchors": {
33
+ "note": "组合语义为 PRD §29 逐字;与批次 1 在册物料的引用关系(CRUD/QUERY/DATA_ARCHETYPE.MASTER_DATA)经 backend-references.md 差异表 §47-§51 行 2026-09-03 对照无冲突;软删保持 optional 位(题 6b:GDPR Art.17 兼容但个人数据须有最终硬删路径)",
34
+ "sources": [
35
+ {
36
+ "url": "doc/POMaster-vNext-PRD-v0.6.1-Engineering-Substrate-Archetype-Catalog.md §29",
37
+ "fetched": "2026-09-03"
38
+ },
39
+ {
40
+ "url": ".trellis/tasks/09-02-vnext-prd-v06-governed-substrate/research/backend-references.md",
41
+ "fetched": "2026-09-03"
42
+ }
43
+ ]
44
+ }
45
+ }