principles 0.0.7 → 0.0.8

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 (331) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +383 -0
  3. data/LICENSE +202 -0
  4. data/NOTICE +4 -0
  5. data/README.md +111 -0
  6. data/exe/principles +20 -0
  7. data/lib/principles/after_commit_hook_options.rb +2 -2
  8. data/lib/principles/cli.rb +50 -42
  9. data/lib/principles/command_line.rb +22 -16
  10. data/lib/principles/command_routes.rb +20 -6
  11. data/lib/principles/controllers/acknowledgement.rb +29 -74
  12. data/lib/principles/controllers/acknowledgements.rb +154 -0
  13. data/lib/principles/controllers/after_commit_report.rb +44 -0
  14. data/lib/principles/controllers/answer.rb +48 -18
  15. data/lib/principles/controllers/answer_phase.rb +20 -3
  16. data/lib/principles/controllers/assessment.rb +32 -11
  17. data/lib/principles/controllers/audit.rb +43 -19
  18. data/lib/principles/controllers/audit_completion.rb +21 -12
  19. data/lib/principles/controllers/command.rb +13 -12
  20. data/lib/principles/controllers/correction.rb +15 -7
  21. data/lib/principles/controllers/first_audit_brief.rb +40 -0
  22. data/lib/principles/controllers/full_audit_request.rb +41 -82
  23. data/lib/principles/controllers/hook_setup.rb +49 -0
  24. data/lib/principles/controllers/inventory.rb +10 -8
  25. data/lib/principles/controllers/mapping.rb +2 -2
  26. data/lib/principles/controllers/member_acknowledgement.rb +32 -21
  27. data/lib/principles/controllers/member_entries.rb +4 -4
  28. data/lib/principles/controllers/member_problems_report.rb +62 -16
  29. data/lib/principles/controllers/members_a_commit_changed.rb +3 -3
  30. data/lib/principles/controllers/members_to_assess.rb +23 -20
  31. data/lib/principles/controllers/meta_principle_setup.rb +5 -6
  32. data/lib/principles/controllers/open_correction.rb +42 -0
  33. data/lib/principles/controllers/parts_to_read.rb +117 -0
  34. data/lib/principles/controllers/repoint.rb +1 -1
  35. data/lib/principles/controllers/running_tool.rb +56 -6
  36. data/lib/principles/controllers/session_start_report.rb +62 -0
  37. data/lib/principles/controllers/survey.rb +2 -2
  38. data/lib/principles/data/audit_files.rb +7 -7
  39. data/lib/principles/data/bounded_file.rb +1 -1
  40. data/lib/principles/data/candidate_files_found.rb +6 -3
  41. data/lib/principles/data/command-steps.json +61 -6
  42. data/lib/principles/data/expected_type.rb +3 -3
  43. data/lib/principles/data/first_parent_log.rb +1 -1
  44. data/lib/principles/data/head_reflog.rb +74 -0
  45. data/lib/principles/data/hook_input.rb +59 -0
  46. data/lib/principles/data/ignored_by_git.rb +2 -2
  47. data/lib/principles/data/known_fields.rb +1 -1
  48. data/lib/principles/data/linked_path.rb +1 -1
  49. data/lib/principles/data/map_files.rb +2 -2
  50. data/lib/principles/data/principles_on_path.rb +83 -0
  51. data/lib/principles/data/principles_subfolder.rb +1 -1
  52. data/lib/principles/data/project_files.rb +10 -3
  53. data/lib/principles/data/repository.rb +14 -7
  54. data/lib/principles/data/running_version.rb +10 -8
  55. data/lib/principles/data/schema_check.rb +5 -5
  56. data/lib/principles/data/schemas/acknowledgement-answer.schema.json +86 -21
  57. data/lib/principles/data/schemas/acknowledgements-answer.schema.json +9 -2
  58. data/lib/principles/data/schemas/assessment-answer.schema.json +43 -22
  59. data/lib/principles/data/schemas/audit-record.schema.json +29 -20
  60. data/lib/principles/data/schemas/command-steps.schema.json +1 -1
  61. data/lib/principles/data/schemas/correction-answer-guide.schema.json +1 -1
  62. data/lib/principles/data/schemas/correction-answer.schema.json +9 -9
  63. data/lib/principles/data/schemas/member-map.schema.json +3 -3
  64. data/lib/principles/data/schemas/repointing-answer.schema.json +1 -1
  65. data/lib/principles/error.rb +4 -4
  66. data/lib/principles/failure_refusal.rb +57 -0
  67. data/lib/principles/invocation_options.rb +4 -4
  68. data/lib/principles/launch.rb +49 -0
  69. data/lib/principles/list_open_findings_options.rb +1 -1
  70. data/lib/principles/models/accepted_loading.rb +2 -2
  71. data/lib/principles/models/acknowledged_check.rb +23 -11
  72. data/lib/principles/models/acknowledgement.rb +34 -18
  73. data/lib/principles/models/acknowledgement_left_as_printed.rb +7 -15
  74. data/lib/principles/models/acknowledgement_refusal.rb +25 -10
  75. data/lib/principles/models/acknowledgements.rb +45 -29
  76. data/lib/principles/models/acknowledgements_across.rb +68 -0
  77. data/lib/principles/models/activation.rb +2 -2
  78. data/lib/principles/models/after_commit_input.rb +115 -0
  79. data/lib/principles/models/agent_loads.rb +1 -1
  80. data/lib/principles/models/answer_fields.rb +2 -2
  81. data/lib/principles/models/answer_place.rb +3 -3
  82. data/lib/principles/models/answer_text.rb +2 -2
  83. data/lib/principles/models/answered_time.rb +4 -4
  84. data/lib/principles/models/assessment_answer.rb +10 -10
  85. data/lib/principles/models/assessment_basis.rb +2 -2
  86. data/lib/principles/models/assessment_left_as_printed.rb +1 -1
  87. data/lib/principles/models/assessment_report.rb +6 -7
  88. data/lib/principles/models/audit.rb +33 -34
  89. data/lib/principles/models/audit_record.rb +54 -28
  90. data/lib/principles/models/audit_records.rb +13 -13
  91. data/lib/principles/models/audit_start.rb +3 -3
  92. data/lib/principles/models/audited_member_lines.rb +1 -1
  93. data/lib/principles/models/candidate_files.rb +18 -10
  94. data/lib/principles/models/candidate_inventory.rb +6 -6
  95. data/lib/principles/models/candidate_outline.rb +9 -9
  96. data/lib/principles/models/carried_assessments.rb +18 -3
  97. data/lib/principles/models/carried_member.rb +5 -5
  98. data/lib/principles/models/changed_regions.rb +92 -0
  99. data/lib/principles/models/check_result_guide.rb +50 -0
  100. data/lib/principles/models/check_since_last_audit.rb +5 -4
  101. data/lib/principles/models/cited_files.rb +4 -4
  102. data/lib/principles/models/command_steps.rb +3 -3
  103. data/lib/principles/models/commits_brought_in.rb +1 -1
  104. data/lib/principles/models/commits_since_base.rb +1 -1
  105. data/lib/principles/models/correction_answer.rb +2 -2
  106. data/lib/principles/models/correction_basis.rb +7 -7
  107. data/lib/principles/models/dated_line.rb +1 -2
  108. data/lib/principles/models/decided_prior_findings.rb +6 -6
  109. data/lib/principles/models/declared_map_changes.rb +5 -5
  110. data/lib/principles/models/disposition.rb +21 -21
  111. data/lib/principles/models/entry_file.rb +1 -1
  112. data/lib/principles/models/entry_files.rb +1 -1
  113. data/lib/principles/models/evidence_item.rb +1 -1
  114. data/lib/principles/models/evidence_lines_since.rb +2 -2
  115. data/lib/principles/models/evidence_replacements.rb +3 -3
  116. data/lib/principles/models/finding_write_ups.rb +12 -5
  117. data/lib/principles/models/findings_left_open.rb +4 -4
  118. data/lib/principles/models/first_full_audit.rb +32 -0
  119. data/lib/principles/models/first_raised_claim.rb +1 -1
  120. data/lib/principles/models/fix_only_fields.rb +1 -1
  121. data/lib/principles/models/head_moves.rb +66 -0
  122. data/lib/principles/models/hook_commands.rb +49 -4
  123. data/lib/principles/models/ignored_candidates.rb +1 -1
  124. data/lib/principles/models/instruction_named.rb +2 -3
  125. data/lib/principles/models/json_digest.rb +2 -2
  126. data/lib/principles/models/json_path_query.rb +1 -1
  127. data/lib/principles/models/kept_prior_finding.rb +9 -9
  128. data/lib/principles/models/last_completed_revision.rb +4 -5
  129. data/lib/principles/models/left_as_printed.rb +2 -2
  130. data/lib/principles/models/line_diff.rb +113 -0
  131. data/lib/principles/models/line_span.rb +1 -1
  132. data/lib/principles/models/list_member_problems_check.rb +4 -4
  133. data/lib/principles/models/listed_members.rb +7 -9
  134. data/lib/principles/models/loaded_files.rb +4 -5
  135. data/lib/principles/models/loading_decision.rb +3 -3
  136. data/lib/principles/models/loading_facts.rb +1 -1
  137. data/lib/principles/models/loads_to_check.rb +1 -1
  138. data/lib/principles/models/located_text.rb +1 -1
  139. data/lib/principles/models/mapped_principles.rb +2 -2
  140. data/lib/principles/models/member.rb +31 -4
  141. data/lib/principles/models/member_assessments.rb +8 -8
  142. data/lib/principles/models/member_elsewhere.rb +4 -4
  143. data/lib/principles/models/member_file.rb +4 -4
  144. data/lib/principles/models/member_grounds.rb +1 -1
  145. data/lib/principles/models/member_hashes_as_written.rb +1 -1
  146. data/lib/principles/models/member_lines.rb +29 -61
  147. data/lib/principles/models/member_loads.rb +2 -2
  148. data/lib/principles/models/member_moves.rb +1 -1
  149. data/lib/principles/models/member_problems.rb +14 -15
  150. data/lib/principles/models/member_repair_moves.rb +15 -9
  151. data/lib/principles/models/member_sighting.rb +10 -10
  152. data/lib/principles/models/member_snapshots.rb +1 -1
  153. data/lib/principles/models/member_state.rb +1 -1
  154. data/lib/principles/models/members_across_principles.rb +77 -0
  155. data/lib/principles/models/members_elsewhere.rb +2 -2
  156. data/lib/principles/models/members_sharing_lines.rb +7 -7
  157. data/lib/principles/models/meta_principle.rb +11 -4
  158. data/lib/principles/models/missing_files.rb +3 -3
  159. data/lib/principles/models/new_findings.rb +4 -4
  160. data/lib/principles/models/open_correction.rb +57 -0
  161. data/lib/principles/models/open_finding.rb +36 -31
  162. data/lib/principles/models/open_findings_elsewhere.rb +2 -2
  163. data/lib/principles/models/other_principles.rb +2 -2
  164. data/lib/principles/models/other_templates_placeholders.rb +17 -16
  165. data/lib/principles/models/outline_budget.rb +7 -7
  166. data/lib/principles/models/outline_group.rb +1 -1
  167. data/lib/principles/models/outline_section.rb +2 -2
  168. data/lib/principles/models/part_named.rb +41 -0
  169. data/lib/principles/models/placement.rb +2 -2
  170. data/lib/principles/models/principle.rb +13 -13
  171. data/lib/principles/models/principle_history.rb +8 -8
  172. data/lib/principles/models/principle_members.rb +14 -7
  173. data/lib/principles/models/principles_folder_move.rb +1 -1
  174. data/lib/principles/models/principles_on_path.rb +29 -0
  175. data/lib/principles/models/principles_package.rb +3 -3
  176. data/lib/principles/models/prior_decision_fields.rb +8 -8
  177. data/lib/principles/models/prior_finding_decision.rb +8 -8
  178. data/lib/principles/models/prior_finding_outcomes.rb +1 -1
  179. data/lib/principles/models/prior_findings.rb +5 -5
  180. data/lib/principles/models/problem_report.rb +26 -8
  181. data/lib/principles/models/project.rb +27 -19
  182. data/lib/principles/models/project_history.rb +18 -12
  183. data/lib/principles/models/quoted_change.rb +8 -8
  184. data/lib/principles/models/recent_decision.rb +3 -3
  185. data/lib/principles/models/record_format.rb +16 -10
  186. data/lib/principles/models/record_judged_against.rb +4 -4
  187. data/lib/principles/models/recorded_entry.rb +17 -8
  188. data/lib/principles/models/recorded_finding.rb +9 -9
  189. data/lib/principles/models/recorded_findings.rb +2 -2
  190. data/lib/principles/models/recorded_hashes.rb +2 -2
  191. data/lib/principles/models/recorded_members.rb +13 -13
  192. data/lib/principles/models/refusal_before_shape.rb +2 -2
  193. data/lib/principles/models/repoint.rb +3 -3
  194. data/lib/principles/models/report_hooks.rb +69 -0
  195. data/lib/principles/models/reported_check.rb +34 -31
  196. data/lib/principles/models/request_id.rb +18 -6
  197. data/lib/principles/models/runs_from.rb +7 -2
  198. data/lib/principles/models/sent_answer.rb +14 -12
  199. data/lib/principles/models/sent_prior_decisions.rb +1 -1
  200. data/lib/principles/models/session_start_input.rb +37 -0
  201. data/lib/principles/models/shape_problems_beside.rb +1 -1
  202. data/lib/principles/models/skill_loads.rb +1 -1
  203. data/lib/principles/models/stale_request.rb +59 -0
  204. data/lib/principles/models/still_holds_restatement.rb +6 -6
  205. data/lib/principles/models/submitted_answer.rb +1 -1
  206. data/lib/principles/models/template_placeholders.rb +6 -6
  207. data/lib/principles/models/text_within.rb +1 -1
  208. data/lib/principles/models/tracked_paths.rb +38 -0
  209. data/lib/principles/models/unchecked_members.rb +2 -2
  210. data/lib/principles/models/uncommitted_files.rb +1 -1
  211. data/lib/principles/models/uncommitted_outside_the_map.rb +2 -2
  212. data/lib/principles/models/waits_on.rb +1 -1
  213. data/lib/principles/models/write_up_opening.rb +5 -5
  214. data/lib/principles/models/write_up_pointer.rb +3 -3
  215. data/lib/principles/models/write_up_repoint.rb +2 -3
  216. data/lib/principles/positional_arguments.rb +13 -6
  217. data/lib/principles/prose_list.rb +1 -1
  218. data/lib/principles/session_start_options.rb +1 -1
  219. data/lib/principles/start_audit_options.rb +46 -12
  220. data/lib/principles/supported_ruby.rb +24 -7
  221. data/lib/principles/version.rb +2 -2
  222. data/lib/principles/views/acknowledged_since_last_audit.rb +2 -2
  223. data/lib/principles/views/acknowledgement_result.rb +97 -11
  224. data/lib/principles/views/activation_in_hand.rb +1 -1
  225. data/lib/principles/views/answered_request.rb +6 -2
  226. data/lib/principles/views/assessed_members.rb +50 -41
  227. data/lib/principles/views/assessment_request.rb +39 -36
  228. data/lib/principles/views/audit_changes.rb +4 -4
  229. data/lib/principles/views/audit_commit.rb +5 -4
  230. data/lib/principles/views/audit_result.rb +92 -53
  231. data/lib/principles/views/candidate_files_result.rb +7 -6
  232. data/lib/principles/views/check_notes.rb +29 -6
  233. data/lib/principles/views/check_result_template.rb +45 -34
  234. data/lib/principles/views/completed_audit_next_step.rb +44 -0
  235. data/lib/principles/views/context_parts.rb +112 -0
  236. data/lib/principles/views/correction_request.rb +44 -25
  237. data/lib/principles/views/diff_since_last_audit.rb +8 -6
  238. data/lib/principles/views/findings_result.rb +17 -6
  239. data/lib/principles/views/first_audit_brief.rb +51 -0
  240. data/lib/principles/views/first_audit_line.rb +45 -0
  241. data/lib/principles/views/help.rb +4 -4
  242. data/lib/principles/views/hook_setup_result.rb +91 -0
  243. data/lib/principles/views/instruction.rb +3 -3
  244. data/lib/principles/views/invocation.rb +14 -6
  245. data/lib/principles/views/json_with_entries_on_lines.rb +6 -35
  246. data/lib/principles/views/landed_since_base.rb +1 -1
  247. data/lib/principles/views/line_history_since_last_audit.rb +35 -0
  248. data/lib/principles/views/lines_shared_with_member.rb +6 -6
  249. data/lib/principles/views/loads_to_check_result.rb +8 -5
  250. data/lib/principles/views/map_added_to.rb +3 -3
  251. data/lib/principles/views/map_result.rb +9 -9
  252. data/lib/principles/views/member_change_since_baseline.rb +44 -23
  253. data/lib/principles/views/member_lines_beside_text.rb +43 -0
  254. data/lib/principles/views/member_repairs.rb +3 -2
  255. data/lib/principles/views/member_row.rb +2 -2
  256. data/lib/principles/views/members_a_commit_changed.rb +13 -10
  257. data/lib/principles/views/members_with_no_baseline.rb +3 -3
  258. data/lib/principles/views/meta_principle_passage.rb +1 -1
  259. data/lib/principles/views/meta_principle_result.rb +12 -5
  260. data/lib/principles/views/one_member_check_result_template.rb +7 -7
  261. data/lib/principles/views/open_findings_elsewhere_result.rb +5 -2
  262. data/lib/principles/views/open_findings_line.rb +25 -36
  263. data/lib/principles/views/other_principles_unjudged_result.rb +6 -3
  264. data/lib/principles/views/outside_the_map_result.rb +5 -2
  265. data/lib/principles/views/package_since_last_audit_result.rb +29 -6
  266. data/lib/principles/views/parts_index_result.rb +60 -0
  267. data/lib/principles/views/principle_read_result.rb +5 -6
  268. data/lib/principles/views/principle_with_changed_members.rb +1 -1
  269. data/lib/principles/views/principles_with_no_completed_audit.rb +1 -2
  270. data/lib/principles/views/printed_json.rb +51 -0
  271. data/lib/principles/views/printed_principle.rb +1 -1
  272. data/lib/principles/views/prior_finding_decisions_result.rb +4 -4
  273. data/lib/principles/views/prior_findings_result.rb +17 -14
  274. data/lib/principles/views/problem_lines.rb +39 -17
  275. data/lib/principles/views/problem_result.rb +40 -37
  276. data/lib/principles/views/prompts/acknowledge-a-change/judge-each-member-once-for-every-principle.md +2 -0
  277. data/lib/principles/views/prompts/acknowledge-a-change/read-the-deferred-findings-it-keeps.md +1 -0
  278. data/lib/principles/views/prompts/acknowledge-a-change/resolve-them-in-a-full-audit.md +1 -0
  279. data/lib/principles/views/prompts/acknowledge-a-change/say-whether-the-change-keeps-the-meaning.md +3 -3
  280. data/lib/principles/views/prompts/assess-every-member/confirm-each-write-up-pointer-the-answer-drops.md +2 -0
  281. data/lib/principles/views/prompts/assess-every-member/have-a-changed-check-reviewed-before-running-it.md +1 -1
  282. data/lib/principles/views/prompts/assess-every-member/have-a-new-check-reviewed-before-running-it.md +1 -1
  283. data/lib/principles/views/prompts/assess-every-member/judge-a-carried-assessment-citing-a-decided-finding.md +3 -0
  284. data/lib/principles/views/prompts/assess-every-member/judge-a-submitted-carried-assessment-citing-a-decided-finding.md +5 -0
  285. data/lib/principles/views/prompts/assess-every-member/judge-the-keeping-under-the-release-since-the-last-audit.md +1 -1
  286. data/lib/principles/views/prompts/assess-every-member/keep-the-printed-review-basis-or-replace-it.md +1 -0
  287. data/lib/principles/views/prompts/assess-every-member/name-the-commit-that-made-the-check.md +1 -0
  288. data/lib/principles/views/prompts/assess-every-member/read-a-trimmed-instruction-whole.md +1 -1
  289. data/lib/principles/views/prompts/assess-every-member/read-the-request-in-parts.md +1 -0
  290. data/lib/principles/views/prompts/assess-every-member/why-each-member-is-judged-again.md +3 -2
  291. data/lib/principles/views/prompts/dispose-of-each-finding/answer-guide.json +1 -1
  292. data/lib/principles/views/prompts/dispose-of-each-finding/confirm-each-deferral-written-up-nowhere.md +2 -0
  293. data/lib/principles/views/prompts/dispose-of-each-finding/retain-assessment-and-correction.md +4 -4
  294. data/lib/principles/views/prompts/find-a-principle-to-map/where-the-inventory-looks.md +2 -2
  295. data/lib/principles/views/prompts/learn-what-a-command-does/list-candidate-files.md +4 -3
  296. data/lib/principles/views/prompts/learn-what-a-command-does/list-member-problems.md +6 -6
  297. data/lib/principles/views/prompts/learn-what-a-command-does/list-open-findings.md +11 -11
  298. data/lib/principles/views/prompts/learn-what-a-command-does/report-after-commit.md +14 -0
  299. data/lib/principles/views/prompts/learn-what-a-command-does/report-at-session-start.md +26 -0
  300. data/lib/principles/views/prompts/learn-what-a-command-does/show-answer-check.md +20 -18
  301. data/lib/principles/views/prompts/learn-what-a-command-does/show-first-audit-brief.md +19 -0
  302. data/lib/principles/views/prompts/learn-what-a-command-does/show-hook-setup.md +13 -0
  303. data/lib/principles/views/prompts/learn-what-a-command-does/show-meta-principle-passage.md +3 -1
  304. data/lib/principles/views/prompts/learn-what-a-command-does/show-open-correction.md +12 -0
  305. data/lib/principles/views/prompts/learn-what-a-command-does/start-audit.md +21 -22
  306. data/lib/principles/views/prompts/learn-what-a-command-does/submit-answer.md +5 -4
  307. data/lib/principles/views/prompts/report-the-completed-audit/commit-only-what-the-audit-changed.md +2 -2
  308. data/lib/principles/views/prompts/run-a-first-audit-in-the-background/follow-the-brief.md +18 -0
  309. data/lib/principles/views/prompts/set-principles-up/offer-the-report-hooks.md +2 -0
  310. data/lib/principles/views/prompts/set-principles-up/wire-the-report-hooks-with-the-user.md +8 -0
  311. data/lib/principles/views/prompts/start-a-session/act-on-the-open-findings.md +3 -4
  312. data/lib/principles/views/prompts/start-a-session/every-loaded-line-costs-every-session.md +1 -1
  313. data/lib/principles/views/prompts/start-a-session/hand-the-first-audit-to-a-subagent.md +3 -0
  314. data/lib/principles/views/prompts/start-a-session/run-each-command-above.md +1 -0
  315. data/lib/principles/views/prompts/start-a-session/start-no-second-first-audit.md +2 -0
  316. data/lib/principles/views/prompts.rb +1 -1
  317. data/lib/principles/views/read_the_change.rb +36 -0
  318. data/lib/principles/views/record_waiting_on_an_upgrade.rb +2 -2
  319. data/lib/principles/views/repoint_result.rb +1 -1
  320. data/lib/principles/views/report_hooks_offer.rb +25 -0
  321. data/lib/principles/views/request_part.rb +5 -5
  322. data/lib/principles/views/request_parts.rb +1 -1
  323. data/lib/principles/views/session_start_report.rb +46 -0
  324. data/lib/principles/views/shell_word.rb +1 -1
  325. data/lib/principles/views/trimmed_instructions_note.rb +30 -0
  326. data/lib/principles/views/visible_text.rb +1 -1
  327. data/lib/principles/views/workflow_diagram.rb +1 -1
  328. data/principles.gemspec +44 -0
  329. metadata +83 -14
  330. data/lib/principles/views/prompts/start-a-session/it-returns-after-each-clear-or-compaction-too.md +0 -1
  331. data/lib/principles/views/prompts/start-a-session/it-returns-at-each-session-start.md +0 -1
