principles 0.1.3 → 0.1.5

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 (312) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +151 -1
  3. data/README.md +10 -6
  4. data/exe/principles +1 -1
  5. data/lib/principles/cli.rb +9 -10
  6. data/lib/principles/command_line.rb +15 -6
  7. data/lib/principles/command_routes.rb +18 -2
  8. data/lib/principles/controllers/acknowledgement.rb +19 -4
  9. data/lib/principles/controllers/acknowledgements.rb +43 -12
  10. data/lib/principles/controllers/after_commit_report.rb +15 -2
  11. data/lib/principles/controllers/assessment.rb +7 -3
  12. data/lib/principles/controllers/audit.rb +17 -8
  13. data/lib/principles/controllers/audit_completion.rb +34 -9
  14. data/lib/principles/controllers/carrier_edit_report.rb +40 -0
  15. data/lib/principles/controllers/carrier_practices.rb +26 -0
  16. data/lib/principles/controllers/command.rb +36 -5
  17. data/lib/principles/controllers/context_budget.rb +61 -0
  18. data/lib/principles/controllers/correction.rb +15 -5
  19. data/lib/principles/controllers/full_audit_request.rb +38 -42
  20. data/lib/principles/controllers/inventory.rb +78 -71
  21. data/lib/principles/controllers/last_record_notice_beside.rb +51 -0
  22. data/lib/principles/controllers/member_addition.rb +20 -5
  23. data/lib/principles/controllers/member_entries.rb +50 -39
  24. data/lib/principles/controllers/member_entry_changes.rb +71 -0
  25. data/lib/principles/controllers/member_problems_report.rb +26 -6
  26. data/lib/principles/controllers/members_a_commit_changed.rb +14 -5
  27. data/lib/principles/controllers/members_in_logged_requests.rb +52 -0
  28. data/lib/principles/controllers/members_to_assess.rb +35 -8
  29. data/lib/principles/controllers/meta_principle_setup.rb +12 -4
  30. data/lib/principles/controllers/open_correction.rb +3 -2
  31. data/lib/principles/controllers/parts_to_read.rb +48 -6
  32. data/lib/principles/controllers/plugin_member_addition.rb +48 -0
  33. data/lib/principles/controllers/principle_listing.rb +84 -0
  34. data/lib/principles/controllers/request_logging.rb +65 -0
  35. data/lib/principles/controllers/running_tool.rb +55 -15
  36. data/lib/principles/controllers/session_start_report.rb +26 -2
  37. data/lib/principles/data/branches_bringing_in.rb +52 -0
  38. data/lib/principles/data/captured_requests.rb +118 -0
  39. data/lib/principles/data/carrier_page_markers.rb +38 -0
  40. data/lib/principles/data/changes_since.rb +56 -0
  41. data/lib/principles/data/claude_code_home.rb +75 -0
  42. data/lib/principles/data/command-steps.json +139 -23
  43. data/lib/principles/data/decoded_leaf.rb +63 -0
  44. data/lib/principles/data/head_reflog.rb +13 -2
  45. data/lib/principles/data/kept_line.rb +39 -0
  46. data/lib/principles/data/known_marketplaces.rb +50 -0
  47. data/lib/principles/data/logged_request_matches.rb +144 -0
  48. data/lib/principles/data/logged_request_scan.rb +188 -0
  49. data/lib/principles/data/map_files.rb +18 -4
  50. data/lib/principles/data/plugin_folder.rb +85 -0
  51. data/lib/principles/data/plugin_registry.rb +73 -0
  52. data/lib/principles/data/principles_store.rb +49 -0
  53. data/lib/principles/data/project_files.rb +15 -0
  54. data/lib/principles/data/ran.rb +25 -0
  55. data/lib/principles/data/raw_request_filter.rb +61 -0
  56. data/lib/principles/data/repository.rb +29 -27
  57. data/lib/principles/data/request_logging_folder.rb +135 -0
  58. data/lib/principles/data/request_shape.rb +33 -0
  59. data/lib/principles/data/running_version.rb +1 -1
  60. data/lib/principles/data/schemas/acknowledgement-answer.schema.json +16 -1
  61. data/lib/principles/data/schemas/acknowledgements-answer.schema.json +16 -1
  62. data/lib/principles/data/schemas/assessment-answer.schema.json +8 -0
  63. data/lib/principles/data/schemas/command-steps.schema.json +1 -1
  64. data/lib/principles/data/schemas/correction-answer-guide.schema.json +2 -1
  65. data/lib/principles/data/schemas/correction-answer.schema.json +14 -0
  66. data/lib/principles/data/schemas/member-map.schema.json +12 -1
  67. data/lib/principles/data/settings_env_keys.rb +26 -0
  68. data/lib/principles/data/string_counts.rb +39 -0
  69. data/lib/principles/data/tools_on_path.rb +25 -0
  70. data/lib/principles/data/user_request_logging_folder.rb +73 -0
  71. data/lib/principles/invocation_options.rb +5 -3
  72. data/lib/principles/launch.rb +29 -10
  73. data/lib/principles/models/acknowledged_check.rb +11 -1
  74. data/lib/principles/models/acknowledgement.rb +5 -0
  75. data/lib/principles/models/acknowledgement_refusal.rb +20 -11
  76. data/lib/principles/models/acknowledgements_to_offer.rb +86 -0
  77. data/lib/principles/models/after_commit_input.rb +5 -0
  78. data/lib/principles/models/answer_fields.rb +3 -0
  79. data/lib/principles/models/assessment_basis.rb +10 -3
  80. data/lib/principles/models/audit.rb +10 -10
  81. data/lib/principles/models/audit_record.rb +10 -0
  82. data/lib/principles/models/audit_records.rb +4 -3
  83. data/lib/principles/models/audit_start.rb +9 -0
  84. data/lib/principles/models/authored_locator.rb +33 -0
  85. data/lib/principles/models/candidate_files.rb +23 -3
  86. data/lib/principles/models/candidate_outline.rb +18 -125
  87. data/lib/principles/models/captured_sessions.rb +166 -0
  88. data/lib/principles/models/carrier_edit_input.rb +56 -0
  89. data/lib/principles/models/carrier_kind.rb +79 -0
  90. data/lib/principles/models/carrier_pages_shown.rb +28 -0
  91. data/lib/principles/models/carved_message_bytes.rb +115 -0
  92. data/lib/principles/models/cited_files.rb +12 -3
  93. data/lib/principles/models/context_parts.rb +59 -0
  94. data/lib/principles/models/decided_prior_findings.rb +5 -0
  95. data/lib/principles/models/declared_map_changes.rb +22 -13
  96. data/lib/principles/models/disposition.rb +37 -6
  97. data/lib/principles/models/disposition_placeholders.rb +12 -0
  98. data/lib/principles/models/disposition_text_field.rb +4 -0
  99. data/lib/principles/models/dropped_thinking.rb +73 -0
  100. data/lib/principles/models/feature.rb +54 -0
  101. data/lib/principles/models/finding_outcomes.rb +55 -0
  102. data/lib/principles/models/findings_left_open.rb +9 -11
  103. data/lib/principles/models/head_moves.rb +27 -10
  104. data/lib/principles/models/installed_component.rb +55 -0
  105. data/lib/principles/models/installed_plugins.rb +174 -0
  106. data/lib/principles/models/kept_sessions.rb +34 -0
  107. data/lib/principles/models/locator.rb +8 -0
  108. data/lib/principles/models/logged_request_reach.rb +52 -0
  109. data/lib/principles/models/logged_request_scan_completeness.rb +43 -0
  110. data/lib/principles/models/map_format_raise.rb +28 -0
  111. data/lib/principles/models/mapped_baseline.rb +46 -0
  112. data/lib/principles/models/mapped_principles.rb +2 -1
  113. data/lib/principles/models/maps_holding_file_whole.rb +42 -0
  114. data/lib/principles/models/markdown_text.rb +143 -0
  115. data/lib/principles/models/member.rb +19 -1
  116. data/lib/principles/models/member_entry.rb +56 -0
  117. data/lib/principles/models/member_justification.rb +52 -0
  118. data/lib/principles/models/member_lines.rb +11 -0
  119. data/lib/principles/models/member_loads.rb +17 -2
  120. data/lib/principles/models/member_problems.rb +46 -42
  121. data/lib/principles/models/member_reach.rb +59 -0
  122. data/lib/principles/models/member_snapshots.rb +34 -4
  123. data/lib/principles/models/member_text_as_sent.rb +31 -0
  124. data/lib/principles/models/member_texts.rb +45 -0
  125. data/lib/principles/models/members_by_part.rb +67 -0
  126. data/lib/principles/models/members_in_logged_requests.rb +279 -0
  127. data/lib/principles/models/meta_principle.rb +4 -4
  128. data/lib/principles/models/missing_files.rb +41 -16
  129. data/lib/principles/models/nearly_matching_maps.rb +56 -0
  130. data/lib/principles/models/open_correction.rb +5 -0
  131. data/lib/principles/models/open_finding.rb +4 -3
  132. data/lib/principles/models/outline_budget.rb +10 -1
  133. data/lib/principles/models/outline_item.rb +25 -0
  134. data/lib/principles/models/outline_section.rb +15 -4
  135. data/lib/principles/models/part_named.rb +16 -2
  136. data/lib/principles/models/part_token_estimates.rb +60 -0
  137. data/lib/principles/models/plugin_component.rb +37 -0
  138. data/lib/principles/models/plugin_enabled_in_project_settings.rb +61 -0
  139. data/lib/principles/models/plugin_install.rb +33 -0
  140. data/lib/principles/models/plugin_name.rb +23 -0
  141. data/lib/principles/models/plugin_reference.rb +53 -0
  142. data/lib/principles/models/principle.rb +7 -4
  143. data/lib/principles/models/principle_members.rb +22 -0
  144. data/lib/principles/models/prior_finding_decision.rb +1 -1
  145. data/lib/principles/models/prior_finding_outcomes.rb +12 -1
  146. data/lib/principles/models/problem_report.rb +14 -25
  147. data/lib/principles/models/project.rb +51 -56
  148. data/lib/principles/models/project_harness.rb +48 -0
  149. data/lib/principles/models/project_history.rb +19 -5
  150. data/lib/principles/models/recorded_members.rb +7 -0
  151. data/lib/principles/models/report_hooks.rb +9 -4
  152. data/lib/principles/models/request_channel.rb +62 -0
  153. data/lib/principles/models/request_kind.rb +62 -0
  154. data/lib/principles/models/request_logging.rb +231 -0
  155. data/lib/principles/models/request_logging_guard.rb +84 -0
  156. data/lib/principles/models/request_time.rb +46 -0
  157. data/lib/principles/models/runs_from.rb +0 -5
  158. data/lib/principles/models/script_comments.rb +58 -0
  159. data/lib/principles/models/session_registry.rb +61 -0
  160. data/lib/principles/models/session_start_input.rb +11 -2
  161. data/lib/principles/models/session_trend.rb +36 -0
  162. data/lib/principles/models/stale_request.rb +9 -0
  163. data/lib/principles/models/turn_opening.rb +83 -0
  164. data/lib/principles/models/turn_position.rb +43 -0
  165. data/lib/principles/models/unfixed_part.rb +82 -0
  166. data/lib/principles/models/unresolved_plugin_members.rb +35 -0
  167. data/lib/principles/models/user_logged_requests.rb +90 -0
  168. data/lib/principles/models/user_settings_entries.rb +49 -0
  169. data/lib/principles/models/whole_file_member_read.rb +48 -0
  170. data/lib/principles/models/without_prose.rb +20 -0
  171. data/lib/principles/models/workflow_jobs.rb +92 -0
  172. data/lib/principles/show_members_in_logged_requests_options.rb +27 -0
  173. data/lib/principles/show_principle_options.rb +32 -0
  174. data/lib/principles/version.rb +2 -2
  175. data/lib/principles/views/acknowledged_result.rb +31 -12
  176. data/lib/principles/views/acknowledgement_result.rb +18 -13
  177. data/lib/principles/views/acknowledgement_template_alone.rb +55 -0
  178. data/lib/principles/views/acknowledgements_offered.rb +54 -0
  179. data/lib/principles/views/added_member.rb +22 -6
  180. data/lib/principles/views/answer_in_a_file.rb +15 -15
  181. data/lib/principles/views/assessed_members.rb +19 -8
  182. data/lib/principles/views/assessment_request.rb +14 -6
  183. data/lib/principles/views/audit_changes.rb +14 -8
  184. data/lib/principles/views/audit_findings.rb +34 -0
  185. data/lib/principles/views/audit_result.rb +26 -24
  186. data/lib/principles/views/candidate_files_result.rb +1 -1
  187. data/lib/principles/views/carrier_checks.rb +40 -0
  188. data/lib/principles/views/carrier_edit_denial.rb +36 -0
  189. data/lib/principles/views/carrier_practices_page.rb +49 -0
  190. data/lib/principles/views/completed_audit_findings.rb +33 -0
  191. data/lib/principles/views/completed_audit_next_step.rb +12 -4
  192. data/lib/principles/views/consecutive_sections_elsewhere.rb +4 -0
  193. data/lib/principles/views/context_budget_result.rb +99 -0
  194. data/lib/principles/views/context_parts.rb +129 -25
  195. data/lib/principles/views/correction_request.rb +32 -17
  196. data/lib/principles/views/disposition_template.rb +35 -0
  197. data/lib/principles/views/first_audit.rb +29 -15
  198. data/lib/principles/views/first_audit_line.rb +4 -5
  199. data/lib/principles/views/hook_setup_result.rb +3 -1
  200. data/lib/principles/views/invocation.rb +14 -5
  201. data/lib/principles/views/last_record_notice.rb +41 -0
  202. data/lib/principles/views/lines_shared_with_member.rb +16 -22
  203. data/lib/principles/views/logged_request_status_meanings.rb +29 -0
  204. data/lib/principles/views/logged_requests_evidence.rb +84 -0
  205. data/lib/principles/views/map_added_to.rb +14 -12
  206. data/lib/principles/views/map_format_raised.rb +28 -0
  207. data/lib/principles/views/map_result.rb +41 -18
  208. data/lib/principles/views/maps_needing_members_or_audit.rb +1 -1
  209. data/lib/principles/views/member_change_since_baseline.rb +4 -0
  210. data/lib/principles/views/member_row.rb +13 -4
  211. data/lib/principles/views/member_sets_overlap.rb +31 -0
  212. data/lib/principles/views/members_a_commit_changed.rb +42 -25
  213. data/lib/principles/views/members_changed_during_audit.rb +27 -0
  214. data/lib/principles/views/members_in_logged_requests_result.rb +123 -0
  215. data/lib/principles/views/members_too_short_to_scan.rb +45 -0
  216. data/lib/principles/views/members_with_no_baseline.rb +6 -6
  217. data/lib/principles/views/meta_principle_result.rb +52 -15
  218. data/lib/principles/views/open_findings_line.rb +31 -92
  219. data/lib/principles/views/parts_index_result.rb +9 -5
  220. data/lib/principles/views/principle_read_result.rb +52 -11
  221. data/lib/principles/views/prior_findings_result.rb +9 -1
  222. data/lib/principles/views/problem_facts.rb +5 -3
  223. data/lib/principles/views/problem_lines.rb +54 -6
  224. data/lib/principles/views/problem_result.rb +7 -15
  225. data/lib/principles/views/prompts/assess-every-member/ask-whether-a-member-seen-only-as-read-is-loaded.md +3 -0
  226. data/lib/principles/views/prompts/assess-every-member/ask-whether-each-reason-holds.md +2 -0
  227. data/lib/principles/views/prompts/assess-every-member/claim-an-earlier-first-raised-at.md +6 -6
  228. data/lib/principles/views/prompts/assess-every-member/judge-the-keeping-against-the-other-principles.md +2 -0
  229. data/lib/principles/views/prompts/assess-every-member/read-a-compact-carried-member.md +9 -8
  230. data/lib/principles/views/prompts/assess-every-member/read-a-flagged-member-s-text-whole.md +3 -0
  231. data/lib/principles/views/prompts/assess-every-member/read-a-judged-member-s-text-whole.md +3 -0
  232. data/lib/principles/views/prompts/assess-every-member/turn-on-request-logging-to-see-what-reaches-context.md +2 -0
  233. data/lib/principles/views/prompts/assess-every-member/weigh-what-reached-the-context.md +7 -0
  234. data/lib/principles/views/prompts/dispose-of-each-finding/answer-guide.json +1 -0
  235. data/lib/principles/views/prompts/dispose-of-each-finding/fix-or-record-each-finding.md +6 -1
  236. data/lib/principles/views/prompts/dispose-of-each-finding/read-the-carrier-page-before-fixing.md +1 -0
  237. data/lib/principles/views/prompts/edit-a-carrier/read-the-page-before-the-first-edit.md +2 -0
  238. data/lib/principles/views/prompts/find-a-principle-to-map/read-a-cut-section-back.md +1 -1
  239. data/lib/principles/views/prompts/follow-each-carriers-best-practices/practices-for-hook-configuration.md +41 -0
  240. data/lib/principles/views/prompts/follow-each-carriers-best-practices/practices-for-hook-scripts.md +35 -0
  241. data/lib/principles/views/prompts/follow-each-carriers-best-practices/practices-for-instruction-files.md +37 -0
  242. data/lib/principles/views/prompts/follow-each-carriers-best-practices/practices-for-other-text-an-agent-reads.md +38 -0
  243. data/lib/principles/views/prompts/follow-each-carriers-best-practices/practices-for-rule-files.md +34 -0
  244. data/lib/principles/views/prompts/follow-each-carriers-best-practices/practices-for-skills.md +35 -0
  245. data/lib/principles/views/prompts/follow-each-carriers-best-practices/practices-for-subagent-definitions.md +35 -0
  246. data/lib/principles/views/prompts/learn-what-a-command-does/add-member.md +49 -51
  247. data/lib/principles/views/prompts/learn-what-a-command-does/change-member-name.md +12 -0
  248. data/lib/principles/views/prompts/learn-what-a-command-does/change-member-reason.md +12 -0
  249. data/lib/principles/views/prompts/learn-what-a-command-does/change-member-role.md +2 -1
  250. data/lib/principles/views/prompts/learn-what-a-command-does/every-command-and-how-they-chain.md +1 -1
  251. data/lib/principles/views/prompts/learn-what-a-command-does/list-candidate-files.md +1 -1
  252. data/lib/principles/views/prompts/learn-what-a-command-does/list-member-problems.md +32 -32
  253. data/lib/principles/views/prompts/learn-what-a-command-does/list-open-findings.md +10 -11
  254. data/lib/principles/views/prompts/learn-what-a-command-does/move-member.md +7 -6
  255. data/lib/principles/views/prompts/learn-what-a-command-does/remove-logged-requests.md +22 -0
  256. data/lib/principles/views/prompts/learn-what-a-command-does/remove-member.md +2 -1
  257. data/lib/principles/views/prompts/learn-what-a-command-does/report-at-session-start.md +8 -4
  258. data/lib/principles/views/prompts/learn-what-a-command-does/report-before-carrier-edit.md +13 -0
  259. data/lib/principles/views/prompts/learn-what-a-command-does/show-audit.md +7 -0
  260. data/lib/principles/views/prompts/learn-what-a-command-does/show-candidate-outlines.md +8 -2
  261. data/lib/principles/views/prompts/learn-what-a-command-does/show-carrier-practices.md +13 -0
  262. data/lib/principles/views/prompts/learn-what-a-command-does/show-context-budget.md +69 -0
  263. data/lib/principles/views/prompts/learn-what-a-command-does/show-hook-setup.md +4 -4
  264. data/lib/principles/views/prompts/learn-what-a-command-does/show-logged-requests.md +22 -0
  265. data/lib/principles/views/prompts/learn-what-a-command-does/show-members-in-logged-requests.md +62 -0
  266. data/lib/principles/views/prompts/learn-what-a-command-does/show-meta-principle-passage.md +13 -10
  267. data/lib/principles/views/prompts/learn-what-a-command-does/show-principle.md +16 -16
  268. data/lib/principles/views/prompts/learn-what-a-command-does/start-audit.md +27 -27
  269. data/lib/principles/views/prompts/learn-what-a-command-does/submit-answer.md +17 -17
  270. data/lib/principles/views/prompts/learn-what-a-command-does/turn-off-request-logging.md +18 -0
  271. data/lib/principles/views/prompts/learn-what-a-command-does/turn-on-request-logging.md +44 -0
  272. data/lib/principles/views/prompts/read-requested-outlines/continue-the-survey.md +3 -2
  273. data/lib/principles/views/prompts/read-what-reached-the-context/explain-request-logging-to-the-user.md +11 -0
  274. data/lib/principles/views/prompts/read-what-reached-the-context/explain-user-request-logging-to-the-user.md +10 -0
  275. data/lib/principles/views/prompts/read-what-reached-the-context/see-whether-members-reach-the-agent.md +2 -0
  276. data/lib/principles/views/prompts/read-what-reached-the-context/what-a-thread-continuation-holds.md +3 -0
  277. data/lib/principles/views/prompts/read-what-reached-the-context/what-absent-means.md +2 -0
  278. data/lib/principles/views/prompts/read-what-reached-the-context/what-each-context-budget-line-says.md +4 -0
  279. data/lib/principles/views/prompts/read-what-reached-the-context/what-each-member-line-says.md +2 -0
  280. data/lib/principles/views/prompts/read-what-reached-the-context/what-not-a-carrier-means.md +2 -0
  281. data/lib/principles/views/prompts/read-what-reached-the-context/what-present-but-not-loaded-means.md +2 -0
  282. data/lib/principles/views/prompts/read-what-reached-the-context/what-present-means.md +1 -0
  283. data/lib/principles/views/prompts/read-what-reached-the-context/what-unmeasurable-means.md +2 -0
  284. data/lib/principles/views/prompts/report-after-a-commit/a-row-ending-audit-asks-to-acknowledge-or-audit-again.md +1 -0
  285. data/lib/principles/views/prompts/report-after-a-commit/a-row-ending-mapping-commit-asks-for-an-audit.md +1 -0
  286. data/lib/principles/views/prompts/report-after-a-commit/a-row-ending-pinned-asks-for-an-audit.md +1 -0
  287. data/lib/principles/views/prompts/report-after-a-commit/plugin-members-are-still-listed.md +1 -0
  288. data/lib/principles/views/prompts/report-after-a-commit/the-commits-changed-these-members-waiting-on-an-upgrade.md +2 -2
  289. data/lib/principles/views/prompts/report-after-a-commit/the-commits-changed-these-members.md +2 -2
  290. data/lib/principles/views/prompts/report-after-a-commit/this-command-shows-what-each-needs-before-the-next-commit.md +1 -0
  291. data/lib/principles/views/prompts/run-a-first-audit-in-the-background/follow-the-brief.md +1 -0
  292. data/lib/principles/views/prompts/set-principles-up/ask-to-set-principles-up-after-an-audit.md +1 -0
  293. data/lib/principles/views/prompts/set-principles-up/entry-file-passage.md +1 -1
  294. data/lib/principles/views/prompts/set-principles-up/map-the-enabling-line-at-no-edit.md +3 -0
  295. data/lib/principles/views/prompts/set-principles-up/name-the-step-each-member-lacks.md +2 -2
  296. data/lib/principles/views/prompts/set-principles-up/place-the-passage-with-the-user.md +4 -2
  297. data/lib/principles/views/prompts/set-principles-up/what-the-passage-presumes.md +1 -1
  298. data/lib/principles/views/prompts/set-principles-up/why-set-principles-up.md +1 -0
  299. data/lib/principles/views/prompts/start-a-session/act-on-the-open-findings.md +2 -1
  300. data/lib/principles/views/prompts/start-a-session/ask-to-set-principles-up.md +2 -0
  301. data/lib/principles/views/prompts/start-a-session/hand-the-first-audit-to-a-subagent.md +2 -3
  302. data/lib/principles/views/prompts/start-a-session/name-the-principles-nothing-checks.md +1 -0
  303. data/lib/principles/views/prompts/start-a-session/raise-the-open-findings-waiting-on-no-one.md +1 -0
  304. data/lib/principles/views/request_logging_result.rb +108 -0
  305. data/lib/principles/views/request_part.rb +10 -4
  306. data/lib/principles/views/request_parts.rb +9 -0
  307. data/lib/principles/views/set_up_offer_line.rb +43 -0
  308. data/lib/principles/views/whole_file_elsewhere.rb +30 -0
  309. metadata +154 -5
  310. data/lib/principles/views/prompts/report-after-a-commit/the-principles-skill-is-where-to-start.md +0 -1
  311. data/lib/principles/views/prompts/report-after-a-commit/this-command-shows-each-one.md +0 -1
  312. data/lib/principles/views/prompts/set-principles-up/keep-them-held-between-audits.md +0 -2
