principles 0.0.6 → 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 (338) 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 +58 -41
  9. data/lib/principles/command_line.rb +37 -14
  10. data/lib/principles/command_routes.rb +21 -7
  11. data/lib/principles/controllers/acknowledgement.rb +50 -118
  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 +52 -21
  15. data/lib/principles/controllers/answer_phase.rb +20 -3
  16. data/lib/principles/controllers/assessment.rb +41 -28
  17. data/lib/principles/controllers/audit.rb +59 -15
  18. data/lib/principles/controllers/audit_completion.rb +25 -12
  19. data/lib/principles/controllers/command.rb +13 -12
  20. data/lib/principles/controllers/correction.rb +26 -11
  21. data/lib/principles/controllers/first_audit_brief.rb +40 -0
  22. data/lib/principles/controllers/full_audit_request.rb +47 -83
  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 +148 -0
  27. data/lib/principles/controllers/member_entries.rb +4 -4
  28. data/lib/principles/controllers/member_problems_report.rb +84 -30
  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 +67 -12
  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 -20
  57. data/lib/principles/data/schemas/acknowledgements-answer.schema.json +95 -0
  58. data/lib/principles/data/schemas/assessment-answer.schema.json +55 -20
  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 +14 -62
  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 +7 -6
  68. data/lib/principles/launch.rb +49 -0
  69. data/lib/principles/list_open_findings_options.rb +23 -0
  70. data/lib/principles/models/accepted_loading.rb +2 -2
  71. data/lib/principles/models/acknowledged_check.rb +106 -0
  72. data/lib/principles/models/acknowledgement.rb +51 -53
  73. data/lib/principles/models/acknowledgement_left_as_printed.rb +18 -5
  74. data/lib/principles/models/acknowledgement_refusal.rb +25 -10
  75. data/lib/principles/models/acknowledgements.rb +115 -0
  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 +12 -3
  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 +14 -15
  88. data/lib/principles/models/audit.rb +46 -34
  89. data/lib/principles/models/audit_record.rb +58 -27
  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 +19 -10
  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 +80 -0
  133. data/lib/principles/models/listed_members.rb +47 -0
  134. data/lib/principles/models/loaded_files.rb +4 -5
  135. data/lib/principles/models/loading_decision.rb +19 -10
  136. data/lib/principles/models/loading_facts.rb +1 -1
  137. data/lib/principles/models/loads_to_check.rb +1 -2
  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 +17 -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 +21 -18
  150. data/lib/principles/models/member_repair_moves.rb +15 -9
  151. data/lib/principles/models/member_sighting.rb +12 -15
  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 +42 -9
  181. data/lib/principles/models/project.rb +29 -20
  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 +42 -36
  196. data/lib/principles/models/request_id.rb +19 -7
  197. data/lib/principles/models/runs_from.rb +7 -2
  198. data/lib/principles/models/sent_answer.rb +38 -16
  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 +15 -7
  217. data/lib/principles/prose_list.rb +1 -1
  218. data/lib/principles/session_start_options.rb +3 -3
  219. data/lib/principles/start_audit_options.rb +54 -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 +137 -17
  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 +68 -38
  227. data/lib/principles/views/assessment_request.rb +43 -21
  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 +100 -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 +51 -39
  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 +49 -33
  237. data/lib/principles/views/diff_since_last_audit.rb +8 -6
  238. data/lib/principles/views/findings_result.rb +33 -1
  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 +32 -9
  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 +11 -7
  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 +61 -0
  256. data/lib/principles/views/members_a_commit_changed.rb +15 -11
  257. data/lib/principles/views/members_with_no_baseline.rb +10 -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 +24 -12
  261. data/lib/principles/views/open_findings_elsewhere_result.rb +5 -2
  262. data/lib/principles/views/open_findings_line.rb +26 -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 +70 -45
  275. data/lib/principles/views/problem_result.rb +75 -43
  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/report-the-exit-status-its-own-listing-gives.md +3 -0
  279. data/lib/principles/views/prompts/acknowledge-a-change/resolve-them-in-a-full-audit.md +1 -0
  280. data/lib/principles/views/prompts/acknowledge-a-change/say-whether-each-change-keeps-its-meaning.md +8 -0
  281. data/lib/principles/views/prompts/acknowledge-a-change/say-whether-the-change-keeps-the-meaning.md +3 -3
  282. data/lib/principles/views/prompts/assess-every-member/confirm-each-write-up-pointer-the-answer-drops.md +2 -0
  283. data/lib/principles/views/prompts/assess-every-member/decide-each-member-loading.md +2 -1
  284. data/lib/principles/views/prompts/assess-every-member/have-a-changed-check-reviewed-before-running-it.md +1 -1
  285. data/lib/principles/views/prompts/assess-every-member/have-a-new-check-reviewed-before-running-it.md +1 -1
  286. data/lib/principles/views/prompts/assess-every-member/judge-a-carried-assessment-citing-a-decided-finding.md +3 -0
  287. data/lib/principles/views/prompts/assess-every-member/judge-a-submitted-carried-assessment-citing-a-decided-finding.md +5 -0
  288. data/lib/principles/views/prompts/assess-every-member/judge-the-keeping-under-the-release-since-the-last-audit.md +1 -1
  289. data/lib/principles/views/prompts/assess-every-member/keep-the-printed-review-basis-or-replace-it.md +1 -0
  290. data/lib/principles/views/prompts/assess-every-member/name-the-commit-that-made-the-check.md +1 -0
  291. data/lib/principles/views/prompts/assess-every-member/read-a-trimmed-instruction-whole.md +1 -1
  292. data/lib/principles/views/prompts/assess-every-member/read-the-request-in-parts.md +1 -0
  293. data/lib/principles/views/prompts/assess-every-member/run-the-check-then-report-it.md +2 -2
  294. data/lib/principles/views/prompts/assess-every-member/run-the-reviewed-check-and-say-what-its-review-rested-on.md +5 -3
  295. data/lib/principles/views/prompts/assess-every-member/why-each-member-is-judged-again.md +3 -2
  296. data/lib/principles/views/prompts/dispose-of-each-finding/answer-guide.json +1 -1
  297. data/lib/principles/views/prompts/dispose-of-each-finding/confirm-each-deferral-written-up-nowhere.md +2 -0
  298. data/lib/principles/views/prompts/dispose-of-each-finding/retain-assessment-and-correction.md +4 -4
  299. data/lib/principles/views/prompts/find-a-principle-to-map/where-the-inventory-looks.md +2 -2
  300. data/lib/principles/views/prompts/learn-what-a-command-does/every-command-and-how-they-chain.md +1 -2
  301. data/lib/principles/views/prompts/learn-what-a-command-does/list-candidate-files.md +4 -3
  302. data/lib/principles/views/prompts/learn-what-a-command-does/list-member-problems.md +16 -16
  303. data/lib/principles/views/prompts/learn-what-a-command-does/list-open-findings.md +65 -61
  304. data/lib/principles/views/prompts/learn-what-a-command-does/report-after-commit.md +14 -0
  305. data/lib/principles/views/prompts/learn-what-a-command-does/report-at-session-start.md +26 -0
  306. data/lib/principles/views/prompts/learn-what-a-command-does/show-answer-check.md +22 -20
  307. data/lib/principles/views/prompts/learn-what-a-command-does/show-first-audit-brief.md +19 -0
  308. data/lib/principles/views/prompts/learn-what-a-command-does/show-hook-setup.md +13 -0
  309. data/lib/principles/views/prompts/learn-what-a-command-does/show-meta-principle-passage.md +3 -1
  310. data/lib/principles/views/prompts/learn-what-a-command-does/show-open-correction.md +12 -0
  311. data/lib/principles/views/prompts/learn-what-a-command-does/start-audit.md +27 -28
  312. data/lib/principles/views/prompts/learn-what-a-command-does/submit-answer.md +39 -38
  313. data/lib/principles/views/prompts/report-the-completed-audit/commit-only-what-the-audit-changed.md +2 -2
  314. data/lib/principles/views/prompts/run-a-first-audit-in-the-background/follow-the-brief.md +18 -0
  315. data/lib/principles/views/prompts/set-principles-up/offer-the-report-hooks.md +2 -0
  316. data/lib/principles/views/prompts/set-principles-up/wire-the-report-hooks-with-the-user.md +8 -0
  317. data/lib/principles/views/prompts/start-a-session/act-on-the-open-findings.md +3 -4
  318. data/lib/principles/views/prompts/start-a-session/every-loaded-line-costs-every-session.md +1 -0
  319. data/lib/principles/views/prompts/start-a-session/hand-the-first-audit-to-a-subagent.md +3 -0
  320. data/lib/principles/views/prompts/start-a-session/run-each-command-above.md +1 -0
  321. data/lib/principles/views/prompts/start-a-session/start-no-second-first-audit.md +2 -0
  322. data/lib/principles/views/prompts/start-a-session/start-with-the-principles-skill.md +1 -0
  323. data/lib/principles/views/prompts.rb +1 -1
  324. data/lib/principles/views/read_the_change.rb +36 -0
  325. data/lib/principles/views/record_waiting_on_an_upgrade.rb +2 -2
  326. data/lib/principles/views/repoint_result.rb +1 -1
  327. data/lib/principles/views/report_hooks_offer.rb +25 -0
  328. data/lib/principles/views/request_part.rb +5 -5
  329. data/lib/principles/views/request_parts.rb +1 -1
  330. data/lib/principles/views/session_start_report.rb +46 -0
  331. data/lib/principles/views/shell_word.rb +1 -1
  332. data/lib/principles/views/trimmed_instructions_note.rb +30 -0
  333. data/lib/principles/views/visible_text.rb +1 -1
  334. data/lib/principles/views/workflow_diagram.rb +1 -1
  335. data/principles.gemspec +44 -0
  336. metadata +95 -14
  337. data/lib/principles/views/prompts/start-a-session/it-returns-after-each-clear-or-compaction-too.md +0 -1
  338. data/lib/principles/views/prompts/start-a-session/it-returns-at-each-session-start.md +0 -1
