principles 0.1.2 → 0.1.4

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 (247) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +132 -0
  3. data/README.md +10 -6
  4. data/lib/principles/command_line.rb +15 -6
  5. data/lib/principles/command_routes.rb +11 -1
  6. data/lib/principles/controllers/acknowledgement.rb +19 -4
  7. data/lib/principles/controllers/acknowledgements.rb +43 -12
  8. data/lib/principles/controllers/after_commit_report.rb +15 -2
  9. data/lib/principles/controllers/assessment.rb +7 -3
  10. data/lib/principles/controllers/audit.rb +17 -8
  11. data/lib/principles/controllers/audit_completion.rb +34 -9
  12. data/lib/principles/controllers/carrier_practices.rb +26 -0
  13. data/lib/principles/controllers/command.rb +31 -3
  14. data/lib/principles/controllers/correction.rb +15 -5
  15. data/lib/principles/controllers/full_audit_request.rb +38 -42
  16. data/lib/principles/controllers/inventory.rb +77 -71
  17. data/lib/principles/controllers/last_record_notice_beside.rb +51 -0
  18. data/lib/principles/controllers/member_acknowledgement.rb +21 -11
  19. data/lib/principles/controllers/member_addition.rb +19 -4
  20. data/lib/principles/controllers/member_entries.rb +25 -6
  21. data/lib/principles/controllers/member_problems_report.rb +26 -6
  22. data/lib/principles/controllers/members_a_commit_changed.rb +14 -5
  23. data/lib/principles/controllers/members_in_logged_requests.rb +52 -0
  24. data/lib/principles/controllers/members_to_assess.rb +24 -7
  25. data/lib/principles/controllers/meta_principle_setup.rb +2 -2
  26. data/lib/principles/controllers/open_correction.rb +3 -2
  27. data/lib/principles/controllers/parts_to_read.rb +46 -5
  28. data/lib/principles/controllers/plugin_member_addition.rb +48 -0
  29. data/lib/principles/controllers/principle_listing.rb +84 -0
  30. data/lib/principles/controllers/request_logging.rb +52 -0
  31. data/lib/principles/controllers/running_tool.rb +45 -17
  32. data/lib/principles/data/branches_bringing_in.rb +52 -0
  33. data/lib/principles/data/changes_since.rb +56 -0
  34. data/lib/principles/data/claude_code_home.rb +58 -0
  35. data/lib/principles/data/command-steps.json +91 -15
  36. data/lib/principles/data/decoded_leaf.rb +63 -0
  37. data/lib/principles/data/head_reflog.rb +13 -2
  38. data/lib/principles/data/kept_line.rb +32 -0
  39. data/lib/principles/data/known_marketplaces.rb +50 -0
  40. data/lib/principles/data/logged_request_matches.rb +138 -0
  41. data/lib/principles/data/logged_request_scan.rb +120 -0
  42. data/lib/principles/data/map_files.rb +18 -4
  43. data/lib/principles/data/plugin_folder.rb +85 -0
  44. data/lib/principles/data/plugin_registry.rb +73 -0
  45. data/lib/principles/data/principles_store.rb +49 -0
  46. data/lib/principles/data/ran.rb +25 -0
  47. data/lib/principles/data/raw_request_filter.rb +61 -0
  48. data/lib/principles/data/repository.rb +34 -27
  49. data/lib/principles/data/request_logging_folder.rb +167 -0
  50. data/lib/principles/data/running_version.rb +1 -1
  51. data/lib/principles/data/schemas/acknowledgement-answer.schema.json +16 -1
  52. data/lib/principles/data/schemas/acknowledgements-answer.schema.json +16 -1
  53. data/lib/principles/data/schemas/assessment-answer.schema.json +8 -0
  54. data/lib/principles/data/schemas/command-steps.schema.json +1 -1
  55. data/lib/principles/data/schemas/correction-answer-guide.schema.json +2 -1
  56. data/lib/principles/data/schemas/correction-answer.schema.json +14 -0
  57. data/lib/principles/data/schemas/member-map.schema.json +10 -1
  58. data/lib/principles/data/string_counts.rb +39 -0
  59. data/lib/principles/data/tools_on_path.rb +25 -0
  60. data/lib/principles/invocation_options.rb +4 -2
  61. data/lib/principles/launch.rb +14 -4
  62. data/lib/principles/models/acknowledged_check.rb +11 -1
  63. data/lib/principles/models/acknowledgement.rb +15 -0
  64. data/lib/principles/models/acknowledgement_placeholders.rb +43 -18
  65. data/lib/principles/models/acknowledgement_refusal.rb +20 -11
  66. data/lib/principles/models/acknowledgements_to_offer.rb +86 -0
  67. data/lib/principles/models/after_commit_input.rb +5 -0
  68. data/lib/principles/models/answer_fields.rb +3 -0
  69. data/lib/principles/models/assessment_basis.rb +10 -3
  70. data/lib/principles/models/audit.rb +10 -10
  71. data/lib/principles/models/audit_record.rb +10 -0
  72. data/lib/principles/models/audit_records.rb +4 -3
  73. data/lib/principles/models/audit_start.rb +9 -0
  74. data/lib/principles/models/authored_locator.rb +33 -0
  75. data/lib/principles/models/candidate_files.rb +23 -3
  76. data/lib/principles/models/candidate_outline.rb +18 -125
  77. data/lib/principles/models/captured_sessions.rb +128 -0
  78. data/lib/principles/models/carrier_kind.rb +79 -0
  79. data/lib/principles/models/cited_files.rb +12 -3
  80. data/lib/principles/models/decided_prior_findings.rb +5 -0
  81. data/lib/principles/models/disposition.rb +38 -7
  82. data/lib/principles/models/disposition_placeholders.rb +27 -7
  83. data/lib/principles/models/disposition_text_field.rb +4 -0
  84. data/lib/principles/models/feature.rb +53 -0
  85. data/lib/principles/models/finding_outcomes.rb +55 -0
  86. data/lib/principles/models/findings_left_open.rb +9 -11
  87. data/lib/principles/models/head_moves.rb +27 -10
  88. data/lib/principles/models/installed_component.rb +55 -0
  89. data/lib/principles/models/installed_plugins.rb +174 -0
  90. data/lib/principles/models/kept_sessions.rb +34 -0
  91. data/lib/principles/models/locator.rb +8 -0
  92. data/lib/principles/models/logged_request_reach.rb +44 -0
  93. data/lib/principles/models/logged_request_scan_completeness.rb +43 -0
  94. data/lib/principles/models/mapped_baseline.rb +46 -0
  95. data/lib/principles/models/maps_holding_file_whole.rb +42 -0
  96. data/lib/principles/models/markdown_text.rb +143 -0
  97. data/lib/principles/models/member.rb +14 -1
  98. data/lib/principles/models/member_entry.rb +56 -0
  99. data/lib/principles/models/member_lines.rb +11 -0
  100. data/lib/principles/models/member_loads.rb +17 -2
  101. data/lib/principles/models/member_problems.rb +45 -42
  102. data/lib/principles/models/member_reach.rb +36 -0
  103. data/lib/principles/models/member_snapshots.rb +23 -4
  104. data/lib/principles/models/member_text_as_sent.rb +31 -0
  105. data/lib/principles/models/member_texts.rb +45 -0
  106. data/lib/principles/models/members_in_logged_requests.rb +240 -0
  107. data/lib/principles/models/missing_files.rb +41 -16
  108. data/lib/principles/models/named_placeholder.rb +17 -7
  109. data/lib/principles/models/nearly_matching_maps.rb +56 -0
  110. data/lib/principles/models/open_correction.rb +5 -0
  111. data/lib/principles/models/open_finding.rb +4 -3
  112. data/lib/principles/models/outline_budget.rb +10 -1
  113. data/lib/principles/models/outline_item.rb +25 -0
  114. data/lib/principles/models/outline_section.rb +15 -4
  115. data/lib/principles/models/part_named.rb +16 -2
  116. data/lib/principles/models/plugin_component.rb +37 -0
  117. data/lib/principles/models/plugin_install.rb +33 -0
  118. data/lib/principles/models/plugin_name.rb +23 -0
  119. data/lib/principles/models/plugin_reference.rb +53 -0
  120. data/lib/principles/models/principle_members.rb +15 -0
  121. data/lib/principles/models/prior_finding_decision.rb +1 -1
  122. data/lib/principles/models/prior_finding_outcomes.rb +12 -1
  123. data/lib/principles/models/problem_report.rb +14 -25
  124. data/lib/principles/models/project.rb +35 -29
  125. data/lib/principles/models/project_history.rb +23 -0
  126. data/lib/principles/models/recorded_members.rb +7 -0
  127. data/lib/principles/models/request_logging.rb +196 -0
  128. data/lib/principles/models/runs_from.rb +0 -5
  129. data/lib/principles/models/script_comments.rb +58 -0
  130. data/lib/principles/models/stale_request.rb +9 -0
  131. data/lib/principles/models/template_placeholders.rb +10 -9
  132. data/lib/principles/models/unfixed_part.rb +82 -0
  133. data/lib/principles/models/unresolved_plugin_members.rb +35 -0
  134. data/lib/principles/models/whole_file_member_read.rb +48 -0
  135. data/lib/principles/models/without_prose.rb +20 -0
  136. data/lib/principles/models/workflow_jobs.rb +92 -0
  137. data/lib/principles/show_members_in_logged_requests_options.rb +27 -0
  138. data/lib/principles/show_principle_options.rb +32 -0
  139. data/lib/principles/version.rb +2 -2
  140. data/lib/principles/views/acknowledged_result.rb +31 -12
  141. data/lib/principles/views/acknowledgement_result.rb +41 -29
  142. data/lib/principles/views/acknowledgement_template_alone.rb +55 -0
  143. data/lib/principles/views/acknowledgements_offered.rb +54 -0
  144. data/lib/principles/views/added_member.rb +22 -6
  145. data/lib/principles/views/answer_in_a_file.rb +16 -16
  146. data/lib/principles/views/assessed_members.rb +18 -7
  147. data/lib/principles/views/assessment_request.rb +8 -3
  148. data/lib/principles/views/audit_changes.rb +14 -8
  149. data/lib/principles/views/audit_findings.rb +34 -0
  150. data/lib/principles/views/audit_result.rb +14 -19
  151. data/lib/principles/views/carrier_checks.rb +40 -0
  152. data/lib/principles/views/carrier_practices_page.rb +49 -0
  153. data/lib/principles/views/completed_audit_findings.rb +33 -0
  154. data/lib/principles/views/completed_audit_next_step.rb +12 -4
  155. data/lib/principles/views/consecutive_sections_elsewhere.rb +4 -0
  156. data/lib/principles/views/context_parts.rb +129 -25
  157. data/lib/principles/views/correction_request.rb +22 -17
  158. data/lib/principles/views/disposition_template.rb +35 -0
  159. data/lib/principles/views/first_audit.rb +29 -15
  160. data/lib/principles/views/first_audit_brief.rb +0 -1
  161. data/lib/principles/views/first_audit_line.rb +4 -5
  162. data/lib/principles/views/invocation.rb +16 -6
  163. data/lib/principles/views/last_record_notice.rb +41 -0
  164. data/lib/principles/views/lines_shared_with_member.rb +16 -22
  165. data/lib/principles/views/logged_request_status_meanings.rb +29 -0
  166. data/lib/principles/views/logged_requests_evidence.rb +69 -0
  167. data/lib/principles/views/map_added_to.rb +14 -12
  168. data/lib/principles/views/map_result.rb +39 -17
  169. data/lib/principles/views/member_change_since_baseline.rb +4 -0
  170. data/lib/principles/views/member_row.rb +13 -4
  171. data/lib/principles/views/member_sets_overlap.rb +31 -0
  172. data/lib/principles/views/members_a_commit_changed.rb +42 -25
  173. data/lib/principles/views/members_changed_during_audit.rb +27 -0
  174. data/lib/principles/views/members_in_logged_requests_result.rb +68 -0
  175. data/lib/principles/views/members_too_short_to_scan.rb +45 -0
  176. data/lib/principles/views/members_with_no_baseline.rb +6 -6
  177. data/lib/principles/views/meta_principle_result.rb +14 -2
  178. data/lib/principles/views/open_findings_line.rb +31 -92
  179. data/lib/principles/views/parts_index_result.rb +9 -5
  180. data/lib/principles/views/principle_read_result.rb +52 -11
  181. data/lib/principles/views/prior_findings_result.rb +9 -1
  182. data/lib/principles/views/problem_facts.rb +5 -3
  183. data/lib/principles/views/problem_lines.rb +32 -6
  184. data/lib/principles/views/problem_result.rb +7 -15
  185. data/lib/principles/views/prompts/answer-any-judgement-request/fill-the-answer-in-a-file.md +1 -1
  186. data/lib/principles/views/prompts/assess-every-member/claim-an-earlier-first-raised-at.md +6 -6
  187. data/lib/principles/views/prompts/assess-every-member/read-a-compact-carried-member.md +9 -8
  188. data/lib/principles/views/prompts/assess-every-member/read-a-flagged-member-s-text-whole.md +3 -0
  189. data/lib/principles/views/prompts/assess-every-member/read-a-judged-member-s-text-whole.md +3 -0
  190. data/lib/principles/views/prompts/assess-every-member/turn-on-request-logging-to-see-what-reaches-context.md +2 -0
  191. data/lib/principles/views/prompts/assess-every-member/weigh-what-reached-the-context.md +7 -0
  192. data/lib/principles/views/prompts/dispose-of-each-finding/answer-guide.json +1 -0
  193. data/lib/principles/views/prompts/dispose-of-each-finding/fix-or-record-each-finding.md +5 -0
  194. data/lib/principles/views/prompts/dispose-of-each-finding/retain-assessment-and-correction.md +1 -1
  195. data/lib/principles/views/prompts/find-a-principle-to-map/read-a-cut-section-back.md +1 -1
  196. data/lib/principles/views/prompts/follow-each-carriers-best-practices/practices-for-hook-configuration.md +41 -0
  197. data/lib/principles/views/prompts/follow-each-carriers-best-practices/practices-for-hook-scripts.md +35 -0
  198. data/lib/principles/views/prompts/follow-each-carriers-best-practices/practices-for-instruction-files.md +37 -0
  199. data/lib/principles/views/prompts/follow-each-carriers-best-practices/practices-for-other-text-an-agent-reads.md +38 -0
  200. data/lib/principles/views/prompts/follow-each-carriers-best-practices/practices-for-rule-files.md +34 -0
  201. data/lib/principles/views/prompts/follow-each-carriers-best-practices/practices-for-skills.md +35 -0
  202. data/lib/principles/views/prompts/follow-each-carriers-best-practices/practices-for-subagent-definitions.md +35 -0
  203. data/lib/principles/views/prompts/learn-what-a-command-does/add-member.md +50 -51
  204. data/lib/principles/views/prompts/learn-what-a-command-does/change-member-role.md +2 -1
  205. data/lib/principles/views/prompts/learn-what-a-command-does/list-candidate-files.md +1 -1
  206. data/lib/principles/views/prompts/learn-what-a-command-does/list-member-problems.md +32 -32
  207. data/lib/principles/views/prompts/learn-what-a-command-does/list-open-findings.md +10 -11
  208. data/lib/principles/views/prompts/learn-what-a-command-does/move-member.md +7 -6
  209. data/lib/principles/views/prompts/learn-what-a-command-does/remove-logged-requests.md +16 -0
  210. data/lib/principles/views/prompts/learn-what-a-command-does/remove-member.md +2 -1
  211. data/lib/principles/views/prompts/learn-what-a-command-does/report-at-session-start.md +2 -2
  212. data/lib/principles/views/prompts/learn-what-a-command-does/show-answer-check.md +3 -3
  213. data/lib/principles/views/prompts/learn-what-a-command-does/show-audit.md +7 -0
  214. data/lib/principles/views/prompts/learn-what-a-command-does/show-candidate-outlines.md +8 -2
  215. data/lib/principles/views/prompts/learn-what-a-command-does/show-carrier-practices.md +13 -0
  216. data/lib/principles/views/prompts/learn-what-a-command-does/show-logged-requests.md +20 -0
  217. data/lib/principles/views/prompts/learn-what-a-command-does/show-members-in-logged-requests.md +48 -0
  218. data/lib/principles/views/prompts/learn-what-a-command-does/show-open-correction.md +1 -1
  219. data/lib/principles/views/prompts/learn-what-a-command-does/show-principle.md +14 -14
  220. data/lib/principles/views/prompts/learn-what-a-command-does/start-audit.md +27 -27
  221. data/lib/principles/views/prompts/learn-what-a-command-does/submit-answer.md +11 -11
  222. data/lib/principles/views/prompts/learn-what-a-command-does/turn-off-request-logging.md +10 -0
  223. data/lib/principles/views/prompts/learn-what-a-command-does/turn-on-request-logging.md +32 -0
  224. data/lib/principles/views/prompts/read-requested-outlines/continue-the-survey.md +3 -2
  225. data/lib/principles/views/prompts/read-what-reached-the-context/explain-request-logging-to-the-user.md +11 -0
  226. data/lib/principles/views/prompts/read-what-reached-the-context/see-whether-members-reach-the-agent.md +2 -0
  227. data/lib/principles/views/prompts/read-what-reached-the-context/what-absent-means.md +2 -0
  228. data/lib/principles/views/prompts/read-what-reached-the-context/what-not-a-carrier-means.md +2 -0
  229. data/lib/principles/views/prompts/read-what-reached-the-context/what-present-but-not-loaded-means.md +2 -0
  230. data/lib/principles/views/prompts/read-what-reached-the-context/what-present-means.md +1 -0
  231. data/lib/principles/views/prompts/read-what-reached-the-context/what-unmeasurable-means.md +2 -0
  232. data/lib/principles/views/prompts/report-after-a-commit/plugin-members-are-still-listed.md +1 -0
  233. data/lib/principles/views/prompts/report-after-a-commit/the-commits-changed-these-members-waiting-on-an-upgrade.md +2 -2
  234. data/lib/principles/views/prompts/report-after-a-commit/the-commits-changed-these-members.md +2 -2
  235. data/lib/principles/views/prompts/report-after-a-commit/this-command-shows-what-each-needs-before-the-next-commit.md +1 -0
  236. data/lib/principles/views/prompts/run-a-first-audit-in-the-background/follow-the-brief.md +1 -1
  237. data/lib/principles/views/prompts/set-principles-up/entry-file-passage.md +1 -1
  238. data/lib/principles/views/prompts/start-a-session/act-on-the-open-findings.md +2 -1
  239. data/lib/principles/views/prompts/start-a-session/hand-the-first-audit-to-a-subagent.md +2 -3
  240. data/lib/principles/views/prompts/start-a-session/raise-the-open-findings-waiting-on-no-one.md +1 -0
  241. data/lib/principles/views/request_logging_result.rb +62 -0
  242. data/lib/principles/views/request_part.rb +10 -4
  243. data/lib/principles/views/request_parts.rb +9 -0
  244. data/lib/principles/views/whole_file_elsewhere.rb +30 -0
  245. metadata +101 -4
  246. data/lib/principles/views/prompts/report-after-a-commit/the-principles-skill-is-where-to-start.md +0 -1
  247. data/lib/principles/views/prompts/report-after-a-commit/this-command-shows-each-one.md +0 -1