@@ -8,6 +8,8 @@
8
8
  "writes": "Removes only `.principles/maps/ID.json`, listed under `removed`; `wrote` is empty. Commit the removal if the map was tracked. Retains member files and audit entries." },
9
9
  { "id": "write-guidance-search-paths", "heading": "Write the recorded guidance search paths, which the project commits",
10
10
  "writes": "Writes `.principles/guidance-search-paths.json`; commit it as it changes. Never a map, audit or guidance file." },
11
+ { "id": "write-request-logging", "heading": "Switch request logging; these write only in git-ignored `.principles/request-logging/` and the user-level folder",
12
+ "writes": "Writes only inside `.principles/request-logging/`, listed under `wrote`, and refuses unless git confirms it ignores that folder. Never commit it: a logged request holds a session's whole context. With --for-user, writes only the user-level folder outside every repository, and never the user's settings." },
11
13
  { "id": "write-audit-record", "heading": "Audit; these write only the audit record, `.principles/audits/ID.json`, which the project commits",
12
14
  "writes": "Writes `.principles/audits/ID.json`, listed under `wrote` when it does; commit it. Never the map or a member's file." }
13
15
  ],
@@ -16,9 +18,10 @@
16
18
  "read-map": ["principles_folder_not_moved", "both_principles_folders", "symlinked_directory", "unknown_principle", "unparseable_map", "invalid_map", "newer_format", "duplicate_member"],