@@ -11,6 +11,7 @@ require_relative "member_file"
11
11
  require_relative "commits_brought_in"
12
12
  require_relative "uncommitted_files"
13
13
  require_relative "captured_head"
14
+ require_relative "tracked_paths"
14
15
 
15
16
  module Principles
16
17
  # The domain logic, and the mediation of persistence. models/CLAUDE.md owns the boundary.
@@ -19,7 +20,7 @@ module Principles
19
20
  # is based on, each member as that commit holds it, and what changed since. Outside git there is no
20
21
  # history, and an audit has no base commit. A path that is a symbolic link, or lies below one, is read at
21
22
  # each commit in the file its links lead to, and whether it is committed, and which commits touched it, cover
22
- # every link on the way, since git holds a link as its target's name (#695). uncommitted_outside alone asks by
23
+ # every link on the way, since git holds a link as its target's name. uncommitted_outside alone asks by
23
24
  # the paths given: start-audit asks it only once base_commit found every file they lead to committed.
24
25
  class ProjectHistory
25
26
  # This tool's folder as git names a folder, now and under its earlier name.
@@ -31,15 +32,20 @@ module Principles
31
32
  @repository = repository
32
33
  @files = files
33
34
  @head = CapturedHead.new(repository) #: CapturedHead
35
+ @tracked_paths = nil #: TrackedPaths?
34
36
  end
