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
@@ -17,7 +17,7 @@ module Principles
17
17
  module Controllers
18
18
  # A full audit's assessment, which submit-answer and show-answer-check hand over: this tool checks the request
19
19
  # it answers and each member's assessment, then completes an audit with no findings or asks for the correction
20
- # of its findings (D35, D50).
20
+ # of its findings.
21
21
  class Assessment < AnswerPhase
22
22
  # The result of answering an assessment request, which checked_request found unchanged, with the prior findings
23
23
  # it listed, and the record change it makes, not yet written.
@@ -36,7 +36,7 @@ module Principles
36
36
 
37
37
  # The prior findings the request an answer's head names listed, refused when that request, given the head's
38
38
  # basis, no longer matches the project, before the rest of the answer's shape is read: checked here alone, since
39
- # its template prints placeholders this release's schema could otherwise refuse first (#1052).
39
+ # its template prints placeholders this release's schema could otherwise refuse first.
40
40
  #: (Models::RequestId, Hash[String, untyped]) -> Models::PriorFindings
41
41
  def checked_request(request_id, head)
42
42
  audit = audit_now(request_id.principle_id)
@@ -49,9 +49,8 @@ module Principles
49
49
  end
50
50
 
51
51
  # The refusals an answer meets before its shape: first a check_result on a member with no check, which the
52
- # shape would refuse as lacking its command (#1088), then any phase's, whose template is read first, as before,
53
- # then a judgement left as its template printed it, named with the shape's problems, so one refusal names both
54
- # (#1109).
52
+ # shape would refuse as lacking its command, then any phase's, whose template is read first, as before,
53
+ # then a judgement left as its template printed it, named with the shape's problems, so one refusal names both.
55
54
  #: (Models::RequestId) -> Array[Models::RefusalBeforeShape]
56
55
  def before_shape(request_id)
57
56
  any_phase = super
@@ -59,9 +58,29 @@ module Principles
59
58
  Models::AssessmentLeftAsPrinted.new]
60
59
  end
61
60
 
61
+ # Each member the answer carries forward whose kept assessment names a prior finding it decides other than
62
+ # still_holds, from the record the answer is judged against.
63
+ # @override
64
+ #: (Models::SubmittedAnswer) -> Array[Hash[String, untyped]]
65
+ def carried_naming_decided(submitted)
66
+ audit = audit_now(submitted.request_id.principle_id)
67
+ record_judged_against(audit).carried.naming_decided(submitted.response)
68
+ end
69
+
70
+ # Each prior finding whose write-up pointer the answer drops with null, with the pointer it had, as the
71
+ # decisions on the prior findings, once checked, say.
72
+ # @override
73
+ #: (Models::SubmittedAnswer) -> Array[Hash[String, untyped]]
74
+ def pointers_dropped(submitted)
75
+ response = submitted.response
76
+ decided = submitted.prior_findings.decided(response["prior_finding_decisions"], response.fetch("findings", []),
77
+ records: @audit_records) { |locator| snapshot(locator) }
78
+ decided.changed.fetch("pointers_dropped")
79
+ end
80
+
62
81
  private
63
82
 
64
- # The placeholders a full audit's template printed, as start-audit --as template prints it now (#1084).
83
+ # The placeholders a full audit's template printed, as start-audit --as template prints it now.
65
84
  #: (Models::RequestId) -> Hash[String, untyped]?
66
85
  def printed_placeholders(request_id)
67
86
  handed(FullAuditRequest, principle_id: request_id.principle_id).to_fill
@@ -89,7 +108,7 @@ module Principles
89
108
 
90
109
  # Completes an audit with no findings. Otherwise asks the agent to correct them. Each is refused once the last
91
110
  # completed record changed after the assessment's request was printed, the completion unless it writes
92
- # nothing (D50).
111
+ # nothing.
93
112
  #: (Models::AuditStart, Models::Audit, Array[untyped], Models::DecidedPriorFindings, Models::AssessmentBasis)
94
113
  #| -> [untyped, Array[Models::AuditRecord]]
95
114
  def correction(start, audit, findings, decided, assessed)
@@ -101,9 +120,10 @@ module Principles
101
120
  end
102
121
 
103
122
  # The correction request for findings, and the open record that keeps the assessment, whose digest its basis