@@ -1,8 +1,10 @@
1
1
  # typed: strict
2
2
  # frozen_string_literal: true
3
3
 
4
+ require_relative "member_row"
4
5
  require_relative "visible_text"
5
6
  require_relative "invocation"
7
+ require_relative "prompts"
6
8
 
7
9
  module Principles
8
10
  # What this tool prints, from plain values a controller hands it. views/CLAUDE.md owns the boundary.
@@ -11,15 +13,13 @@ module Principles
11
13
  Lines = Struct.new(:stdout, :stderr, :status, keyword_init: true)
12
14
 
13
15
  # list-member-problems --short, for a commit hook or heartbeat that acts on an exit status and short lines
14
- # alone (#291): one tab-separated line per changed member on stdout, exit 3 when a member an audit assessed
15
- # changed and 4 when only members no audit assessed were edited (D44), and on stderr what to do next and
16
+ # alone: one tab-separated line per changed member on stdout, then one per principle counting its members
17
+ # no audit has assessed, exit 3 when there is any line to act on, and on stderr what to do next and
16
18
  # anything an empty stdout would hide.
17
19
  class ProblemLines
18
- # The exit status that says a member's own text changed since an audit or acknowledgement assessed it; 1 and
19
- # 2 already mean refused and usage error.
20
+ # The exit status that says a member's own text changed since an audit or acknowledgement assessed it, or that
21
+ # no audit has assessed a member; 1 and 2 already mean refused and usage error.
20
22
  CHANGED = 3
21
- # The exit status that says only members no audit has assessed were edited since they were mapped.
22
- UNASSESSED_ONLY = 4
23
23
 
24
24
  NO_MAPS = "No principle is mapped in this project, so there is nothing to check."
25
25
 
@@ -30,59 +30,84 @@ module Principles
30
30
  end
31
31
 
32
32
  # report is list-member-problems' JSON result: its "members", "counts" and "next_action".
