whykit 0.3.1__py3-none-any.whl

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 (84) hide show
  1. whykit/__init__.py +21 -0
  2. whykit/adopt.py +776 -0
  3. whykit/backlinks.py +106 -0
  4. whykit/check.py +320 -0
  5. whykit/ci_formats.py +283 -0
  6. whykit/cli.py +1719 -0
  7. whykit/completion.py +193 -0
  8. whykit/config.py +233 -0
  9. whykit/console.py +217 -0
  10. whykit/context.py +204 -0
  11. whykit/contract.py +210 -0
  12. whykit/contract_schemas/backlinks-report.schema.json +61 -0
  13. whykit/contract_schemas/context-bundle.schema.json +27 -0
  14. whykit/contract_schemas/context-pack.schema.json +29 -0
  15. whykit/contract_schemas/impact-report.schema.json +122 -0
  16. whykit/contract_schemas/query-result.schema.json +105 -0
  17. whykit/contract_schemas/status-report.schema.json +176 -0
  18. whykit/contract_schemas/trace-report.schema.json +211 -0
  19. whykit/diff.py +823 -0
  20. whykit/evidence.py +178 -0
  21. whykit/explorer_index.py +554 -0
  22. whykit/graph.py +318 -0
  23. whykit/immutability.py +624 -0
  24. whykit/impact.py +272 -0
  25. whykit/init_layout.py +205 -0
  26. whykit/io.py +563 -0
  27. whykit/lint.py +2190 -0
  28. whykit/lsp.py +1241 -0
  29. whykit/markdown_code.py +107 -0
  30. whykit/mcp_server.py +2289 -0
  31. whykit/messages.py +46 -0
  32. whykit/pack.py +294 -0
  33. whykit/parse_cache.py +752 -0
  34. whykit/placeholders.py +84 -0
  35. whykit/promote.py +651 -0
  36. whykit/py.typed +0 -0
  37. whykit/query.py +174 -0
  38. whykit/review.py +527 -0
  39. whykit/rule_policy.py +1063 -0
  40. whykit/rules.py +274 -0
  41. whykit/scaffold.py +784 -0
  42. whykit/sensitivity.py +95 -0
  43. whykit/snapshot.py +319 -0
  44. whykit/status.py +167 -0
  45. whykit/tables.py +120 -0
  46. whykit/template/00-context/README.md +17 -0
  47. whykit/template/00-context/company.md +52 -0
  48. whykit/template/00-context/evidence-register.md +34 -0
  49. whykit/template/00-context/goals.md +38 -0
  50. whykit/template/00-context/review-log.md +22 -0
  51. whykit/template/00-context/terminology.md +34 -0
  52. whykit/template/01-strategy/README.md +7 -0
  53. whykit/template/02-discoverability/README.md +10 -0
  54. whykit/template/03-website/README.md +7 -0
  55. whykit/template/04-automation/README.md +10 -0
  56. whykit/template/05-operations/README.md +19 -0
  57. whykit/template/06-decisions/README.md +11 -0
  58. whykit/template/06-decisions/decision-log.md +38 -0
  59. whykit/template/07-research/README.md +10 -0
  60. whykit/template/AGENTS.md +163 -0
  61. whykit/template/Home.md +57 -0
  62. whykit/template/INTEROP.md +117 -0
  63. whykit/template/OBSIDIAN.md +92 -0
  64. whykit/template/README.md +51 -0
  65. whykit/template/assets/README.md +6 -0
  66. whykit/template/reports/README.md +7 -0
  67. whykit/template/templates/README.md +7 -0
  68. whykit/template/templates/automation-spec-template.md +70 -0
  69. whykit/template/templates/decision-record-template.md +65 -0
  70. whykit/template/templates/document-template.md +55 -0
  71. whykit/template/templates/experiment-template.md +62 -0
  72. whykit/template/templates/meeting-note-template.md +47 -0
  73. whykit/template/templates/page-brief-template.md +63 -0
  74. whykit/template/templates/research-note-template.md +53 -0
  75. whykit/template/templates/source-ingestion-template.md +43 -0
  76. whykit/template/whykit.toml +39 -0
  77. whykit/trace.py +272 -0
  78. whykit/vault_index.py +190 -0
  79. whykit-0.3.1.dist-info/METADATA +162 -0
  80. whykit-0.3.1.dist-info/RECORD +84 -0
  81. whykit-0.3.1.dist-info/WHEEL +4 -0
  82. whykit-0.3.1.dist-info/entry_points.txt +3 -0
  83. whykit-0.3.1.dist-info/licenses/LICENSE +201 -0
  84. whykit-0.3.1.dist-info/licenses/NOTICE +13 -0