104
- # carries in place of the assessment, so the correction reads it back from the record (D87).
123
+ # carries in place of the assessment, so the correction reads it back from the record, and keeps the
124
+ # correction's request_id and basis, so show-open-correction prints it again.
105
125
  # It is refused before it is printed once the last completed record changed, so no fix is made for an audit
106
- # that cannot complete (D50). The check results travel in the record, so the completed record keeps them (D30).
126
+ # that cannot complete. The check results travel in the record, so the completed record keeps them.
107
127
  #: (Models::AuditStart, Models::Audit, Array[untyped], Models::DecidedPriorFindings, Models::AssessmentBasis)
108
128
  #| -> [untyped, Array[Models::AuditRecord]]
109
129
  def correction_request(start, audit, findings, decided, assessed)
@@ -111,7 +131,8 @@ module Principles
111
131
  record = open_record(start, audit, findings)
112
132
  basis = Models::CorrectionBasis.printed(start, findings: findings, prior: decided, revision: assessed.revision,
113
133
  open_record: record)
114
- [request_to_correct(basis, audit, findings), @audit_records.changes(record)]
134
+ request = request_to_correct(basis, audit, findings)
135
+ [request, @audit_records.changes(record.correcting(request.request_id, basis.to_h))]
115
136
  end
116
137
 
117
138
  # The correction request for findings, answered under an id that digests its basis and the members now.
@@ -123,7 +144,7 @@ module Principles
123
144
  end
124
145
 
125
146
  # The open record that keeps the assessment, and outside git what the audit began from, and the last completed
126
- # record, so a restarted audit still lists its prior findings (D35), in git as outside it (D87).
147
+ # record, so a restarted audit still lists its prior findings, in git as outside it.
127
148
  #: (Models::AuditStart, Models::Audit, Array[untyped]) -> Models::AuditRecord
128
149
  def open_record(start, audit, findings)
129
150
  last = @audit_records.find(audit.id)&.last_completed
@@ -7,6 +7,7 @@ require_relative "../models/finding_write_ups"
7
7
  require_relative "../views/findings_result"
8
8
  require_relative "../views/open_findings_line"
9
9
  require_relative "acknowledgement"
10
+ require_relative "acknowledgements"
10
11
  require_relative "full_audit_request"
11
12
  require_relative "repoint"
12
13
 
@@ -30,54 +31,76 @@ module Principles
30
31
  end
31
32
  end
32
33
 
34
+ # The line report-at-session-start ends with while any finding is open, worded for the session's start, source,
35
+ # with list-open-findings --short's words, its command leaving out --project, since a session runs in its
36
+ # project; none while none is open.
37
+ #: (String) -> Array[String]
38
+ def session_start_open_findings(source)
39
+ records = open_records(nil)
40
+ waiting = Models::FindingsLeftOpen.of(records).waiting_at(Time.now.utc)
41
+ Views::OpenFindingsLine.new(invocation.without_project)
42
+ .lines(waiting, Models::FindingWriteUps.of(@project, records).not_found, source:)
43
+ end
44
+
33
45
  private
34
46
 
35
47
  # The audit start-audit's options ask for: a one-member audit with --member, a repoint of the open
36
- # findings' write-ups with --write-ups (D59), else a full audit; a full or one-member audit's answer alone with
37
- # --as template (D81, #773).
48
+ # findings' write-ups with --write-ups, else a full audit; a full or one-member audit's answer alone with
49
+ # --as template.
38
50
  #: (String, Hash[String, untyped]) -> Hash[String, untyped]
39
51
  def started_audit(id, options)
40
52
  naming_the_executable { @audit_records.refuse_newer(id, version: @tool.version) }
41
- return acknowledge(id, options["member"], to_fill: options["as"] == "template") if options["member"]
53
+ ids = [id, *options.fetch("other_ids", [])]
54
+ return acknowledge(ids, options.fetch("member"), to_fill: options["as"] == "template") if options["member"]
42
55
  return handed(Repoint).start(id) if options["write_ups"]
43
56
 
44
57
  full_audit(id, options)
45
58
  end
46
59
 
47
60
  # A full audit's request, or with --as template its answer alone, or with --instruction one instruction field
48
- # of it (D81).
61
+ # of it, or with --part one other part of it, or one member's slot of the answer beside --as template.
49
62
  #: (String, Hash[String, untyped]) -> Hash[String, untyped]
50
63
  def full_audit(id, options)