33
- # assessed_change says whether a member an audit assessed changed, and unassessed_change whether a member no
34
- # audit assessed was edited since mapping; the model decides both, so the status follows from them alone.
35
- #: (Hash[String, untyped], nothing_changed: String, assessed_change: bool, unassessed_change: bool) -> Lines
36
- def short(report, nothing_changed:, assessed_change:, unassessed_change:)
37
- members = report.fetch("members")
38
- Lines.new(stdout: members.map { |member| "#{row(member)}\n" }.join,
39
- stderr: notes(report, nothing_changed).map { |note| "#{note}\n" }.join,
40
- status: status(assessed_change, unassessed_change))
33
+ # assessed_change says whether a member an audit assessed changed, and never_assessed counts, by principle,
34
+ # the members no audit has assessed; the model decides both, so the status follows from them alone.
35
+ # names_a_command says whether next_action names one, as ProblemResult says.
36
+ #: (Hash[String, untyped], nothing_changed: String, assessed_change: bool,
37
+ #| never_assessed: Hash[String, Integer], names_a_command: bool) -> Lines
38
+ def short(report, nothing_changed:, assessed_change:, never_assessed:, names_a_command:)
39
+ rows = report.fetch("members").map { MemberRow.new(it).short } +
40
+ never_assessed.map { |id, count| counted(id, count) }
41
+ Lines.new(stdout: rows.map { "#{it}\n" }.join,
42
+ stderr: notes(report, nothing_changed, names_a_command).map { |note| "#{note}\n" }.join,
43
+ status: assessed_change || !never_assessed.empty? ? CHANGED : 0)
41
44
  end
42
45
 
43
- # One changed member's row, its fields tab-separated: its principle, id, newest commit that changed it (or
44
- # "uncommitted"), that commit's subject, and what it was compared with: "audit" or "mapping_commit". The
45
- # after-commit hook prints the same row for each member a commit changed (D73).
46
- #: (Hash[String, untyped]) -> String
47
- def row(member)
48
- history = member.fetch("history", {})
49
- newest = history.fetch("commits", []).first
50
- fields = [member.fetch("principle"), member.fetch("id"), newest ? newest.fetch("commit") : "uncommitted",
51
- newest ? described(newest, history) : "not committed yet", member.dig("since", "baseline"),
52
- *("waiting_on_an_upgrade" if member["waiting_on_an_upgrade"])]
53
- fields.map { |field| VisibleText.new(field.to_s).to_s }.join("\t")
46
+ # short's lines for a session-start hook: on stdout, first the context universal, unless source is
47
+ # resume, whose conversation holds it already, then one line for each principle with a changed member an
48
+ # audit or acknowledgement assessed, counting them, with the command that lists them, from changed, in place of
49
+ # the rows and never-assessed counts, which an always-loaded carrier cannot afford, then where to start, as
50
+ # session_start_lines says; stderr and the status kept. Its command leaves
51
+ # out --project, as the hook's own commands do, since a session runs in its project.
52
+ #: (Lines, changed: Hash[String, Integer], source: String, skill: bool) -> Lines
53
+ def at_session_start(short, changed:, source:, skill:)
54
+ stdout = session_start_lines(changed:, source:, skill:)
55
+ Lines.new(stdout: stdout.map { "#{it}\n" }.join, stderr: short.stderr, status: short.status)
56
+ end
57
+
58
+ # at_session_start's stdout, a line each: the context universal, but on resume, then each principle's count
59
+ # of changed audited members with the command that lists them, then, when any is, where to start: the principles
60
+ # skill when skill says this session has it, as the plugin installs it, else those commands.
61
+ #: (changed: Hash[String, Integer], source: String, skill: bool) -> Array[String]
62
+ def session_start_lines(changed:, source:, skill:)
63
+ counts = changed.map { |id, count| changed_line(id, count) }
64
+ [*(Prompts.text("start-a-session/every-loaded-line-costs-every-session") unless source == "resume"),
65
+ *counts, *(where_to_start(skill) unless counts.empty?)]
54
66
  end
55
67
 
56
68
  private
57
69
 
58
- #: (bool, bool) -> Integer
59
- def status(assessed_change, unassessed_change)
60
- return CHANGED if assessed_change
70
+ # Where the agent starts with the changed members the count lines name: the principles skill, or without it the
71
+ # commands those lines print.
72
+ #: (bool) -> String
73
+ def where_to_start(skill)
74
+ return Prompts.text("start-a-session/start-with-the-principles-skill") if skill
61
75
 
62
- unassessed_change ? UNASSESSED_ONLY : 0
76
+ Prompts.text("start-a-session/run-each-command-above")
63
77
  end
64
78
 
65
- # The newest commit's subject, with how many earlier commits changed the member, and whether it changed
66
- # again on disk.
67
- #: (Hash[String, untyped], Hash[String, untyped]) -> String
68
- def described(newest, history)
69
- earlier = history.fetch("commits").length - 1
70
- more = history.dig("stopped_at", "reason") == "limit" ? " or more" : ""
71
- notes = [("+#{earlier}#{more} earlier" if earlier.positive?),
72
- ("also uncommitted" if history["uncommitted"])].compact
73
- notes.empty? ? newest.fetch("subject") : "#{newest.fetch("subject")} (#{notes.join("; ")})"
79
+ # The session-start line counting principle id's changed audited members, with the command that lists them.
80
+ #: (String, Integer) -> String
81
+ def changed_line(id, count)
82
+ "#{count} audited member#{"s" unless count == 1} of #{VisibleText.new(id)} changed: " \
83
+ "#{@invocation.without_project.in_project("list-member-problems", id, options: ["--short"])}"
74
84
  end
75
85
 
86
+ # The line counting principle id's members no audit has assessed, which a reader tells from a member's row by
87
+ # its two fields.
88
+ #: (String, Integer) -> String
89
+ def counted(id, count) = "#{VisibleText.new(id)}\t#{count} never assessed"
90
+
76
91
  # What the agent does next, and what an empty stdout would otherwise hide: no maps, or, in next_action,
77
- # each principle's members with no baseline to compare with and what gives them one (#564), and each
78
- # principle waiting on an upgrade, whose members are not counted, so they leave counts empty (D85, V8).
79
- #: (Hash[String, untyped], String) -> Array[String]
80
- def notes(report, nothing_changed)
92
+ # each principle's members with no baseline to compare with and what gives them one, and each
93
+ # principle waiting on an upgrade, whose members are not counted, so they leave counts empty.
94
+ #: (Hash[String, untyped], String, bool) -> Array[String]
95
+ def notes(report, nothing_changed, names_a_command)
81
96
  no_maps = report.fetch("counts").empty? && !report.key?("empty_maps") &&