@@ -6,9 +6,9 @@ It refuses with `broken_members` while any member cannot be found or read, or a
6
6
  own check can stop on its exit status. Each member the refusal lists carries its own refusal and `repair_with`: a
7
7
  `move-member`, if it moved; for a section or passage, a second `move-member --path NEW_PATH`, if its text moved into
8
8
  another file; or a `remove-member`, if it is gone. When its file was renamed, the move is `move-member --path
9
- NEW_PATH`, which keeps its audit. `missing_files` groups the members of each file that cannot be read, with
10
- `git_detected_rename` when git pairs that path with a file: its `to`, `similarity` and `deleted_in`. That is git's
11
- match, so check it before you fill in `NEW_PATH`.
9
+ NEW_PATH`, which keeps its audit. `missing_files` groups each unreadable file's members, and the refusal's `repair`
10
+ says once how to repair them. Its `git_detected_rename`, git's match for the path, gives `to`, `similarity` and
11
+ `deleted_in`: check it before you fill in `NEW_PATH`. Its `on_branches` names a local branch bringing the file in.
12
12
 
13
13
  Otherwise it lists each changed member with `since`: whether it was compared with the last audit (`audit`) or with
14
14
  the commit that mapped the member where it is (`mapping_commit`), and that commit, and `history`: the commits after
@@ -19,10 +19,9 @@ follows a member that `move-member --path` moved to a renamed file. A merge is c
19
19
  `unchanged` for a member as its last audit or acknowledgement recorded it, `unchanged_since_mapping` for one compared
20
20
  only with the commit that mapped it, which no audit has assessed, and `no_baseline` for a member with no earlier text.
21
21
  `no_baseline_because` says why, for each principle with one: `outside_git`, where no completed audit assessed it,
22
- so a completed audit gives each one; or `not_committed`, where no commit holds the member where its map places it,
23
- so committing those of the map and the member's file that differ from HEAD or are untracked gives it one,
24
- and when every one is committed already, a completed audit gives it one. `next_action` names that audit, or those
25
- files.
22
+ so a completed audit gives each one; or `not_committed`, where no commit holds the member where its map places it, so
23
+ committing those of the map and the member's file that differ from HEAD or are untracked gives it one, and when every
24
+ one is committed already, a completed audit gives it one. `next_action` names that audit, or those files.
26
25
  `no_completed_audit` names readable maps without a completed full audit, even uncommitted. `next_action` counts them
27
26
  before baselines without judging meaning or completeness. `empty_maps` names maps with no members, even after an audit.
28
27
  Add a member first if empty; commit required files before an audit. Unknown/newer records keep upgrade/refusal guidance.
@@ -33,43 +32,44 @@ audit with `start-audit ID`. When the member still says the same thing, a comple
33
32
  its check, if any, in git, acknowledge it with `start-audit ID --member MEMBER`; `next_action` offers that only where
34
33
  it applies, as one command per principle giving `--member` for each such member, quoted for a shell.
35
34
  `records_waiting_on_an_upgrade`: principles whose record a later copy wrote, changes marked `waiting_on_an_upgrade`.
35
+ A plugin's member (`add-member --plugin`) is compared with its map's `pinned` hash until an audit, `source` naming
36
+ the version installed; `plugin_unresolved`, and an uncounted `--short` row, name one no plugin gives and its `reason`.
36
37
 
37
38
  Run it after a commit that touches a mapped member's file, and at the start of a session.
38
39
 
39
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
40
41
  changed member on stdout, with these tab-separated fields: its principle, its id, the newest commit that changed it
41
- (or `uncommitted`), whose subject and earlier commits `--history` adds to the JSON result, and what it was compared
42
- with: `audit` when an audit or acknowledgement assessed its text, or `mapping_commit`
43
- when no audit has, so only the commit that mapped it gives a baseline, then `waiting_on_an_upgrade` for one compared
42
+ (or `uncommitted`, or a plugin's `version:` installed), whose subject and earlier commits `--history` adds to the JSON
43
+ result, and what it was compared with: `audit` when an audit or acknowledgement assessed its text, or `mapping_commit`
44
+ or `pinned` when no audit has, so only its mapping gives a baseline, then `waiting_on_an_upgrade` for one compared
44
45
  with hashes a later copy wrote. Members compared with an audit come first. Control and invisible characters in a field
45
46
  are written as `\uXXXX`, so an id holding such a character is escaped for display: copied from a row, it names no
46
47
  member. The commands `next_action` prints carry each id exactly. After the rows, a line for each principle with members
47
- no audit has assessed gives its id and `N never assessed`. It exits 0 when no member this copy can act on changed, as
48
- when each change waits on an upgrade, and 3 when it prints a row or a count.
49
- Every refusal exits 1 with a single line of JSON on stderr, the only line this tool writes there when it refuses,
50
- whose `code` names it, such as `broken_members` (a member that cannot be found or read), `principles_folder_not_moved`
51
- (a project state to repair) or `unsupported_ruby` (no supported Ruby runs this tool). Other programs, such as an rbenv
52
- 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
53
- usage error exits 2. When it does not refuse, stderr carries what to do next, its commands naming `--project` if given
54
- it, else run in the project it names once, and says when there are no maps, or members with no baseline, that an empty
55
- stdout would hide. A changed member stays listed until an audit takes it in: a notice, not a gate that blocks commits.
48
+ no audit has assessed gives its id and `N never assessed`. It exits 0 when nothing this copy can act on changed, as when
49
+ a change waits on an upgrade, its plugin is unresolved or a member has no baseline yet, as one added and not committed,
50
+ and 3 when it prints a row or a count. Every refusal exits 1 with a single line of JSON on stderr, the only line this
51
+ tool writes there when it refuses, whose `code` names it, such as `broken_members` (a member that cannot be found or
52
+ read), `principles_folder_not_moved` (a project state to repair) or `unsupported_ruby` (no supported Ruby runs this
53
+ tool). Other programs, such as an rbenv shim, may write other lines there, and codes may be added: a code a hook does
54
+ not know is still a refusal to read. A usage error exits 2. When it does not refuse, stderr carries what to do next, its
55
+ commands naming `--project` if given it, else run in the project it names once, and says when there are no maps, or
56
+ members with no baseline, that an empty stdout would hide, else `Nothing changed (N members).` A changed member stays
57
+ listed until an audit takes it in: a notice, not a gate that blocks commits.
56
58
  For a post-commit hook, run: %{executable} list-member-problems --short || true
57
59
  A heartbeat can compare each line's commit with the last one it reported.
58
60
  `--short --session-start SOURCE`, for the session-start hook, prints one line instead: a changed principle's count
59
61
  and this command for it, to run before the user's task, or, for several, their count and `--short`, which lists them.
60
62
 
61
63
  `--commits-after COMMIT --hook-event EVENT` is for a Claude Code hook that runs after a Bash call, so a long session
62
- learns of a member it changed at the commit that changed it, not only at its next start. The plugin's after-commit
63
- hook runs it once HEAD moved during the call, with COMMIT the full sha HEAD pointed at before, and EVENT the hook's
64
- event, `PostToolUse` or `PostToolUseFailure`. It prints one JSON object, `hookSpecificOutput`, whose `hookEventName`
65
- is EVENT and whose `additionalContext` names, one row per member in `--short`'s fields, the members whose newest
66
- changing commit came after COMMIT, of both kinds, then how many other changed members are still listed, this command
67
- without the options, and, under the plugin, a line naming the `/principles` skill as where to start; one waiting
68
- on an upgrade comes apart. It prints nothing when those commits changed no mapped member. A refusal is reported, as
69
- its code and this command, only when those commits changed `.principles/` or a file a map names, since only then could
70
- they have caused it; else it prints nothing, and the session-start hook reports it. It exits 0 but for a usage error.
64
+ learns of a member it changed at the commit that changed it, not only at its next start. The plugin's after-commit hook
65
+ runs it once HEAD moved during the call, with COMMIT the full sha HEAD pointed at before, and EVENT the hook's event,
66
+ `PostToolUse` or `PostToolUseFailure`. It prints one JSON object, `hookSpecificOutput`, whose `hookEventName` is EVENT
67
+ and whose `additionalContext` names, one row per member in `--short`'s fields, the members whose newest changing commit
68
+ came after COMMIT, of both kinds, then how many other changed members are still listed, a plugin's apart, and this
69
+ command with `--short`, which shows what each needs before the next commit; one waiting on an upgrade comes apart. It
70
+ prints nothing when those commits changed no mapped member. A refusal is reported, as its code and this command, only
71
+ when those commits changed `.principles/` or a file a map names, since only then could they have caused it; else it
72
+ prints nothing, and the session-start hook reports it. It exits 0 but for a usage error.
71
73
 
72
- A member edited without changing what it says is listed at every commit until an audit takes the edit in. A member still
73
- says the same thing after a fixed typo, a reworded sentence or a renumbered citation; an added, dropped, reversed,
74
- narrowed or widened rule changes what it says. When one member was edited but still says the same thing, and a completed
75
- full audit has judged it, take in just that edit with `start-audit ID --member MEMBER` instead of a full audit.
74
+ A member still says the same thing after a fixed typo, a reworded sentence or a renumbered citation; an added,
75
+ dropped, reversed, narrowed or widened rule changes what it says.
@@ -63,14 +63,13 @@ design, and `open N days` since first raised, with no script over this JSON. It
63
63
 
64
64
  `--short` is for a session-start hook, where an open finding would otherwise wait unseen until its principle's next full
65
65
  audit. It prints one line instead of JSON, and nothing at all when no deferred finding is open, exiting 0 either way:
66
- how many deferred findings have a `waits_on`, the oldest of them by principle and id with its `waits_on`, cut at a word
67
- within 80 characters with a parenthesis left open closed, how many have none, and git's `user.name`; then to raise in
68
- the first reply each that waits on the agent's user, or on no one, since nothing else will, and the command that lists
69
- them, which one finding's own line needs no command for. The agent judges whether that user is the one named. While
70
- any open finding's `write_up_opening_reason` is `unavailable`, the line also names that write-up, or the first of them
71
- with their count, so a pointer that no longer resolves is seen at session start. With `--session-start SOURCE`, one of
72
- `startup`, `resume`, `clear` and `compact` as Claude Code's SessionStart hook names them, the line for `clear` or
73
- `compact` asks for the next reply; without it the line is worded for `startup`. For `resume`, whose conversation holds
74
- the line already, it gives only how many are open, how many whole days the oldest has waited since its
75
- `first_raised_at`, not `waits_on_since`, which dates only the ask, and the command that prints the line whole. The
76
- principles plugin's session-start hook prints this line, passing its source.
66
+ first, while any finding has a `waits_on`, to act on each that waits on the agent itself, then to raise in the first
67
+ reply each that waits on a person, or on no one, since nothing else will; then how many deferred findings have a
68
+ `waits_on`, how many have none, how many whole days the oldest has waited, and the `--lines` command that lists whom
69
+ each waits on. The agent judges from each `waits_on` whether it names itself or a person. While any open finding's `write_up_opening_reason` is `unavailable`, the line also names that write-up, or the
70
+ first of them with their count, so a pointer that no longer resolves is seen at session start. With `--session-start
71
+ SOURCE`, one of `startup`, `resume`, `clear` and `compact` as Claude Code's SessionStart hook names them, the line for
72
+ `clear` or `compact` asks for the next reply; without it the line is worded for `startup`. For `resume`, whose
73
+ conversation holds the line already, it gives only how many deferred findings are open, the oldest by principle and id,
74
+ how many whole days it has waited since its `first_raised_at`, not `waits_on_since`, which dates only the ask, and the
75
+ command that prints the line whole. The principles plugin's session-start hook prints this line, passing its source.
@@ -1,10 +1,11 @@
1
1
  Points MEMBER of principle ID at a new place, keeping its role and the key its audit is filed under. Use it when a
2
- heading was renamed, a passage's anchor was lost, or the member should be narrower or wider, as when a passage was
3
- cut short. When the member's file was renamed or moved, or its text moved into another file, give that path with
4
- `--path PATH`, with the member's own `--section`, passage or `--query` flags, so it keeps its last audit. This tool
5
- does not guess the new path: find it with git or by reading the project. The location flags are as for `add-member`
6
- and replace the old ones whole, so `--path` alone makes the member the whole file. MEMBER is the id `show-principle`
7
- lists. The result says which lines the member now spans.
2
+ heading was renamed, a passage's anchor was lost, or the member should be narrower or wider, as when a passage was cut
3
+ short. When the member's file was renamed or moved, or its text moved into another file, give that path with
4
+ `--path PATH`, with the member's own `--section`, passage or `--query` flags, so it keeps its last audit. This tool does
5
+ not guess the new path: find it with git or by reading the project. The location flags are as for `add-member` and
6
+ replace the old ones whole, so `--path` alone makes the member the whole file, and `--ending-at` alone is refused: give
7
+ the opening with `--starting-at` again. MEMBER is the id `show-principle` lists. The result prints the member's new id
8
+ and place under `member`, with the lines it now spans, but not its role or the whole map: `show-principle` shows those.
8
9
 
9
10
  A new literal `--ending-at` must occur once after the complete opening in the selected region; overlapping matches count.
10
11
  `ambiguous_passage_end` refuses before writing: exact `eligible_ending_count`, up to five `ending_candidates` with
@@ -0,0 +1,16 @@
1
+ Use it when `show-logged-requests` shows the folder holding more sessions than you still need: each request copies
2
+ the session's whole context, so old sessions fill the disk and keep old context on it.
3
+
4
+ `--keep-sessions N` says how many of the newest sessions to keep, a whole number, 0 keeping none; without it, 5.
5
+ It refuses with `invalid_keep_sessions` any other value. Before deleting anything it also refuses with
6
+ `request_logging_unguarded` while the folder exists without its `.gitignore`, and with
7
+ `request_logging_not_ignored` while git does not ignore every file there.
8
+
9
+ It ranks the sessions by their newest line in `requests/index.jsonl`, comparing the timestamps as text, and deletes
10
+ the request and response files the index names for every session older than the newest N. It keeps the index, the
11
+ launch file, any file a kept session also names, and any file the index names outside `requests/`. It also deletes
12
+ each request file the index does not name, which `show-logged-requests` counts as `orphan_requests`, once it was
13
+ written before every kept session's file; with `--keep-sessions 0` every such file stays, since one may belong to a
14
+ session still running.
15
+
16
+ Its result lists what it deleted under `removed`; `wrote` is empty.
@@ -1,5 +1,6 @@
1
1
  Takes MEMBER out of principle ID. MEMBER is the id `show-principle` lists. The member's file is not
2
- touched.
2
+ touched. It prints the id it removed as `member_removed` and how many members are left as `members_left`, not the
3
+ map; `show-principle ID` lists them.
3
4
 
4
5
  An id no member has is refused with `unknown_member`. When it differs from one mapped id only in case, spacing, dashes
5
6
  or quotes, or is the heading or passage of exactly one mapped id given without its path, the refusal names that id under
@@ -15,8 +15,8 @@ which files to commit, or the audit to run when every file is committed already.
15
15
  baseline, so that line would repeat at every session, and is left out. Then a line for each principle whose audit record
16
16
  a later release of principles wrote: this copy does not check its members, so none of them is counted, and the line says
17
17
  how to update. Then, while any principle awaits its first full audit, one line counting them, naming none, asks the
18
- agent to tell the user and start one background subagent to follow `show-first-audit-brief`, or to offer the audit at
19
- its next pause if it cannot. At resume and compact, when one may be running already, it gives the count alone and asks
18
+ agent to start one background subagent to follow `show-first-audit-brief`, tell the user, and relay its result. At
19
+ resume and compact, when one may be running already, it gives the count alone and asks
20
20
  for no second one. Last, while any finding an audit deferred or accepted is open, the one line `list-open-findings