@@ -0,0 +1,105 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://cometweb.io/schemas/whykit/query-result.schema.json",
4
+ "title": "WhyKit query result",
5
+ "type": "object",
6
+ "required": [
7
+ "contract_version",
8
+ "query",
9
+ "total",
10
+ "returned",
11
+ "results"
12
+ ],
13
+ "properties": {
14
+ "contract_version": {
15
+ "const": 1
16
+ },
17
+ "query": {
18
+ "description": "The filters this result was computed with; null means the filter was not applied.",
19
+ "type": "object",
20
+ "required": [
21
+ "text",
22
+ "limit"
23
+ ],
24
+ "properties": {
25
+ "text": {
26
+ "type": [
27
+ "string",
28
+ "null"
29
+ ]
30
+ },
31
+ "canonical_only": {
32
+ "type": "boolean"
33
+ },
34
+ "limit": {
35
+ "type": "integer",
36
+ "minimum": 0
37
+ }
38
+ },
39
+ "additionalProperties": true
40
+ },
41
+ "results": {
42
+ "type": "array",
43
+ "items": {
44
+ "type": "object",
45
+ "required": [
46
+ "path",
47
+ "title",
48
+ "type",
49
+ "status",
50
+ "source_ids"
51
+ ],
52
+ "properties": {
53
+ "path": {
54
+ "type": "string",
55
+ "minLength": 1
56
+ },
57
+ "title": {
58
+ "type": "string"
59
+ },
60
+ "type": {
61
+ "type": "string"
62
+ },
63
+ "status": {
64
+ "type": "string"
65
+ },
66
+ "owner": {
67
+ "type": "string"
68
+ },
69
+ "sensitivity": {
70
+ "type": "string"
71
+ },
72
+ "source_of_truth": {
73
+ "type": "boolean"
74
+ },
75
+ "source_ids": {
76
+ "type": "array",
77
+ "items": {
78
+ "type": "string",
79
+ "pattern": "^E-[0-9]{3,}$"
80
+ }
81
+ },
82
+ "tags": {
83
+ "type": "array",
84
+ "items": {
85
+ "type": "string"
86
+ }
87
+ },
88
+ "score": {
89
+ "type": "number"
90
+ }
91
+ },
92
+ "additionalProperties": true
93
+ }
94
+ },
95
+ "total": {
96
+ "type": "integer",
97
+ "minimum": 0
98
+ },
99
+ "returned": {
100
+ "type": "integer",
101
+ "minimum": 0
102
+ }
103
+ },
104
+ "additionalProperties": true
105
+ }
@@ -0,0 +1,176 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://cometweb.io/schemas/whykit/status-report.schema.json",
4
+ "title": "WhyKit status report",
5
+ "description": "Output of `whykit status --json`.",
6
+ "type": "object",
7
+ "required": [
8
+ "contract_version",
9
+ "root",
10
+ "as_of",
11
+ "documents",
12
+ "canonical",
13
+ "decisions",
14
+ "evidence_active",
15
+ "evidence_retired",
16
+ "errors",
17
+ "warnings",
18
+ "finding_codes",
19
+ "review_queue",
20
+ "review_overdue",
21
+ "findings"
22
+ ],
23
+ "properties": {
24
+ "contract_version": {
25
+ "const": 1
26
+ },
27
+ "root": {
28
+ "type": "string"
29
+ },
30
+ "as_of": {
31
+ "type": "string",
32
+ "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}$"
33
+ },
34
+ "documents": {
35
+ "type": "integer",
36
+ "minimum": 0
37
+ },
38
+ "canonical": {
39
+ "type": "integer",
40
+ "minimum": 0
41
+ },
42
+ "decisions": {
43
+ "type": "integer",
44
+ "minimum": 0
45
+ },
46
+ "evidence_active": {
47
+ "type": "integer",
48
+ "minimum": 0
49
+ },
50
+ "evidence_retired": {
51
+ "type": "integer",
52
+ "minimum": 0
53
+ },
54
+ "errors": {
55
+ "type": "integer",
56
+ "minimum": 0
57
+ },
58
+ "warnings": {
59
+ "type": "integer",
60
+ "minimum": 0
61
+ },
62
+ "finding_codes": {
63
+ "type": "object",
64
+ "additionalProperties": {
65
+ "type": "integer",
66
+ "minimum": 0
67
+ }
68
+ },
69
+ "review_queue": {
70
+ "type": "array",
71
+ "items": {
72
+ "type": "object",
73
+ "required": [
74
+ "path",
75
+ "title",
76
+ "owner",
77
+ "review_by",
78
+ "days",
79
+ "state"
80
+ ],
81
+ "properties": {
82
+ "path": {
83
+ "type": "string"
84
+ },
85
+ "title": {
86
+ "type": "string"
87
+ },
88
+ "owner": {
89
+ "type": "string"
90
+ },
91
+ "review_by": {
92
+ "type": "string"
93
+ },
94
+ "days": {
95
+ "type": "integer"
96
+ },
97
+ "state": {
98
+ "enum": [
99
+ "overdue",
100
+ "due"
101
+ ]
102
+ }
103
+ },
104
+ "additionalProperties": true
105
+ }
106
+ },
107
+ "review_overdue": {
108
+ "type": "integer",
109
+ "minimum": 0
110
+ },
111
+ "decision_states": {
112
+ "type": "object",
113
+ "additionalProperties": {
114
+ "type": "integer",
115
+ "minimum": 0
116
+ }
117
+ },
118
+ "document_states": {
119
+ "type": "object",
120
+ "additionalProperties": {
121
+ "type": "integer",
122
+ "minimum": 0
123
+ }
124
+ },
125
+ "sensitivity": {
126
+ "type": "object",
127
+ "additionalProperties": {
128
+ "type": "integer",
129
+ "minimum": 0
130
+ }
131
+ },
132
+ "approved_without_owner": {
133
+ "type": "integer",
134
+ "minimum": 0
135
+ },
136
+ "findings": {
137
+ "type": "array",
138
+ "items": {
139
+ "type": "object",
140
+ "required": [
141
+ "path",
142
+ "line",
143
+ "level",
144
+ "code",
145
+ "message"
146
+ ],
147
+ "properties": {
148
+ "path": {
149
+ "type": "string"
150
+ },
151
+ "line": {
152
+ "type": [
153
+ "integer",
154
+ "null"
155
+ ]
156
+ },
157
+ "level": {
158
+ "enum": [
159
+ "error",
160
+ "warning"
161
+ ]
162
+ },
163
+ "code": {
164
+ "type": "string",
165
+ "minLength": 1
166
+ },
167
+ "message": {
168
+ "type": "string"
169
+ }
170
+ },
171
+ "additionalProperties": true
172
+ }
173
+ }
174
+ },
175
+ "additionalProperties": true
176
+ }
@@ -0,0 +1,211 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://cometweb.io/schemas/whykit/trace-report.schema.json",
4
+ "title": "WhyKit decision trace",
5
+ "description": "Output of `whykit trace --json`. An unknown `--decision` yields an empty `decisions` list and exit 1.",
6
+ "type": "object",
7
+ "required": [
8
+ "contract_version",
9
+ "as_of",
10
+ "decision",
11
+ "decisions",
12
+ "summary"
13
+ ],
14
+ "properties": {
15
+ "contract_version": {
16
+ "const": 1
17
+ },
18
+ "as_of": {
19
+ "type": "string",
20
+ "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}$"
21
+ },
22
+ "decision": {
23
+ "anyOf": [
24
+ {
25
+ "type": "string",
26
+ "pattern": "^D-[0-9]{3,}$"
27
+ },
28
+ {
29
+ "type": "null"
30
+ }
31
+ ]
32
+ },
33
+ "decisions": {
34
+ "type": "array",
35
+ "items": {
36
+ "type": "object",
37
+ "required": [
38
+ "decision_id",
39
+ "path",
40
+ "status",
41
+ "live",
42
+ "evidence",
43
+ "gaps"
44
+ ],
45
+ "properties": {
46
+ "decision_id": {
47
+ "type": "string"
48
+ },
49
+ "path": {
50
+ "type": "string"
51
+ },
52
+ "title": {
53
+ "type": "string"
54
+ },
55
+ "status": {
56
+ "type": "string"
57
+ },
58
+ "owner": {
59
+ "type": "string"
60
+ },
61
+ "sensitivity": {
62
+ "type": "string"
63
+ },
64
+ "superseded_by": {
65
+ "type": "array",
66
+ "items": {
67
+ "type": "string"
68
+ }
69
+ },
70
+ "live": {
71
+ "type": "boolean"
72
+ },
73
+ "evidence": {
74
+ "type": "array",
75
+ "items": {
76
+ "type": "object",
77
+ "required": [
78
+ "id",
79
+ "state",
80
+ "stale"
81
+ ],
82
+ "properties": {
83
+ "id": {
84
+ "type": "string"
85
+ },
86
+ "via": {
87
+ "type": [
88
+ "string",
89
+ "null"
90
+ ]
91
+ },
92
+ "state": {
93
+ "enum": [
94
+ "active",
95
+ "retired",
96
+ "missing"
97
+ ]
98
+ },
99
+ "source": {
100
+ "type": [
101
+ "string",
102
+ "null"
103
+ ]
104
+ },
105
+ "type": {
106
+ "type": [
107
+ "string",
108
+ "null"
109
+ ]
110
+ },
111
+ "accessed": {
112
+ "type": [
113
+ "string",
114
+ "null"
115
+ ]
116
+ },
117
+ "age_days": {
118
+ "type": [
119
+ "integer",
120
+ "null"
121
+ ]
122
+ },
123
+ "max_age_days": {
124
+ "type": [
125
+ "integer",
126
+ "null"
127
+ ]
128
+ },
129
+ "stale": {
130
+ "type": "boolean"
131
+ },
132
+ "replaced_by": {
133
+ "type": [
134
+ "string",
135
+ "null"
136
+ ]
137
+ }
138
+ },
139
+ "additionalProperties": true
140
+ }
141
+ },
142
+ "gaps": {
143
+ "type": "array",
144
+ "items": {
145
+ "enum": [
146
+ "no_evidence",
147
+ "missing_evidence",
148
+ "retired_evidence",
149
+ "stale_evidence"
150
+ ]
151
+ }
152
+ }
153
+ },
154
+ "additionalProperties": true
155
+ }
156
+ },
157
+ "summary": {
158
+ "type": "object",
159
+ "required": [
160
+ "decisions",
161
+ "live",
162
+ "live_with_gaps",
163
+ "gaps"
164
+ ],
165
+ "properties": {
166
+ "decisions": {
167
+ "type": "integer",
168
+ "minimum": 0
169
+ },
170
+ "live": {
171
+ "type": "integer",
172
+ "minimum": 0
173
+ },
174
+ "live_with_gaps": {
175
+ "type": "integer",
176
+ "minimum": 0
177
+ },
178
+ "gaps": {
179
+ "type": "object",
180
+ "required": [
181
+ "no_evidence",
182
+ "missing_evidence",
183
+ "retired_evidence",
184
+ "stale_evidence"
185
+ ],
186
+ "properties": {
187
+ "no_evidence": {
188
+ "type": "integer",
189
+ "minimum": 0
190
+ },
191
+ "missing_evidence": {
192
+ "type": "integer",
193
+ "minimum": 0
194
+ },
195
+ "retired_evidence": {
196
+ "type": "integer",
197
+ "minimum": 0
198
+ },
199
+ "stale_evidence": {
200
+ "type": "integer",
201
+ "minimum": 0
202
+ }
203
+ },
204
+ "additionalProperties": true
205
+ }
206
+ },
207
+ "additionalProperties": true
208
+ }
209
+ },
210
+ "additionalProperties": true
211
+ }