17
19
  "read-audit": ["principles_folder_not_moved", "both_principles_folders", "symlinked_directory", "unparseable_audit", "invalid_audit_record"],
18
20
  "rewrite-audit": ["newer_audit_record"],
21
+ "read-plugin-registry": ["unreadable_plugin_registry", "unsupported_plugin_registry"],
19
22
  "locate-text": ["outside_project", "not_a_file", "unreadable_file", "renamed_in_case", "invalid_encoding", "section_needs_markdown", "query_needs_frontmatter", "query_with_other_locators", "unsupported_query", "unsupported_frontmatter", "duplicate_frontmatter_key", "field_not_found", "section_not_found",
20
23
  "ambiguous_heading", "passage_not_found", "ambiguous_passage", "passage_end_not_found",
21
- "broken_members"]
24
+ "broken_members", "plugin_members_unresolved"]
22
25
  },
23
26
  "commands": [
24
27
  {
@@ -84,7 +87,8 @@
84
87
  ]
85
88
  },
86
89
  {
87
- "name": "show-principle", "usage": "show-principle ID", "group": "read", "options": [],
90
+ "name": "show-principle", "usage": "show-principle ID [--loads] [--member MEMBER_ID]", "group": "read",
91
+ "options": ["loads", "member"],
88
92
  "summary": "Each member, where it is and whether it changed.",
89
93
  "help": "learn-what-a-command-does/show-principle",
90
94
  "steps": [
@@ -94,12 +98,12 @@
94
98
  ]
95
99
  },