21
21
  --short` prints, worded for the session's start, and short on resume, whose conversation holds the whole line already.
22
22
 
@@ -1,7 +1,7 @@
1
1
  Checks your answer, to the request its `request_id` or REQUEST_ID names, as `submit-answer` would; writes nothing.
2
2
  It prints the refusal `submit-answer` would give, such as a passage that matches twice, or `answer_acceptable`
3
3
  with the files submitting would write. Use it instead of searching the project yourself before you submit. Pass
4
- `--file FILE`, naming the answer written to a FILE outside the project; `--file -` reads it from stdin instead.
4
+ `--file FILE`, naming the answer written to a FILE kept out of git; `--file -` reads it from stdin instead.
5
5
  Its `next_action` ends with `submit-answer`, giving the same `--file` value again.
6
6
 
7
7
  The same current-ID history checks apply to assessment/correction answers with a Git base. For their
@@ -36,8 +36,8 @@ is allowed when there is nowhere to point, and then `list-open-findings` prints
36
36
  When a full audit's assessment has findings, `next_action` names the command that prints the correction's answer
37
37
  it leads to, `--as template`, with its `request_id` and the `basis` digests filled in, so you never copy them by
38
38
  hand; `show-open-correction ID` prints the same answer once the assessment is submitted. Redirect it to the file
39
- `next_action` names by its full path, outside the project, and fill only its `dispositions`: each `action` names the four actions
40
- and what each adds. Submit it after the assessment, as `next_action` says; the assessment writes the open record the
39
+ `next_action` names by its full path, kept out of git, and fill only its `dispositions`: each `action` names the four actions,
40
+ and the answer guide shows what each adds. Submit it after the assessment, as `next_action` says; the assessment writes the open record the
41
41
  correction is checked against. `--as template` refuses with `no_correction_to_fill` an answer that leads to none.
42
42
 
43
43
  `correction_recovery` says to keep a copy of the assessment you submit, or for `--file -` its exact stdin bytes,
@@ -2,6 +2,13 @@ Shows the record of principle ID's last audit: whether it is open or completed,
2
2
  from, each member's hash and each finding's members and disposition. Run it when a completed result
3
3
  points here with `full_record`.
4
4
 
5
+ When you need only what the last audit found, as when filling a full audit's `recent_decision`, add
6
+ `--findings`: it prints the record's `principle_id`, `status`, `base_commit`, `audited_at` and `findings`
7
+ alone, without the members it judged, and for an open record the same of the last completed audit it keeps,
8
+ under `last_completed`. `base_commit` is the commit the audit began from, whose text its findings'
9
+ evidence names; the fix of a fixed finding landed after it. A completed record keeps no `last_completed`,
10
+ so an earlier audit's findings are then only in git: git log -p -- .principles/audits/ID.json shows them.
11
+
5
12
  A full audit keeps each member's `assessment` as you gave it: the `assessment`, `delivery`, any
6
13
  `observation` and the `evidence`, with `evidence_sha256`, the hash of each evidence item's text then,
7
14
  `assessed_at`, and `entry_sha256` and `loads_sha256`, digests of the member's map entry and of when it
@@ -11,8 +11,14 @@ on ignored links or targets. Their contents are not read. No success is inferred
11
11
 
12
12
  `inventory.files` uses the survey's entries: `path`, `characters`, and `symlink_to` when linked. Markdown gives
13
13
  `outline`, with its headings and top-level list items, and any `description` and `opening_line` as in
14
- list-candidate-files. Explicitly requested test-data files and skill references receive outlines too: you chose
15
- them, and you judge relevance. Non-Markdown text gives path and size alone; open it only if needed.
14
+ list-candidate-files. Explicitly requested test-data files and skill references receive outlines too: you chose them,
15
+ and you judge relevance. A CI workflow in `.github/workflows/` gives each job, `job ID: NAME`, followed by its steps,
16
+ each by its name or else what it runs or uses; one whose YAML does not parse gives path and size alone. Other text, such
17
+ as a script or a hook, gives its whole-line `#` comments as its `outline`, where such a file states the rule it
18
+ enforces, its shebang and Ruby magic comments (`frozen_string_literal`, `typed`, `encoding`, `coding`, `warn_indent`,
19
+ `shareable_constant_value`) left out; text with none gives path and size alone. Past 20 items under one heading, or 20
20
+ comments, `(N more, lines A-B)` gives the lines from the first left out to the section's end. Open a file only if
21
+ needed.
16
22
 