51
64
  naming_the_executable do
52
65
  full = handed(FullAuditRequest, principle_id: id)
53
66
  next full.instruction(options["instruction"]) if options["instruction"]
67
+ next full_part(full, options) if options["part"]
54
68
 
55
69
  options["as"] ? full.to_fill : full.printed
56
70
  end
57
71
  end
58
72
 
73
+ # The part of the request --part names, or beside --as template the member's slot of the answer it names.
74
+ #: (FullAuditRequest, Hash[String, untyped]) -> Hash[String, untyped]
75
+ def full_part(full, options)
76
+ options["as"] ? full.slot_to_fill(options.fetch("part")) : full.part(options.fetch("part"))
77
+ end
78
+
59
79
  # id's committed record. With none, an id no map has is refused as show-principle refuses it, since
60
- # starting its audit would be refused too; a record kept after its map was removed still shows (#577). One a
61
- # later copy wrote says its audits wait on an upgrade (D85, V8).
80
+ # starting its audit would be refused too; a record kept after its map was removed still shows. One a
81
+ # later copy wrote says its audits wait on an upgrade.
62
82
  #: (String) -> Hash[String, untyped]
63
83
  def shown_audit(id)
64
84
  @principles.find(id) unless @audit_records.exist?(id)
65
85
  @audit_records.fetch(id).shown.merge(waiting_beside(id), "wrote" => [])
66
86
  end
67
87
 
68
- # A one-member audit of the member member_ids names (D33), or of several members in one request (#1169), or its
69
- # answer alone to fill (#773).
70
- #: (String, Array[String], to_fill: bool) -> Hash[String, untyped]
71
- def acknowledge(id, member_ids, to_fill:)
88
+ # A one-member audit of the member --member names, or of several members in one request, or of the
89
+ # members several principles map, or its answer alone to fill.
90
+ #: (Array[String], Array[String], to_fill: bool) -> Hash[String, untyped]
91
+ def acknowledge(ids, member_ids, to_fill:)
92
+ id = ids.fetch(0)
93
+ return handed(Acknowledgements).across(ids, member_ids, to_fill:) if ids.size > 1
94
+ return handed(Acknowledgements).several(id, member_ids, to_fill:) if member_ids.size > 1
95
+
72
96
  acknowledgement = handed(Acknowledgement)
73
97
  member_id = member_ids.first.to_s
74
- return acknowledgement.several(id, member_ids, to_fill:) if member_ids.size > 1
75
98
 
76
99
  to_fill ? acknowledgement.to_fill(id, member_id) : acknowledgement.start(id, member_id)
77
100
  end
78
101
 
79
102
  # The open findings in the form the options ask for: the session-start hook's one line with --short, a line each
80
- # with --lines (#1156), or the full list.
103
+ # with --lines, or the full list.
81
104
  #: (String?, Hash[String, untyped]) -> untyped
82
105
  def listed_open_findings(id, options)
83
106
  return open_findings_line(id, options) if options["short"]
@@ -86,15 +109,16 @@ module Principles
86
109
  open_findings(id)
87
110
  end
88
111
 
89
- # Each open finding on a line, with whom it waits on (#1156).
112
+ # Each open finding on a line, with whom it waits on and how long it has been open until now.
90
113
  #: (String?) -> Views::Lines
91
114
  def open_findings_lines(id)
92
- Views::FindingsResult.new(invocation).lines(open_records(id).flat_map(&:left_open).map(&:listed))
115
+ now = Time.now.utc
116
+ Views::FindingsResult.new(invocation).lines(open_records(id).flat_map(&:left_open).map { it.waited_at(now) })
93
117
  end
94
118
 
95
- # The findings the last completed audit of map id, or of every map, deferred or accepted (#292, D35). Across
119
+ # The findings the last completed audit of map id, or of every map, deferred or accepted. Across
96
120
  # every map, it names each principle whose record a later copy wrote, so a list left without one that cannot be
97
- # read does not look whole (D85, V8).
121
+ # read does not look whole.
98
122
  #: (String?) -> Hash[String, untyped]
99
123
  def open_findings(id)
100
124
  listed = Models::FindingWriteUps.of(@project, open_records(id)).listed
@@ -105,8 +129,8 @@ module Principles
105
129
  end
106
130
 
107
131
  # The one line saying how many findings are open and how long the oldest has waited until now, and which