96
100
  {
97
- "name": "show-audit", "usage": "show-audit ID", "group": "read", "options": [],
101
+ "name": "show-audit", "usage": "show-audit ID [--findings]", "group": "read", "options": ["findings"],
98
102
  "summary": "The record of a principle's last audit.",
99
103
  "help": "learn-what-a-command-does/show-audit",
100
104
  "steps": [
101
105
  { "id": "show-record", "actor": "cli",
102
- "does": "Prints the audit record: its status, base commit, each member's hash and each finding's members and disposition.",
106
+ "does": "Prints the audit record: its status, base commit, each member's hash and each finding's members and disposition; with --findings, its findings alone.",
103
107
  "refuses": ["unknown_principle", "unknown_audit"], "refuses_like": ["read-audit"] }
104
108
  ]
105
109
  },
@@ -109,7 +113,7 @@
109
113
  "help": "learn-what-a-command-does/list-open-findings",
110
114
  "steps": [
111
115
  { "id": "read-open-findings", "actor": "cli",
112
- "does": "Reads the last audit record of principle ID, or of every principle, and lists each deferred or accepted finding with its action, its members, its recorded_at pointer and when the audit was made. Says that an earlier audit's open findings are only in git. With --lines, prints each open finding on a line with its principle, id and waits_on. With --short, prints one line saying how many deferred findings wait on someone named or no one, whom the oldest waits on and git's user.name, and to raise each that waits on the user in the first reply, and nothing when none is open; --session-start clear or compact asks for the next reply, and resume shortens it to the facts, since a resumed conversation holds the whole line already.",
116
+ "does": "Reads the last audit record of principle ID, or of every principle, and lists each deferred or accepted finding with its action, its members, its recorded_at pointer and when the audit was made. Says that an earlier audit's open findings are only in git. With --lines, prints each open finding on a line with its principle, id and waits_on. With --short, prints one line saying first to act on each deferred finding that waits on the agent and to raise in the first reply each that waits on a person or on no one, then how many wait on someone named or no one and how long the oldest has, and nothing when none is open; --session-start clear or compact asks for the next reply, and resume shortens it to the facts, since a resumed conversation holds the whole line already.",
113
117
  "refuses_like": ["read-map", "read-audit"] },
114
118
  { "id": "follow-up-each-finding", "actor": "agent",
115
119
  "does": "Read each finding where its recorded_at points, and decide each one at its principle's next full audit.",
@@ -126,13 +130,22 @@
126
130
  "does": "Reads the hook's JSON on stdin after a shell call and always exits 0. When the call committed in a mapped repository, its own directory's or one its command changed into with cd or ran git -C in, prints the hook's JSON naming the members those commits changed, for the first such repository; otherwise prints nothing, at the cost of a few git calls." }
127
131
  ]
128
132
  },