17
23
  The full rendered result uses the survey's byte budget. `outlines_cut` names shortened outlines, whose line-range
18
24
  markers show where to read needed items. `outlines_left_out` names files whose outlines were omitted: request
@@ -0,0 +1,13 @@
1
+ An edit made by habit can make an always-loaded file heavier, put a task's rule where every session reads it, or
2
+ leave a "never" with no reason. Run this command before you judge or edit a member when you want more than the
3
+ one-paragraph check for its carrier kind: it prints that kind's page of practices, a few kilobytes. It writes
4
+ nothing.
5
+
6
+ KIND is one of `instructions` (`CLAUDE.md`, `AGENTS.md` and their kin), `rule` (a `.claude/rules` file), `skill`,
7
+ `subagent`, `hook_configuration` (a settings or hooks file), `hook_script` (a file a hook command runs) and `none`,
8
+ the page for any other text an agent reads, such as a docs page or text a program prints into context.
9
+
10
+ It prints `carrier`, `practices`, the page as Markdown, and an empty `wrote`.
11
+ Each point on a page says which host it holds for when it holds for only one.
12
+
13
+ It refuses with `unknown_carrier_kind` a kind it has no page for, and its repair names each kind it has.
@@ -0,0 +1,20 @@
1
+ Use it after request logging was turned on and the host relaunched with the launch line, to see what was
2
+ captured: whether requests arrive, from which sessions, and how much of the disk they take. A long session writes
3
+ its whole context with every request, so the folder can grow fast. A logged request holds the user's account email as well
4
+ as the working context, and the host writes its files readable by other local users, behind a folder
5
+ `turn-on-request-logging` makes readable only by its owner.
6
+
7
+ It writes nothing. It refuses with `request_logging_unguarded` while `.principles/request-logging/` exists
8
+ without its `.gitignore`, and with `request_logging_not_ignored` while git does not ignore every file there, before
9
+ reading a logged request.
10
+
11
+ `sessions` lists each session the host's `requests/index.jsonl` names, in the order it first names them, with its
12
+ `session_id`, its `requests`, the `files` its requests and their responses fill, and their `bytes`.
13
+ `orphan_requests` counts the request `files` no index line names, and their `bytes`; judge why from the session. An index line that is not a JSON object naming a session and its files is left out.
14
+
15
+ It never says whether the session you run in is capturing: the host's telemetry variables never reach your shell, so
16
+ judge that from the sessions and their sizes.
17
+
18
+ `newest` names, under `request_written_at`, when the newest request file was written, in UTC, and under
19
+ `session_id`, the session of the index's newest line; each is null before there is one. Compare the time with now to
20
+ judge whether requests still arrive.
@@ -0,0 +1,48 @@
1
+ A member can be mapped and audited yet never reach the agent, or reach it in every request at a cost nobody
2
+ chose. This command is for seeing what actually reached the context: it reads the logged requests and
3
+ reports which mapped members' text each one holds. It writes nothing.
4
+
5
+ A captured request holds the session's whole working context and the user's account email, and the host writes its
6
+ file readable by other local users, so the command reads none while git might commit one. It refuses with
7
+ `request_logging_unguarded` while the folder's `.gitignore` is gone, and with `request_logging_not_ignored` while git
8
+ does not ignore every path there.
9
+
10
+ It runs `jq` and `rg` over the captured requests, with no slower fallback. While either is not on PATH it
11
+ refuses with `fast_tools_missing`, naming the missing tool and what it does here; ask the user before
12
+ installing it, then run the command again.
13
+
14
+ It opens with `members_by_status`, how many members have each status, every status named. Then it prints
15
+ `members`, one entry per mapped member: its `principle`, its `member` key, then, for a member moved since it was
16
+ mapped, its `id`, where it is now, since its key names where it was, then its `status`, the `seen_in` requests that
17
+ held its lines, its `most_bytes` in one, and the `segments` it was seen in. That stays within a tool result however
18
+ many requests are logged. `--places` prints instead, under `seen`, each place its lines were found, which grows with
19
+ every request, and `--member KEY`, given once a member, the same for those members alone, refusing a key no map holds
20
+ as `unknown_member`, with any key it is spelled like as `did_you_mean`: the `request` file, the `query_source` the host's index gives it, the
21
+ JSON `path` inside the request, the `segment` (`reminder` inside a system reminder, `plain` elsewhere), the
22
+ `share` of the member's lines found there, the `count` of their occurrences there, the `offsets` at which each
23
+ starts, in bytes into the string at `path`, and their `bytes`, every occurrence counted, since a line sent twice
24
+ costs its bytes twice. A member is measured by its lines of 24 bytes or more, with leading indentation stripped.
25
+ While requests are logged here, `list-member-problems` names each member with no such line under
26
+ `too_short_to_scan`, an `unmeasurable` one here, with the `move-member` that widens it. `orphans` counts the
27
+ captured requests the host's index gives no `query_source`, since it writes an index line only once the response
28
+ succeeds. `quoting_requests` names the
29
+ requests that name a captured request file, where the agent read or named one, so what was seen there may
30
+ be a quote of an earlier request rather than what the host loaded. `unreadable` names each request the scan could
31
+ not read, by its `request` file and its `reason`: `not_whole_json` for one that is not whole JSON, such as one a
32
+ host left truncated, and `not_decoded` for whole JSON the scan stops at, such as a list rather than a request,
33
+ or a request the scan did not decode to its end, such as one the host rewrote while it read.
34
+ Such a request is not scanned at all, rather than in part, so a member it held is not counted.
35
+ `completeness` says how much the scan read: the requests `captured`, those under `unreadable` too, the `leaves`,
36
+ strings, in those it decoded, and `complete`, true only when it read every request through. A full audit's
37
+ `requests` and every `seen_in` count only the requests read through, the captured ones less the unreadable. Read an
38
+ `absent` as proven only while `complete` is true.
39
+ Nothing from a request's text is printed, and `wrote` is empty.
40
+
41
+ `--short` prints lines instead of JSON, and no `status_meanings`, to read before or in place of the whole result: first the counts by status,
42
+ then the requests captured, whether the scan was complete, how many requests were unreadable and how many quote a logged
43
+ request; then one tab-separated line a member, with its status, principle, member key, followed by `(now ID)` once
44
+ moved, and the segments it was seen in,
45
+ or `-` for none.
46
+
47
+ `status_meanings` says once what each `status` means, `not_a_carrier` first. A full audit's `logged_requests` part
48
+ prints it too.
@@ -3,7 +3,7 @@ Prints the answer to fill for the correction a full audit's assessment with find
3
3
  again. It reads principle ID's open audit record and writes nothing.
