principles 0.0.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.
Files changed (278) hide show
  1. checksums.yaml +7 -0
  2. data/exe/principles +10 -0
  3. data/lib/principles/after_commit_hook_options.rb +44 -0
  4. data/lib/principles/cli.rb +149 -0
  5. data/lib/principles/command_line.rb +188 -0
  6. data/lib/principles/command_routes.rb +60 -0
  7. data/lib/principles/controllers/acknowledgement.rb +106 -0
  8. data/lib/principles/controllers/answer.rb +172 -0
  9. data/lib/principles/controllers/audit.rb +203 -0
  10. data/lib/principles/controllers/audit_completion.rb +113 -0
  11. data/lib/principles/controllers/command.rb +201 -0
  12. data/lib/principles/controllers/correction.rb +99 -0
  13. data/lib/principles/controllers/help.rb +107 -0
  14. data/lib/principles/controllers/inventory.rb +181 -0
  15. data/lib/principles/controllers/mapping.rb +56 -0
  16. data/lib/principles/controllers/member_entries.rb +149 -0
  17. data/lib/principles/controllers/members_a_commit_changed.rb +43 -0
  18. data/lib/principles/controllers/members_to_assess.rb +160 -0
  19. data/lib/principles/controllers/meta_principle_setup.rb +92 -0
  20. data/lib/principles/controllers/repoint.rb +68 -0
  21. data/lib/principles/controllers/running_tool.rb +41 -0
  22. data/lib/principles/data/audit_files.rb +96 -0
  23. data/lib/principles/data/bounded_file.rb +45 -0
  24. data/lib/principles/data/candidate_files_found.rb +105 -0
  25. data/lib/principles/data/command-steps.json +305 -0
  26. data/lib/principles/data/command_steps_file.rb +50 -0
  27. data/lib/principles/data/expected_type.rb +71 -0
  28. data/lib/principles/data/ignored_by_git.rb +54 -0
  29. data/lib/principles/data/json_text.rb +57 -0
  30. data/lib/principles/data/known_fields.rb +42 -0
  31. data/lib/principles/data/linked_path.rb +102 -0
  32. data/lib/principles/data/map_files.rb +104 -0
  33. data/lib/principles/data/principle_id.rb +32 -0
  34. data/lib/principles/data/principles_subfolder.rb +93 -0
  35. data/lib/principles/data/project_files.rb +109 -0
  36. data/lib/principles/data/repository.rb +165 -0
  37. data/lib/principles/data/running_version.rb +44 -0
  38. data/lib/principles/data/schema_check.rb +139 -0
  39. data/lib/principles/data/schemas/acknowledgement-answer.schema.json +25 -0
  40. data/lib/principles/data/schemas/answer-guide.schema.json +99 -0
  41. data/lib/principles/data/schemas/assessment-answer.schema.json +332 -0
  42. data/lib/principles/data/schemas/audit-record.schema.json +277 -0
  43. data/lib/principles/data/schemas/command-steps.schema.json +83 -0
  44. data/lib/principles/data/schemas/correction-answer-guide.schema.json +68 -0
  45. data/lib/principles/data/schemas/correction-answer.schema.json +306 -0
  46. data/lib/principles/data/schemas/member-map.schema.json +39 -0
  47. data/lib/principles/data/schemas/repointing-answer.schema.json +44 -0
  48. data/lib/principles/error.rb +102 -0
  49. data/lib/principles/invocation_options.rb +77 -0
  50. data/lib/principles/models/accepted_loading.rb +36 -0
  51. data/lib/principles/models/acknowledgement.rb +203 -0
  52. data/lib/principles/models/activation.rb +64 -0
  53. data/lib/principles/models/agent_loads.rb +64 -0
  54. data/lib/principles/models/answer_fields.rb +67 -0
  55. data/lib/principles/models/answer_place.rb +53 -0
  56. data/lib/principles/models/answer_text.rb +37 -0
  57. data/lib/principles/models/answered_time.rb +65 -0
  58. data/lib/principles/models/assessment_answer.rb +131 -0
  59. data/lib/principles/models/assessment_basis.rb +47 -0
  60. data/lib/principles/models/assessment_report.rb +62 -0
  61. data/lib/principles/models/audit.rb +200 -0
  62. data/lib/principles/models/audit_record.rb +249 -0
  63. data/lib/principles/models/audit_records.rb +103 -0
  64. data/lib/principles/models/audit_start.rb +96 -0
  65. data/lib/principles/models/audited_member_lines.rb +45 -0
  66. data/lib/principles/models/candidate_files.rb +66 -0
  67. data/lib/principles/models/candidate_inventory.rb +67 -0
  68. data/lib/principles/models/candidate_listing.rb +32 -0
  69. data/lib/principles/models/carried_assessments.rb +76 -0
  70. data/lib/principles/models/check_since_last_audit.rb +61 -0
  71. data/lib/principles/models/cited_files.rb +39 -0
  72. data/lib/principles/models/command_steps.rb +270 -0
  73. data/lib/principles/models/commits_brought_in.rb +27 -0
  74. data/lib/principles/models/commits_since_base.rb +32 -0
  75. data/lib/principles/models/correction_answer.rb +66 -0
  76. data/lib/principles/models/correction_basis.rb +70 -0
  77. data/lib/principles/models/dated_line.rb +29 -0
  78. data/lib/principles/models/decided_prior_findings.rb +106 -0
  79. data/lib/principles/models/declared_map_changes.rb +156 -0
  80. data/lib/principles/models/disposition.rb +233 -0
  81. data/lib/principles/models/entry_file.rb +65 -0
  82. data/lib/principles/models/entry_files.rb +46 -0
  83. data/lib/principles/models/evidence_item.rb +48 -0
  84. data/lib/principles/models/evidence_lines_since.rb +57 -0
  85. data/lib/principles/models/evidence_replacements.rb +99 -0
  86. data/lib/principles/models/finding_write_ups.rb +108 -0
  87. data/lib/principles/models/findings_left_open.rb +34 -0
  88. data/lib/principles/models/first_raised_claim.rb +128 -0
  89. data/lib/principles/models/frontmatter_fields.rb +128 -0
  90. data/lib/principles/models/hook_commands.rb +100 -0
  91. data/lib/principles/models/ignored_candidates.rb +46 -0
  92. data/lib/principles/models/json_digest.rb +35 -0
  93. data/lib/principles/models/json_path_query.rb +131 -0
  94. data/lib/principles/models/json_path_selectors.rb +64 -0
  95. data/lib/principles/models/json_path_string.rb +76 -0
  96. data/lib/principles/models/kept_prior_finding.rb +70 -0
  97. data/lib/principles/models/last_completed_revision.rb +70 -0
  98. data/lib/principles/models/line_span.rb +49 -0
  99. data/lib/principles/models/loaded_files.rb +60 -0
  100. data/lib/principles/models/loading_decision.rb +45 -0
  101. data/lib/principles/models/loading_facts.rb +45 -0
  102. data/lib/principles/models/loads_to_check.rb +93 -0
  103. data/lib/principles/models/locate_refusal.rb +23 -0
  104. data/lib/principles/models/located_text.rb +43 -0
  105. data/lib/principles/models/locator.rb +52 -0
  106. data/lib/principles/models/map_members.rb +171 -0
  107. data/lib/principles/models/markdown_file.rb +92 -0
  108. data/lib/principles/models/member.rb +171 -0
  109. data/lib/principles/models/member_assessments.rb +144 -0
  110. data/lib/principles/models/member_elsewhere.rb +74 -0
  111. data/lib/principles/models/member_file.rb +156 -0
  112. data/lib/principles/models/member_grounds.rb +32 -0
  113. data/lib/principles/models/member_history.rb +68 -0
  114. data/lib/principles/models/member_lines.rb +95 -0
  115. data/lib/principles/models/member_loads.rb +197 -0
  116. data/lib/principles/models/member_map.rb +219 -0
  117. data/lib/principles/models/member_map_history.rb +143 -0
  118. data/lib/principles/models/member_maps.rb +185 -0
  119. data/lib/principles/models/member_moves.rb +95 -0
  120. data/lib/principles/models/member_problems.rb +253 -0
  121. data/lib/principles/models/member_sighting.rb +176 -0
  122. data/lib/principles/models/member_snapshots.rb +36 -0
  123. data/lib/principles/models/member_state.rb +35 -0
  124. data/lib/principles/models/members_elsewhere.rb +46 -0
  125. data/lib/principles/models/members_sharing_lines.rb +116 -0
  126. data/lib/principles/models/meta_principle.rb +51 -0
  127. data/lib/principles/models/missing_files.rb +85 -0
  128. data/lib/principles/models/misspelt_member_id.rb +45 -0
  129. data/lib/principles/models/open_finding.rb +221 -0
  130. data/lib/principles/models/open_findings_elsewhere.rb +45 -0
  131. data/lib/principles/models/other_principles.rb +47 -0
  132. data/lib/principles/models/placement.rb +42 -0
  133. data/lib/principles/models/plain_text_file.rb +32 -0
  134. data/lib/principles/models/principles_folder_move.rb +59 -0
  135. data/lib/principles/models/principles_package.rb +53 -0
  136. data/lib/principles/models/prior_finding_decision.rb +162 -0
  137. data/lib/principles/models/prior_finding_outcomes.rb +60 -0
  138. data/lib/principles/models/prior_findings.rb +109 -0
  139. data/lib/principles/models/problem_report.rb +110 -0
  140. data/lib/principles/models/project.rb +214 -0
  141. data/lib/principles/models/project_history.rb +203 -0
  142. data/lib/principles/models/record_judged_against.rb +42 -0
  143. data/lib/principles/models/recorded_entry.rb +93 -0
  144. data/lib/principles/models/recorded_finding.rb +97 -0
  145. data/lib/principles/models/recorded_findings.rb +58 -0
  146. data/lib/principles/models/recorded_members.rb +149 -0
  147. data/lib/principles/models/repoint.rb +112 -0
  148. data/lib/principles/models/reported_check.rb +130 -0
  149. data/lib/principles/models/request_id.rb +70 -0
  150. data/lib/principles/models/runs_from.rb +36 -0
  151. data/lib/principles/models/skill_loads.rb +123 -0
  152. data/lib/principles/models/still_holds_restatement.rb +87 -0
  153. data/lib/principles/models/text_size.rb +26 -0
  154. data/lib/principles/models/uncommitted_outside_the_map.rb +30 -0
  155. data/lib/principles/models/waits_on.rb +58 -0
  156. data/lib/principles/models/write_up_opening.rb +93 -0
  157. data/lib/principles/models/write_up_pointer.rb +50 -0
  158. data/lib/principles/models/write_up_repoint.rb +39 -0
  159. data/lib/principles/prose_list.rb +23 -0
  160. data/lib/principles/supported_ruby.rb +93 -0
  161. data/lib/principles/version.rb +11 -0
  162. data/lib/principles/views/acknowledged_since_last_audit.rb +34 -0
  163. data/lib/principles/views/acknowledgement_result.rb +44 -0
  164. data/lib/principles/views/activation_in_hand.rb +47 -0
  165. data/lib/principles/views/assessment_request.rb +131 -0
  166. data/lib/principles/views/audit_changes.rb +79 -0
  167. data/lib/principles/views/audit_commit.rb +55 -0
  168. data/lib/principles/views/audit_result.rb +147 -0
  169. data/lib/principles/views/candidate_files_result.rb +95 -0
  170. data/lib/principles/views/check_result_template.rb +75 -0
  171. data/lib/principles/views/diff_since_last_audit.rb +29 -0
  172. data/lib/principles/views/findings_result.rb +45 -0
  173. data/lib/principles/views/help.rb +119 -0
  174. data/lib/principles/views/invocation.rb +66 -0
  175. data/lib/principles/views/landed_since_base.rb +27 -0
  176. data/lib/principles/views/lines_shared_with_member.rb +111 -0
  177. data/lib/principles/views/loads_to_check_result.rb +45 -0
  178. data/lib/principles/views/map_result.rb +169 -0
  179. data/lib/principles/views/member_change_since_baseline.rb +58 -0
  180. data/lib/principles/views/member_repairs.rb +82 -0
  181. data/lib/principles/views/members_a_commit_changed.rb +66 -0
  182. data/lib/principles/views/members_with_no_baseline.rb +56 -0
  183. data/lib/principles/views/meta_principle_passage.rb +23 -0
  184. data/lib/principles/views/meta_principle_result.rb +170 -0
  185. data/lib/principles/views/open_findings_elsewhere_result.rb +32 -0
  186. data/lib/principles/views/open_findings_line.rb +125 -0
  187. data/lib/principles/views/other_principles_unjudged_result.rb +32 -0
  188. data/lib/principles/views/outside_the_map_result.rb +31 -0
  189. data/lib/principles/views/package_since_last_audit_result.rb +34 -0
  190. data/lib/principles/views/principle_read_result.rb +86 -0
  191. data/lib/principles/views/principle_with_changed_members.rb +26 -0
  192. data/lib/principles/views/principles_with_no_completed_audit.rb +30 -0
  193. data/lib/principles/views/printed_principle.rb +45 -0
  194. data/lib/principles/views/prior_finding_decisions_result.rb +35 -0
  195. data/lib/principles/views/prior_findings_result.rb +80 -0
  196. data/lib/principles/views/problem_lines.rb +84 -0
  197. data/lib/principles/views/problem_result.rb +107 -0
  198. data/lib/principles/views/prompts/acknowledge-a-change/say-whether-the-change-keeps-the-meaning.md +12 -0
  199. data/lib/principles/views/prompts/answer-any-judgement-request/what-a-self-audit-cannot-show.md +6 -0
  200. data/lib/principles/views/prompts/assess-every-member/answer-guide.json +63 -0
  201. data/lib/principles/views/prompts/assess-every-member/assess-each-member-and-the-set.md +12 -0
  202. data/lib/principles/views/prompts/assess-every-member/check-roles-other-principles-give-these-lines.md +7 -0
  203. data/lib/principles/views/prompts/assess-every-member/decide-each-member-loading.md +17 -0
  204. data/lib/principles/views/prompts/assess-every-member/decide-each-prior-finding.md +38 -0
  205. data/lib/principles/views/prompts/assess-every-member/give-problem-evidence-at-still-holds.md +2 -0
  206. data/lib/principles/views/prompts/assess-every-member/give-the-evidence-a-prior-finding-lacks.md +7 -0
  207. data/lib/principles/views/prompts/assess-every-member/have-a-changed-check-reviewed-before-running-it.md +4 -0
  208. data/lib/principles/views/prompts/assess-every-member/have-a-new-check-reviewed-before-running-it.md +3 -0
  209. data/lib/principles/views/prompts/assess-every-member/have-hidden-characters-in-a-check-explained.md +4 -0
  210. data/lib/principles/views/prompts/assess-every-member/judge-acknowledged-edits-together.md +6 -0
  211. data/lib/principles/views/prompts/assess-every-member/judge-the-keeping-against-the-other-principles.md +7 -0
  212. data/lib/principles/views/prompts/assess-every-member/judge-the-keeping-under-the-release-since-the-last-audit.md +10 -0
  213. data/lib/principles/views/prompts/assess-every-member/judge-the-set-with-carried-assessments.md +10 -0
  214. data/lib/principles/views/prompts/assess-every-member/keep-the-last-review-basis-unless-you-give-a-new-one.md +1 -0
  215. data/lib/principles/views/prompts/assess-every-member/name-another-principles-open-finding-rather-than-raise-it.md +9 -0
  216. data/lib/principles/views/prompts/assess-every-member/read-whether-each-prior-finding-s-evidence-changed.md +12 -0
  217. data/lib/principles/views/prompts/assess-every-member/run-a-named-check-at-every-full-audit.md +2 -0
  218. data/lib/principles/views/prompts/assess-every-member/run-the-check-then-report-it.md +2 -0
  219. data/lib/principles/views/prompts/assess-every-member/run-the-reviewed-check-and-say-what-its-review-rested-on.md +6 -0
  220. data/lib/principles/views/prompts/assess-every-member/uncommitted-files-outside-the-map.md +4 -0
  221. data/lib/principles/views/prompts/assess-every-member/why-each-member-is-judged-again.md +24 -0
  222. data/lib/principles/views/prompts/dispose-of-each-finding/answer-guide.json +34 -0
  223. data/lib/principles/views/prompts/dispose-of-each-finding/fix-or-record-each-finding.md +24 -0
  224. data/lib/principles/views/prompts/find-a-principle-to-map/ask-the-owner-before-mapping.md +1 -0
  225. data/lib/principles/views/prompts/find-a-principle-to-map/choose-one-principle.md +5 -0
  226. data/lib/principles/views/prompts/find-a-principle-to-map/owner-ask-ignored-folders.md +2 -0
  227. data/lib/principles/views/prompts/find-a-principle-to-map/owner-ask-ignored.md +3 -0
  228. data/lib/principles/views/prompts/find-a-principle-to-map/owner-ask-possibly-test-data.md +2 -0
  229. data/lib/principles/views/prompts/find-a-principle-to-map/owner-ask-untracked.md +2 -0
  230. data/lib/principles/views/prompts/find-a-principle-to-map/what-each-command-writes.md +4 -0
  231. data/lib/principles/views/prompts/find-a-principle-to-map/where-the-inventory-looks.md +10 -0
  232. data/lib/principles/views/prompts/learn-what-a-command-does/add-member.md +45 -0
  233. data/lib/principles/views/prompts/learn-what-a-command-does/change-activation.md +21 -0
  234. data/lib/principles/views/prompts/learn-what-a-command-does/change-description.md +2 -0
  235. data/lib/principles/views/prompts/learn-what-a-command-does/change-member-check.md +17 -0
  236. data/lib/principles/views/prompts/learn-what-a-command-does/change-member-role.md +9 -0
  237. data/lib/principles/views/prompts/learn-what-a-command-does/create-principle.md +6 -0
  238. data/lib/principles/views/prompts/learn-what-a-command-does/every-command-and-how-they-chain.md +28 -0
  239. data/lib/principles/views/prompts/learn-what-a-command-does/list-candidate-files.md +17 -0
  240. data/lib/principles/views/prompts/learn-what-a-command-does/list-member-problems.md +73 -0
  241. data/lib/principles/views/prompts/learn-what-a-command-does/list-open-findings.md +71 -0
  242. data/lib/principles/views/prompts/learn-what-a-command-does/list-principles.md +7 -0
  243. data/lib/principles/views/prompts/learn-what-a-command-does/move-member.md +11 -0
  244. data/lib/principles/views/prompts/learn-what-a-command-does/remove-member-check.md +10 -0
  245. data/lib/principles/views/prompts/learn-what-a-command-does/remove-member.md +6 -0
  246. data/lib/principles/views/prompts/learn-what-a-command-does/show-answer-check.md +16 -0
  247. data/lib/principles/views/prompts/learn-what-a-command-does/show-audit.md +20 -0
  248. data/lib/principles/views/prompts/learn-what-a-command-does/show-meta-principle-passage.md +52 -0
  249. data/lib/principles/views/prompts/learn-what-a-command-does/show-principle.md +86 -0
  250. data/lib/principles/views/prompts/learn-what-a-command-does/start-audit.md +68 -0
  251. data/lib/principles/views/prompts/learn-what-a-command-does/submit-answer.md +56 -0
  252. data/lib/principles/views/prompts/repoint-write-ups/point-each-moved-write-up-at-its-new-place.md +10 -0
  253. data/lib/principles/views/prompts/report-after-a-commit/it-refused-after-the-commits-touched-the-maps.md +2 -0
  254. data/lib/principles/views/prompts/report-after-a-commit/others-are-still-listed.md +1 -0
  255. data/lib/principles/views/prompts/report-after-a-commit/the-commits-changed-these-members.md +2 -0
  256. data/lib/principles/views/prompts/report-after-a-commit/this-command-shows-each-one.md +1 -0
  257. data/lib/principles/views/prompts/report-the-completed-audit/commit-only-what-the-audit-changed.md +2 -0
  258. data/lib/principles/views/prompts/report-the-completed-audit/replace-the-default-commit-message.md +4 -0
  259. data/lib/principles/views/prompts/report-the-completed-audit/what-completion-means.md +2 -0
  260. data/lib/principles/views/prompts/set-principles-up/entry-file-passage.md +3 -0
  261. data/lib/principles/views/prompts/set-principles-up/name-the-step-each-member-lacks.md +15 -0
  262. data/lib/principles/views/prompts/set-principles-up/place-the-passage-with-the-user.md +31 -0
  263. data/lib/principles/views/prompts/set-principles-up/set-up-first.md +2 -0
  264. data/lib/principles/views/prompts/set-principles-up/what-the-passage-presumes.md +4 -0
  265. data/lib/principles/views/prompts/start-a-session/act-on-the-open-findings.md +5 -0
  266. data/lib/principles/views/prompts/start-a-session/it-returns-after-each-clear-or-compaction-too.md +1 -0
  267. data/lib/principles/views/prompts/start-a-session/it-returns-at-each-session-start.md +1 -0
  268. data/lib/principles/views/prompts/start-a-session/raise-them-at-the-next-pause.md +1 -0
  269. data/lib/principles/views/prompts/start-a-session/raise-them-before-the-first-task.md +1 -0
  270. data/lib/principles/views/prompts.rb +71 -0
  271. data/lib/principles/views/repoint_result.rb +80 -0
  272. data/lib/principles/views/request_part.rb +26 -0
  273. data/lib/principles/views/request_parts.rb +26 -0
  274. data/lib/principles/views/shell_word.rb +29 -0
  275. data/lib/principles/views/visible_text.rb +26 -0
  276. data/lib/principles/views/workflow_diagram.rb +77 -0
  277. data/lib/principles.rb +5 -0
  278. metadata +326 -0