108
- # write-ups can no longer be found (#694), or nothing when none is open, for a session-start hook (D47),
109
- # worded for the session's start, startup unless --session-start names another (#717).
132
+ # write-ups can no longer be found, or nothing when none is open, for a session-start hook,
133
+ # worded for the session's start, startup unless --session-start names another.
110
134
  #: (String?, Hash[String, untyped]) -> Views::Lines
111
135
  def open_findings_line(id, options)
112
136
  records = open_records(id)
@@ -117,7 +141,7 @@ module Principles
117
141
 
118
142
  # The records whose open findings list-open-findings reads: id's, refused when a later copy wrote it in a
119
143
  # form this copy cannot read, since an empty list would say it has none; or every principle's this copy can
120
- # read, so one such record does not refuse the rest (D85, V8).
144
+ # read, so one such record does not refuse the rest.
121
145
  #: (String?) -> Array[Models::AuditRecord]
122
146
  def open_records(id)
123
147
  ids = @principles.ids_of(id)
@@ -18,11 +18,10 @@ module Principles
18
18
  # submit-answer reaches from an assessment with no findings or from a correction, with the record it writes,
19
19
  # the files to commit and what landed since the base commit.
20
20
  class AuditCompletion < Command
21
- # map_changes are the changes a correction declared to the map, which name the map file to commit (D40).
21
+ # map_changes are the changes a correction declared to the map, which name the map file to commit.
22
22
  # replacing is the revision of the last completed record when the request that completes the audit was
23
- # printed, which refuses to replace a record changed since (#646). read_back_from is the record a correction
24
- # read the audit's assessment back from, which, when completed, only an identical retry completes again (D24,
25
- # D87).
23
+ # printed, which refuses to replace a record changed since. read_back_from is the record a correction
24
+ # read the audit's assessment back from, which, when completed, only an identical retry completes again.
26
25
  #: (Models::Project, tool: RunningTool, ?map_changes: Models::DeclaredMapChanges?,
27
26
  #| ?replacing: Models::LastCompletedRevision?, ?read_back_from: Models::AuditRecord?) -> void
28
27
  def initialize(project, tool:, map_changes: nil, replacing: nil, read_back_from: nil)
@@ -33,7 +32,7 @@ module Principles
33
32
  end
34
33
 
35
34
  # The completed result, and the record change it makes, not yet written.
36
- # Each prior finding's decision is applied: a kept one stays in the record, and a closed one is reported (D35).
35
+ # Each prior finding's decision is applied: a kept one stays in the record, and a closed one is reported.
37
36
  #: (Models::AuditStart, Models::Audit, Array[Models::Disposition], Array[untyped], Models::DecidedPriorFindings)
38
37
  #| -> [untyped, Array[Models::AuditRecord]]
39
38
  def completed(start, audit, dispositions, findings, decided)
@@ -45,8 +44,8 @@ module Principles
45
44
  end
46
45
 
47
46
  # The record an audit writes, made now, saying what its assessments answered, with each assessment carried
48
- # forward taken from the record it replaces (D49), and the release of principles it ran under when its
49
- # principle keeps one (D68).
47
+ # forward taken from the record it replaces, and the release of principles it ran under when its
48
+ # principle keeps one.
50
49
  #: (Models::AuditStart, Array[untyped], String, Hash[String, String], ?Models::AuditRecord?)
51
50
  #| -> Models::AuditRecord
52
51
  def record(start, findings, status, members, last_completed = nil)
@@ -60,8 +59,8 @@ module Principles
60
59
  private
61
60
 
62
61
  # What the completed audit prints: its resolved and open findings, as the record it writes holds them, so they
63
- # agree with list-open-findings (#714); what it changed; each prior finding's decision (D35); and, while
64
- # principles is not set up, the offer to set it up (D95).
62
+ # agree with list-open-findings; what it changed; each prior finding's decision; and, while
63
+ # principles is not set up, the offer to set it up.
65
64
  #: (Models::AuditStart, Models::Audit, Array[Models::Disposition], Models::DecidedPriorFindings,
66
65
  #| Models::AuditRecord) -> untyped
67
66
  def completion_result(start, audit, dispositions, decided, written)
@@ -70,7 +69,17 @@ module Principles
70
69
  completed = audit_result.completion(principle_id: audit.id, resolved: written.resolved_ids(decided),
71
70
  open: written.open_ids,
72
71
  changes: changes(start, audit, dispositions, written), decisions: decisions)