4
4
 
5
5
  It prints the correction's answer alone: its `request_id` and `basis`, which you hand back unchanged, and one disposition for each finding to fill.
6
- Redirect it to the file `submit-answer`'s `next_action` names by its full path, outside the project, fill only
6
+ Redirect it to the file `submit-answer`'s `next_action` names by its full path, kept out of git, fill only
7
7
  its `dispositions`, and submit it with `submit-answer --file` and that path. It prints the same answer in git and outside it, and still
8
8
  after you fix members, which leaves the correction current; `submit-answer` checks it as usual.
9
9
 
@@ -2,17 +2,18 @@ Shows each member of principle ID, where its text is now and whether it changed
2
2
  member is changed, unassessed, locator_lost or unavailable. A member that is locator_lost or unavailable carries
3
3
  `repair_with`: a `move-member` with its `NEW_PATH`, `HEADING` or `QUERY` to fill in, for a section or passage a
4
4
  second `move-member` for text moved into another file, and a `remove-member`. Run the one that fits;
5
- `next_action` names those members.
5
+ `next_action` names those members. A member from an installed plugin carries `source`, with `read_only: true`;
6
+ one no installed plugin gives is `plugin_unresolved`, with its `reason` and no `repair_with`. `--member MEMBER_ID`
7
+ prints that member alone, its `last_assessment` and any `last_acknowledgement` since; an unknown id is `unknown_member`.
6
8
 