82
97
  !report.key?("records_waiting_on_an_upgrade")
83
- [(NO_MAPS if no_maps),
84
- (report.fetch("next_action") unless report.fetch("next_action") == nothing_changed),
85
- ("Details: #{@invocation.in_project("list-member-problems")}" unless report.fetch("members").empty?)].compact
98
+ action = report.fetch("next_action")
99
+ [(NO_MAPS if no_maps), (project_line if names_a_command),
100
+ (action unless action == nothing_changed)].compact
101
+ end
102
+
103
+ # The project once, before the first command stderr prints, where they run since they leave out --project,
104
+ # and how to see the details rows leave out, such as each commit's subject; only the latter when each
105
+ # command names --project already.
106
+ #: () -> String
107
+ def project_line
108
+ return "Details: drop --short." if @invocation.named?
109
+
110
+ "In #{@invocation.project_word} (details: drop --short):"
86
111
  end
87
112
  end
88
113
  end
@@ -18,6 +18,10 @@ module Principles
18
18
  OLDER_STATE = "An older version of this tool kept audit runs in this file. This version does not read " \
19
19
  "it, so an audit recorded only there is not a baseline. Start a new audit to make one."
20
20
 
21
+ # The lead before the acknowledgements, which leaves the agent to judge each change.
22
+ ACKNOWLEDGE_LEAD = "Acknowledge members that still say the same thing with start-audit --member below; if " \
23
+ "one's meaning changed, or its check is new, changed or fails, run start-audit ID:"
24
+
21
25
  #: (Invocation) -> void
22
26
  def initialize(invocation)
23
27
  @invocation = invocation
@@ -26,64 +30,103 @@ module Principles
26
30
 
27
31
  # report holds "members", the changed members, and "counts"; not_read names older files left unread;
28
32
  # no_baseline_files names, by principle, the files to commit so its members with no baseline gain one.
29
- # acknowledgeable names, by principle, the changed members a one-member audit may judge (#626, D56).
30
- # waiting names each principle whose record a later copy wrote, whose members are not checked (D85, V8).
33
+ # acknowledgeable names, by the principles that acknowledge them together, the changed members a one-member
34
+ # audit may judge.
35
+ # waiting names each principle whose record a later copy wrote, whose members are not checked.
31
36
  #: (Hash[String, untyped], ?not_read: Array[String], ?no_baseline_files: Hash[String, Array[String]],
32
- #| ?acknowledgeable: Hash[String, Array[String]], ?waiting: Array[RecordWaitingOnAnUpgrade])
37
+ #| ?acknowledgeable: Hash[Array[String], Array[String]], ?waiting: Array[RecordWaitingOnAnUpgrade])
33
38
  #| -> Hash[String, untyped]
34
39
  def checked(report, not_read: [], no_baseline_files: {}, acknowledgeable: {}, waiting: [])
40
+ checked_naming_commands(report, not_read:, no_baseline_files:, acknowledgeable:, waiting:).first
41
+ end
42
+
43
+ # The same result, and whether its next_action names a command, before which --short names the project once,
44
+ # so no view reads the action's text to find one.
45
+ #: (Hash[String, untyped], ?not_read: Array[String], ?no_baseline_files: Hash[String, Array[String]],
46
+ #| ?acknowledgeable: Hash[Array[String], Array[String]], ?waiting: Array[RecordWaitingOnAnUpgrade])
47
+ #| -> [Hash[String, untyped], bool]
48
+ def checked_naming_commands(report, not_read: [], no_baseline_files: {}, acknowledgeable: {}, waiting: [])
35
49
  unless not_read.empty?
36
50
  report = report.merge("not_read" => not_read.map { |file| { "file" => file, "because" => OLDER_STATE } })
37
51
  end
38
52
  report = report.merge("records_waiting_on_an_upgrade" => waiting.map(&:to_h)) unless waiting.empty?
39
- report.merge("next_action" => next_action(report, no_baseline_files:, acknowledgeable:, waiting:))
53
+ action, commands = next_action(report, no_baseline_files:, acknowledgeable:, waiting:)
54
+ [report.merge("next_action" => action), commands]
55
+ end
56
+
57
+ # For each principle with members no baseline holds, what gives them one: outside git a completed audit,
58
+ # and in git committing the files no_baseline_files names.
59
+ #: (Hash[String, untyped], Hash[String, Array[String]]) -> Array[MembersWithNoBaseline]
60
+ def no_baseline_actions(report, no_baseline_files)
61
+ report.fetch("no_baseline_because", {}).map do |id, because|
62
+ MembersWithNoBaseline.new(id: id, count: report.fetch("compared_with").fetch(id).fetch("no_baseline"),
63
+ because: because, audit: @invocation.in_project("start-audit", id),
64
+ files: no_baseline_files.fetch(id, []))
65
+ end
40
66
  end
41
67
 
42
68
  private
43
69
 
44
- # What to do next for report, each kind of action on lines of its own, or NOTHING_CHANGED when none applies.
70
+ # What to do next for report, each kind of action on lines of its own, or NOTHING_CHANGED when none applies,
71
+ # and whether it names a command: every changed, unaudited and mapping action does, a no-baseline one as it
72
+ # says, and neither the mapping notice nor a waiting principle's update sentence does.
45
73
  #: (Hash[String, untyped], no_baseline_files: Hash[String, Array[String]],
46
- #| acknowledgeable: Hash[String, Array[String]], waiting: Array[RecordWaitingOnAnUpgrade]) -> String
74
+ #| acknowledgeable: Hash[Array[String], Array[String]], waiting: Array[RecordWaitingOnAnUpgrade])
75
+ #| -> [String, bool]
47
76
  def next_action(report, no_baseline_files:, acknowledgeable:, waiting:)
48
77
  waits = waiting.map(&:principle)
49
78
  mapping = MapsNeedingMembersOrAudit.new(@invocation, report: report, files_to_commit: no_baseline_files,
50
79
  waiting: waits)