133
+ {
134
+ "name": "report-before-carrier-edit", "usage": "report-before-carrier-edit", "group": "read", "options": [],
135
+ "summary": "Stops a session's first edit of each carrier kind once, naming its practices page.",
136
+ "help": "learn-what-a-command-does/report-before-carrier-edit",
137
+ "steps": [
138
+ { "id": "report-before-carrier-edit", "actor": "cli",
139
+ "does": "Reads the PreToolUse hook's JSON on stdin and always exits 0. When the call would edit a file in the project of a carrier kind a host loads by itself, and this session has not been pointed at that kind's page yet, prints the hook's JSON denying the call once, its reason naming show-carrier-practices KIND and asking for the same edit again, and leaves a marker for that session and kind in the temporary folder; otherwise prints nothing, and the edit goes through." }
140
+ ]
141
+ },
129
142
  {
130
143
  "name": "report-at-session-start", "usage": "report-at-session-start", "group": "read", "options": [],
131
- "summary": "What the agent should act on as a session starts, for a SessionStart hook to add to its context.",
144
+ "summary": "What the agent should act on as a session starts, for a SessionStart hook's context.",
132
145
  "help": "learn-what-a-command-does/report-at-session-start",
133
146
  "steps": [
134
147
  { "id": "report-at-session-start", "actor": "cli",
135
- "does": "Reads the SessionStart hook's JSON on stdin and always exits 0, since the host adds a SessionStart hook's output to the context only then. Prints nothing in a project with no maps. Otherwise prints, each line marked principles:, for one principle whose members an audit assessed changed since, a line with its count, that its audit no longer covers them, and the list-member-problems ID command to run before the user's task, which offers acknowledging them or auditing again, or for several, one line counting them with the list-member-problems --short command that lists them, then, in git, what gives each principle's members with no baseline one, then each principle whose audit record a later release wrote, whose audits wait on an upgrade, then, while any principle awaits its first full audit, one line counting them that asks for one background subagent to follow show-first-audit-brief, or to offer the audit at the next pause if none can be started, and at resume and compact only the count, asking for no second subagent, then, while any audit finding is left open, the one line list-open-findings --short prints, worded for the session's start. When list-member-problems refuses, prints instead its code and the command that shows its repair; input it cannot read is read as a startup." }
148
+ "does": "Reads the SessionStart hook's JSON on stdin and always exits 0, since the host adds a SessionStart hook's output to the context only then. Prints nothing in a project with no maps. Otherwise prints, each line marked principles:, for one principle whose members an audit assessed changed since, a line with its count, that its audit no longer covers them, and the list-member-problems ID command to run before the user's task, which offers acknowledging them or auditing again, or for several, one line counting them with the list-member-problems --short command that lists them, then, in git, what gives each principle's members with no baseline one, then each principle whose audit record a later release wrote, whose audits wait on an upgrade, then, while any principle awaits its first full audit, one line counting them that asks the agent to start one background subagent to follow show-first-audit-brief, tell the user, and relay its result, and at resume and compact only the count, asking for no second subagent, then, while any audit finding is left open, the one line list-open-findings --short prints, worded for the session's start. When list-member-problems refuses, prints instead its code and the command that shows its repair; input it cannot read is read as a startup." }
136
149
  ]
137
150
  },
138
151
  {
@@ -144,7 +157,7 @@
144
157
  "does": "Runs every check submit-answer would and prints the same refusal, or names the files submitting would write. Writes nothing.",
145
158
  "refuses": ["unparseable_json", "unreadable_file", "request_mismatch", "unknown_request", "stale_request", "stale_map", "undeclared_move", "moves_need_git", "map_entries_need_git", "invalid_removed_members", "empty_correction_map",
146
159
  "incomplete_coverage", "invalid_delivery", "observation_repeats_last_audit", "invalid_check_result", "invalid_answer", "unknown_member", "duplicate_finding",
147
- "incomplete_dispositions", "invalid_disposition", "claimed_change_missing", "unassessed_changes", "git_history_unavailable",
160
+ "incomplete_dispositions", "invalid_disposition", "claimed_change_missing", "plugin_member_read_only", "unassessed_changes", "git_history_unavailable",
148
161
  "no_correction_to_fill"],
149
162
  "refuses_like": ["read-map", "read-audit", "locate-text", "rewrite-audit"] },
150
163
  { "id": "submit-the-checked-answer", "actor": "agent",
@@ -164,7 +177,7 @@
164
177
  },