35
37
 
38
+ # Every path git tracks, as git spells it, read once for the command; none outside git.
39
+ #: () -> TrackedPaths
40
+ def tracked_paths = @tracked_paths ||= TrackedPaths.new(@repository.tracked_files)
41
+
36
42
  # Which of paths, and of the links and files they lead through, git does not track, which an audit refuses as
37
- # members until committed (#386, #695). nil outside git, where nothing is checked.
43
+ # members until committed. nil outside git, where nothing is checked.
38
44
  #: (Array[String]) -> Array[String]?
39
45
  def untracked(paths) = (@repository.untracked(through_links(paths)) if @repository.inside?)
40
46
 
41
47
  # Whether git tracks path and every file its links lead to, so a fresh clone finds its text; an ignored file is
42
- # not tracked either (#896). True outside git, where nothing is checked.
48
+ # not tracked either. True outside git, where nothing is checked.
43
49
  #: (String) -> bool
44
50
  def tracks?(path) = !@repository.inside? || @repository.not_tracked(through_links([path])).empty?
45
51
 
@@ -48,7 +54,7 @@ module Principles
48
54
  def inside_git? = @repository.inside?
49
55
 
50
56
  # The full sha of the commit revision names, which a survey of the commits after it starts from. Refuses outside
51
- # git, where there are no commits, and a revision git resolves to no commit (#1171).
57
+ # git, where there are no commits, and a revision git resolves to no commit.
52
58
  #: (String) -> String