51
- action = [changed_action(report, acknowledgeable, waits), unaudited_action(report, waits), mapping.notice,
52
- *no_baseline_actions(report, no_baseline_files).map(&:to_s), *mapping.actions,
80
+ commanding = [changed_action(report, acknowledgeable, waits), unaudited_action(report, waits)].compact
81
+ no_baseline = no_baseline_actions(report, no_baseline_files)
82
+ action = [*commanding, mapping.notice, *no_baseline.map(&:to_s), *mapping.actions,
53
83
  *waiting.map(&:to_s)].compact.join("\n")
54
- action.empty? ? NOTHING_CHANGED : action
84
+ [action.empty? ? NOTHING_CHANGED : action, names_a_command?(commanding, no_baseline, mapping)]
85
+ end
86
+
87
+ # Whether any of the actions that may name a command does.
88
+ #: (Array[String], Array[MembersWithNoBaseline], MapsNeedingMembersOrAudit) -> bool
89
+ def names_a_command?(commanding, no_baseline, mapping)
90
+ !commanding.empty? || no_baseline.any?(&:names_a_command?) || !mapping.actions.empty?
55
91
  end
56
92
 
57
- # For each principle with a changed member, its audits, each command ending its own line (#568): where
58
- # acknowledgeable names a member a one-member audit may judge, that audit for each such member, filled and
59
- # shell-quoted so the agent types no id (#626, D56), then the full audit, each with when to use it; elsewhere
60
- # the full audit alone, with no condition, as nothing else applies (#633). None for a principle in waits, whose
61
- # audits wait on an upgrade (#1066).
62
- #: (Hash[String, untyped], Hash[String, Array[String]], Array[String]) -> String?
93
+ # For each principle with a changed member, its audits, each command ending its own line: where acknowledgeable
94
+ # names members a one-member audit may judge, one acknowledgement for all of them, filled and shell-quoted so
95
+ # the agent types no id, after one lead saying when to audit in full instead; the full audit for a principle
96
+ # with a changed member no acknowledgement may judge, with no condition, as nothing else applies to it. None for
97
+ # a principle in waits, whose audits wait on an upgrade.
98
+ #: (Hash[String, untyped], Hash[Array[String], Array[String]], Array[String]) -> String?
63
99
  def changed_action(report, acknowledgeable, waits)
64
- principles = report.fetch("members").map { |member| member.fetch("principle") }.uniq - waits
65
- audits = principles.flat_map do |id|
66
- full = @invocation.in_project("start-audit", id)
67
- members = acknowledgeable.fetch(id, [])
68
- next "Audit #{id} in full to judge its changed members: #{full}" if members.empty?
69
-
70
- [*members.flat_map { |member| acknowledge_lines(id, member) },
71
- "When a change alters what a member of #{id} says, or its check is new, changed or does not pass, " \
72
- "audit it in full: #{full}"]
73
- end
74
- audits.empty? ? nil : audits.join("\n")
100
+ changed = report.fetch("members").group_by { it.fetch("principle") }.except(*waits)
101
+ acknowledging = acknowledgeable.map { |ids, members| acknowledge_line(ids, members) }
102
+ full = changed.filter_map { |id, members| full_audit_line(id, members, acknowledged_in(acknowledgeable, id)) }
103
+ lines = [*(ACKNOWLEDGE_LEAD unless acknowledging.empty?), *acknowledging, *full]
104
+ lines.empty? ? nil : lines.join("\n")
105
+ end
106
+
107
+ # The acknowledgement of every member in members by the principles ids names, each of those it maps.
108
+ #: (Array[String], Array[String]) -> String
109
+ def acknowledge_line(ids, members)
110
+ @invocation.listed_in_project("start-audit", ids, options: members.flat_map { ["--member", it] })
75
111
  end
76
112
 
77
- # The lead naming member, and on a line of its own the one-member audit that acknowledges its change.
78
- #: (String, String) -> Array[String]
79
- def acknowledge_lines(id, member)
80
- ["When #{member} still says the same thing, acknowledge it:",
81
- @invocation.in_project("start-audit", id, options: ["--member", member])]
113
+ # The members an acknowledgement in acknowledgeable takes in for principle id.
114
+ #: (Hash[Array[String], Array[String]], String) -> Array[String]
115
+ def acknowledged_in(acknowledgeable, id) = acknowledgeable.select { |ids, _| ids.include?(id) }.values.flatten
116
+
117
+ # The full audit of principle id, for its changed members no acknowledgement may judge, or nil when the
118
+ # acknowledgement takes in every one.
119
+ #: (String, Array[Hash[String, untyped]], Array[String]) -> String?
120
+ def full_audit_line(id, members, acknowledgeable)
121
+ return if members.all? { acknowledgeable.include?(it.fetch("id")) }
122
+
123
+ other = acknowledgeable.empty? ? "" : " other"
124
+ "Audit #{id} in full to judge its#{other} changed members: #{@invocation.in_project("start-audit", id)}"
82
125
  end
83
126
 
84
127
  # Members compared only with the commit that mapped them have never been assessed, so neither "changed" nor
85
128
  # "unchanged" says whether they carry their principle: those added to an audited principle by principle, and
86
- # every principle awaiting its first full audit in one line (D58, #731), but those in waits (#1066).
129
+ # every principle awaiting its first full audit in one line, but those in waits.
87
130
  #: (Hash[String, untyped], Array[String]) -> String?
88
131
  def unaudited_action(report, waits)
89
132
  awaiting = report.fetch("awaiting_first_audit", [])
@@ -110,17 +153,6 @@ module Principles
110
153
  ["No audit has assessed these yet, so whether they carry their principle is unknown, changed or not:",
111
154
  *unseen].join("\n")
112
155
  end
113
-
114
- # For each principle with members no baseline holds, what gives them one: outside git a completed audit,
115
- # and in git committing the files no_baseline_files names.
116
- #: (Hash[String, untyped], Hash[String, Array[String]]) -> Array[MembersWithNoBaseline]
117
- def no_baseline_actions(report, no_baseline_files)
118
- report.fetch("no_baseline_because", {}).map do |id, because|
119
- MembersWithNoBaseline.new(id: id, count: report.fetch("compared_with").fetch(id).fetch("no_baseline"),
120
- because: because, audit: @invocation.in_project("start-audit", id),
121
- files: no_baseline_files.fetch(id, []))
122
- end
123
- end
124
156
  end
125
157
  end
126
158
  end
@@ -0,0 +1,2 @@
1
+ Each member is mapped by every principle in `principles` that lists it, each with its own role, baseline and
2
+ context. Judge each member once, against every principle that lists it.
@@ -0,0 +1 @@
1
+ To read the deferred findings this acknowledgement keeps, which only a full audit resolves: %{list_open_findings}
@@ -0,0 +1,3 @@
1
+ One exception: this check is this tool's own list-member-problems, which lists this member, and any other the answer
2
+ acknowledges, until the record is committed, so it exits 3 now: report that 3, and under check_result.listed_members
3
+ the member id in the second column of each line it prints.
@@ -0,0 +1 @@
1
+ To resolve those %{principle_id} keeps, audit it in full: %{start_audit}
@@ -0,0 +1,8 @@
1
+ Judge each member in `members` on its own: read its change in its member_lines, or by running its read_the_change.
2
+ Answer `meaning_kept: true` only when the member still says the same thing. A member still says the same thing after a
3
+ fixed typo, a reworded sentence or a renumbered citation; an added, dropped, reversed, narrowed or widened rule changes
4
+ what it says. The answer is accepted for every member or refused for all, so when one changed, or you are unsure,
5
+ start this request again without it and audit it in full. Give each a one-line `reason` in your own words, under its
6
+ id in the template's `members`; quotes left out read as its `first_changed_lines`. Optional in each: `old_line` and
7
+ `new_line`, another changed line per side or 30 characters including the edit; a check's `check_result.command` and
8
+ `check_result.review_basis`.
@@ -1,6 +1,6 @@
1
1
  Read the change in member_lines, or by running read_the_change. Answer `meaning_kept: true` only when the member
2
2
  still says the same thing. A member still says the same thing after a fixed typo, a reworded sentence or a
3
3
  renumbered citation; an added, dropped, reversed, narrowed or widened rule changes what it says. When it changed, or
4
- you are unsure, run a full audit instead. Give a one-line `reason` in your own words, and fill the template; quotes
5
- left out read as `first_changed_lines`. Optional: `old_line` and `new_line`, another changed line per side or 30
6
- characters including the edit; `basis.base_commit`; a check's `check_result.command` and `check_result.review_basis`.
4
+ you are unsure, run a full audit instead. Give a one-line `reason` in your own words, and fill its `members` entry;
5
+ quotes left out read as `first_changed_lines`. Optional: `old_line` and `new_line`, another changed line per side or
6
+ 30 characters including the edit; `basis.base_commit`; a check's `check_result.command` and `check_result.review_basis`.
@@ -0,0 +1,2 @@
1
+ This answer's null `recorded_at` drops the write-up pointer each finding under `prior_findings_pointers_dropped`
2
+ has, shown there. If a drop is not meant, leave that `recorded_at` as printed, which keeps it, and check again.
@@ -11,7 +11,8 @@ A member whose loading the last full audit accepted carries `last_accepted`: its
11
11
  `unchanged` or `changed`, comparing when the member loads and the member's own text, not its file's size, so a file
12
12
  growing outside the member stays `unchanged`. An edit acknowledged with `--member`, or a fix made in that audit's
13
13
  correction, counts as the text the decision was kept with. When `since_accepted` is `changed`, `last_accepted.changed`
14
- names which moved, `loading` or `member_text`, beside the `loads` it accepted: weigh the decision again.
14
+ names which moved, `loading` or `member_text`, beside the `loads` it accepted: weigh the decision again. When it is
15
+ `unchanged` and its reason still holds, decide `kept` with no `reason`; the record keeps the last accepted reason.
15
16
 
16
17
  When this principle's work is in hand in every session, change the activation to always, under which no member is
17
18
  listed here: %{always}
@@ -1,4 +1,4 @@
1
- This check changed since the last audit ran it%{changed_in}; show-audit prints the command that
1
+ This check changed since the last audit ran it; show-audit prints the command that
2
2
  audit ran, in this member's check_result. Before you run it, have
3
3
  the change reviewed by the project's owner, or confirm it against the project's own documentation;
4
4
  documentation outside the check's own file counts for more than comments in it.
@@ -1,3 +1,3 @@
1
- No audit has run this check%{set_in}. Before you run it,
1
+ No audit has run this check. Before you run it,
2
2
  have it reviewed by the project's owner, or confirm it against the project's own documentation;
3
3
  documentation outside the check's own file counts for more than comments in it.
@@ -0,0 +1,3 @@
1
+ Each member under `carried_assessments_citing_decided_findings` carries forward an assessment whose text names a
2
+ finding this answer decides other than still_holds; the id may be another record's. If the assessment no longer
3
+ holds, replace that member's `carried_forward` with your own assessment, and check the answer again.
@@ -0,0 +1,5 @@
1
+ Each member under `carried_assessments_citing_decided_findings` carried forward an assessment whose text names a
2
+ finding this answer decided other than still_holds; the id may be another record's. If that assessment no longer
3
+ holds, once this audit completes, start the next full audit and give that member your own assessment in place of
4
+ `carried_forward`:
5
+ %{start_audit}
@@ -1,6 +1,6 @@
1
1
  `version_at_last_audit` is the version of `principles` this principle's last completed audit ran under, or null when
2
2
  no completed audit recorded one, and `version_now` the version running now. A new version can change the session-start
3
- hook, the skill and the passage `show-meta-principle-passage` proposes, none of which this project maps.
3
+ hook, the skill and the passage `show-meta-principle-passage` proposes, %{mapped}.
4
4
  `passage_changed` says whether that passage's text changed since, or is null when there is nothing to compare it
5
5
  with. The project's passage may differ from the one setup proposes, on purpose: placed in its own words, with a step
6
6
  left to a section that already carries it. So when the version or the passage changed, compare what each says the
@@ -0,0 +1 @@
1
+ review_basis holds the line its last review rested on, from %{since}: kept as printed, or replace it with a new one.
@@ -0,0 +1 @@
1
+ Commit %{commit} %{verb} this check.
@@ -1 +1 @@
1
- Printed in part: %{fields}. To read one whole, add `--instruction FIELD` to this start-audit.
1
+ Printed in part, enough for this request's cases: %{fields}. To read one whole, add `--instruction FIELD` to this start-audit.
@@ -0,0 +1 @@
1
+ List this request's parts with their bytes, then print one alone with `--part NAME`: %{index}
@@ -1,2 +1,2 @@
1
- Run the command in the project, then replace this text with its exit status, an integer. If it could not be
2
- run, write why in not_run_reason instead, and leave this text as printed.
1
+ Run the command in the project, then replace exit_status with its exit status, an integer. If it could not be
2
+ run, write why in not_run_reason instead, and leave exit_status as printed.
@@ -1,3 +1,5 @@
1
- Then run it in the project, replace this text with its exit status, an integer, and replace review_basis with
2
- what the review rested on. This tool keeps that line and cannot verify it. If it was not run, including when no
3
- review was possible, write why in not_run_reason instead, and leave this text and review_basis as printed.
1
+ Then run it in the project, replace exit_status with its exit status, an integer, and replace review_basis with what
2
+ the review rested on, in one line, such as who reviewed it or the document that confirms it; for your own review,
3
+ "Self-reviewed by the agent: <what you checked it against>". This tool keeps that line and cannot verify it. If it
4
+ was not run, including when no review was possible, write why in not_run_reason instead, and leave exit_status and
5
+ review_basis as printed.
@@ -1,6 +1,7 @@
1
1
  Assess each member with `judge_because` afresh. In git, after a full audit, its `read_the_change` shows the edits to its
2
- file since that audit's base commit; a change to its map entry, its loads or the question does not show there, so an
3
- empty diff does not mean nothing changed. Its value says why this audit cannot carry its last assessment:
2
+ lines, or to a whole or moved file, since that audit's base commit; a change to its map entry, its loads or the
3
+ question does not show there, so an empty diff does not mean nothing changed. Its value says why this audit cannot carry
4
+ its last assessment:
4
5
 
5
6
  `not_assessed_before`: no completed audit has assessed it.
6
7
 
@@ -14,7 +14,7 @@
14
14
  "reason": "Why, and what remains",
15
15
  "changed_members": [],
16
16
  "evidence": [],
17
- "recorded_at": { "path": "where the project keeps the write-up", "starting_at": "the line that states the problem" },
17
+ "recorded_at": { "path": "where the project keeps the write-up, or set recorded_at null if none", "starting_at": "the line that states the problem" },
18
18
  "waits_on": "Whom it waits on, to decide what, in one line, or null"
19
19
  },