165
178
  {
166
179
  "name": "show-first-audit-brief", "usage": "show-first-audit-brief [ID]", "group": "read", "options": [],
167
- "summary": "Print the instructions for one background subagent to run a principle's first full audit.",
180
+ "summary": "Print the brief for one background subagent to run a principle's first full audit.",
168
181
  "help": "learn-what-a-command-does/show-first-audit-brief",
169
182
  "steps": [
170
183
  { "id": "print-first-audit-brief", "actor": "cli",
@@ -178,30 +191,115 @@
178
191
  },
179
192
  {
180
193
  "name": "show-meta-principle-passage", "usage": "show-meta-principle-passage", "group": "read", "options": [],
181
- "summary": "Set principles up: propose the passage that keeps the others held between audits, and the add-member that maps it.",
194
+ "summary": "Set principles up: propose the passage that has agents check the others between audits, and the add-member that maps it.",
182
195
  "help": "learn-what-a-command-does/show-meta-principle-passage",
183
196
  "steps": [
184
197
  { "id": "propose-meta-principle-passage", "actor": "cli",
185
198
  "does": "Writes nothing. Shows the sticking-to-your-principles map that the printed add-member creates, its description and an activation for all work, or, where that map is already there, shows it and names its members already in an entry file; says which of CLAUDE.md and AGENTS.md exist and whether one links the other, and proposes the passage each would take, with its size.",
186
199
  "refuses_like": ["read-map"] },
187
200
  { "id": "place-the-passage", "actor": "agent",
188
- "does": "With no member mapped, show the user the passage, agree where it goes, write it there, and map it as the principle's member, or map another file or setting that keeps the principles held, such as a timer. With a member mapped, agree with the user which step each member lacks, and add any that is missing.",
201
+ "does": "With no member mapped, show the user the passage, agree where it goes, write it there, and map it as the principle's member, or map another file or setting that has every session check the principles, such as a timer. With a member mapped, agree with the user which step each member lacks, and add any that is missing.",
189
202
  "cannot_check": "where the passage belongs, or whether a passage or member already in the project does its job; agree that with the user.",
190
203
  "answer_with": "add-member" }
191
204
  ]
192
205
  },
193
206
  {
194
207
  "name": "show-hook-setup", "usage": "show-hook-setup", "group": "read", "options": [],
195
- "summary": "Show the hook entries that run the session-start and after-commit reports without the principles plugin.",
208
+ "summary": "Show the hook entries that run the session-start and after-commit reports without the plugin.",
196
209
  "help": "learn-what-a-command-does/show-hook-setup",
197
210
  "steps": [
198
211
  { "id": "show-hook-entries", "actor": "cli",
199
- "does": "Writes nothing. Prints, for Claude Code then Codex, the file a project's own hooks go in and the entries that run report-at-session-start at each session's start and report-after-commit after each shell call, each guarded to say principles failed to start instead of failing the hook, and how to remove them." },
212
+ "does": "Writes nothing. Prints, for Claude Code then Codex, the file a project's own hooks go in and the entries that run report-at-session-start at each session's start, report-after-commit after each shell call and, on Claude Code, report-before-carrier-edit before each Edit and Write, each guarded to say principles failed to start instead of failing the hook, and how to remove them." },
200
213
  { "id": "write-the-hook-entries", "actor": "agent",
201
214
  "does": "Show the user the entries for this session's host and the file they go in, and write them there only once the user agrees; remove them when the principles plugin is enabled.",
202
215
  "cannot_check": "whether the user agrees, or whether the host runs the entries; start a new session to see the report." }
203
216
  ]
204
217
  },
218
+ {
219
+ "name": "show-logged-requests", "usage": "show-logged-requests", "group": "read", "options": [],
220
+ "summary": "Show each session the host captured, with its requests, files and bytes.",
221
+ "help": "learn-what-a-command-does/show-logged-requests",
222
+ "steps": [
223
+ { "id": "tally-captured-sessions", "actor": "cli",
224
+ "does": "Writes nothing. Refuses while the folder exists without its `.gitignore`, or git does not ignore every file there. Otherwise lists, from the host's `requests/index.jsonl`, each session's requests, the files they and their responses fill and those files' bytes, counts the request files no index line names, and names when the newest request file was written and the session of the index's newest line. Never says whether a session is capturing now.",
225
+ "refuses": ["request_logging_unguarded", "request_logging_not_ignored"] },
226
+ { "id": "judge-what-was-captured", "actor": "agent",
227
+ "does": "Judge from the sessions and their sizes whether capture is running as the user meant, and tell the user how much the folder holds.",
228
+ "cannot_check": "whether the session you run in is capturing, since the host's telemetry variables never reach your shell." }
229
+ ]
230
+ },
231
+ {
232
+ "name": "show-carrier-practices", "usage": "show-carrier-practices KIND", "group": "read", "options": [],
233
+ "summary": "Show the practices for judging and editing one kind of carrier, such as a rule file or a skill.",
234
+ "help": "learn-what-a-command-does/show-carrier-practices",
235
+ "steps": [
236
+ { "id": "show-carrier-page", "actor": "cli",
237
+ "does": "Writes nothing. Prints, for carrier kind KIND, the page of its practices under practices, and under source the guide it was distilled from and the plugin version it was reconciled at. Refuses a kind it has no page for, naming each it has.",
238
+ "refuses": ["unknown_carrier_kind"] },
239
+ { "id": "judge-and-edit-by-the-page", "actor": "agent",
240
+ "does": "Judge or edit the member of that kind by the page, and say in your answer which of its points the edit or finding rests on.",
241
+ "cannot_check": "whether the agent read the page or followed it." }
242
+ ]
243
+ },
244
+ {
245
+ "name": "turn-on-request-logging", "usage": "turn-on-request-logging [--for-user]", "group": "write-request-logging", "options": ["for-user"],
246
+ "summary": "Set up the git-ignored folder where the host can write each request it sends.",
247
+ "help": "learn-what-a-command-does/turn-on-request-logging",
248
+ "steps": [
249
+ { "id": "write-ignored-request-logging-folder", "actor": "cli",
250
+ "does": "Writes `.principles/request-logging/.gitignore`, holding `*`, unless it is there, then asks git whether it ignores the folder, its files and every file already in it. Refuses outside git, or when git tracks a file there, and removes what it wrote. Once git confirms it, writes the launch file `settings.json`, whose `env` asks the host to write each request's body under `requests/` with no telemetry exporter, and prints the launch line. With --for-user, writes nothing in the project: makes the user-level folder outside every repository, and its `requests/`, readable only by the user, prints the user's settings file and the `env` entries to add to it, which it never writes, and prunes that folder's sessions no project registered, by counts alone.",
251
+ "refuses": ["request_logging_not_ignored"] },
252
+ { "id": "launch-with-the-line", "actor": "agent",
253
+ "does": "Give the user the launch line, and say that capture starts only when they relaunch the host with it and that each logged request holds the session's whole working context. With --for-user, give the user `explain_to_user` and get their agreement before they add the entries to their settings and relaunch.",
254
+ "cannot_check": "whether the user relaunched the host with the line, or whether the host wrote any request." }
255
+ ]
256
+ },
257
+ {
258
+ "name": "show-members-in-logged-requests", "usage": "show-members-in-logged-requests [--short | --places | --member KEY]", "group": "read", "options": ["short", "places", "member"],
259
+ "summary": "Show which members' text logged requests hold.",
260
+ "help": "learn-what-a-command-does/show-members-in-logged-requests",
261
+ "steps": [
262
+ { "id": "scan-captured-requests", "actor": "cli",
263
+ "does": "Writes nothing. Refuses while the request-logging folder exists without its `.gitignore`, or git does not ignore it, and while jq or rg is not on PATH, naming the missing tool and what it does there, and a --member key no map holds. Otherwise prints, for each mapped member, how many captured requests held its lines, its most bytes in one and its segments; with --places or --member, each place its lines were seen, with the share of its lines there and their bytes; and no text from a request.",
264
+ "refuses": ["request_logging_unguarded", "request_logging_not_ignored", "fast_tools_missing", "unknown_member"] }
265
+ ]
266
+ },
267
+ {
268
+ "name": "show-context-budget", "usage": "show-context-budget [--short] [--session ID]", "group": "read", "options": ["short", "session"],
269
+ "summary": "Show the bytes loaded at each turn's opening, beside its tokens.",
270
+ "help": "learn-what-a-command-does/show-context-budget",
271
+ "steps": [
272
+ { "id": "measure-turn-openings", "actor": "cli",
273
+ "does": "Writes nothing. Refuses while the request-logging folder exists without its `.gitignore`, or git does not ignore it, and while jq is not on PATH. Refuses a --session no turn opening was sent in. Otherwise lists, by session, each captured request that opens a turn, with its bytes and the input tokens its response counted, and each session's trend, or with --short a line a session, and no text from a request.",
274
+ "refuses": ["request_logging_unguarded", "request_logging_not_ignored", "fast_tools_missing", "unknown_session"] },
275
+ { "id": "judge-the-budget", "actor": "agent",
276
+ "does": "Judge from the bytes and tokens how much of each turn's context the host loads before the work starts, and tell the user.",
277
+ "cannot_check": "what any request held, since it prints no text from one." }
278
+ ]
279
+ },
280
+ {
281
+ "name": "turn-off-request-logging", "usage": "turn-off-request-logging [--for-user]", "group": "write-request-logging", "options": ["for-user"],
282
+ "summary": "Stop the host capturing requests, keeping those already captured.",
283
+ "help": "learn-what-a-command-does/turn-off-request-logging",
284
+ "steps": [
285
+ { "id": "empty-launch-file", "actor": "cli",
286
+ "does": "Refuses while the folder exists without its `.gitignore`, or git does not ignore it. Otherwise empties the launch file's `env`, so a host started with it captures nothing, and writes nothing where request logging was never turned on. Deletes no logged request. With --for-user, writes nothing: prints the user's settings file, the entry to remove from its `env` and those to remove only if they were added for request logging, and prunes the user-level folder's sessions no project registered, by counts alone.",
287
+ "refuses": ["request_logging_unguarded", "request_logging_not_ignored"] },
288
+ { "id": "relaunch-the-host", "actor": "agent",
289
+ "does": "Tell the user the host they started with the launch file keeps capturing until they relaunch it. With --for-user, ask the user whether they set any of the telemetry entries for their own use, then have them remove the entries from their settings and relaunch every host they started since.",
290
+ "cannot_check": "whether the host was relaunched." }
291
+ ]
292
+ },
293
+ {
294
+ "name": "remove-logged-requests", "usage": "remove-logged-requests [--keep-sessions N]", "group": "write-request-logging", "options": ["keep-sessions"],
295
+ "summary": "Delete the logged requests of all but the newest captured sessions.",
296
+ "help": "learn-what-a-command-does/remove-logged-requests",
297
+ "steps": [
298
+ { "id": "remove-older-sessions", "actor": "cli",
299
+ "does": "Refuses while the folder exists without its `.gitignore`, or git does not ignore it, and a --keep-sessions that is not a whole number, before deleting anything. Then ranks the sessions by their newest index line and deletes, under `requests/`, each file the index names for a session older than the newest N, keeping any file a kept session also names, and each request file the index does not name that was written before every kept session's file.",
300
+ "refuses": ["request_logging_unguarded", "request_logging_not_ignored", "invalid_keep_sessions"] }
301
+ ]
302
+ },
205
303
  {
206
304
  "name": "create-principle", "usage": "create-principle ID --description TEXT", "group": "write-map", "options": ["description"],
207
305
  "summary": "Map a new principle and say what it is.",
@@ -249,15 +347,15 @@
249
347
  ]
250
348
  },