73
- @principles.set_up? ? completed : audit_result.offering_set_up(completed)
72
+ offering_set_up(completed)
73
+ end
74
+
75
+ # completed, with the offer to set principles up while it is not, and outside the plugin, whose hooks report
76
+ # changed members already, the offer of the hook entries that do.
77
+ #: (Hash[String, untyped]) -> Hash[String, untyped]
78
+ def offering_set_up(completed)
79
+ return completed if @principles.set_up?
80
+
81
+ hooks = !@tool.runs_from.session_start_hook_in_this_session?
82
+ audit_result.offering_set_up(completed, hooks: hooks)
74
83
  end
75
84
 
76
85
  # What the audit changed in the project: the files to commit, in git the commits since the base, the
@@ -87,8 +96,8 @@ module Principles
87
96
  end
88
97
 
89
98
  # Each other principle with a member in paths, the files this audit's fixes changed, whose own text now
90
- # differs from what this tool last knew of it or whose reference broke, as list-member-problems reports it
91
- # (#410). A map this tool
99
+ # differs from what this tool last knew of it or whose reference broke, as list-member-problems reports it.
100
+ # A map this tool
92
101
  # cannot read names none here; list-member-problems reports it.
93
102
  #: (Models::Audit, Array[String]) -> Array[Views::PrincipleWithChangedMembers]
94
103
  def other_changed(audit, paths)
@@ -67,8 +67,8 @@ module Principles
67
67
  end
68
68
 
69
69
  # Runs the block, putting the running executable into any refusal a model raised, followed by this project,
70
- # so a repair runs on the same project from anywhere, as answer_with does (#572). rerun, when given, prints the
71
- # command running now with another member id, which a refusal naming a near miss leads its repair with (D56).
70
+ # so a repair runs on the same project from anywhere, as answer_with does. rerun, when given, prints the
71
+ # command running now with another member id, which a refusal naming a near miss leads its repair with.
72
72
  #: [T] (?rerun: (^(String) -> String)?) { () -> T } -> T
73
73
  def naming_the_executable(rerun: nil, &)
74
74
  yield
@@ -76,11 +76,11 @@ module Principles
76
76
  refusal = (rerun ? e.rerun_with_near_miss(&rerun) : e).printing_commands do |command|
77
77
  invocation.listed_in_project(command.command, command.values, options: command.options, usage: command.usage)
78
78
  end
79
- raise with_member_repairs(refusal).naming("#{@tool.executable} #{invocation.project_option}")
79
+ raise with_member_repairs(refusal).naming(invocation.prefix)
80
80
  end
81
81
 
82
82
  # A broken_members refusal, with each member's own repair commands beside it as repair_with, since a
83
- # model's repair can only name placeholders (#252). Any other refusal is returned as it is.
83
+ # model's repair can only name placeholders. Any other refusal is returned as it is.
84
84
  #: (Error) -> Error
85
85
  def with_member_repairs(error)
86
86
  return error unless error.payload["code"] == "broken_members"
@@ -97,7 +97,8 @@ module Principles
97
97
  def repaired(entry, repairs)
98
98
  principle = entry["principle"] or return entry
99
99
  id = entry["id"] or return entry
100
- moves = Models::MemberRepairMoves.new(@principles.find(principle).member(id), code: entry["code"]).to_a
100
+ member = @principles.find(principle).member(id)
101
+ moves = Models::MemberRepairMoves.new(member, code: entry["code"], tracked_as: entry["tracked_as"]).to_a
101
102
  entry.merge("repair_with" => repairs.commands(principle, id, moves))
102
103
  rescue Error
103
104
  entry
@@ -118,10 +119,10 @@ module Principles
118
119
  # The executable and project that printed commands name, built for each run and never stored.
119
120
  #: () -> Views::Invocation
120
121
  def invocation
121
- Views::Invocation.new(executable: @tool.executable, project: @project.root)
122
+ @tool.invocation(@project.root)
122
123
  end
123
124
 
124
- # Principle id as waiting on an upgrade, when a later copy wrote its record (D85, V8).
125
+ # Principle id as waiting on an upgrade, when a later copy wrote its record.
125
126
  #: (String) -> Views::RecordWaitingOnAnUpgrade?
