@hap-labs/human-agent-paradigm 0.1.0 → 0.2.1

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.
@@ -1,166 +0,0 @@
1
- {
2
- "version": 1,
3
- "required_files": [
4
- "human_agent_paradigm.md",
5
- "derived_specification.md",
6
- "conformance_checklist.md",
7
- "contract_template.md",
8
- "decision_request_template.md",
9
- "delivery_report_template.md"
10
- ],
11
- "upstream_references": {
12
- "derived_specification.md": [
13
- "版本:v1.0",
14
- "上级文件:`HUMAN_AGENT_PARADIGM.md` v1.0"
15
- ],
16
- "conformance_checklist.md": [
17
- "版本:v1.0",
18
- "配套文件:`DERIVED_SPECIFICATION.md` v1.0"
19
- ],
20
- "contract_template.md": [
21
- "派生规范 `DERIVED_SPECIFICATION.md` v1.0"
22
- ],
23
- "decision_request_template.md": [
24
- "派生规范 `DERIVED_SPECIFICATION.md` v1.0"
25
- ],
26
- "delivery_report_template.md": [
27
- "派生规范 `DERIVED_SPECIFICATION.md` v1.0"
28
- ]
29
- },
30
- "required_headings": {
31
- "human_agent_paradigm.md": [
32
- "0. 文件地位与效力",
33
- "1. 愿景与成功定义",
34
- "2. 根本信条(公理)",
35
- "3. 两条硬性要求",
36
- "4. 角色与行为边界",
37
- "5. 协作流程(方向级)",
38
- "6. 卓越性方向(优秀的五个维度)",
39
- "7. 经济性方向(最低总成本)",
40
- "8. 资产与演进(复利飞轮)",
41
- "9. 范式的自我治理",
42
- "10. 术语定义",
43
- "11. 范式级验收判据"
44
- ],
45
- "derived_specification.md": [
46
- "0. 地位、追溯与解释",
47
- "1. 通用交付物与记录要求",
48
- "2. 契约规范",
49
- "3. 协作流程规范(P0–P7)",
50
- "4. 决策与沟通规范",
51
- "5. 可靠性与证据规范",
52
- "6. 优秀与多视角审视规范",
53
- "7. 经济性与自治预算规范",
54
- "8. 资产与演进规范",
55
- "9. 符合性治理",
56
- "附录 A:追溯总表",
57
- "附录 B:最低记录清单",
58
- "修订记录"
59
- ],
60
- "conformance_checklist.md": [
61
- "使用说明",
62
- "A. 规范地位与适用性",
63
- "B. 可靠(硬性要求一)",
64
- "C. 优秀(硬性要求二)",
65
- "D. 边界与决策",
66
- "E. 流程与契约",
67
- "F. 经济性与自治",
68
- "G. 资产与演进",
69
- "H. 安全与合规底线",
70
- "I. 治理与证据",
71
- "J. 范式级验收判据(宪法 11)",
72
- "最终判定",
73
- "修订记录"
74
- ],
75
- "contract_template.md": [
76
- "使用规则",
77
- "契约元信息"
78
- ],
79
- "decision_request_template.md": [
80
- "使用规则"
81
- ],
82
- "delivery_report_template.md": [
83
- "使用规则"
84
- ]
85
- },
86
- "checklist": {
87
- "expected_items": 89,
88
- "expected_star_items": 41,
89
- "item_prefixes": {
90
- "A. 规范地位与适用性": "A",
91
- "B. 可靠(硬性要求一)": "R",
92
- "C. 优秀(硬性要求二)": "E",
93
- "D. 边界与决策": "D",
94
- "E. 流程与契约": "P",
95
- "F. 经济性与自治": "C",
96
- "G. 资产与演进": "K",
97
- "H. 安全与合规底线": "S",
98
- "I. 治理与证据": "G",
99
- "J. 范式级验收判据(宪法 11)": "J"
100
- },
101
- "sections": [
102
- "A. 规范地位与适用性",
103
- "B. 可靠(硬性要求一)",
104
- "C. 优秀(硬性要求二)",
105
- "D. 边界与决策",
106
- "E. 流程与契约",
107
- "F. 经济性与自治",
108
- "G. 资产与演进",
109
- "H. 安全与合规底线",
110
- "I. 治理与证据",
111
- "J. 范式级验收判据(宪法 11)"
112
- ],
113
- "final_section": "最终判定"
114
- },
115
- "contract_template": {
116
- "required_sections": [
117
- "C1 背景与意图",
118
- "C2 范围与非目标",
119
- "C3 约束与底线",
120
- "C4 可靠标准",
121
- "C5 优秀标准(五个维度,逐条可判定)",
122
- "C6 多视角审视要求",
123
- "C7 自治预算",
124
- "C8 交付物与证据清单",
125
- "C9 验收方式",
126
- "C10 变更、终止与失败处置"
127
- ]
128
- },
129
- "decision_request_template": {
130
- "required_sections": [
131
- "Part A 决策请求",
132
- "A0 元信息",
133
- "A1 必要性测试(必填,不通过则不得发送)",
134
- "A2 背景摘要",
135
- "A3 实质选项",
136
- "A4 推荐与理由",
137
- "A5 默认选择与逾期处置",
138
- "A6 决策影响",
139
- "A7 响应窗口",
140
- "A8 人的决定与留痕",
141
- "Part B 必要信息补全请求(仅限 P0/P1)",
142
- "B0 前置校验(不通过则不得发送)",
143
- "B1 请求内容",
144
- "B2 人的答复与留痕",
145
- "发送前自检"
146
- ]
147
- },
148
- "delivery_report_template": {
149
- "required_sections": [
150
- "1. 元信息",
151
- "2. 交付单元清单",
152
- "3. 契约对照总表",
153
- "4. 可靠证据",
154
- "5. 优秀证据(五个维度逐项)",
155
- "6. 多视角审视与缺陷",
156
- "7. 符合性自检结果",
157
- "8. 资产沉淀",
158
- "9. 成本台账摘要",
159
- "10. 安全与合规",
160
- "11. 已知边界与未完成说明",
161
- "12. 验收建议(仅自查结论)",
162
- "13. 签署与验收",
163
- "附:追溯矩阵"
164
- ]
165
- }
166
- }
@@ -1,79 +0,0 @@
1
- """Render check results as JSON, Markdown, and console summaries."""
2
-
3
- import json
4
- from collections import Counter
5
-
6
-
7
- def summarize(findings):
8
- by_rule = Counter(finding.rule_id for finding in findings)
9
- return {
10
- "total_findings": len(findings),
11
- "findings_by_rule": dict(sorted(by_rule.items())),
12
- }
13
-
14
-
15
- def result_payload(run_id, root, config_path, docs_dir, elapsed_seconds, findings):
16
- return {
17
- "run_id": run_id,
18
- "root": str(root),
19
- "docs_dir": str(docs_dir),
20
- "config_path": str(config_path),
21
- "elapsed_seconds": round(elapsed_seconds, 4),
22
- "summary": summarize(findings),
23
- "findings": [finding.to_dict() for finding in findings],
24
- }
25
-
26
-
27
- def render_json(payload):
28
- return json.dumps(payload, ensure_ascii=False, indent=2) + "\n"
29
-
30
-
31
- def render_markdown(payload):
32
- summary = payload["summary"]
33
- lines = [
34
- "# repo_governance_check 结构检查报告",
35
- "",
36
- "> 本报告仅表示结构检查结果,不构成对文档内容实质符合性的证明。",
37
- "",
38
- f"- Run ID: `{payload['run_id']}`",
39
- f"- Root: `{payload['root']}`",
40
- f"- Docs dir: `{payload['docs_dir']}`",
41
- f"- Config: `{payload['config_path']}`",
42
- f"- Elapsed: {payload['elapsed_seconds']} s",
43
- f"- Total findings: {summary['total_findings']}",
44
- "",
45
- "## 规则汇总",
46
- "",
47
- "| 规则 | 发现数 |",
48
- "| :--- | :--- |",
49
- ]
50
- for rule_id, count in summary["findings_by_rule"].items():
51
- lines.append(f"| {rule_id} | {count} |")
52
- lines.extend(["", "## 发现清单", ""])
53
- if not payload["findings"]:
54
- lines.append("无发现。")
55
- else:
56
- lines.extend(
57
- [
58
- "| 规则 | 严重度 | 文件 | 行号 | 消息 | 证据 |",
59
- "| :--- | :--- | :--- | :--- | :--- | :--- |",
60
- ]
61
- )
62
- for finding in payload["findings"]:
63
- lines.append(
64
- "| {rule_id} | {severity} | `{file}` | {line} | {message} | {evidence} |".format(
65
- **finding
66
- )
67
- )
68
- lines.append("")
69
- return "\n".join(lines)
70
-
71
-
72
- def render_console(payload):
73
- summary = payload["summary"]
74
- status = "STRUCTURAL FAIL" if summary["total_findings"] else "STRUCTURAL PASS"
75
- return (
76
- f"{status}: {summary['total_findings']} structural finding(s) "
77
- f"in {payload['root']} (docs: {payload['docs_dir']}, "
78
- f"{payload['elapsed_seconds']} s)"
79
- )