251
349
  {
252
- "name": "add-member", "usage": "add-member ID PATH [--section HEADING] [--starting-at TEXT [--ending-at TEXT]] [--query QUERY] --role ROLE [--check COMMAND]", "group": "write-map", "options": ["section", "starting-at", "ending-at", "query", "role", "check"],
350
+ "name": "add-member", "usage": "add-member ID PATH [--section HEADING] [--starting-at TEXT [--ending-at TEXT]] [--query QUERY] [--plugin NAME@MARKETPLACE] --role ROLE --name NAME --reason REASON [--check COMMAND]", "group": "write-map", "options": ["plugin", "section", "starting-at", "ending-at", "query", "role", "name", "reason", "check"],
253
351
  "summary": "Add a file, a Markdown section or a passage.",
254
352
  "help": "learn-what-a-command-does/add-member",
255
353
  "steps": [
256
354
  { "id": "locate-new-member", "actor": "cli",
257
- "does": "Loads the map, or starts sticking-to-your-principles only after verifying its map path is absent at committed HEAD, requiring any prior removal to be committed. Then finds the member's text, so a locator that matches nothing is refused now rather than at the audit.",
258
- "refuses": ["invalid_answer", "ending_without_start", "ambiguous_passage_end", "map_removal_not_committed", "git_history_unavailable"], "refuses_like": ["read-map", "locate-text"] },
355
+ "does": "Loads the map, or starts sticking-to-your-principles only after verifying its map path is absent at committed HEAD, requiring any prior removal to be committed. Then finds the member's text, so a locator that matches nothing is refused now rather than at the audit. With --plugin, finds the plugin's install in Claude Code's record instead.",
356
+ "refuses": ["invalid_answer", "unjustified_member", "ending_without_start", "ambiguous_passage_end", "map_removal_not_committed", "git_history_unavailable", "plugin_component_not_plain", "plugin_member_located", "plugin_not_installed", "plugin_from_directory_marketplace", "plugin_marketplace_unknown", "plugin_component_linked", "plugin_component_not_found"], "refuses_like": ["read-map", "locate-text", "read-plugin-registry"] },
259
357
  { "id": "write-member", "actor": "cli",
260
- "does": "Refuses a member already in the map, then adds it with its role; the first member of sticking-to-your-principles creates its map.",
358
+ "does": "Refuses a member already in the map, then adds it with its role; the first member of sticking-to-your-principles creates its map. Reports, without deciding, other maps holding a whole-file member's file whole, and those whose member set nearly matches this one's.",
261
359
  "refuses": ["member_exists"] },
262
360
  { "id": "add-next-or-audit", "actor": "agent",
263
361
  "does": "Add the next member the same way. Once the map lists every member, commit it: in git, that commit is the members' baseline until their first full audit, which judges them and may come later; outside git, the first full audit gives them one.",
@@ -267,7 +365,7 @@
267
365
  },
268
366
  {
269
367
  "name": "move-member", "usage": "move-member ID MEMBER [--path PATH] [--section HEADING] [--starting-at TEXT [--ending-at TEXT]] [--query QUERY]", "group": "write-map", "options": ["path", "section", "starting-at", "ending-at", "query"],
270
- "summary": "Point a member at a new place in its file, or in another file: the one its file was renamed to, or one its text moved into.",
368
+ "summary": "Point a member at a new place: in its file, its renamed file, or a file its text moved into.",
271
369
  "help": "learn-what-a-command-does/move-member",
272
370
  "steps": [
273
371
  { "id": "find-member", "actor": "cli", "does": "Finds MEMBER in the map.",
@@ -277,6 +375,24 @@
277
375
  "refuses": ["invalid_answer", "ending_without_start", "ambiguous_passage_end", "member_exists"], "refuses_like": ["locate-text"] }
278
376
  ]
279
377
  },
378
+ {
379
+ "name": "change-member-name", "usage": "change-member-name ID MEMBER --name NAME", "group": "write-map", "options": ["name"],
380
+ "summary": "Rename a member for display; commands still take its id.",
381
+ "help": "learn-what-a-command-does/change-member-name",
382
+ "steps": [
383
+ { "id": "write-name", "actor": "cli", "does": "Finds MEMBER in the map by its id and replaces its name, keeping its id, key and audit.",
384
+ "refuses": ["unknown_member", "invalid_answer"], "refuses_like": ["read-map"] }
385
+ ]
386
+ },
387
+ {
388
+ "name": "change-member-reason", "usage": "change-member-reason ID MEMBER --reason REASON", "group": "write-map", "options": ["reason"],
389
+ "summary": "Rewrite why a member's carrier puts its principle in context.",
390
+ "help": "learn-what-a-command-does/change-member-reason",
391
+ "steps": [
392
+ { "id": "write-reason", "actor": "cli", "does": "Finds MEMBER in the map and replaces its reason.",
393
+ "refuses": ["unknown_member", "invalid_answer"], "refuses_like": ["read-map"] }
394
+ ]
395
+ },
280
396
  {
281
397
  "name": "change-member-role", "usage": "change-member-role ID MEMBER --role ROLE", "group": "write-map", "options": ["role"],
282
398
  "summary": "Reword a member's role.",
@@ -288,7 +404,7 @@
288
404
  },
289
405
  {
290
406
  "name": "change-member-check", "usage": "change-member-check ID MEMBER --check COMMAND", "group": "write-map", "options": ["check"],
291
- "summary": "Name the command that enforces a member, which each audit asks you to run.",
407
+ "summary": "Name the command enforcing a member, which each audit asks you to run.",
292
408
  "help": "learn-what-a-command-does/change-member-check",
293
409
  "steps": [
294
410
  { "id": "write-check", "actor": "cli", "does": "Finds MEMBER in the map and stores COMMAND as its check. This tool never runs it.",
@@ -325,7 +441,7 @@
325
441
  { "to": "start-acknowledgement", "when": "you passed --member" },
326
442
  { "to": "start-deciding-open-findings", "when": "you passed --open-findings" }] },
327
443
  { "id": "assess-every-member", "actor": "agent",
328
- "does": "Assess each member not carried, and any carried one whose sighting is too old to rely on, the set as a whole and one recent decision under it, a finding per problem. Run each check, carried_checks_to_run's too, per shared_check_instructions and check_instructions. Decide each prior finding and listed member to check against the activation.",
444
+ "does": "Assess each member not carried, or carried on too old a sighting, by carrier_checks and page_command, then the set and one recent decision under it: a finding per problem. Run each check and carried_checks_to_run per shared_check_instructions and check_instructions. Decide each prior finding and listed member to check against the activation.",
329
445
  "prompt": "assess-every-member/assess-each-member-and-the-set",
330
446
  "checks": "every member is assessed or carried forward once, a marker only where the request carries the member, and each piece of evidence resolves to project text that has not changed since the request.",
331
447
  "cannot_check": "whether your assessment is true, a member reached your context, or your findings are the right ones.",
@@ -357,7 +473,7 @@
357
473
  { "to": "recheck-members", "when": "the request was an assessment or a correction" }] },
358
474
  { "id": "acknowledge-the-change", "actor": "cli",
359
475
  "does": "For a one-member audit, checks the answer's kept meaning, one-line reason, quotes then and now and any check result, then moves the member's hash and check result in the audit record beside the acknowledgement.",
360
- "refuses": ["stale_request", "cannot_acknowledge", "quote_not_found"] },
476
+ "refuses": ["stale_request", "cannot_acknowledge", "invalid_check_result", "quote_not_found"] },
361
477
  { "id": "commit-the-acknowledgement", "actor": "agent",
362
478
  "does": "Commit the audit record, then check that list-member-problems --short no longer reports the member.",
363
479
  "cannot_check": "that you committed, or that the change keeps the meaning.",
@@ -381,14 +497,14 @@
381
497
  "next": [{ "to": "complete-audit", "when": "there are no findings" },
382
498
  { "to": "dispose-of-each-finding", "when": "there are findings" }] },
383
499
  { "id": "dispose-of-each-finding", "actor": "agent",
384
- "does": "Fix each finding and reassess what you changed, or record why it waits: deferred, accepted or disagreed.",
500
+ "does": "Fix each finding per carrier_checks and reassess it, or record why it waits: deferred, accepted, disagreed.",
385
501
  "prompt": "dispose-of-each-finding/fix-or-record-each-finding",
386
502
  "checks": "each finding has one disposition, and each fixed finding changed the members it names.",
387
503
  "cannot_check": "whether a fix is right or a deferral justified.",
388
504
  "answer_with": "submit-answer" },
389
505
  { "id": "check-dispositions", "actor": "cli",
390
506
  "does": "Checks the original request, basis and hashes and, with a Git base, uninterrupted current-ID map presence on captured HEAD's first-parent line. Refuses unverifiable continuity or undeclared map changes. Checks one disposition per finding, that only fixed members changed since the base, and each recorded_at resolves.",
391
- "refuses": ["stale_map", "undeclared_move", "moves_need_git", "map_entries_need_git", "invalid_removed_members", "empty_correction_map", "stale_request", "git_history_unavailable", "audit_completed_since_request", "incomplete_dispositions", "invalid_disposition", "invalid_answer", "claimed_change_missing", "unassessed_changes"],
507
+ "refuses": ["stale_map", "undeclared_move", "moves_need_git", "map_entries_need_git", "invalid_removed_members", "empty_correction_map", "stale_request", "git_history_unavailable", "audit_completed_since_request", "incomplete_dispositions", "invalid_disposition", "invalid_answer", "claimed_change_missing", "plugin_member_read_only", "unassessed_changes"],
392
508
  "refuses_like": ["locate-text"] },