7
- Each member's `loads` says, for each host this tool derives, when that host loads the member's file into the agent's
8
- context. Only `claude_code` is derived; Codex is not yet. The derivation follows Claude Code's documented loading
9
- from the file's path alone, for a session started at the project root, not what loaded in any session:
9
+ `--loads` adds each member's `loads` and the rest below. Each member's `loads` says, for each host this tool derives,
10
+ when that host loads the member's file into the agent's context. Only `claude_code` is derived; Codex is not yet.
11
+ It follows Claude Code's documented loading by path, for a session at the project root, not what loaded in one:
10
12
 
11
13
  - `session_start`: the project's `CLAUDE.md`, `.claude/CLAUDE.md` or `CLAUDE.local.md`, in every session.
12
14
  - `on_files` with `files`: one of those files in a folder below the root, once a file in that folder is read,
13
15
  written or edited.
14
- - `session_start` too: a rule in `.claude/rules/`, or a folder within it, without a `paths` field in its
15
- frontmatter.
16
+ - `session_start` too: a rule in `.claude/rules/`, or a folder within it, with no `paths` field in its frontmatter.
16
17
  - `on_files` with `paths_field`: a rule with a `paths` field, once a file it matches is read, written or edited.
17
18
  `paths_field` is the field's lines as written; this tool does not read the globs, so read them yourself.
18
19
  - `on_invocation`: a skill's `SKILL.md` in `.claude/skills/NAME/`, whose body loads when the skill is invoked.
@@ -32,7 +33,7 @@ from the file's path alone, for a session started at the project root, not what
32
33
  a note kept beside the agents, is `not_determined`.
33
34
  - `not_determined`: This tool knows the file is a rule, a skill or an agent but not when it loads.
34
35
  `frontmatter_refused` names the code this tool refused its frontmatter with, so read the frontmatter; `not_derived`
35
- names a kind it does not derive yet, such as a rules folder below the project root.
36
+ names a kind it does not derive yet, such as a rules folder below the project root or a plugin's file.
36
37
  - `no_known_carrier`: This tool knows no Claude Code facility that loads this path by itself. An `@` import from
37
38
  another instruction file, or a user-level file, may still load it; read the importing file to check.
38
39
 
@@ -56,13 +57,12 @@ an unreadable file is not taken for one without hooks.
56
57
  divided by four, rounded up, not a tokenizer count. These are source measurements, not injected context sizes:
57
58
  host processing and imports can change what reaches context. A skill's body waits for invocation; an agent's
58
59
  body goes to its subagent. A `loads` without `context` refers to the main session.
59
- `member_bytes` and `member_tokens` measure the member's own lines, equalling the file values for a whole-file
60
- member, omitted when this tool cannot find the member. Moving source lines need not save that much context.
61
- Those lines may be other members' too: `overlaps` names this principle's members sharing a line with it, `same_lines_as`
62
- those spanning exactly its lines, and `mapped_elsewhere` other principles' members, each with its role, `first_line`,
63
- `last_line`, and `same_lines` when spanning exactly the same lines, `spans_these_lines` when its lines include all of
64
- this member's, or `within_these_lines` when they all lie within this member's. Each is left out when none shares a line.
65
- Before narrowing a section to save its `member_bytes`, check whose lines they are.
60
+ `member_bytes` and `member_tokens` measure the member's own lines, equalling the file values for a whole-file member,
61
+ omitted when this tool cannot find the member. Before narrowing a section to save them, check whose lines they are:
62
+ `overlaps` names this principle's members sharing a line with it, `same_lines_as` those spanning exactly its lines,
63
+ and `mapped_elsewhere` other principles' members, each with its role, `first_line`, `last_line`, and `same_lines` when
64
+ spanning exactly the same lines, `spans_these_lines` when its lines include all of this member's, or
65
+ `within_these_lines` when they all lie within this member's. Each is left out when none shares a line.
66
66
 