126
127
  def waiting_on_an_upgrade(id)
127
128
  format = @audit_records.newer_format(id) or return
@@ -129,7 +130,7 @@ module Principles
129
130
  newest: Models::RecordFormat::NEWEST, update: format.update_either_way)
130
131
  end
131
132
 
132
- # The line saying principle id's audits wait on an upgrade, as a field to print beside it, or none (#1067).
133
+ # The line saying principle id's audits wait on an upgrade, as a field to print beside it, or none.
133
134
  #: (String) -> Hash[String, String]
134
135
  def waiting_beside(id) = waiting_on_an_upgrade(id)&.beside || {}
135
136
 
@@ -173,7 +174,7 @@ module Principles
173
174
  def member_loads(map, hooks = @project.hook_commands) = @project.member_loads(map.members, hooks)
174
175
 
175
176
  # The members a full audit lists to check against its activation, each with the decision its last completed
176
- # audit, whose record is given or read now, accepted on the member's loading (#355, #502).
177
+ # audit, whose record is given or read now, accepted on the member's loading.
177
178
  #: (Models::Audit, ?Models::AuditRecord?) -> Models::LoadsToCheck
178
179
  def loads_to_check(audit, record = @audit_records.find(audit.id))
179
180
  audit.loads_to_check(member_loads(audit.map), record)
@@ -188,12 +189,12 @@ module Principles
188
189
  carried: carried_assessments(audit, record), record: record)
189
190
  end
190
191
 
191
- # What each member's assessment was judged on beside its text: its map entry and when it loads (D49).
192
+ # What each member's assessment was judged on beside its text: its map entry and when it loads.
192
193
  #: (Models::Audit) -> Models::MemberGrounds
193
194
  def grounds(audit) = audit.grounds(member_loads(audit.map))
194
195
 
195
196
  # Which members' last assessments a full audit carries forward, from its record, given or read now, and the
196
- # question it asks (D49).
197
+ # question it asks.
197
198
  #: (Models::Audit, ?Models::AuditRecord?) -> Models::CarriedAssessments
198
199
  def carried_assessments(audit, record = @audit_records.find(audit.id))
199
200
  audit.carried_assessments(record, grounds: grounds(audit), question: Views::AssessmentRequest.question)
@@ -206,7 +207,7 @@ module Principles
206
207
  end
207
208
 
208
209
  # The members sharing a line with member where it is now, in map and in the other maps, as add-member and
209
- # show-principle print them (#383, #541).
210
+ # show-principle print them.
210
211
  #: (Models::Member, Models::Principle) -> Views::LinesSharedWithMember
211
212
  def lines_shared(member, map)
212
213
  Views::LinesSharedWithMember.new(**Models::MembersSharingLines.of(@project, member).facts_beside(map))
@@ -5,6 +5,7 @@ require_relative "answer_phase"
5
5
  require_relative "../models/audit"
6
6
  require_relative "../models/correction_answer"
7
7
  require_relative "../models/declared_map_changes"
8
+ require_relative "../models/finding_write_ups"
8
9
  require_relative "../models/request_id"
9
10
  require_relative "../views/prompts"
10
11
  require_relative "audit_completion"
@@ -15,11 +16,11 @@ module Principles
15
16
  module Controllers
16
17
  # A full audit's correction, which submit-answer and show-answer-check hand over: this tool checks each
17
18
  # disposition, and any members moved or whose role or check a fix changed, against the map and hashes the
18
- # audit began from, and completes the audit (D28, D40).
19
+ # audit began from, and completes the audit.
19
20
  class Correction < AnswerPhase
20
21
  # The result of answering a correction request, and the record change it makes, not yet written. A refused
21
22
  # answer to a request printed before the record changed is refused as stale, so the agent starts again rather
22
- # than repairing it (#671).
23
+ # than repairing it.
23
24
  # @override
24
25
  #: (Models::SubmittedAnswer) -> [untyped, Array[Models::AuditRecord]]
25
26
  def answered(submitted)
@@ -33,7 +34,7 @@ module Principles
33
34
  end
34
35
 
35
36
  # What each map entry a fix in the answer claims changed, from the map its audit started from and its map now;
36
- # the audit is built and the base map read only when a fix claims one (#462).
37
+ # the audit is built and the base map read only when a fix claims one.
37
38
  # @override