53
59
  def commit_named(revision)
54
60
  unless @repository.inside?
@@ -62,12 +68,12 @@ module Principles
62
68
  .including("revision" => revision)
63
69
  end
64
70
 
65
- # Each file the commits after commit, a full sha, changed up to HEAD that the project still holds (#1171).
71
+ # Each file the commits after commit, a full sha, changed up to HEAD that the project still holds.
66
72
  #: (String) -> Array[String]
67
73
  def changed_after(commit) = @repository.changed_since(commit).select { |path| @files.file?(path) }
68
74
 
69
75
  # The project's files, other than paths, that differ from HEAD or are untracked, ignored ones aside; nil
70
- # outside git or when there are none. A check and an answer's evidence read them as they are now (#409).
76
+ # outside git or when there are none. A check and an answer's evidence read them as they are now.
71
77
  #: (Array[String]) -> Array[String]?
72
78
  def uncommitted_outside(paths)
73
79
  return unless @repository.inside?
@@ -77,7 +83,7 @@ module Principles
77
83
  end
78
84
 
79
85
  # Refuses a write-up's path while it, or a file its links lead to, differs from HEAD: the record is committed
80
- # pointing at it, so a fresh clone would find nothing there (#760). Nothing outside git.
86
+ # pointing at it, so a fresh clone would find nothing there. Nothing outside git.
81
87
  #: (String) -> void
82
88
  def refuse_uncommitted_write_up(path)
83
89
  UncommittedFiles.new(uncommitted([path])).refuse_write_up(path) if @repository.inside?
@@ -100,7 +106,7 @@ module Principles
100
106
  end
101
107
 
102
108
  # The lines of the member at locator in its file at commit, or nil when commit lacks the file or the
103
- # locator finds nothing in its text there, as after a move; any other refusal still refuses (#457).
109
+ # locator finds nothing in its text there, as after a move; any other refusal still refuses.
104
110
  #: (String, Locator) -> Array[String]?
105
111
  def lines_at(commit, locator)
106
112
  path = locator.path
@@ -130,7 +136,7 @@ module Principles
130
136
  # The rename git detects for path, a file absent from the working tree, as {"to", "similarity",