67
67
  Adding members' sizes counts a shared file once per member. `loading_basis` qualifies the aggregates below:
68
68
  `host: claude_code`, `kind: documented_prediction`, `session_start_assumption: project_root`; not observed delivery
@@ -1,8 +1,8 @@
1
- Asks you to assess every member of principle ID and the set. Run it after mapping and when `show-principle` reports a
2
- member changed, unassessed, locator_lost or unavailable. `--part PART` prints parts, sized in `part_bytes`: a member's
3
- with its `text` and `lines_in_text`, an instruction as printed or `response_template` bare (`part_empty` if empty),
4
- `--as template --part members/ID` slots; `--part index` lists `part_command`, their `bytes`, whether `this_audit`
5
- `judges` or `carries_forward` a member, `trimmed_instructions`, `answer_with` and `next_action`, per `read_in_parts`.
1
+ Asks you to assess every member of principle ID and the set, after mapping or when `show-principle` reports one changed
2
+ or unassessed. `--part PART` prints parts, sized in `part_bytes`: a member's with `text` and `lines_in_text`, or a whole
3
+ file's `text_part`: `read_with`, `bytes`, `read_whole`; `response_template` bare or `part_empty`; `--as template --part
4
+ members/ID` slots. `--part index`: `part_command`, `bytes` or `bytes_unknown`, `this_audit`: `judges` (ids: `--part
5
+ judged_members`)/`carries_forward`, `trimmed_instructions`, `answer_with` and `next_action`, per `read_in_parts`.
6
6
 
7
7
  `start-audit` itself writes nothing. `submit-answer` writes the audit record, `.principles/audits/ID.json`: a full audit
8
8
  writes it open when its assessment has findings, completed once it has none or its correction is accepted. In git,
@@ -12,30 +12,30 @@ edited `basis`, whose `basis.last_completed_revision` names the record it follow
12
12
  problem no completed audit recorded and fixed before `start-audit` is not recorded, and a deferred or accepted finding
13
13
  fixed since is decided `resolved`. To record one, commit a revert, run the audit, and redo it in the correction.
14
14
 
15
- It refuses with `broken_members` while a member cannot be found or read, grouped by file in `missing_files`. A checked
16
- member carries `check_since_last_audit`, and `check_hidden_characters` if its check hides any. `mapped_elsewhere` shows
17
- other principles' members on its lines, judged by `mapped_elsewhere_instruction`, with `open_finding_ids` from
15
+ It refuses with `broken_members` while a member cannot be found or read, by file in `missing_files`. A checked member
16
+ carries `check_since_last_audit`, and `check_hidden_characters` if its check hides any. `mapped_elsewhere` shows other
17
+ principles' members on its lines, judged by `mapped_elsewhere_instruction`, with `open_finding_ids` from
18
18
  `open_findings_elsewhere`, whose `evidence` items say `shares_lines_with`, `shares_no_lines`, `whole_file` or
19
19
  `not_located`, or which says `evidence_not_kept`. In git, `context.uncommitted_files_outside_the_map` lists up to ten
20
- changed or untracked files, `not_named` the rest. `--instruction FIELD` prints whole any `trimmed_instructions` lists. A
21
- meta-principle audit adds `package_since_last_audit`, `passage_changed` and `other_principles_with_unjudged_changes`.
20
+ changed or untracked files, `not_named` the rest. A meta-principle audit adds `package_since_last_audit`,
21
+ `passage_changed` and `other_principles_with_unjudged_changes`. `logged_requests` shows what captured requests hold.
22
22
 
23
- After a full audit, a member carries `carried_forward`, with its `assessed_at`, an observed one's `observed_at` (or
23
+ After a full audit, a member carries `carried_forward`, its `assessed_at`, an observed one's `observed_at` (or
24
24
  `observed_at_from_assessed_at`), `evidence_changed` and, in git, `file_changed_outside_member`, or `judge_because` with
25
- `read_the_change`, a moved one `moved_from`; a carried one prints whole if a fact fires or a finding is open on it;
26
- `carried_forward_instruction` and `judge_because_instruction` explain. One acknowledged with `--member` since carries
27
- `acknowledged_since_last_audit` with `last_audited_commit`, its acknowledgements, lines then and now, or `{"omitted":
28
- "not_found_at_last_audit"}` once moved. A new or changed check needs `review_basis`, kept unverified; an unchanged one
29
- `review_basis` and `review_basis_since`, kept while left as printed, a changed one `last_run_review_basis`.
25
+ `read_the_change`, a whole file's text change `changed_lines`, a moved one `moved_from`; a carried one prints whole if a
26
+ fact fires; `carried_forward_instruction` and `judge_because_instruction` explain. One acknowledged since carries
27
+ `acknowledged_since_last_audit` with `last_audited_commit`, its acknowledgements, lines then and now, or, once moved,
28
+ `not_found_at_last_audit`. A new or changed check needs `review_basis`, kept unverified; an unchanged one `review_basis`
29
+ and `review_basis_since`, kept if left as printed, a changed one `last_run_review_basis`. A plugin member has `source`.
30
30
 
31
31
  ## Prior findings
32
32
 
33
- When the last completed audit deferred or accepted findings, `context.prior_findings` lists them, with
34
- `first_raised_at`, its `waits_on` and `waits_on_since`, changes since as `changed_since_audit`; an older one may claim
35
- `raised_in`, found by `git log --follow`. Each listed finding shows its `evidence`, in git each item with
36
- `changed_since_last_audit` and `found_now`, or `evidence_not_kept` and an `evidence_request` for `problem_evidence`,
37
- whose `replaces` re-points a lost item. Decide each in `prior_finding_decisions` as `still_holds`, `resolved`,
38
- `withdrawn` or `raised_again`; only `resolved` may give `evidence`. Results name `prior_findings_pointers_dropped`,
33
+ When the last completed audit deferred or accepted findings, `context.prior_findings` lists them, with `action`,
34
+ `reason`, `first_raised_at`, `waits_on`, `waits_on_since`, changes since as `changed_since_audit`; older ones may claim
35
+ `raised_in`. Each listed finding shows its `evidence`, in git each item with `changed_since_last_audit` and `found_now`,
36
+ or `evidence_not_kept` and an `evidence_request` for `problem_evidence`, whose `replaces` re-points a lost item. Decide
37
+ each in `prior_finding_decisions` as `still_holds`, `resolved`, `withdrawn` or `raised_again`; only `resolved` may give
38
+ `evidence`. `--as template` adds each `finding_problem`. Results name `prior_findings_pointers_dropped`,
39
39
  `prior_findings_waits_on_dropped`, `prior_findings_evidence_replaced`, `prior_findings_problems_restated`.
40
40
 
41
41
  ## Members to check against the activation
@@ -51,11 +51,11 @@ names or this tool could not determine, and any under an invoked or always activ
51
51
  ## One member's edit: `--member`
52
52
 
53
53
  Use `--member MEMBER` when one member was edited but still says the same thing, as `list-member-problems --help`
54
- describes, or `list-member-problems --short` repeats it until a full audit. It shows `baseline_commit`, `member_lines`
55
- (or a large member's `changed_region` or `changed_regions`, `context_lines`, `from_line`, `unchanged_lines_skipped` or
56
- `read_instead`), `first_changed_lines`, `read_the_change`, `check_instruction`, its `deferred_findings` and
57
- `accepted_findings`, with `deferred_findings_kept` and `change_shown_under` across principles; its `question` asks for
58
- `meaning_kept`. This tool checks both quotes. A near-miss id is refused as `unknown_member` with `did_you_mean`. A
54
+ describes. It shows `baseline_commit`, `member_lines` (or a large member's `changed_region` or `changed_regions`,
55
+ `context_lines`, `from_line`, `unchanged_lines_skipped` or `read_instead`), `first_changed_lines`, `read_the_change`,
56
+ `check_instruction`, its `deferred_findings` and `accepted_findings`, with `deferred_findings_kept` and
57
+ `change_shown_under` across principles; its `question` asks for `meaning_kept`; `--as template` adds `role` (or `roles`)
58
+ and `answer_with` to read. This tool checks both quotes. A near-miss id gets `unknown_member` and `did_you_mean`. A
59
59
  one-member audit writes the record once its answer is accepted, keeping the edit in `acknowledgements`; commit it. It is
60
60
  refused as `cannot_acknowledge` outside git, while an audit is open, and for a member no completed audit assessed, whose
61
61
  baseline text does not match the audit record, whose check is not the one that audit ran, or whose `check_result` is not
@@ -1,5 +1,5 @@
1
1
  Gives your answer, filled from its template, to the request its `request_id` names; a REQUEST_ID you give must
2
- match. Pass a JSON FILE outside the project with `--file FILE`; `--file -` reads stdin. This tool writes audit records
2
+ match. Pass a JSON FILE kept out of git with `--file FILE`; `--file -` reads stdin. This tool writes audit records
3
3
  at `.principles/audits/ID.json`, never member guidance. In a full audit, make each fix after the assessment is accepted
4
4
  and before you submit the correction that reports it; earlier fixes cause `stale_request` before an assessment's shape
5
5
  check. A completed full audit or acknowledgement after an assessment/correction request causes
@@ -22,18 +22,18 @@ text is not judged. An evidence/`recorded_at` location refusal (such as `ambiguo
22
22
  (`invalid_check_result`) retains its code, any `path` and repair, names whose evidence/check failed, and gives `fields`