20
20
  "accepted": {
@@ -0,0 +1,2 @@
1
+ Deferred with recorded_at null: %{finding_ids}. That is allowed when there is nowhere to point; the record then
2
+ keeps no write-up, so list-open-findings prints none. If one is written up, point its recorded_at there and check again.
@@ -1,4 +1,4 @@
1
- Keep the exact original assessment you submit (or the exact stdin bytes for `--file -`) and this correction
2
- packet before changing members. Save copies outside the project, including the correction's request_id,
3
- basis and response_template or correction_template, and fill only its dispositions. Git cannot reconstruct
4
- your assessment judgements.
1
+ Keep a copy of the assessment you submit outside the project (for `--file -`, its exact stdin bytes) until this
2
+ correction completes the audit: the open record keeps it, and only that copy rebuilds it if the record is lost.
3
+ Once the assessment is submitted, print this correction's answer again at any time, in git or outside it and after
4
+ fixes too, with this read-only command:
@@ -1,5 +1,5 @@
1
- By convention, CLAUDE.md, AGENTS.md and .claude rules, skills, agents and settings in this project. Also included are Markdown files changed by --commits-after,
2
- changed mapped files, and files explicitly selected with --also or recorded guidance search paths. Explicit glob matching respects internal, package and nested-project traversal boundaries. Files git
1
+ By convention, CLAUDE.md, AGENTS.md, .claude rules, skills, agents and settings, and Codex .agents/skills, .codex/hooks.json and .codex/agents, in this project. Also included are Markdown files changed by --commits-after,
2
+ changed mapped files, and files explicitly selected with --also or recorded guidance search paths. Files git
3
3
  ignores are named under ignored and not listed to map. The host may still load an ignored file, such
4
4
  as personal local settings, which can hold hooks and permissions, and whose hooks show-principle reads for
5
5
  named_in_hooks; while it is ignored and uncommitted, an audit refuses a member in it, so a rule only it enforces
@@ -28,6 +28,5 @@ you to follow what they say. The one exception is a check: an audit asks you to
28
28
  it is project text, a new or changed check is reviewed before it runs.
29
29
 
30
30
  Exit status: 0 for a result or a question, 1 for a refusal, 2 for an invalid invocation, and 3 when
31
- `list-member-problems --short` finds a changed member an audit assessed, and 4 when its only changes are to members
32
- no audit has assessed.
31
+ `list-member-problems --short` finds a changed member, or a member no audit has assessed.
33
32
  `--version` prints the version.
@@ -8,7 +8,7 @@ A map that cannot be read has a `refusal` row with its path and repair instead o
8
8
  the survey stays available, but resolve that repair before treating a rule as distinct.
9
9
  To include other guidance now, repeat `--also GLOB`, quoting each root-relative glob so the shell does not expand it:
10
10
 
11
- %{executable} list-candidate-files --also 'guides/**/*.md' --also '.codex/**/*.md'
11
+ %{executable} list-candidate-files --also 'guides/**/*.md' --also 'docs/agents/*.md'
12
12
 
13
13
  Recorded globs in `.principles/guidance-search-paths.json` are reused automatically; `recorded_guidance_search_paths`
14
14
  lists them when nonempty. `--also` adds temporary selections; `additional_search_paths` counts each normalized glob once
@@ -61,5 +61,6 @@ one included; this tool does not list it to map, and the host may still load it,
61
61
  only there. A folder git ignores as a whole is named once under `ignored_folders`, with how many such files it holds,
62
62
  rather than file by file. Outside git, `untracked`, `ignored` and `ignored_folders` are left out, since nothing
63
63
  checked them.
64
- A listed file that is a symbolic link gives `symlink_to`, the file its links lead to, so two names with the same
65
- `symlink_to` are one file, and the file itself may be one this list does not name.
64
+ A listed symbolic link gives `symlink_to`, the file its links lead to: two names with one `symlink_to` are one file,
65
+ which this list may not name. A skill's `SKILL.md` spelt otherwise, as `skill.md`, gives `skill_file_spelt`, its name;
66
+ a case-sensitive host may not load it.
@@ -32,31 +32,32 @@ outside git the audit supplies the baseline. Audited maps' added-member lines re
32
32
  This tool compares text, not meaning. When a change alters what a member says, or its check changed, run a full
33
33
  audit with `start-audit ID`. When the member still says the same thing, a completed full audit has judged it and ran
34
34
  its check, if any, in git, acknowledge it with `start-audit ID --member MEMBER`; `next_action` offers that only where
35
- it applies, as one command per such member with its id filled in and quoted for a shell.
35
+ it applies, as one command per principle giving `--member` for each such member, quoted for a shell.
36
36
  `records_waiting_on_an_upgrade`: principles whose record a later copy wrote, changes marked `waiting_on_an_upgrade`.
37
37
 
38
38
  Run it after a commit that touches a mapped member's file, and at the start of a session.
39
39
 
40
40
  `--short` is for a git hook or a heartbeat that acts on an exit status and short lines alone. It prints one line per
41
41
  changed member on stdout, with these tab-separated fields: its principle, its id, the newest commit that changed it
42
- (or `uncommitted`), that commit's subject, noting how many earlier commits changed it and whether it changed again on
43
- disk, and what it was compared with: `audit` when an audit or acknowledgement assessed its text, or `mapping_commit`
42
+ (or `uncommitted`), whose subject and earlier commits the JSON result's `history` gives, and what it was compared
43
+ with: `audit` when an audit or acknowledgement assessed its text, or `mapping_commit`
44
44
  when no audit has, so only the commit that mapped it gives a baseline, then `waiting_on_an_upgrade` for one compared
45
45
  with hashes a later copy wrote. Members compared with an audit come first. Control and invisible characters in a field
46
46
  are written as `\uXXXX`, so an id holding such a character is escaped for display: copied from a row, it names no
47
- member. The commands `next_action` prints carry each id exactly. It exits 0 when no member this copy can act on changed,
48
- as when each change waits on an upgrade, 3 when a member an audit assessed changed, and 4 when the only changes are
49
- edits to members no audit has assessed. An edit like that carries no verdict, since neither text was judged, so a
50
- session-start hook can leave exit 4 and `mapping_commit` rows out, while a post-commit hook still sees each edit.
47
+ member. The commands `next_action` prints carry each id exactly. After the rows, a line for each principle with members
48
+ no audit has assessed gives its id and `N never assessed`. It exits 0 when no member this copy can act on changed, as
49
+ when each change waits on an upgrade, and 3 when it prints a row or a count.
51
50
  Every refusal exits 1 with a single line of JSON on stderr, the only line this tool writes there when it refuses,
52
51
  whose `code` names it, such as `broken_members` (a member that cannot be found or read), `principles_folder_not_moved`
53
52
  (a project state to repair) or `unsupported_ruby` (no supported Ruby runs this tool). Other programs, such as an rbenv
54
53
  shim, may write other lines there, and codes may be added: a code a hook does not know is still a refusal to read. A
55
- usage error exits 2. When it does not refuse, stderr carries what to do next, and says when there are no maps, or
56
- members with no baseline, that an empty stdout would hide. A changed member stays listed until an audit takes it in,
57
- so use it as a notice rather than a gate that blocks commits.
54
+ usage error exits 2. When it does not refuse, stderr carries what to do next, its commands naming `--project` if given
55
+ it, else run in the project it names once, and says when there are no maps, or members with no baseline, that an empty
56
+ stdout would hide. A changed member stays listed until an audit takes it in: a notice, not a gate that blocks commits.
58
57
  For a post-commit hook, run: %{executable} list-member-problems --short || true
59
58
  A heartbeat can compare each line's commit with the last one it reported.
59
+ `--short --session-start SOURCE`, for the session-start hook, prints instead the meta-principle's reminder, but on
60
+ `resume`, then each principle's count of changed audited members with a command listing them.
60
61
 
61
62
  `--commits-after COMMIT --hook-event EVENT` is for a Claude Code hook that runs after a Bash call, so a long session
62
63
  learns of a member it changed at the commit that changed it, not only at its next start. The plugin's after-commit
@@ -64,13 +65,12 @@ hook runs it once HEAD moved during the call, with COMMIT the full sha HEAD poin
64
65
  event, `PostToolUse` or `PostToolUseFailure`. It prints one JSON object, `hookSpecificOutput`, whose `hookEventName`
65
66
  is EVENT and whose `additionalContext` names, one row per member in `--short`'s fields, the members whose newest
66
67
  changing commit came after COMMIT, of both kinds, then how many other changed members are still listed, this command
67
- without the options, and a line naming the `/principles` skill as where to start; one waiting
68
+ without the options, and, under the plugin, a line naming the `/principles` skill as where to start; one waiting
68
69
  on an upgrade comes apart. It prints nothing when those commits changed no mapped member. A refusal is reported, as
69
70
  its code and this command, only when those commits changed `.principles/` or a file a map names, since only then could
70
71
  they have caused it; else it prints nothing, and the session-start hook reports it. It exits 0 but for a usage error.
71
72
 
72
- A member edited without changing what it says is listed at every commit until an audit takes the edit in. A member
73
- still says the same thing after a fixed typo, a reworded sentence or a renumbered citation; an added, dropped,
74
- reversed, narrowed or widened rule changes what it says. When one member was edited but still says the same
75
- thing, and a completed full audit has judged it, take in just that edit with `start-audit ID --member MEMBER`
76
- instead of a full audit.
73
+ A member edited without changing what it says is listed at every commit until an audit takes the edit in. A member still
74
+ says the same thing after a fixed typo, a reworded sentence or a renumbered citation; an added, dropped, reversed,
75
+ narrowed or widened rule changes what it says. When one member was edited but still says the same thing, and a completed
76
+ full audit has judged it, take in just that edit with `start-audit ID --member MEMBER` instead of a full audit.