131
137
  # "deleted_in"}: the last commit that touched path, or nil while the move is not yet committed. It is
132
138
  # git's similarity match, which can pair a deleted file with an unrelated similar one, so the agent checks
133
- # it (#276). nil outside git, for a file that exists, or when git detects none.
139
+ # it. nil outside git, for a file that exists, or when git detects none.
134
140
  #: (String) -> Hash[String, untyped]?
135
141
  def rename_of(path)
136
142
  return unless @repository.inside? && @repository.absent?(path)
@@ -160,12 +166,12 @@ module Principles
160
166
  end
161
167
 
162
168
  # Which of paths name a file in the project now, so a file deleted since an audit cited it is not committed as a
163
- # deletion (#842).
169
+ # deletion.
164
170
  #: (Array[String]) -> Array[String]
165
171
  def existing(paths) = paths.select { |path| @files.file?(path) }
166
172
 
167
173
  # The commit HEAD named when this history first asked, kept for the rest of the command, so a commit landing
168
- # while it runs leaves no read at one commit and the next at another (#1161); nil outside git. A history serves
174
+ # while it runs leaves no read at one commit and the next at another; nil outside git. A history serves
169
175
  # one command at most, so the next command sees the new commit.
170
176
  #: () -> String?
171
177
  def head = @head.commit
@@ -187,7 +193,7 @@ module Principles
187
193
  @repository.commits_touching(through_links(paths), since: since, up_to: head || "HEAD")
188
194
  end
189
195
 
190
- # The commits after commit, up to HEAD, that one move of HEAD brought in, whatever they changed (D73).
196
+ # The commits after commit, up to HEAD, that one move of HEAD brought in, whatever they changed.
191
197
  #: (String) -> CommitsBroughtIn
192
198
  def commits_brought_in(commit)
193
199
  CommitsBroughtIn.new(@repository.commits_since(commit, []).map { |each| each.fetch("commit") })
@@ -7,8 +7,8 @@ require_relative "member_lines"
7
7
  module Principles
8
8
  # The domain logic, and the mediation of persistence. models/CLAUDE.md owns the boundary.
9
9
  module Models
10
- # A one-member audit's change as its answer quotes it (D33): a line of the member before the change and one after,
11
- # each a whole line of its side or a fragment long enough to show the edit that only its side reads (#352, #379).
10
+ # A one-member audit's change as its answer quotes it: a line of the member before the change and one after,
11
+ # each a whole line of its side or a fragment long enough to show the edit that only its side reads.
12
12
  class QuotedChange
13
13
  # One side of the change a quote is checked against: the member's lines then, and when they read.
14
14
  class SideOfTheChange
@@ -33,10 +33,10 @@ module Principles
33
33
  def first_line_absent_from(other) = @lines.find { |line| !other.whole_line?(line) } || ""
34
34
  end
35
35
 
36
- # The fewest characters a quoted fragment of a line may have, so it shows which edit was read (#352).
36
+ # The fewest characters a quoted fragment of a line may have, so it shows which edit was read.
37
37
  FRAGMENT_LENGTH = 30
38
38
 
39
- # The longest changed line the hint gives whole, beyond which it gives the span the edit changed (#1103).
39
+ # The longest changed line the hint gives whole, beyond which it gives the span the edit changed.
40
40
  LONG_LINE = 200
41
41
 
42
42
  # lines holds the member's lines at its baseline commit and at HEAD; member_id names it in a refusal.
@@ -48,9 +48,9 @@ module Principles
48
48
  freeze
49
49
  end
50
50
 
51
- # The first line on each side the other lacks, which the request hints the quotes from (#1016); of a pair with a
51
+ # The first line on each side the other lacks, which the request hints the quotes from; of a pair with a
52
52
  # line over LONG_LINE characters, the span each side's edit changed, so a small edit is found without comparing
53
- # two long lines by eye, and the request does not carry them again (#1103).
53
+ # two long lines by eye, and the request does not carry them again.
54
54
  #: () -> Hash[String, String]
55
55
  def first_changed_lines
56
56
  old_line = @then.first_line_absent_from(@now)
@@ -83,7 +83,7 @@ module Principles
83
83
  end
84
84
 
85
85
  # The start of the word at index in line, when it starts within FRAGMENT_LENGTH before it; else index, so a
86
- # span of a line without spaces keeps its context (#1144).
86
+ # span of a line without spaces keeps its context.
87
87
  #: (String, Integer) -> Integer
88
88
  def word_start(line, index)
89
89
  return index if index.zero?
@@ -113,7 +113,7 @@ module Principles
113
113
  def common_length(one, other) = one.each_char.zip(other.each_char).take_while { |a, b| a == b }.length
114
114
 
115
115
  # A quote is a whole line, or a fragment long enough to show the edit, that only this side reads; or "" when
116
- # this side has no line the other lacks, as before a pure insertion (#1070).
116
+ # this side has no line the other lacks, as before a pure insertion.
117
117
  #: (String, SideOfTheChange, SideOfTheChange) -> void
118
118
  def quoted(line, side, other)
119
119
  return if line == side.first_line_absent_from(other)
@@ -11,10 +11,10 @@ module Principles
11
11
  module Models
12
12
  # The recent decision under a principle an assessment answer judges against its members' own words: either why
13
13
  # none can be checked, or how one held up with pointers to where it is recorded. The record keeps none of it,
14
- # but a completed audit asks to commit the files its evidence cites (#860).
14
+ # but a completed audit asks to commit the files its evidence cites.
15
15
  class RecentDecision
16
16
  # The placeholder start-audit --as template prints in each field of both forms, so the agent fills one form