23
23
  with each `problem` and JSON `pointer` into your answer. `invalid_answer` names fields ending in another template's
24
24
  placeholder; use this template or reword the ending. Set correction `action` to fixed, deferred, accepted or disagreed;
25
- else `invalid_disposition` names the finding. A deferred disposition may give `waits_on`, one line naming whom it waits
26
- on and to decide what, printed by `list-open-findings`. Null is allowed on any action; text on another action or
27
- multiple lines causes `invalid_disposition`. The tool records when it was asked; never send that time. For a legacy
25
+ only a deferral may give `waits_on` text, one line naming whom it waits on to decide what, which `list-open-findings`
26
+ prints; null is allowed on any action. Never send when it was asked. A partial fix may give `unfixed_part`: the rest,
27
+ raised as a new finding. Else `invalid_disposition` names the finding. For a legacy
28
28
  prior finding, `still_holds` may supply `first_raised_at` (that audit's `audited_at`) and `raised_in` (full commit sha)
29
29
  together. Only that commit's `.principles/audits/ID.json` or earlier `.memeplex/audits/ID.json` is read; it must leave
30
30
  the same finding deferred/accepted. Judge identity yourself. Refusals explain repairs: `raised_in_not_found` (also
31
31
  outside git), `raised_in_unreadable`, `raised_in_lacks_finding`, `raised_in_time_differs`, `first_raised_not_earlier`
32
- (date must precede stored time). Completed full audits list own/kept deferred or accepted IDs in `open_findings`,
33
- fixed/resolved IDs in `resolved_findings`, and each closed prior finding's decision/reason in `prior_findings_closed`.
34
- Disagreed/withdrawn findings are in neither open nor resolved. In git, `commits_since_base` lists commits touching each
35
- member's file; uncommitted fixes have an empty list. `files_to_commit` lists their files; `commit_with` commits only
36
- those, stopping during an unfinished merge. Replace its `-m` default as `commit_message_to_replace` says.
32
+ (date must precede stored time). Completed full audits list own/kept IDs in `deferred_findings` and
33
+ `accepted_findings`, fixed/resolved IDs in `resolved_findings`, each closed prior finding's decision/reason in
34
+ `prior_findings_closed`, and none disagreed/withdrawn. In git, `commits_since_base` lists commits touching each member's
35
+ file; uncommitted fixes have an empty list. `files_to_commit` lists their files; `commit_with` commits only those,
36
+ stopping during an unfinished merge. Replace its `-m` default as `commit_message_to_replace` says.
37
37
  `cited_files_missing` lists missing cited files excluded from `files_to_commit`; record references remain. If HEAD moved
38
38
  without touching a member, `head_moved_past_base` gives `base_commit` and `head`. If its fixes changed a file another
39
39
  principle also maps, `other_principles_with_changed_members` names each such principle and its members in fixed
@@ -46,8 +46,8 @@ what to retain; `show-answer-check --help` covers `carried_assessments_citing_de
46
46
 
47
47
  In git, this tool reads the map at the audit base: fixed dispositions declare roles/checks in `changed_map_entries`,
48
48
  text/additions in `changed_members`, removals in `removed_members`. `invalid_removed_members` rejects invalid removal
49
- claims; `empty_correction_map` requires a survivor/replacement. Source files stay intact.
50
- `claimed_change_missing` rejects unchanged entries; `members_added_awaiting_assessment` lack baselines.
49
+ claims; `empty_correction_map` requires a survivor/replacement. Source files stay intact. `claimed_change_missing`
50
+ rejects unchanged entries, `plugin_member_read_only` plugin members; `members_added_awaiting_assessment` lack baselines.
51
51
  Role/removal claims require git (`map_entries_need_git`). Full rules: correction question, `show-answer-check --help`.
52
52
 
53
53
  For a `start-audit --member` request, `quote_not_found` refuses an `old_line` or `new_line` not a line only its side
@@ -0,0 +1,10 @@
1
+ Use it when you are done capturing the requests the host sends, so later sessions stop filling
2
+ `.principles/request-logging/requests/` with copies of their whole context.
3
+
4
+ It empties the `env` of `.principles/request-logging/settings.json`, the launch file, and lists it under
5
+ `wrote`, so a host started with that file captures nothing. Where request logging was never turned on it writes nothing.
6
+ It deletes no logged request: those already captured stay in the folder, which git ignores. A host already running keeps
7
+ capturing until it is relaunched, which `next_action` says.
8
+
9
+ Before writing, it refuses with `request_logging_unguarded` while the folder exists without its `.gitignore`, and
10
+ with `request_logging_not_ignored` while git does not ignore every file there.
@@ -0,0 +1,32 @@
1
+ Use it before you capture the requests the host sends, to see which mapped members' text reaches the agent's
2
+ context. The project's first full audit to complete names it in `submit-answer`'s `next_action`, for the agent
3
+ to offer the user, while no request is logged here. A request holds the session's whole working context, the files
4
+ read and every tool result, so it must never be committed: this command sets up a folder git ignores before anything
5
+ is written there.
6
+
7
+ It writes `.principles/request-logging/.gitignore`, holding `*`, unless it is there, so git ignores the folder and
8
+ all it holds, and lists it under `wrote`. Then it asks git whether it ignores the folder's files and every file
9
+ already in it. Outside git, or when git tracks a file there, it refuses with `request_logging_not_ignored` and
10
+ removes what it wrote; its repair says how to make git ignore the folder.
11
+
12
+ Once git confirms it, it writes `.principles/request-logging/settings.json`, the launch file, and lists it
13
+ under `wrote`. Its `env` turns Claude Code's telemetry on with its metrics, logs and traces exporters set to `none`,
14
+ and asks the host to write each request's body under the folder's `requests/`, by its absolute path. Claude Code
15
+ documents reading these variables at launch, from a file passed with `claude --settings`, and ignoring them in a
16
+ project's own settings. A real launch wrote the bodies with the exporters off, read from `--settings` as from
17
+ variables exported in the shell. A logged request holds the user's account email as well as the working context. The
18
+ host writes each file readable by other local users; this command makes the folder, when it is new, readable only by
19
+ its owner.
20
+
21
+ It prints `launch_line`, `claude --settings` and the launch file's path, for the user to start Claude Code with.
22
+ Capture starts only on that launch, so the host must be relaunched with it. It is a line, never an alias, since an
23
+ alias would capture in every project the user starts the host in; each checkout or worktree writes its own launch
24
+ file. `resume_line` is the same line with `--resume`, to keep the conversation. The line starts the host from a
25
+ shell; a host the Desktop app or an IDE starts is not given the file. `next_action` says what a logged request
26
+ holds, that the launch file overrides a telemetry exporter the user set up, for that launch, and that
27
+ `turn-off-request-logging` deletes no logged request. Git ignores the folder, but a backup or an archive of the
28
+ project still holds it.
29
+
30
+ `explain_to_user` is a paragraph for the agent to give the user before the relaunch: what a logged request holds and
31
+ who can read it, that subagents' and side calls' requests are logged too, its disk use, `remove-logged-requests` and
32
+ `turn-off-request-logging`, and that `--resume` keeps the conversation while any relaunch stops background agents.