393
509
  { "id": "complete-audit", "actor": "cli",
394
510
  "does": "Writes the record unless it already says the same, and prints the open and resolved findings and the files to commit, in git only those differing from HEAD, with the commits since the base touching each changed member.",
@@ -0,0 +1,63 @@
1
+ # typed: strict
2
+ # frozen_string_literal: true
3
+
4
+ module Principles
5
+ # Every file and process this tool reads or writes. data/CLAUDE.md owns the boundary.
6
+ module Data
7
+ # One string in a captured request, split at reminder tags into segments and each segment into lines: reminder
8
+ # inside a system-reminder tag, plain outside one.
9
+ class DecodedLeaf
10
+ OPENING = "<system-reminder>"
11
+ CLOSING = "</system-reminder>"
12
+ # Splits a string at each tag, keeping the tags as pieces of their own.
13
+ TAGS = /(#{Regexp.escape(OPENING)}|#{Regexp.escape(CLOSING)})/
14
+ # The segment each tag begins.
15
+ SEGMENT_AFTER = { OPENING => "reminder", CLOSING => "plain" }.freeze #: Hash[String, String]
16
+
17
+ #: (String) -> void
18
+ def initialize(text)
19
+ @text = text
20
+ freeze
21
+ end
22
+
23
+ # Each of its lines holding one of patterns, with its segment and the byte offset in the string it starts at, as
24
+ # [segment, line, offset]. Only the patterns it holds are looked for line by line, as a long string holds few of
25
+ # many patterns.
26
+ #: (Array[String]) -> Array[[String, String, Integer]]
27
+ def holding(patterns)
28
+ held = patterns.select { @text.include?(it) }
29
+ held.empty? ? [] : lines.select { |_, line, _| held.any? { line.include?(it) } }
30
+ end
31
+
32
+ private
33
+
34
+ # Each line with its segment and offset, in order.
35
+ #: () -> Array[[String, String, Integer]]
36
+ def lines
37
+ segments.flat_map do |segment, part, at|
38
+ part.split("\n", -1).map do |line|
39
+ placed = [segment, line, at] #: [String, String, Integer]
40
+ at += line.bytesize + 1
41
+ placed
42
+ end
43
+ end
44
+ end
45
+
46
+ # Each segment with the byte offset its text starts at: plain until a reminder tag opens, reminder until one
47
+ # closes, each tag's bytes counted between them.
48
+ #: () -> Array[[String, String, Integer]]
49
+ def segments
50
+ segment = "plain"
51
+ at = 0
52
+ @text.split(TAGS, -1).filter_map do |piece|
53
+ start = at
54
+ at += piece.bytesize
55
+ next [segment, piece, start] unless SEGMENT_AFTER.key?(piece)
56
+
57
+ segment = SEGMENT_AFTER.fetch(piece)
58
+ nil
59
+ end
60
+ end
61
+ end
62
+ end
63
+ end
@@ -7,8 +7,9 @@ module Principles
7
7
  # Every file and process this tool reads or writes. data/CLAUDE.md owns the boundary.
8
8
  module Data
9
9
  # What git says of HEAD in the repository holding one directory, as report-after-commit asks it after each shell
10
- # call: the repository's root, whether this tool mapped it, when its HEAD reflog was last written and the subject
11
- # of that move, HEAD's committer time, and the full sha of a revision. Each is nil where git cannot say.
10
+ # call: the repository's root and git folder, whether this tool mapped it, when its HEAD reflog was last written
11
+ # and the subject of that move, HEAD's committer time, and the full sha of a revision. Each is nil where git cannot
12
+ # say.
12
13
  class HeadReflog
13
14
  # The folders a mapped project holds its maps in: the folder's name now, and its earlier one.
14
15
  MAPS_FOLDERS = %w[.principles .memeplex].freeze #: Array[String]
@@ -25,6 +26,16 @@ module Principles
25
26
  #: () -> String?
26
27
  def toplevel = read(["rev-parse", "--show-toplevel"])
27
28
 
29
+ # The repository's git folder, which each of its worktrees shares and a clone does not, with every symbolic link
30
+ # resolved, or nil outside git.
31
+ #: () -> String?
32
+ def common_dir
33
+ folder = read(["rev-parse", "--path-format=absolute", "--git-common-dir"]) or return
34
+ File.realpath(folder)
35
+ rescue SystemCallError
36
+ nil
37
+ end
38
+
28
39
  # Whether this tool's folder is at the root.
29
40
  #: () -> bool
30
41
  def mapped?
@@ -0,0 +1,39 @@
1
+ # typed: strict
2
+ # frozen_string_literal: true
3
+
4
+ module Principles
5
+ # Every file and process this tool reads or writes. data/CLAUDE.md owns the boundary.
6
+ module Data
7
+ # One line of a captured request's string that holds a pattern, as the scan keeps it: the request, the JSON path
8
+ # of the string, the role of the message it sits in, if any, and the line as DecodedLeaf#holding gives it, its
9
+ # segment, its text and the byte in the string it starts at. A plain class, not ::Data.define, since Sorbet's
10
+ # strict level needs a signature for each reader, which ::Data.define's lack.
11
+ class KeptLine
12
+ #: (String, String, String?, [String, String, Integer]) -> void
13
+ def initialize(request, path, role, line)
14
+ @request = request
15
+ @path = path
16
+ @role = role
17
+ @segment = line[0] #: String
18
+ @text = line[1] #: String
19
+ @offset = line[2] #: Integer
20
+ freeze
21
+ end
22
+
23
+ #: String
24
+ attr_reader :request, :path, :segment, :text
25
+
26
+ #: Integer
27
+ attr_reader :offset
28
+
29
+ # The role of the message it sits in, such as system or user, or nil outside a message or for a role that is not
30
+ # a string.
31
+ #: String?
32
+ attr_reader :role
33
+
34
+ # The place it was kept in, a request, path and segment, which a member's lines are counted by.
35
+ #: () -> [String, String, String]
36
+ def place = [@request, @path, @segment]
37
+ end
38
+ end
39
+ end
@@ -0,0 +1,50 @@
1
+ # typed: strict
2
+ # frozen_string_literal: true
3
+
4
+ require "json"
5
+ require_relative "../error"
6
+ require_relative "json_text"
7
+
8
+ module Principles
9
+ # Every file and process this tool reads or writes. data/CLAUDE.md owns the boundary.
10
+ module Data
11
+ # Claude Code's record of the marketplaces it knows, the text of known_marketplaces.json under its config folder:
12
+ # for each marketplace by name, where its plugins come from. A probe saw a local folder recorded as source
13
+ # "directory" without quoting how it nests, so this reads the kind either as source itself or as source.source.
14
+ class KnownMarketplaces
15
+ # The marketplaces text records, refused when it is not a JSON object.
16
+ #: (String) -> void
17
+ def initialize(text)
18
+ @marketplaces = parsed(text) #: Hash[String, untyped]
19
+ freeze
20
+ end
21
+
22
+ # The kind of source the marketplace named comes from, such as "directory" or "github", or nil when the record
23
+ # names no such marketplace or no kind this tool can read.
24
+ #: (String) -> String?
25
+ def source_kind(name)
26
+ marketplace = @marketplaces[name]
27
+ source = marketplace["source"] if marketplace.is_a?(Hash)
28
+ kind = source.is_a?(Hash) ? source["source"] : source
29
+ kind if kind.is_a?(String)
30
+ end
31
+
32
+ private
33
+
34
+ #: (String) -> Hash[String, untyped]
35
+ def parsed(text)
36
+ marketplaces = JsonText.new(text).parsed
37
+ marketplaces.is_a?(Hash) ? marketplaces : unreadable
38
+ rescue JSON::ParserError
39
+ unreadable
40
+ end
41
+
42
+ #: () -> bot
43
+ def unreadable
44
+ raise Error.new("unreadable_plugin_registry",
45
+ "Claude Code's record of its plugin marketplaces is not in the shape this tool reads",
46
+ "Reinstall the plugin with Claude Code, or map the project's own files instead.")
47
+ end
48
+ end
49
+ end
50
+ end