17
- # and leaves the other as printed, which is not giving it (#994).
17
+ # and leaves the other as printed, which is not giving it.
18
18
  PLACEHOLDERS = TemplatePlaceholders.new(
19
19
  {
20
20
  "unavailable_reason" => "Why no recent decision under this principle can be checked. Leave as printed " \
@@ -35,7 +35,7 @@ module Principles
35
35
  end
36
36
 
37
37
  # Whether the decision as sent gives fields and leaves every one as the template printed it, so gives neither
38
- # form (#1010).
38
+ # form.
39
39
  #: () -> bool
40
40
  def left_as_printed? = @sent_any && @decision.empty?
41
41
 
@@ -9,17 +9,21 @@ module Principles
9
9
  module Models
10
10
  # An audit record's format: the number a copy compares with the newest it writes and rewrites without losing a
11
11
  # field, and the first release that wrote it, which a copy that does not know the format names as the update to
12
- # make (D85). A record without a format is older than format 1. An open record outside git keeps the last
12
+ # make. A record without a format is older than format 1. An open record outside git keeps the last
13
13
  # completed one whole, so that one's format counts too.
14
14
  class RecordFormat
15
15
  # The refusal of a record a later copy wrote at a format this copy cannot rewrite or read, which a read across
16
- # principles, or one comparing members, catches by its kind rather than its code (D85, #1077).
16
+ # principles, or one comparing members, catches by its kind rather than its code.
17
17
  class NewerFormatError < Error; end
18
18
 
19
- # Raise NEWEST in the commit that adds a field an older copy would drop on a rewrite, and set FIRST_RELEASE by
20
- # hand to the release that commit ships in.
21
- NEWEST = 1
22
- FIRST_RELEASE = "0.0.4"
19
+ # The release that first wrote each format. In the commit that adds a field an older copy would drop on a
20
+ # rewrite, add the next format here, set by hand to the release that commit ships in, and name the field in
21
+ # FIELD_FORMATS, so only a record carrying it moves up.
22
+ FIRST_RELEASES = { 1 => "0.0.4", 2 => "0.0.8" }.freeze #: Hash[Integer, String]
23
+ # The format each later field needs: the open record's correction, which show-open-correction prints again.
24
+ FIELD_FORMATS = { "correction" => 2 }.freeze #: Hash[String, Integer]
25
+ # The newest format this copy writes and rewrites without losing a field; formats count up from 1.
26
+ NEWEST = FIRST_RELEASES.size #: Integer
23
27
  FIELDS = %w[format format_first_release].freeze
24
28
 
25
29
  #: (untyped) -> RecordFormat?
@@ -34,10 +38,12 @@ module Principles
34
38
  freeze
35
39
  end
36
40
 
37
- # The record's fields as this copy writes them, its format and that format's first release ahead of the rest.
41
+ # The record's fields as this copy writes them, ahead of the rest the oldest format that holds them all and that
42
+ # format's first release, worked out again on each write.
38
43
  #: () -> Hash[String, untyped]
39
44
  def stamped
40
- { "format" => NEWEST, "format_first_release" => FIRST_RELEASE, **@fields.except(*FIELDS) }
45
+ format = FIELD_FORMATS.filter_map { |field, needs| needs if @fields.key?(field) }.max || 1
46
+ { "format" => format, "format_first_release" => FIRST_RELEASES.fetch(format), **@fields.except(*FIELDS) }
41
47
  end
42
48
 
43
49
  # Refuses a record whose format, or its kept last completed record's, is above NEWEST, before this copy, at
@@ -52,7 +58,7 @@ module Principles
52
58
  end
53
59
 
54
60
  # Refuses a record this copy's schema refused, when a later copy wrote it, so it is not reported as invalid.
55
- # A read holds no version, so the repair names both ways to update (V3).
61
+ # A read holds no version, so the repair names both ways to update.
56
62
  #: (String) -> void
57
63
  def refuse_unreadable(file)
58
64
  return unless newer?
@@ -73,7 +79,7 @@ module Principles
73
79
  #: () -> String
74
80
  def first_release = newest_held.last
75
81
 
76
- # How to update to read the record, whatever copy runs: what a read without the running version says (V3, V5).
82
+ # How to update to read the record, whatever copy runs: what a read without the running version says.
77
83
  #: () -> String
78
84
  def update_either_way
79
85
  "Update the principles plugin or gem to #{first_release} or later, or a checkout or archive of principles " \
@@ -9,8 +9,8 @@ module Principles
9
9
  # The domain logic, and the mediation of persistence. models/CLAUDE.md owns the boundary.
10
10
  module Models
11
11
  # The principle's audit record as it stands when an assessment answer is judged against it, each part read from
12
- # that one record: the members whose loads the answer must decide (#355), the assessments it may carry
13
- # forward (D49), and the command it ran for each member's check (D63).
12
+ # that one record: the members whose loads the answer must decide, the assessments it may carry
13
+ # forward, and the command it ran for each member's check.
14
14
  class RecordJudgedAgainst
15
15
  # record is the principle's stored record, open or completed, nil when it has none.
16
16
  #: (loads: LoadsToCheck, carried: CarriedAssessments, record: AuditRecord?) -> void
@@ -34,9 +34,9 @@ module Principles
34
34
  #: (String) -> String?
35
35
  def check_run_for(key) = @record&.check_run_for(key)
36
36
 
37
- # The line saying what the review of that run rested on, and since when, as check_since_last_audit shows it.
37
+ # The line saying what the review of that run rested on, and since when, as an answer keeping it carries it.
38
38
  #: (String) -> Hash[String, untyped]
39
- def check_review_for(key) = @record&.check_review_for(key) || {}
39
+ def check_review_for(key) = @record&.check_review_carried_for(key) || {}
40
40
  end
41
41
  end
42
42
  end
@@ -7,7 +7,7 @@ module Principles
7
7
  # The domain logic, and the mediation of persistence. models/CLAUDE.md owns the boundary.
8
8
  module Models
9
9
  # One member's entry in a completed audit record, filed under the id the member had then: its hash, any
10
- # acknowledgements since (D33), and the assessment that audit kept for it, with what it was judged on (D49).
10
+ # acknowledgements since, and the assessment that audit kept for it, with what it was judged on.
11
11
  class RecordedEntry
12
12
  #: (String, Hash[String, untyped]) -> void
13
13
  def initialize(filed_id, entry)
@@ -18,7 +18,7 @@ module Principles
18
18
 
19
19
  # The key the record knows the member by: the key kept beside its entry when it differs from the id it was
20
20
  # filed under, else that id. The one owner of that rule, which MemberHashesAsWritten reads a newer record by
21
- # too (#1066).
21
+ # too.
22
22
  #: () -> String
23
23
  def key = @entry["key"] || @filed_id
24
24
 
@@ -26,13 +26,22 @@ module Principles
26
26
  #: () -> Hash[String, untyped]?
27
27
  def assessment = @entry["assessment"]
28
28
 
29
- # The path of each file the kept assessment cites as evidence; none when it kept none (#724).
29
+ # The path of each file the kept assessment cites as evidence; none when it kept none.
30
30
  #: () -> Array[String]
31
31
  def cited_paths = (assessment&.fetch("evidence", nil) || []).map { it.fetch("path") }
32
32
 
33
+ # Each of finding_ids the kept assessment's text names as a whole word, in its assessment or observation; none
34
+ # when it kept none. Ids repeat across records, so naming one says only that the text may cite it.
35
+ #: (Array[String]) -> Array[String]
36
+ def naming(finding_ids)
37
+ kept = assessment or return []
38
+ text = kept.values_at("assessment", "observation").compact.join("\n")
39
+ finding_ids.select { text.match?(/(?<![[:alnum:]_])#{Regexp.escape(it)}(?![[:alnum:]_])/) }
40
+ end
41
+
33
42
  # The kept assessment as the next full audit shows it carried forward, an observed delivery's sighting dated
34
- # beside it (#680), with whether any evidence it cited changed since, which the block says from each evidence
35
- # item's hash then (D49).
43
+ # beside it, with whether any evidence it cited changed since, which the block says from each evidence
44
+ # item's hash then.
36
45
  #: () { (Locator, String) -> bool } -> Hash[String, untyped]
37
46
  def carried_forward(&changed)
38
47
  kept = assessment || {}
@@ -42,7 +51,7 @@ module Principles
42
51
  end
43
52
 
44
53
  # When the sighting the kept assessment observed was, if observation repeats its observation word for word:
45
- # its observed_at, or for a record from before sightings were dated, its assessed_at (#680). Nil otherwise.
54
+ # its observed_at, or for a record from before sightings were dated, its assessed_at. Nil otherwise.
46
55
  #: (String) -> String?
47
56
  def repeated_sighting(observation)
48
57
  kept = assessment or return nil
@@ -55,7 +64,7 @@ module Principles
55
64
 
56
65
  # Why the member, now id with its text hashing to sha256 and judged on grounds, must be judged again, or nil
57
66
  # when its kept assessment still describes it: the same text the audit judged, under the same id, map entry
58
- # and loads (D49). An acknowledged edit is judged again, unless it was undone.
67
+ # and loads. An acknowledged edit is judged again, unless it was undone.
59
68
  #: (id: String, sha256: String?, grounds: Hash[String, String]) -> String?
60
69
  def judge_because(id:, sha256:, grounds:)
61
70
  return "changed_during_last_audit" if @entry["changed_during_last_audit"]
@@ -71,7 +80,7 @@ module Principles
71
80
  private
72
81
 
73
82
  # When kept's observed delivery was seen, as shown beside it: its observed_at, or for a record from before
74
- # sightings were dated, its assessed_at, saying so. Empty for a delivery not observed (#680).
83
+ # sightings were dated, its assessed_at, saying so. Empty for a delivery not observed.
75
84
  #: (Hash[String, untyped]) -> Hash[String, untyped]
76
85
  def sighting(kept)
77
86
  return {} unless kept["delivery"] == "observed"
@@ -7,7 +7,7 @@ module Principles
7
7
  # The domain logic, and the mediation of persistence. models/CLAUDE.md owns the boundary.
8
8
  module Models
9
9
  # One finding as an audit record holds it: its id, what the audit did about it and where it is written up.
10
- # AuditRecord reads its findings only through this value (#768).
10
+ # AuditRecord reads its findings only through this value.
11
11
  class RecordedFinding
12
12
  # What a finding an assessment raised carries to its record, through the correction's basis: the one list of
13
13
  # those fields, so the basis and the record cannot carry different ones.
@@ -34,7 +34,7 @@ module Principles
34
34
  #: () -> String?
35
35
  def action = @fields["action"]
36
36
 
37
- # Why its audit left it unfixed, or nil when it was fixed or its record predates keeping the reason (#996).
37
+ # Why its audit left it unfixed, or nil when it was fixed or its record predates keeping the reason.
38
38
  #: () -> String?
39
39
  def reason = @fields["reason"]
40
40
 
@@ -49,24 +49,24 @@ module Principles
49
49
  #: () -> String?
50
50
  def first_raised_at = @fields["first_raised_at"]
51
51
 
52
- # The locators of the evidence it was raised with, or nil when its record keeps none (D64).
52
+ # The locators of the evidence it was raised with, or nil when its record keeps none.
53
53
  #: () -> Array[Hash[String, untyped]]?
54
54
  def evidence = @fields["evidence"]
55
55
 
56
56
  # Whether its record keeps the evidence it was raised with; one written before this tool kept evidence, or kept
57
- # by a still_holds decision that gave none, keeps none (D64, #856).
57
+ # by a still_holds decision that gave none, keeps none.
58
58
  #: () -> bool
59
59
  def evidence_kept? = !evidence.nil?
60
60
 
61
- # The path of each file it points at: its evidence and its write-up (#724).
61
+ # The path of each file it points at: its evidence and its write-up.
62
62
  #: () -> Array[String]
63
63
  def cited_paths = [*evidence&.map { it.fetch("path") }, recorded_at&.path].compact.uniq
64
64
 
65
- # The commit whose record an audit cited for an earlier first_raised_at, when one did (D53).
65
+ # The commit whose record an audit cited for an earlier first_raised_at, when one did.
66
66
  #: () -> String?
67
67
  def raised_in = @fields["raised_in"]
68
68
 
69
- # The one line saying whom it waits on and to decide what, when its deferral says (D52).
69
+ # The one line saying whom it waits on and to decide what, when its deferral says.
70
70
  #: () -> String?
71
71
  def waits_on = @fields["waits_on"]
72
72
 
@@ -74,7 +74,7 @@ module Principles
74
74
  #: () -> String?
75
75
  def waits_on_since = @fields["waits_on_since"]
76
76
 
77
- # Whether its audit left it open, deferred or accepted, for the next full audit to decide (D35).
77
+ # Whether its audit left it open, deferred or accepted, for the next full audit to decide.
78
78
  #: () -> bool
79
79
  def open? = %w[deferred accepted].include?(action)
80
80
 
@@ -83,7 +83,7 @@ module Principles
83
83
  def fixed? = action == "fixed"
84
84
 
85
85
  # This finding pointed at recorded_at, the move from where it pointed appended to its repointed with when and
86
- # why (D59), or itself when it already points there, so an identical retry writes nothing (D24).
86
+ # why, or itself when it already points there, so an identical retry writes nothing.
87
87
  #: (WriteUpPointer, at: String, reason: String) -> RecordedFinding
88
88
  def moved_to(pointer, at:, reason:)
89
89
  return self if recorded_at == pointer
@@ -38,7 +38,7 @@ module Principles
38
38
  #: () -> Array[String]
39
39
  def fixed_ids = @findings.select(&:fixed?).map(&:id)
40
40
 
41
- # These findings with each one a repoint names moved by it, dated at (D59); the last repoint naming one wins.
41
+ # These findings with each one a repoint names moved by it, dated at; the last repoint naming one wins.
42
42
  #: (Array[WriteUpRepoint], at: String) -> RecordedFindings
43
43
  def repointed(repoints, at:)
44
44
  by_finding = repoints.to_h { |repoint| [repoint.finding_id, repoint] }
@@ -50,7 +50,7 @@ module Principles
50
50
  members: @members)
51
51
  end
52
52
 
53
- # The path of each file they point at: their evidence and write-ups (#724).
53
+ # The path of each file they point at: their evidence and write-ups.
54
54
  #: () -> Array[String]
55
55
  def cited_paths = @findings.flat_map(&:cited_paths).uniq
56
56
  end
@@ -5,8 +5,8 @@ module Principles
5
5
  # The domain logic, which loads and saves itself through data/. models/CLAUDE.md owns the boundary.
6
6
  module Models
7
7
  # The member hashes a principle's audit record holds, by key, which its members now are compared with, and
8
- # whether a later copy wrote that record, so its audits wait on an upgrade and the comparison is read-only
9
- # (D85, V8, #1066, #1067). A principle with no record holds none.
8
+ # whether a later copy wrote that record, so its audits wait on an upgrade and the comparison is read-only.
9
+ # A principle with no record holds none.
10
10
  class RecordedHashes
11
11
  #: (Hash[String, String], ?waiting: bool) -> void
12
12
  def initialize(by_key, waiting: false)
@@ -10,8 +10,8 @@ module Principles
10
10
  # The domain logic, and the mediation of persistence. models/CLAUDE.md owns the boundary.
11
11
  module Models
12
12
  # The members an audit record assessed: each filed under the id it had then, with its key beside it when the
13
- # two differ, holding its hash then, the result reported for its check (D30), its accepted loading decision
14
- # and the acknowledgements made for it since (D33). Callers reach them through AuditRecord#members.
13
+ # two differ, holding its hash then, the result reported for its check, its accepted loading decision
14
+ # and the acknowledgements made for it since. Callers reach them through AuditRecord#members.
15
15
  class RecordedMembers
16
16
  #: (Hash[String, untyped]) -> void
17
17
  def initialize(entries)
@@ -24,7 +24,7 @@ module Principles
24
24
  def to_h = @entries
25
25
 
26
26
  # The entries without when each assessment was made, or when a sighting it gave no date for was dated, which a
27
- # record made again from the same answer dates anew (#680).
27
+ # record made again from the same answer dates anew.
28
28
  #: () -> Hash[String, untyped]
29
29
  def undated
30
30
  @entries.transform_values do |entry|
@@ -33,7 +33,7 @@ module Principles
33
33
  end
34
34
  end
35
35
 
36
- # The path of each file an assessment kept here cites as evidence, carried forward or made now (#724).
36
+ # The path of each file an assessment kept here cites as evidence, carried forward or made now.
37
37
  #: () -> Array[String]
38
38
  def cited_paths
39
39
  @entries.flat_map { |id, entry| RecordedEntry.new(id, entry).cited_paths }.uniq
@@ -60,7 +60,7 @@ module Principles
60
60
  end
61
61
 
62
62
  # The check the record's audit was given an exit status for, for the member known by key: nil when the
63
- # member had no check then, or its check was reported as not run, so no audit has run it (D30, #227).
63
+ # member had no check then, or its check was reported as not run, so no audit has run it.
64
64
  #: (String) -> String?
65
65
  def check_run_for(key)
66
66
  result = entry_for(key)&.fetch("check_result", nil) or return nil
@@ -70,7 +70,7 @@ module Principles
70
70
  # How check, the map's check now for the member known by key, stands to the one the record's audit ran:
71
71
  # :unchanged when it ran this same command, or none for a member that has none; :removed when it ran one the
72
72
  # member no longer has; :changed when it ran another; :not_run when it was told this one could not be run; :new
73
- # when it reported none (D30, D63, #1071). The one owner of that comparison, which a full audit's template and a
73
+ # when it reported none. The one owner of that comparison, which a full audit's template and a
74
74
  # one-member audit both ask.
75
75
  #: (String, String?) -> Symbol
76
76
  def check_since(key, check)
@@ -83,7 +83,7 @@ module Principles
83
83
  end
84
84
 
85
85
  # What the review of that run rested on, for the member known by key, as the record keeps it: its review_basis
86
- # and any review_basis_since, or nothing when the record ran no check for it or kept no line (D63).
86
+ # and any review_basis_since, or nothing when the record ran no check for it or kept no line.
87
87
  #: (String) -> Hash[String, untyped]
88
88
  def check_review_as_kept(key)
89
89
  return {} unless check_run_for(key)
@@ -91,7 +91,7 @@ module Principles
91
91
  entry_for(key)&.fetch("check_result")&.slice("review_basis", "review_basis_since") || {}
92
92
  end
93
93
 
94
- # Each member's accepted loading decision, by its id now, found by the key it keeps through moves (#502).
94
+ # Each member's accepted loading decision, by its id now, found by the key it keeps through moves.
95
95
  #: (PrincipleMembers) -> Hash[String, AcceptedLoading]
96
96
  def loading_accepted(members)
97
97
  members.to_h do |member|
@@ -100,14 +100,14 @@ module Principles
100
100
  end.compact
101
101
  end
102
102
 
103
- # The acknowledgements made for the member known by key since the record's audit, oldest first (D33).
103
+ # The acknowledgements made for the member known by key since the record's audit, oldest first.
104
104
  #: (String) -> Array[Hash[String, untyped]]
105
105
  def acknowledgements_for(key)
106
106
  entry_for(key)&.fetch("acknowledgements", nil) || []
107
107
  end
108
108
 
109
109
  # The member acknowledged most recently and when, as [id, acknowledged_at], or nil when none was since the
110
- # record's audit (#668). The times compare as text, which orders them only because every writer gives UTC in
110
+ # record's audit. The times compare as text, which orders them only because every writer gives UTC in
111
111
  # ISO 8601.
112
112
  #: () -> [String, String]?
113
113
  def latest_acknowledgement
@@ -116,8 +116,8 @@ module Principles
116
116
  end.max_by(&:last)
117
117
  end
118
118
 
119
- # These entries with the member known by key moved to change's to_sha256, and change kept beside it (D33), with
120
- # check_result, when given, in place of the result it kept (#1071).
119
+ # These entries with the member known by key moved to change's to_sha256, and change kept beside it, with
120
+ # check_result, when given, in place of the result it kept.
121
121
  #: (String, Hash[String, untyped], ?check_result: Hash[String, untyped]?) -> RecordedMembers
122
122
  def acknowledged(key, change, check_result: nil)
123
123
  RecordedMembers.new(@entries.to_h do |id, entry|
@@ -143,7 +143,7 @@ module Principles
143
143
  end
144
144
 
145
145
  # These entries with each assessment an answer carried forward, marked {"carried_forward": true}, replaced by
146
- # the one last kept for the same member, so the record keeps it with its first date (D49).
146
+ # the one last kept for the same member, so the record keeps it with its first date.
147
147
  #: (RecordedMembers?) -> RecordedMembers
148
148
  def carrying(last)
149
149
  RecordedMembers.new(@entries.to_h do |id, entry|
@@ -5,13 +5,13 @@ module Principles
5
5
  # The domain logic, and the mediation of persistence. models/CLAUDE.md owns the boundary.
6
6
  module Models
7
7
  # A refusal an answer meets before its shape is checked, for a mistake the shape would refuse without naming, such
8
- # as a placeholder left in a field of another type (#773, #1084, #1088). A phase lists its own, in order, and
8
+ # as a placeholder left in a field of another type. A phase lists its own, in order, and
9
9
  # SentAnswer reads each, so a new one is declared here once.
10
10
  # @interface
11
11
  module RefusalBeforeShape
12
12
  # Refuses answer, as sent from source, when it makes this mistake; nothing otherwise. shape_problems are the
13
13
  # problems its shape check finds, as Data::SchemaCheck#problems gives them, which a refusal may name beside its
14
- # own, so one refusal names every repair (#1106). Sorbet takes an abstract method only with a forwarding super
14
+ # own, so one refusal names every repair. Sorbet takes an abstract method only with a forwarding super
15
15
  # for its body, which RuboCop would otherwise call useless.
16
16
  # @abstract
17
17
  #: (untyped, String, Array[Hash[String, String]]) -> void
@@ -14,7 +14,7 @@ require_relative "write_up_repoint"
14
14
  module Principles
15
15
  # The domain logic, and the mediation of persistence. models/CLAUDE.md owns the boundary.
16
16
  module Models
17
- # A repoint of a principle's open findings' write-ups without a full audit (D59): the agent, having checked
17
+ # A repoint of a principle's open findings' write-ups without a full audit: the agent, having checked
18
18
  # where a write-up moved to, gives each finding it names a new recorded_at, and the last completed record keeps
19
19
  # it, with where it pointed before, when and why. Judging that the new place holds the write-up is the agent's.
20
20
  class Repoint
@@ -70,7 +70,7 @@ module Principles
70
70
  def unchanged_ids(repointed) = completed.open_ids - moved_ids(repointed)
71
71
 
72
72
  # Refuses unless the principle's record is a completed audit's: an open record outside git keeps the completed
73
- # one, whose findings its correction will decide, and with none there is nothing to repoint (D59).
73
+ # one, whose findings its correction will decide, and with none there is nothing to repoint.
74
74
  #: () -> AuditRecord
75
75
  def completed
76
76
  record = @record
@@ -90,7 +90,7 @@ module Principles
90
90
  private
91
91
 
92
92
  # Refuses ids, the findings an answer's repoints name, when one is not open in the completed record or two
93
- # name one finding, since either would otherwise read as a success (#760, T20).
93
+ # name one finding, since either would otherwise read as a success.
94
94
  #: (Array[String]) -> void
95
95
  def each_open_once(ids)
96
96
  open = completed.open_ids