38
39
  #: (Models::SubmittedAnswer) -> Array[Hash[String, untyped]]
39
40
  def map_entry_changes(submitted)
@@ -45,9 +46,16 @@ module Principles
45
46
  end
46
47
  end
47
48
 
49
+ # Each finding the completed record leaves deferred with recorded_at null.
50
+ # @override
51
+ #: (Array[Models::AuditRecord]) -> Array[String]
52
+ def deferred_written_up_nowhere(changes)
53
+ Models::FindingWriteUps.of(@project, changes).deferred_written_up_nowhere
54
+ end
55
+
48
56
  private
49
57
 
50
- # The placeholders a correction's template printed, its dispositions' (#1084).
58
+ # The placeholders a correction's template printed, its dispositions'.
51
59
  #: (Models::RequestId) -> Hash[String, untyped]?
52
60
  def printed_placeholders(_request_id) = Models::Disposition::TEMPLATE_PLACEHOLDERS
53
61
 
@@ -64,13 +72,13 @@ module Principles
64
72
  findings, basis.prior_decided.moved(moves))
65
73
  end
66
74
 
67
- # What the audit a correction resumes began from, its assessment read back from the record it left (D87).
75
+ # What the audit a correction resumes began from, its assessment read back from the record it left.
68
76
  #: (Models::Audit, Models::CorrectionBasis, Hash[String, String], Models::MemberMoves) -> Models::AuditStart
69
77
  def resumed(audit, basis, before, moves) = audit.resumed(basis, before, moves, @audit_records.find(audit.id))
70
78
 
71
79
  # The packaged answer guide, which the correction request prints, is the one owner of its samples, the text
72
80
  # the agent saw, so its sample for each action is handed to the model, which refuses a field given back as
73
- # its sample (#789). Should the tool be upgraded between request and answer, that answer is checked only
81
+ # its sample. Should the tool be upgraded between request and answer, that answer is checked only
74
82
  # against the new guide's samples.
75
83
  #: (untyped, Array[untyped], Models::AuditStart, Models::Audit) -> Array[Models::Disposition]
76
84
  def dispositions(response, findings, start, audit)
@@ -107,7 +115,7 @@ module Principles
107
115
  end
108
116
 
109
117
  # The completion of a correction, which read its assessment back from the audit's record: the open one or, for
110
- # an identical retry, the completed one (D87).
118
+ # an identical retry, the completed one.
111
119
  #: (Models::DeclaredMapChanges, Models::CorrectionBasis, Models::Audit) -> AuditCompletion
112
120
  def completion(map_changes, basis, audit)
113
121
  handed(AuditCompletion, map_changes: map_changes, replacing: basis.printed_after,
@@ -0,0 +1,40 @@
1
+ # typed: strict
2
+ # frozen_string_literal: true
3
+
4
+ require_relative "command"
5
+ require_relative "../models/first_full_audit"
6
+ require_relative "../models/problem_report"
7
+ require_relative "../views/first_audit_brief"
8
+
9
+ module Principles
10
+ # Each runs one command: reads models, applies their rules and prints through a view.
11
+ # controllers/CLAUDE.md owns the boundary.
12
+ module Controllers
13
+ # show-first-audit-brief: the instructions for one background subagent to run a principle's first full audit,
14
+ # so the session that starts it spends a few hundred bytes of its context on the audit rather than tens of
15
+ # kilobytes. It writes nothing.
16
+ class FirstAuditBrief < Command
17
+ #: (String, String?, Hash[String, untyped]) -> untyped
18
+ def call(command, id, _options)
19
+ naming_the_executable do
20
+ unknown(command) unless command == "show-first-audit-brief"
21
+
22
+ id ? brief(id) : view.awaiting(Models::ProblemReport.for(@project, nil).awaiting_first_audit)
23
+ end
24
+ end
25
+
26
+ private
27
+
28
+ # The brief for principle id, refused once a full audit of it has completed.
29
+ #: (String) -> Hash[String, untyped]
30
+ def brief(id)
31
+ @principles.find(id)
32
+ Models::FirstFullAudit.new(id, @audit_records.find(id)).refuse_once_completed
33
+ view.result(id)
34
+ end
35
+
36
+ #: () -> Views::FirstAuditBrief
37
+ def view = Views::FirstAuditBrief.new(invocation)
38
+ end
39
+ end
40
+ end