@@ -0,0 +1,332 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "assessment-answer.schema.json",
4
+ "title": "Assessment answer",
5
+ "description": "What an agent answers an audit's assessment request with: the request's id and basis, an assessment of each member and of the set, a recent decision, and any findings. Fields this tool does not read are refused, to catch a misspelt field (D29). The rules across fields, such as which members exist, stay in Models::AssessmentAnswer.",
6
+ "type": "object",
7
+ "additionalProperties": false,
8
+ "required": [
9
+ "request_id",
10
+ "basis",
11
+ "member_assessments",
12
+ "collective_assessment",
13
+ "recent_decision",
14
+ "findings"
15
+ ],
16
+ "properties": {
17
+ "request_id": {
18
+ "type": "string"
19
+ },
20
+ "basis": {
21
+ "type": "object",
22
+ "additionalProperties": false,
23
+ "required": [
24
+ "base_commit",
25
+ "last_completed_revision"
26
+ ],
27
+ "properties": {
28
+ "base_commit": {
29
+ "type": [
30
+ "string",
31
+ "null"
32
+ ],
33
+ "pattern": "\\A[0-9a-f]{40}([0-9a-f]{24})?\\z",
34
+ "description": "A full commit sha, as start-audit gave it, or null outside git. This tool refuses anything else before running git."
35
+ },
36
+ "last_completed_revision": {
37
+ "type": [
38
+ "string",
39
+ "null"
40
+ ],
41
+ "description": "The revision of the principle's last completed audit record when start-audit printed the request, or null when there was none. The request id binds it."
42
+ }
43
+ }
44
+ },
45
+ "member_assessments": {
46
+ "type": "array",
47
+ "items": {
48
+ "type": "object",
49
+ "additionalProperties": false,
50
+ "required": [
51
+ "member_id"
52
+ ],
53
+ "description": "A fresh assessment, with assessment, delivery and evidence, or the marker carried_forward: true for a member the request carries forward (D49). Models::MemberAssessments refuses an entry that is neither.",
54
+ "properties": {
55
+ "member_id": {
56
+ "type": "string"
57
+ },
58
+ "carried_forward": {
59
+ "const": true
60
+ },
61
+ "assessment": {
62
+ "type": "string"
63
+ },
64
+ "delivery": {
65
+ "type": "string",
66
+ "description": "observed or not_observed; Models::AssessmentAnswer refuses any other with invalid_delivery."
67
+ },
68
+ "observation": {
69
+ "type": "string"
70
+ },
71
+ "observed_at": {
72
+ "type": ["string", "null"],
73
+ "minLength": 1,
74
+ "description": "On an observed delivery only, when the agent saw what observation describes, if that was before this audit; omitted or null, it is this audit's time, so the agent never types a clock time (#716). Models::MemberSighting refuses it on not_observed, one not a UTC time to the second as audited_at is, such as 2026-11-01T09:30:00Z, and one after the answer (#699), and refuses an observation repeated word for word from the last full audit as observation_repeats_last_audit unless it is that audit's date or null (#680, #716)."
75
+ },
76
+ "evidence": {
77
+ "type": "array",
78
+ "items": {
79
+ "type": "object",
80
+ "required": [
81
+ "path"
82
+ ],
83
+ "additionalProperties": false,
84
+ "properties": {
85
+ "path": {
86
+ "type": "string"
87
+ },
88
+ "heading": {
89
+ "type": "string"
90
+ },
91
+ "starting_at": {
92
+ "type": "string"
93
+ },
94
+ "ending_at": {
95
+ "type": "string"
96
+ },
97
+ "query": {
98
+ "type": "string"
99
+ }
100
+ }
101
+ }
102
+ },
103
+ "check_result": {
104
+ "type": "object",
105
+ "additionalProperties": false,
106
+ "required": [
107
+ "command"
108
+ ],
109
+ "description": "A member check's result as the agent reports it: the command, exactly as the map names it, its exit_status or, when it could not be run, not_run_reason, and review_basis, one line saying what the review before the run rested on, which an exit_status for a check the stored record did not run needs (D63). Models::AssessmentAnswer refuses any other combination with invalid_check_result.",
110
+ "properties": {
111
+ "command": {
112
+ "type": "string"
113
+ },
114
+ "exit_status": {
115
+ "type": "integer"
116
+ },
117
+ "not_run_reason": {
118
+ "type": "string"
119
+ },
120
+ "review_basis": {
121
+ "type": "string"
122
+ }
123
+ }
124
+ }
125
+ }
126
+ }
127
+ },
128
+ "collective_assessment": {
129
+ "type": "string"
130
+ },
131
+ "recent_decision": {
132
+ "type": "object",
133
+ "additionalProperties": false,
134
+ "properties": {
135
+ "unavailable_reason": {
136
+ "type": "string"
137
+ },
138
+ "assessment": {
139
+ "type": "string"
140
+ },
141
+ "evidence": {
142
+ "type": "array",
143
+ "items": {
144
+ "type": "object",
145
+ "required": [
146
+ "path"
147
+ ],
148
+ "additionalProperties": false,
149
+ "properties": {
150
+ "path": {
151
+ "type": "string"
152
+ },
153
+ "heading": {
154
+ "type": "string"
155
+ },
156
+ "starting_at": {
157
+ "type": "string"
158
+ },
159
+ "ending_at": {
160
+ "type": "string"
161
+ },
162
+ "query": {
163
+ "type": "string"
164
+ }
165
+ }
166
+ }
167
+ }
168
+ }
169
+ },
170
+ "loading_decisions": {
171
+ "description": "One decision for each member the request lists in loads_to_check_against_activation (#355). Which decision each needs, and its reason, is checked by Models::LoadsToCheck.",
172
+ "type": "array",
173
+ "items": {
174
+ "type": "object",
175
+ "additionalProperties": false,
176
+ "required": ["member_id", "decision"],
177
+ "properties": {
178
+ "member_id": { "type": "string" },
179
+ "decision": { "type": ["string", "null"] },
180
+ "reason": { "type": "string" },
181
+ "as": { "type": "string" }
182
+ }
183
+ }
184
+ },
185
+ "prior_finding_decisions": {
186
+ "description": "One decision for each finding the request lists in prior_findings (D35). Which decision each needs, and its reason, is checked by Models::PriorFindings.",
187
+ "type": "array",
188
+ "items": {
189
+ "type": "object",
190
+ "additionalProperties": false,
191
+ "required": ["finding_id", "decision"],
192
+ "properties": {
193
+ "finding_id": { "type": "string" },
194
+ "decision": { "type": ["string", "null"] },
195
+ "reason": { "type": "string" },
196
+ "as": { "type": "string" },
197
+ "problem": { "type": "string" },
198
+ "action": { "type": "string" },
199
+ "first_raised_at": {
200
+ "type": "string",
201
+ "description": "On a still_holds decision, an earlier time the finding was first raised: the audited_at of the record that raised_in holds, which Models::FirstRaisedClaim checks (D53)."
202
+ },
203
+ "raised_in": {
204
+ "type": "string",
205
+ "pattern": "^[0-9a-f]{40}([0-9a-f]{24})?$",
206
+ "description": "The full sha of the commit whose audit record, at .principles/audits/ID.json or the earlier .memeplex/audits/ID.json, left this finding open at first_raised_at (D53)."
207
+ },
208
+ "waits_on": {
209
+ "type": ["string", "null"],
210
+ "description": "On a still_holds decision that leaves the finding deferred, a new one line saying whom it waits on and to decide what; null drops the one it carried. Leaving it out keeps it (D52)."
211
+ },
212
+ "recorded_at": {
213
+ "x-type-refusal-advice": {
214
+ "keys": [
215
+ "heading",
216
+ "starting_at"
217
+ ],
218
+ "says": "plus starting_at (or heading) when the file holds more than this finding"
219
+ },
220
+ "type": ["object", "null"],
221
+ "required": ["path"],
222
+ "additionalProperties": false,
223
+ "properties": {
224
+ "path": { "type": "string" },
225
+ "heading": { "type": "string" },
226
+ "starting_at": { "type": "string" },
227
+ "ending_at": { "type": "string" },
228
+ "query": { "type": "string" }
229
+ }
230
+ },
231
+ "evidence": {
232
+ "type": "array",
233
+ "items": {
234
+ "type": "object",
235
+ "required": ["path"],
236
+ "additionalProperties": false,
237
+ "properties": {
238
+ "path": { "type": "string" },
239
+ "heading": { "type": "string" },
240
+ "starting_at": { "type": "string" },
241
+ "ending_at": { "type": "string" },
242
+ "query": { "type": "string" }
243
+ }
244
+ }
245
+ },
246
+ "problem_evidence": {
247
+ "description": "On a still_holds decision, pointers to where the problem is: for a finding marked evidence_not_kept, its evidence, which the record keeps (D64); for one whose record keeps evidence, each the new place of the kept item named by replaces, its position in the finding's evidence, which must no longer be found (D70). Models::StillHoldsRestatement refuses any other.",
248
+ "type": "array",
249
+ "items": {
250
+ "type": "object",
251
+ "required": ["path"],
252
+ "additionalProperties": false,
253
+ "properties": {
254
+ "path": { "type": "string" },
255
+ "heading": { "type": "string" },
256
+ "starting_at": { "type": "string" },
257
+ "ending_at": { "type": "string" },
258
+ "query": { "type": "string" },
259
+ "replaces": { "type": "integer" }
260
+ }
261
+ }
262
+ }
263
+ }
264
+ }
265
+ },
266
+ "findings": {
267
+ "type": "array",
268
+ "items": {
269
+ "type": "object",
270
+ "additionalProperties": false,
271
+ "x-unread-field-advice": {
272
+ "recorded_at": "give it in this finding's disposition, in the correction answer this assessment leads to"
273
+ },
274
+ "required": [
275
+ "id",
276
+ "member_ids",
277
+ "problem",
278
+ "consequence",
279
+ "proposed_action",
280
+ "evidence"
281
+ ],
282
+ "properties": {
283
+ "id": {
284
+ "type": "string"
285
+ },
286
+ "member_ids": {
287
+ "type": "array",
288
+ "items": {
289
+ "type": "string"
290
+ }
291
+ },
292
+ "problem": {
293
+ "type": "string"
294
+ },
295
+ "consequence": {
296
+ "type": "string"
297
+ },
298
+ "proposed_action": {
299
+ "type": "string"
300
+ },
301
+ "evidence": {
302
+ "type": "array",
303
+ "items": {
304
+ "type": "object",
305
+ "required": [
306
+ "path"
307
+ ],
308
+ "additionalProperties": false,
309
+ "properties": {
310
+ "path": {
311
+ "type": "string"
312
+ },
313
+ "heading": {
314
+ "type": "string"
315
+ },
316
+ "starting_at": {
317
+ "type": "string"
318
+ },
319
+ "ending_at": {
320
+ "type": "string"
321
+ },
322
+ "query": {
323
+ "type": "string"
324
+ }
325
+ }
326
+ }
327
+ }
328
+ }
329
+ }
330
+ }
331
+ }
332
+ }
@@ -0,0 +1,277 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "audit-record.schema.json",
4
+ "title": "Audit record",
5
+ "description": "A principle's committed audit record, .principles/audits/ID.json: what the last audit began from, each member's hash when it was assessed, and each finding's outcome. Fields this schema does not name are allowed, so an older version can read a record a newer one wrote (D29).",
6
+ "type": "object",
7
+ "required": ["principle_id", "status", "map_version", "base_commit", "audited_at", "members", "findings"],
8
+ "properties": {
9
+ "principle_id": { "type": "string", "minLength": 1 },
10
+ "status": { "enum": ["open", "completed"] },
11
+ "map_version": { "type": "string", "minLength": 1 },
12
+ "base_commit": { "type": ["string", "null"] },
13
+ "audited_at": { "type": "string", "minLength": 1 },
14
+ "members": {
15
+ "type": "object",
16
+ "additionalProperties": {
17
+ "type": "object",
18
+ "required": ["sha256"],
19
+ "properties": {
20
+ "sha256": { "type": "string", "minLength": 1 },
21
+ "key": { "type": "string", "minLength": 1, "description": "The member's key in the map, when it differs from the id this entry is filed under, because the member has moved." },
22
+ "assessment": {
23
+ "description": "The member's assessment as a full audit's agent gave it, which the next full audit may carry forward while the member and what it was judged on are unchanged (D49).",
24
+ "type": "object",
25
+ "required": ["assessment", "delivery", "evidence", "evidence_sha256", "assessed_at", "entry_sha256", "loads_sha256"],
26
+ "properties": {
27
+ "assessment": { "type": "string", "minLength": 1 },
28
+ "delivery": { "type": "string", "minLength": 1 },
29
+ "observation": { "type": "string" },
30
+ "observed_at": { "type": "string", "minLength": 1, "description": "On an observed delivery, when the sighting its observation describes was: the time the agent gave, or else when the assessment was made. Carrying it forward keeps this; a record written before it was kept has none (#680)." },
31
+ "evidence": {
32
+ "type": "array",
33
+ "items": {
34
+ "type": "object",
35
+ "required": ["path"],
36
+ "properties": {
37
+ "path": { "type": "string", "minLength": 1 },
38
+ "heading": { "type": "string" },
39
+ "starting_at": { "type": "string" },
40
+ "ending_at": { "type": "string" },
41
+ "query": { "type": "string" }
42
+ }
43
+ }
44
+ },
45
+ "evidence_sha256": { "type": "array", "items": { "type": "string", "minLength": 1 }, "description": "The hash of each evidence item's text when it was assessed, in the same order." },
46
+ "assessed_at": { "type": "string", "minLength": 1, "description": "When the assessment was made; carrying it forward keeps this." },
47
+ "entry_sha256": { "type": "string", "minLength": 1, "description": "A digest of the member's map entry when it was assessed: its path, locator, role and check." },
48
+ "loads_sha256": { "type": "string", "minLength": 1, "description": "A digest of when the member loaded when it was assessed, without file sizes." }
49
+ }
50
+ },
51
+ "changed_during_last_audit": { "const": true, "description": "The member changed during this audit, as a fix in its correction changes it, so no assessment read the text recorded here and none is kept." },
52
+ "check_result": {
53
+ "description": "The result the agent reported for the member's check, as of base_commit. This tool never ran it (D30).",
54
+ "type": "object",
55
+ "required": ["command"],
56
+ "properties": {
57
+ "command": { "type": "string", "minLength": 1 },
58
+ "exit_status": { "type": "integer" },
59
+ "not_run_reason": { "type": "string", "minLength": 1 },
60
+ "review_basis": { "type": "string", "minLength": 1 },
61
+ "review_basis_since": { "type": "string", "minLength": 1, "description": "When an earlier audit first kept this review_basis, carried while the check and the line are unchanged. Absent means this record's audited_at; only principles writes it (D63, D52)." }
62
+ }
63
+ },
64
+ "loading_accepted": {
65
+ "description": "The agent's accepted decision that the member loads as it does under the principle's activation, with its reason and the loads it accepted (#355).",
66
+ "type": "object",
67
+ "required": ["reason", "loads"],
68
+ "properties": {
69
+ "reason": { "type": "string", "minLength": 1 },
70
+ "loads": {
71
+ "type": "object",
72
+ "description": "When each host loads the member's file and how big it is, as show-principle derived it at the assessment. Each field is named, so show-audit prints it back.",
73
+ "properties": {
74
+ "claude_code": {
75
+ "type": "object",
76
+ "properties": {
77
+ "when": {
78
+ "type": "string"
79
+ },
80
+ "file_bytes": {
81
+ "type": "integer"
82
+ },
83
+ "estimated_tokens": {
84
+ "type": "integer"
85
+ },
86
+ "member_bytes": {
87
+ "type": "integer"
88
+ },
89
+ "member_tokens": {
90
+ "type": "integer"
91
+ },
92
+ "context": {
93
+ "type": "string"
94
+ },
95
+ "skill_part": {
96
+ "type": "string"
97
+ },
98
+ "invoked_by": {
99
+ "type": "string"
100
+ },
101
+ "description": {
102
+ "type": "object",
103
+ "properties": {
104
+ "files": {
105
+ "type": "array",
106
+ "items": {
107
+ "type": "string"
108
+ }
109
+ },
110
+ "paths_field": {
111
+ "type": "array",
112
+ "items": {
113
+ "type": "string"
114
+ }
115
+ },
116
+ "when": {
117
+ "type": "string"
118
+ },
119
+ "file_bytes": {
120
+ "type": "integer"
121
+ },
122
+ "estimated_tokens": {
123
+ "type": "integer"
124
+ },
125
+ "member_bytes": {
126
+ "type": "integer"
127
+ },
128
+ "member_tokens": {
129
+ "type": "integer"
130
+ },
131
+ "not_derived": {
132
+ "type": "string"
133
+ }
134
+ }
135
+ },
136
+ "files": {
137
+ "type": "array",
138
+ "items": {
139
+ "type": "string"
140
+ }
141
+ },
142
+ "paths_field": {
143
+ "type": "array",
144
+ "items": {
145
+ "type": "string"
146
+ }
147
+ },
148
+ "not_derived": {
149
+ "type": "string"
150
+ },
151
+ "frontmatter_refused": {
152
+ "type": "string"
153
+ },
154
+ "named_in_hooks": {
155
+ "type": "array",
156
+ "items": {
157
+ "type": "object",
158
+ "properties": {
159
+ "settings": {
160
+ "type": "string"
161
+ },
162
+ "event": {
163
+ "type": "string"
164
+ },
165
+ "matcher": {
166
+ "type": "string"
167
+ },
168
+ "command": {
169
+ "type": "string"
170
+ },
171
+ "args": {
172
+ "type": "array",
173
+ "items": {
174
+ "type": "string"
175
+ }
176
+ }
177
+ }
178
+ }
179
+ }
180
+ }
181
+ }
182
+ }
183
+ }
184
+ }
185
+ },
186
+ "acknowledgements": {
187
+ "description": "Changes a one-member audit judged to keep the member's meaning since the last full audit, oldest first (D33).",
188
+ "type": "array",
189
+ "items": {
190
+ "type": "object",
191
+ "required": ["from_sha256", "to_sha256", "commit", "reason", "acknowledged_at"],
192
+ "properties": {
193
+ "from_sha256": { "type": "string", "minLength": 1 },
194
+ "to_sha256": { "type": "string", "minLength": 1 },
195
+ "commit": { "type": "string", "minLength": 1 },
196
+ "reason": { "type": "string", "minLength": 1 },
197
+ "acknowledged_at": { "type": "string", "minLength": 1 },
198
+ "deferred_findings": { "type": "array", "items": { "type": "string", "minLength": 1 } },
199
+ "accepted_findings": { "type": "array", "items": { "type": "string", "minLength": 1 } }
200
+ }
201
+ }
202
+ }
203
+ }
204
+ }
205
+ },
206
+ "judged_against": { "type": "string", "minLength": 1, "description": "A digest of the principle's description and the question this tool asked, which every assessment in the record answered (D49)." },
207
+ "principles_package": {
208
+ "description": "On the sticking-to-your-principles record only: the version of principles its audit ran under, and a digest of the passage that version proposes for setup, as printed, by key: entry_file_passage, or, in a record a release before D71 wrote, one key for each passage form it proposed, which its next full audit compares with the version running then (D68).",
209
+ "type": "object",
210
+ "required": ["version", "passage_sha256"],
211
+ "properties": {
212
+ "version": { "type": "string", "minLength": 1 },
213
+ "passage_sha256": { "type": "object", "additionalProperties": { "type": "string", "pattern": "^[0-9a-f]{64}$" } }
214
+ }
215
+ },
216
+ "base_members": { "type": "object", "additionalProperties": { "type": "string", "minLength": 1 } },
217
+ "last_completed": { "type": "object", "required": ["principle_id", "status", "audited_at", "members", "findings"] },
218
+ "findings": {
219
+ "type": "array",
220
+ "items": {
221
+ "type": "object",
222
+ "required": ["id", "member_ids"],
223
+ "properties": {
224
+ "id": { "type": "string", "minLength": 1 },
225
+ "member_ids": { "type": "array", "items": { "type": "string" } },
226
+ "problem": { "type": "string", "description": "The finding's problem as the assessment stated it, at audit time (D34)." },
227
+ "evidence": {
228
+ "type": "array",
229
+ "description": "The evidence the assessment raised the finding with, as the answer located it (D64). Absent from a finding recorded before it was kept.",
230
+ "items": {
231
+ "type": "object",
232
+ "required": ["path"],
233
+ "additionalProperties": false,
234
+ "properties": {
235
+ "path": { "type": "string" },
236
+ "heading": { "type": "string" },
237
+ "starting_at": { "type": "string" },
238
+ "ending_at": { "type": "string" },
239
+ "query": { "type": "string" }
240
+ }
241
+ }
242
+ },
243
+ "first_raised_at": { "type": "string", "minLength": 1, "description": "When an earlier audit first raised this finding, kept or raised again since (D35). Absent means this record's audited_at." },
244
+ "raised_in": { "type": "string", "minLength": 1, "description": "The commit whose record a full audit cited for an earlier first_raised_at, checked to leave this finding open then (D53)." },
245
+ "action": { "type": "string", "minLength": 1 },
246
+ "waits_on": { "type": "string", "minLength": 1, "description": "On a deferred finding, the one line its answer gave saying whom it waits on and to decide what (D52)." },
247
+ "waits_on_since": { "type": "string", "minLength": 1, "description": "When an earlier audit asked waits_on, carried since. Absent means this record's audited_at; only principles writes it (D52)." },
248
+ "recorded_at": {
249
+ "type": "object",
250
+ "required": ["path"],
251
+ "properties": {
252
+ "path": { "type": "string", "minLength": 1 },
253
+ "heading": { "type": "string" },
254
+ "starting_at": { "type": "string" },
255
+ "ending_at": { "type": "string" },
256
+ "query": { "type": "string" }
257
+ }
258
+ },
259
+ "repointed": {
260
+ "type": "array",
261
+ "description": "Each repoint of recorded_at since the full audit that kept this finding: where it pointed, where it points, when and why (D59). Only principles writes it.",
262
+ "items": {
263
+ "type": "object",
264
+ "required": ["from", "to", "at", "reason"],
265
+ "properties": {
266
+ "from": { "type": ["object", "null"] },
267
+ "to": { "type": "object" },
268
+ "at": { "type": "string", "minLength": 1 },
269
+ "reason": { "type": "string" }
270
+ }
271
+ }
272
+ }
273
+ }
274
+ }
275
+ }
276
+ }
277
+ }