principles 0.0.6 → 0.0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +383 -0
- data/LICENSE +202 -0
- data/NOTICE +4 -0
- data/README.md +111 -0
- data/exe/principles +20 -0
- data/lib/principles/after_commit_hook_options.rb +2 -2
- data/lib/principles/cli.rb +58 -41
- data/lib/principles/command_line.rb +37 -14
- data/lib/principles/command_routes.rb +21 -7
- data/lib/principles/controllers/acknowledgement.rb +50 -118
- data/lib/principles/controllers/acknowledgements.rb +154 -0
- data/lib/principles/controllers/after_commit_report.rb +44 -0
- data/lib/principles/controllers/answer.rb +52 -21
- data/lib/principles/controllers/answer_phase.rb +20 -3
- data/lib/principles/controllers/assessment.rb +41 -28
- data/lib/principles/controllers/audit.rb +59 -15
- data/lib/principles/controllers/audit_completion.rb +25 -12
- data/lib/principles/controllers/command.rb +13 -12
- data/lib/principles/controllers/correction.rb +26 -11
- data/lib/principles/controllers/first_audit_brief.rb +40 -0
- data/lib/principles/controllers/full_audit_request.rb +47 -83
- data/lib/principles/controllers/hook_setup.rb +49 -0
- data/lib/principles/controllers/inventory.rb +10 -8
- data/lib/principles/controllers/mapping.rb +2 -2
- data/lib/principles/controllers/member_acknowledgement.rb +148 -0
- data/lib/principles/controllers/member_entries.rb +4 -4
- data/lib/principles/controllers/member_problems_report.rb +84 -30
- data/lib/principles/controllers/members_a_commit_changed.rb +3 -3
- data/lib/principles/controllers/members_to_assess.rb +23 -20
- data/lib/principles/controllers/meta_principle_setup.rb +5 -6
- data/lib/principles/controllers/open_correction.rb +42 -0
- data/lib/principles/controllers/parts_to_read.rb +117 -0
- data/lib/principles/controllers/repoint.rb +1 -1
- data/lib/principles/controllers/running_tool.rb +56 -6
- data/lib/principles/controllers/session_start_report.rb +62 -0
- data/lib/principles/controllers/survey.rb +2 -2
- data/lib/principles/data/audit_files.rb +7 -7
- data/lib/principles/data/bounded_file.rb +1 -1
- data/lib/principles/data/candidate_files_found.rb +6 -3
- data/lib/principles/data/command-steps.json +67 -12
- data/lib/principles/data/expected_type.rb +3 -3
- data/lib/principles/data/first_parent_log.rb +1 -1
- data/lib/principles/data/head_reflog.rb +74 -0
- data/lib/principles/data/hook_input.rb +59 -0
- data/lib/principles/data/ignored_by_git.rb +2 -2
- data/lib/principles/data/known_fields.rb +1 -1
- data/lib/principles/data/linked_path.rb +1 -1
- data/lib/principles/data/map_files.rb +2 -2
- data/lib/principles/data/principles_on_path.rb +83 -0
- data/lib/principles/data/principles_subfolder.rb +1 -1
- data/lib/principles/data/project_files.rb +10 -3
- data/lib/principles/data/repository.rb +14 -7
- data/lib/principles/data/running_version.rb +10 -8
- data/lib/principles/data/schema_check.rb +5 -5
- data/lib/principles/data/schemas/acknowledgement-answer.schema.json +86 -20
- data/lib/principles/data/schemas/acknowledgements-answer.schema.json +95 -0
- data/lib/principles/data/schemas/assessment-answer.schema.json +55 -20
- data/lib/principles/data/schemas/audit-record.schema.json +29 -20
- data/lib/principles/data/schemas/command-steps.schema.json +1 -1
- data/lib/principles/data/schemas/correction-answer-guide.schema.json +1 -1
- data/lib/principles/data/schemas/correction-answer.schema.json +14 -62
- data/lib/principles/data/schemas/member-map.schema.json +3 -3
- data/lib/principles/data/schemas/repointing-answer.schema.json +1 -1
- data/lib/principles/error.rb +4 -4
- data/lib/principles/failure_refusal.rb +57 -0
- data/lib/principles/invocation_options.rb +7 -6
- data/lib/principles/launch.rb +49 -0
- data/lib/principles/list_open_findings_options.rb +23 -0
- data/lib/principles/models/accepted_loading.rb +2 -2
- data/lib/principles/models/acknowledged_check.rb +106 -0
- data/lib/principles/models/acknowledgement.rb +51 -53
- data/lib/principles/models/acknowledgement_left_as_printed.rb +18 -5
- data/lib/principles/models/acknowledgement_refusal.rb +25 -10
- data/lib/principles/models/acknowledgements.rb +115 -0
- data/lib/principles/models/acknowledgements_across.rb +68 -0
- data/lib/principles/models/activation.rb +2 -2
- data/lib/principles/models/after_commit_input.rb +115 -0
- data/lib/principles/models/agent_loads.rb +1 -1
- data/lib/principles/models/answer_fields.rb +2 -2
- data/lib/principles/models/answer_place.rb +3 -3
- data/lib/principles/models/answer_text.rb +2 -2
- data/lib/principles/models/answered_time.rb +12 -3
- data/lib/principles/models/assessment_answer.rb +10 -10
- data/lib/principles/models/assessment_basis.rb +2 -2
- data/lib/principles/models/assessment_left_as_printed.rb +1 -1
- data/lib/principles/models/assessment_report.rb +14 -15
- data/lib/principles/models/audit.rb +46 -34
- data/lib/principles/models/audit_record.rb +58 -27
- data/lib/principles/models/audit_records.rb +13 -13
- data/lib/principles/models/audit_start.rb +3 -3
- data/lib/principles/models/audited_member_lines.rb +1 -1
- data/lib/principles/models/candidate_files.rb +18 -10
- data/lib/principles/models/candidate_inventory.rb +6 -6
- data/lib/principles/models/candidate_outline.rb +9 -9
- data/lib/principles/models/carried_assessments.rb +18 -3
- data/lib/principles/models/carried_member.rb +5 -5
- data/lib/principles/models/changed_regions.rb +92 -0
- data/lib/principles/models/check_result_guide.rb +50 -0
- data/lib/principles/models/check_since_last_audit.rb +5 -4
- data/lib/principles/models/cited_files.rb +4 -4
- data/lib/principles/models/command_steps.rb +3 -3
- data/lib/principles/models/commits_brought_in.rb +1 -1
- data/lib/principles/models/commits_since_base.rb +1 -1
- data/lib/principles/models/correction_answer.rb +2 -2
- data/lib/principles/models/correction_basis.rb +19 -10
- data/lib/principles/models/dated_line.rb +1 -2
- data/lib/principles/models/decided_prior_findings.rb +6 -6
- data/lib/principles/models/declared_map_changes.rb +5 -5
- data/lib/principles/models/disposition.rb +21 -21
- data/lib/principles/models/entry_file.rb +1 -1
- data/lib/principles/models/entry_files.rb +1 -1
- data/lib/principles/models/evidence_item.rb +1 -1
- data/lib/principles/models/evidence_lines_since.rb +2 -2
- data/lib/principles/models/evidence_replacements.rb +3 -3
- data/lib/principles/models/finding_write_ups.rb +12 -5
- data/lib/principles/models/findings_left_open.rb +4 -4
- data/lib/principles/models/first_full_audit.rb +32 -0
- data/lib/principles/models/first_raised_claim.rb +1 -1
- data/lib/principles/models/fix_only_fields.rb +1 -1
- data/lib/principles/models/head_moves.rb +66 -0
- data/lib/principles/models/hook_commands.rb +49 -4
- data/lib/principles/models/ignored_candidates.rb +1 -1
- data/lib/principles/models/instruction_named.rb +2 -3
- data/lib/principles/models/json_digest.rb +2 -2
- data/lib/principles/models/json_path_query.rb +1 -1
- data/lib/principles/models/kept_prior_finding.rb +9 -9
- data/lib/principles/models/last_completed_revision.rb +4 -5
- data/lib/principles/models/left_as_printed.rb +2 -2
- data/lib/principles/models/line_diff.rb +113 -0
- data/lib/principles/models/line_span.rb +1 -1
- data/lib/principles/models/list_member_problems_check.rb +80 -0
- data/lib/principles/models/listed_members.rb +47 -0
- data/lib/principles/models/loaded_files.rb +4 -5
- data/lib/principles/models/loading_decision.rb +19 -10
- data/lib/principles/models/loading_facts.rb +1 -1
- data/lib/principles/models/loads_to_check.rb +1 -2
- data/lib/principles/models/located_text.rb +1 -1
- data/lib/principles/models/mapped_principles.rb +2 -2
- data/lib/principles/models/member.rb +31 -4
- data/lib/principles/models/member_assessments.rb +17 -8
- data/lib/principles/models/member_elsewhere.rb +4 -4
- data/lib/principles/models/member_file.rb +4 -4
- data/lib/principles/models/member_grounds.rb +1 -1
- data/lib/principles/models/member_hashes_as_written.rb +1 -1
- data/lib/principles/models/member_lines.rb +29 -61
- data/lib/principles/models/member_loads.rb +2 -2
- data/lib/principles/models/member_moves.rb +1 -1
- data/lib/principles/models/member_problems.rb +21 -18
- data/lib/principles/models/member_repair_moves.rb +15 -9
- data/lib/principles/models/member_sighting.rb +12 -15
- data/lib/principles/models/member_snapshots.rb +1 -1
- data/lib/principles/models/member_state.rb +1 -1
- data/lib/principles/models/members_across_principles.rb +77 -0
- data/lib/principles/models/members_elsewhere.rb +2 -2
- data/lib/principles/models/members_sharing_lines.rb +7 -7
- data/lib/principles/models/meta_principle.rb +11 -4
- data/lib/principles/models/missing_files.rb +3 -3
- data/lib/principles/models/new_findings.rb +4 -4
- data/lib/principles/models/open_correction.rb +57 -0
- data/lib/principles/models/open_finding.rb +36 -31
- data/lib/principles/models/open_findings_elsewhere.rb +2 -2
- data/lib/principles/models/other_principles.rb +2 -2
- data/lib/principles/models/other_templates_placeholders.rb +17 -16
- data/lib/principles/models/outline_budget.rb +7 -7
- data/lib/principles/models/outline_group.rb +1 -1
- data/lib/principles/models/outline_section.rb +2 -2
- data/lib/principles/models/part_named.rb +41 -0
- data/lib/principles/models/placement.rb +2 -2
- data/lib/principles/models/principle.rb +13 -13
- data/lib/principles/models/principle_history.rb +8 -8
- data/lib/principles/models/principle_members.rb +14 -7
- data/lib/principles/models/principles_folder_move.rb +1 -1
- data/lib/principles/models/principles_on_path.rb +29 -0
- data/lib/principles/models/principles_package.rb +3 -3
- data/lib/principles/models/prior_decision_fields.rb +8 -8
- data/lib/principles/models/prior_finding_decision.rb +8 -8
- data/lib/principles/models/prior_finding_outcomes.rb +1 -1
- data/lib/principles/models/prior_findings.rb +5 -5
- data/lib/principles/models/problem_report.rb +42 -9
- data/lib/principles/models/project.rb +29 -20
- data/lib/principles/models/project_history.rb +18 -12
- data/lib/principles/models/quoted_change.rb +8 -8
- data/lib/principles/models/recent_decision.rb +3 -3
- data/lib/principles/models/record_format.rb +16 -10
- data/lib/principles/models/record_judged_against.rb +4 -4
- data/lib/principles/models/recorded_entry.rb +17 -8
- data/lib/principles/models/recorded_finding.rb +9 -9
- data/lib/principles/models/recorded_findings.rb +2 -2
- data/lib/principles/models/recorded_hashes.rb +2 -2
- data/lib/principles/models/recorded_members.rb +13 -13
- data/lib/principles/models/refusal_before_shape.rb +2 -2
- data/lib/principles/models/repoint.rb +3 -3
- data/lib/principles/models/report_hooks.rb +69 -0
- data/lib/principles/models/reported_check.rb +42 -36
- data/lib/principles/models/request_id.rb +19 -7
- data/lib/principles/models/runs_from.rb +7 -2
- data/lib/principles/models/sent_answer.rb +38 -16
- data/lib/principles/models/sent_prior_decisions.rb +1 -1
- data/lib/principles/models/session_start_input.rb +37 -0
- data/lib/principles/models/shape_problems_beside.rb +1 -1
- data/lib/principles/models/skill_loads.rb +1 -1
- data/lib/principles/models/stale_request.rb +59 -0
- data/lib/principles/models/still_holds_restatement.rb +6 -6
- data/lib/principles/models/submitted_answer.rb +1 -1
- data/lib/principles/models/template_placeholders.rb +6 -6
- data/lib/principles/models/text_within.rb +1 -1
- data/lib/principles/models/tracked_paths.rb +38 -0
- data/lib/principles/models/unchecked_members.rb +2 -2
- data/lib/principles/models/uncommitted_files.rb +1 -1
- data/lib/principles/models/uncommitted_outside_the_map.rb +2 -2
- data/lib/principles/models/waits_on.rb +1 -1
- data/lib/principles/models/write_up_opening.rb +5 -5
- data/lib/principles/models/write_up_pointer.rb +3 -3
- data/lib/principles/models/write_up_repoint.rb +2 -3
- data/lib/principles/positional_arguments.rb +15 -7
- data/lib/principles/prose_list.rb +1 -1
- data/lib/principles/session_start_options.rb +3 -3
- data/lib/principles/start_audit_options.rb +54 -12
- data/lib/principles/supported_ruby.rb +24 -7
- data/lib/principles/version.rb +2 -2
- data/lib/principles/views/acknowledged_since_last_audit.rb +2 -2
- data/lib/principles/views/acknowledgement_result.rb +137 -17
- data/lib/principles/views/activation_in_hand.rb +1 -1
- data/lib/principles/views/answered_request.rb +6 -2
- data/lib/principles/views/assessed_members.rb +68 -38
- data/lib/principles/views/assessment_request.rb +43 -21
- data/lib/principles/views/audit_changes.rb +4 -4
- data/lib/principles/views/audit_commit.rb +5 -4
- data/lib/principles/views/audit_result.rb +100 -53
- data/lib/principles/views/candidate_files_result.rb +7 -6
- data/lib/principles/views/check_notes.rb +29 -6
- data/lib/principles/views/check_result_template.rb +51 -39
- data/lib/principles/views/completed_audit_next_step.rb +44 -0
- data/lib/principles/views/context_parts.rb +112 -0
- data/lib/principles/views/correction_request.rb +49 -33
- data/lib/principles/views/diff_since_last_audit.rb +8 -6
- data/lib/principles/views/findings_result.rb +33 -1
- data/lib/principles/views/first_audit_brief.rb +51 -0
- data/lib/principles/views/first_audit_line.rb +45 -0
- data/lib/principles/views/help.rb +4 -4
- data/lib/principles/views/hook_setup_result.rb +91 -0
- data/lib/principles/views/instruction.rb +3 -3
- data/lib/principles/views/invocation.rb +32 -9
- data/lib/principles/views/json_with_entries_on_lines.rb +6 -35
- data/lib/principles/views/landed_since_base.rb +1 -1
- data/lib/principles/views/line_history_since_last_audit.rb +35 -0
- data/lib/principles/views/lines_shared_with_member.rb +6 -6
- data/lib/principles/views/loads_to_check_result.rb +11 -7
- data/lib/principles/views/map_added_to.rb +3 -3
- data/lib/principles/views/map_result.rb +9 -9
- data/lib/principles/views/member_change_since_baseline.rb +44 -23
- data/lib/principles/views/member_lines_beside_text.rb +43 -0
- data/lib/principles/views/member_repairs.rb +3 -2
- data/lib/principles/views/member_row.rb +61 -0
- data/lib/principles/views/members_a_commit_changed.rb +15 -11
- data/lib/principles/views/members_with_no_baseline.rb +10 -3
- data/lib/principles/views/meta_principle_passage.rb +1 -1
- data/lib/principles/views/meta_principle_result.rb +12 -5
- data/lib/principles/views/one_member_check_result_template.rb +24 -12
- data/lib/principles/views/open_findings_elsewhere_result.rb +5 -2
- data/lib/principles/views/open_findings_line.rb +26 -36
- data/lib/principles/views/other_principles_unjudged_result.rb +6 -3
- data/lib/principles/views/outside_the_map_result.rb +5 -2
- data/lib/principles/views/package_since_last_audit_result.rb +29 -6
- data/lib/principles/views/parts_index_result.rb +60 -0
- data/lib/principles/views/principle_read_result.rb +5 -6
- data/lib/principles/views/principle_with_changed_members.rb +1 -1
- data/lib/principles/views/principles_with_no_completed_audit.rb +1 -2
- data/lib/principles/views/printed_json.rb +51 -0
- data/lib/principles/views/printed_principle.rb +1 -1
- data/lib/principles/views/prior_finding_decisions_result.rb +4 -4
- data/lib/principles/views/prior_findings_result.rb +17 -14
- data/lib/principles/views/problem_lines.rb +70 -45
- data/lib/principles/views/problem_result.rb +75 -43
- data/lib/principles/views/prompts/acknowledge-a-change/judge-each-member-once-for-every-principle.md +2 -0
- data/lib/principles/views/prompts/acknowledge-a-change/read-the-deferred-findings-it-keeps.md +1 -0
- data/lib/principles/views/prompts/acknowledge-a-change/report-the-exit-status-its-own-listing-gives.md +3 -0
- data/lib/principles/views/prompts/acknowledge-a-change/resolve-them-in-a-full-audit.md +1 -0
- data/lib/principles/views/prompts/acknowledge-a-change/say-whether-each-change-keeps-its-meaning.md +8 -0
- data/lib/principles/views/prompts/acknowledge-a-change/say-whether-the-change-keeps-the-meaning.md +3 -3
- data/lib/principles/views/prompts/assess-every-member/confirm-each-write-up-pointer-the-answer-drops.md +2 -0
- data/lib/principles/views/prompts/assess-every-member/decide-each-member-loading.md +2 -1
- data/lib/principles/views/prompts/assess-every-member/have-a-changed-check-reviewed-before-running-it.md +1 -1
- data/lib/principles/views/prompts/assess-every-member/have-a-new-check-reviewed-before-running-it.md +1 -1
- data/lib/principles/views/prompts/assess-every-member/judge-a-carried-assessment-citing-a-decided-finding.md +3 -0
- data/lib/principles/views/prompts/assess-every-member/judge-a-submitted-carried-assessment-citing-a-decided-finding.md +5 -0
- data/lib/principles/views/prompts/assess-every-member/judge-the-keeping-under-the-release-since-the-last-audit.md +1 -1
- data/lib/principles/views/prompts/assess-every-member/keep-the-printed-review-basis-or-replace-it.md +1 -0
- data/lib/principles/views/prompts/assess-every-member/name-the-commit-that-made-the-check.md +1 -0
- data/lib/principles/views/prompts/assess-every-member/read-a-trimmed-instruction-whole.md +1 -1
- data/lib/principles/views/prompts/assess-every-member/read-the-request-in-parts.md +1 -0
- data/lib/principles/views/prompts/assess-every-member/run-the-check-then-report-it.md +2 -2
- data/lib/principles/views/prompts/assess-every-member/run-the-reviewed-check-and-say-what-its-review-rested-on.md +5 -3
- data/lib/principles/views/prompts/assess-every-member/why-each-member-is-judged-again.md +3 -2
- data/lib/principles/views/prompts/dispose-of-each-finding/answer-guide.json +1 -1
- data/lib/principles/views/prompts/dispose-of-each-finding/confirm-each-deferral-written-up-nowhere.md +2 -0
- data/lib/principles/views/prompts/dispose-of-each-finding/retain-assessment-and-correction.md +4 -4
- data/lib/principles/views/prompts/find-a-principle-to-map/where-the-inventory-looks.md +2 -2
- data/lib/principles/views/prompts/learn-what-a-command-does/every-command-and-how-they-chain.md +1 -2
- data/lib/principles/views/prompts/learn-what-a-command-does/list-candidate-files.md +4 -3
- data/lib/principles/views/prompts/learn-what-a-command-does/list-member-problems.md +16 -16
- data/lib/principles/views/prompts/learn-what-a-command-does/list-open-findings.md +65 -61
- data/lib/principles/views/prompts/learn-what-a-command-does/report-after-commit.md +14 -0
- data/lib/principles/views/prompts/learn-what-a-command-does/report-at-session-start.md +26 -0
- data/lib/principles/views/prompts/learn-what-a-command-does/show-answer-check.md +22 -20
- data/lib/principles/views/prompts/learn-what-a-command-does/show-first-audit-brief.md +19 -0
- data/lib/principles/views/prompts/learn-what-a-command-does/show-hook-setup.md +13 -0
- data/lib/principles/views/prompts/learn-what-a-command-does/show-meta-principle-passage.md +3 -1
- data/lib/principles/views/prompts/learn-what-a-command-does/show-open-correction.md +12 -0
- data/lib/principles/views/prompts/learn-what-a-command-does/start-audit.md +27 -28
- data/lib/principles/views/prompts/learn-what-a-command-does/submit-answer.md +39 -38
- data/lib/principles/views/prompts/report-the-completed-audit/commit-only-what-the-audit-changed.md +2 -2
- data/lib/principles/views/prompts/run-a-first-audit-in-the-background/follow-the-brief.md +18 -0
- data/lib/principles/views/prompts/set-principles-up/offer-the-report-hooks.md +2 -0
- data/lib/principles/views/prompts/set-principles-up/wire-the-report-hooks-with-the-user.md +8 -0
- data/lib/principles/views/prompts/start-a-session/act-on-the-open-findings.md +3 -4
- data/lib/principles/views/prompts/start-a-session/every-loaded-line-costs-every-session.md +1 -0
- data/lib/principles/views/prompts/start-a-session/hand-the-first-audit-to-a-subagent.md +3 -0
- data/lib/principles/views/prompts/start-a-session/run-each-command-above.md +1 -0
- data/lib/principles/views/prompts/start-a-session/start-no-second-first-audit.md +2 -0
- data/lib/principles/views/prompts/start-a-session/start-with-the-principles-skill.md +1 -0
- data/lib/principles/views/prompts.rb +1 -1
- data/lib/principles/views/read_the_change.rb +36 -0
- data/lib/principles/views/record_waiting_on_an_upgrade.rb +2 -2
- data/lib/principles/views/repoint_result.rb +1 -1
- data/lib/principles/views/report_hooks_offer.rb +25 -0
- data/lib/principles/views/request_part.rb +5 -5
- data/lib/principles/views/request_parts.rb +1 -1
- data/lib/principles/views/session_start_report.rb +46 -0
- data/lib/principles/views/shell_word.rb +1 -1
- data/lib/principles/views/trimmed_instructions_note.rb +30 -0
- data/lib/principles/views/visible_text.rb +1 -1
- data/lib/principles/views/workflow_diagram.rb +1 -1
- data/principles.gemspec +44 -0
- metadata +95 -14
- data/lib/principles/views/prompts/start-a-session/it-returns-after-each-clear-or-compaction-too.md +0 -1
- data/lib/principles/views/prompts/start-a-session/it-returns-at-each-session-start.md +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Meta-principle: what loads at start costs every session's context; load only what the task needs.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Run each command above; its output says what to do next.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
The principles skill, /principles, is where to start with these members; each command's output says what to do next.
|
|
@@ -56,7 +56,7 @@ module Principles
|
|
|
56
56
|
end
|
|
57
57
|
|
|
58
58
|
# The text with each placeholder filled. Text with no values is left as it is, since a prompt may hold a
|
|
59
|
-
# literal %, but one holding a placeholder is refused, so it never reaches the agent unfilled
|
|
59
|
+
# literal %, but one holding a placeholder is refused, so it never reaches the agent unfilled.
|
|
60
60
|
#: (Hash[Symbol, String]) -> String
|
|
61
61
|
def filled(values)
|
|
62
62
|
return format(@text, **values) unless values.empty?
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# typed: strict
|
|
2
|
+
# frozen_string_literal: true
|
|
3
|
+
|
|
4
|
+
require_relative "diff_since_last_audit"
|
|
5
|
+
require_relative "line_history_since_last_audit"
|
|
6
|
+
|
|
7
|
+
module Principles
|
|
8
|
+
# What this tool prints, from plain values a controller hands it. views/CLAUDE.md owns the boundary.
|
|
9
|
+
module Views
|
|
10
|
+
# The command a member's read_the_change prints: the history of its own lines when it is handed them, else the
|
|
11
|
+
# diff of its file over its paths.
|
|
12
|
+
class ReadTheChange
|
|
13
|
+
# since is the commit the change is read from; paths are the member's file then and now, once each; lines are
|
|
14
|
+
# its first_line and last_line now, given only when Member#traced_by_lines? says its change reads by them; to
|
|
15
|
+
# is the commit the change ends at, which holds the file as it is now, or nil for HEAD and the files now.
|
|
16
|
+
#: (since: String, paths: Array[String], lines: Hash[String, Integer]?, ?to: String?) -> void
|
|
17
|
+
def initialize(since:, paths:, lines:, to: nil)
|
|
18
|
+
@since = since
|
|
19
|
+
@paths = paths
|
|
20
|
+
@lines = lines
|
|
21
|
+
@to = to
|
|
22
|
+
freeze
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
#: () -> String
|
|
26
|
+
def to_s
|
|
27
|
+
lines = @lines
|
|
28
|
+
return DiffSinceLastAudit.new(last_audited_commit: @since, paths: @paths, to: @to).to_s unless lines
|
|
29
|
+
|
|
30
|
+
LineHistorySinceLastAudit.new(last_audited_commit: @since, path: @paths.fetch(0),
|
|
31
|
+
first_line: lines.fetch("first_line"), last_line: lines.fetch("last_line"),
|
|
32
|
+
to: @to).to_s
|
|
33
|
+
end
|
|
34
|
+
end
|
|
35
|
+
end
|
|
36
|
+
end
|
|
@@ -5,7 +5,7 @@ module Principles
|
|
|
5
5
|
# What this tool prints, from plain values a controller hands it. views/CLAUDE.md owns the boundary.
|
|
6
6
|
module Views
|
|
7
7
|
# One principle whose audit record a later copy wrote, at a format this copy cannot rewrite, so its audits and
|
|
8
|
-
# acknowledgements wait on an upgrade, which list-member-problems states instead of offering them
|
|
8
|
+
# acknowledgements wait on an upgrade, which list-member-problems states instead of offering them. The
|
|
9
9
|
# session-start hook prints its line from --short's stderr, matching "audit record is format N, first written
|
|
10
10
|
# by release", so a reword of that phrase changes the hook too.
|
|
11
11
|
class RecordWaitingOnAnUpgrade
|
|
@@ -32,7 +32,7 @@ module Principles
|
|
|
32
32
|
def beside = { "record_waiting_on_an_upgrade" => to_s }
|
|
33
33
|
|
|
34
34
|
# As list-principles marks the principle's row: the format alone, since its next_action says once how to update,
|
|
35
|
-
# where the whole line on each row repeated it
|
|
35
|
+
# where the whole line on each row repeated it.
|
|
36
36
|
#: () -> Hash[String, Hash[String, untyped]]
|
|
37
37
|
def marker = { "record_waiting_on_an_upgrade" => record_format }
|
|
38
38
|
|
|
@@ -7,7 +7,7 @@ require_relative "prompts"
|
|
|
7
7
|
module Principles
|
|
8
8
|
# What this tool prints, from plain values a controller hands it. views/CLAUDE.md owns the boundary.
|
|
9
9
|
module Views
|
|
10
|
-
# A repoint of a principle's open findings' write-ups: its request and its result
|
|
10
|
+
# A repoint of a principle's open findings' write-ups: its request and its result.
|
|
11
11
|
class RepointResult
|
|
12
12
|
# What an accepted repoint did: the ids of the findings it repointed and of those it left where they point,
|
|
13
13
|
# and each other principle's open finding whose write-up cannot be found, with those principles (T16).
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# typed: strict
|
|
2
|
+
# frozen_string_literal: true
|
|
3
|
+
|
|
4
|
+
require_relative "invocation"
|
|
5
|
+
require_relative "prompts"
|
|
6
|
+
|
|
7
|
+
module Principles
|
|
8
|
+
# What this tool prints, from plain values a controller hands it. views/CLAUDE.md owns the boundary.
|
|
9
|
+
module Views
|
|
10
|
+
# The offer of the hook entries that report changed members between audits without the principles plugin, which
|
|
11
|
+
# a completed audit and show-meta-principle-passage both make while principles is not set up.
|
|
12
|
+
class ReportHooksOffer
|
|
13
|
+
#: (Invocation) -> void
|
|
14
|
+
def initialize(invocation)
|
|
15
|
+
@invocation = invocation
|
|
16
|
+
freeze
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
#: () -> String
|
|
20
|
+
def to_s
|
|
21
|
+
Prompts.text("set-principles-up/offer-the-report-hooks", command: @invocation.in_project("show-hook-setup"))
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
end
|
|
@@ -6,20 +6,20 @@ require_relative "instruction"
|
|
|
6
6
|
module Principles
|
|
7
7
|
# What this tool prints, from plain values a controller hands it. views/CLAUDE.md owns the boundary.
|
|
8
8
|
module Views
|
|
9
|
-
# One part of a judgement request beyond its members, such as the prior findings to decide
|
|
10
|
-
# to check against the activation
|
|
11
|
-
# the slots it adds to the answer's template, which the request builds in where each belongs
|
|
9
|
+
# One part of a judgement request beyond its members, such as the prior findings to decide or the members
|
|
10
|
+
# to check against the activation: what the agent reads of it, its list and the instruction for it, and
|
|
11
|
+
# the slots it adds to the answer's template, which the request builds in where each belongs.
|
|
12
12
|
class RequestPart
|
|
13
13
|
# The slots this part adds to the answer's template.
|
|
14
14
|
#: Hash[String, untyped]
|
|
15
15
|
attr_reader :slots
|
|
16
|
-
# The instructions for deciding this part, each printed after its list
|
|
16
|
+
# The instructions for deciding this part, each printed after its list.
|
|
17
17
|
#: Array[Instruction]
|
|
18
18
|
attr_reader :instructions
|
|
19
19
|
|
|
20
20
|
# listed is what the agent reads of this part before its instructions. help is, by slot, the placeholder text
|
|
21
21
|
# each of its entries carries in the answer printed alone, where no instruction is printed beside it to say
|
|
22
|
-
# what each field takes
|
|
22
|
+
# what each field takes.
|
|
23
23
|
#: (shown: Hash[String, untyped], slots: Hash[String, untyped], ?instructions: Array[Instruction],
|
|
24
24
|
#| ?help: Hash[String, Hash[String, untyped]]) -> void
|
|
25
25
|
def initialize(shown:, slots:, instructions: [], help: {})
|
|
@@ -6,7 +6,7 @@ require_relative "request_part"
|
|
|
6
6
|
module Principles
|
|
7
7
|
# What this tool prints, from plain values a controller hands it. views/CLAUDE.md owns the boundary.
|
|
8
8
|
module Views
|
|
9
|
-
# A judgement request's parts beyond its members, in the order the agent reads them
|
|
9
|
+
# A judgement request's parts beyond its members, in the order the agent reads them.
|
|
10
10
|
class RequestParts
|
|
11
11
|
#: (Array[RequestPart]) -> void
|
|
12
12
|
def initialize(parts)
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
# typed: strict
|
|
2
|
+
# frozen_string_literal: true
|
|
3
|
+
|
|
4
|
+
require_relative "problem_lines"
|
|
5
|
+
require_relative "invocation"
|
|
6
|
+
|
|
7
|
+
module Principles
|
|
8
|
+
# What this tool prints, from plain values a controller hands it. views/CLAUDE.md owns the boundary.
|
|
9
|
+
module Views
|
|
10
|
+
# report-at-session-start's output: each line a session start adds to the agent's context, marked as this tool's,
|
|
11
|
+
# since the context holds other hooks' lines too, and exit 0, the only status on which a host adds them.
|
|
12
|
+
class SessionStartReport
|
|
13
|
+
# Every line's mark.
|
|
14
|
+
MARK = "principles: "
|
|
15
|
+
|
|
16
|
+
#: (Array[String]) -> void
|
|
17
|
+
def initialize(lines)
|
|
18
|
+
@lines = lines
|
|
19
|
+
freeze
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
# The line naming another principles earlier on PATH, at path, which prints version, where the running copy
|
|
23
|
+
# is running: a bare principles command runs that one.
|
|
24
|
+
#: (String, String, String) -> String
|
|
25
|
+
def self.other_version(path, version, running)
|
|
26
|
+
"the principles on PATH, #{path}, is #{version}, not this plugin's #{running}, so a bare principles command " \
|
|
27
|
+
"runs #{version}. Ask the user to update or remove that copy."
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
# This report, followed by lines.
|
|
31
|
+
#: (Array[String]) -> SessionStartReport
|
|
32
|
+
def followed_by(lines) = SessionStartReport.new([*@lines, *lines])
|
|
33
|
+
|
|
34
|
+
# This report, ending as list-member-problems refused with code: the code, and the command, as invocation names
|
|
35
|
+
# it, whose refusal says why and how to repair it.
|
|
36
|
+
#: (String, Invocation) -> SessionStartReport
|
|
37
|
+
def refused(code, invocation)
|
|
38
|
+
SessionStartReport.new([*@lines, "list-member-problems refused with #{code}. To see why and how to repair " \
|
|
39
|
+
"it, run:\n#{invocation.in_project("list-member-problems")}"])
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
#: () -> Lines
|
|
43
|
+
def printed = Lines.new(stdout: @lines.map { "#{MARK}#{it}\n" }.join, stderr: "", status: 0)
|
|
44
|
+
end
|
|
45
|
+
end
|
|
46
|
+
end
|
|
@@ -6,7 +6,7 @@ module Principles
|
|
|
6
6
|
module Views
|
|
7
7
|
# One word of a printed command, as a shell reads it: as it is when it holds only characters no shell treats
|
|
8
8
|
# specially, else in single quotes, inside which a shell expands nothing. Ids, paths and headings come from
|
|
9
|
-
# project files anyone may have written
|
|
9
|
+
# project files anyone may have written.
|
|
10
10
|
class ShellWord
|
|
11
11
|
# A word every common shell reads as it is: no quote, space, $, `, glob or redirection, and no = or #,
|
|
12
12
|
# which zsh can expand.
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# typed: strict
|
|
2
|
+
# frozen_string_literal: true
|
|
3
|
+
|
|
4
|
+
require_relative "../prose_list"
|
|
5
|
+
require_relative "prompts"
|
|
6
|
+
|
|
7
|
+
module Principles
|
|
8
|
+
# What this tool prints, from plain values a controller hands it. views/CLAUDE.md owns the boundary.
|
|
9
|
+
module Views
|
|
10
|
+
# The note a full audit's request and its index of parts print, naming the instructions the request prints only in
|
|
11
|
+
# part and the flag that prints one whole, so a trimmed field is not taken for the whole.
|
|
12
|
+
class TrimmedInstructionsNote
|
|
13
|
+
# fields is each instruction field the request prints only in part, in order.
|
|
14
|
+
#: (Array[String]) -> void
|
|
15
|
+
def initialize(fields)
|
|
16
|
+
@fields = fields
|
|
17
|
+
freeze
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
# The note under trimmed_instructions; nothing when the request trims none.
|
|
21
|
+
#: () -> Hash[String, String]
|
|
22
|
+
def to_h
|
|
23
|
+
return {} if @fields.empty?
|
|
24
|
+
|
|
25
|
+
{ "trimmed_instructions" => Prompts.text("assess-every-member/read-a-trimmed-instruction-whole",
|
|
26
|
+
fields: ProseList.new(@fields).to_s) }
|
|
27
|
+
end
|
|
28
|
+
end
|
|
29
|
+
end
|
|
30
|
+
end
|
|
@@ -6,7 +6,7 @@ module Principles
|
|
|
6
6
|
module Views
|
|
7
7
|
# Text from a project file or an agent's answer, printed outside JSON with each control, format and separator
|
|
8
8
|
# character written as \uXXXX, as JSON output shows it, so a tab cannot split a field and an invisible character
|
|
9
|
-
# cannot hide
|
|
9
|
+
# cannot hide. cli.rb escapes printed JSON without control characters, since JSON already escapes them
|
|
10
10
|
# inside strings and its own newlines must stay; so the two are not one rule to fold together.
|
|
11
11
|
class VisibleText
|
|
12
12
|
#: (String) -> void
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
module Principles
|
|
5
5
|
# What this tool prints, from plain values a controller hands it. views/CLAUDE.md owns the boundary.
|
|
6
6
|
module Views
|
|
7
|
-
# The docs page that draws every command's steps as one Mermaid flowchart
|
|
7
|
+
# The docs page that draws every command's steps as one Mermaid flowchart: a subgraph
|
|
8
8
|
# per command, this tool's steps as boxes, the agent's as rounded shapes, and a dashed edge where the agent
|
|
9
9
|
# hands over to the command it answers with. It is generated, and a spec fails when the committed copy is
|
|
10
10
|
# stale, so the drawing cannot drift from the steps --help prints.
|
data/principles.gemspec
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require_relative "lib/principles/version"
|
|
4
|
+
|
|
5
|
+
Gem::Specification.new do |spec|
|
|
6
|
+
spec.name = "principles"
|
|
7
|
+
# `rake build[development]` or `rake build[production]` stamps the version into the copy it builds; see the
|
|
8
|
+
# Rakefile. Loaded from the checkout, as Bundler does, it is RELEASE, so Gemfile.lock does not change with
|
|
9
|
+
# every commit.
|
|
10
|
+
spec.version = Principles::BUILT_VERSION || Principles::RELEASE
|
|
11
|
+
spec.summary = "Tighter harness, longer leash: agents you can leave running"
|
|
12
|
+
spec.description = <<~TEXT
|
|
13
|
+
A harness configuration framework that keeps every part of your Claude Code agent's harness in alignment.
|
|
14
|
+
Name the principles your CLAUDE.md files, rules, skills, subagents and hooks encode, and map every place
|
|
15
|
+
that carries each one. When one place changes, the principles CLI helps your agent track which others must
|
|
16
|
+
move with it, and walks your agent through bringing them back into line, recording anything still to fix.
|
|
17
|
+
It never edits your harness and calls no model: it keeps the books deterministically.
|
|
18
|
+
Ruby 3.4, with no runtime gem dependencies.
|
|
19
|
+
Codex and Pi support coming soon.
|
|
20
|
+
TEXT
|
|
21
|
+
spec.license = "Apache-2.0"
|
|
22
|
+
spec.authors = ["Sidu Ponnappa"]
|
|
23
|
+
spec.email = ["sidu@realfast.ai"]
|
|
24
|
+
spec.required_ruby_version = [">= 3.4.2", "< 3.5"]
|
|
25
|
+
spec.homepage = "https://github.com/realfastAI/principles"
|
|
26
|
+
spec.metadata["source_code_uri"] = spec.homepage
|
|
27
|
+
spec.metadata["changelog_uri"] = "#{spec.homepage}/blob/main/CHANGELOG.md"
|
|
28
|
+
spec.metadata["bug_tracker_uri"] = "#{spec.homepage}/issues"
|
|
29
|
+
|
|
30
|
+
# An allowlist of what the CLI runs on: its executable, its Ruby, its data and schemas, and the prompts it prints.
|
|
31
|
+
# With the licence and its NOTICE, which Apache 2.0 requires on every copy, and the README, changelog and this
|
|
32
|
+
# gemspec, which the public repository carries as the gem does, and nothing else, so no harness component, such
|
|
33
|
+
# as a CLAUDE.md or a skill, reaches the gem.
|
|
34
|
+
spec.files = ["CHANGELOG.md", "LICENSE", "NOTICE", "README.md", "exe/principles", "principles.gemspec",
|
|
35
|
+
*Dir["lib/**/*.rb", "lib/principles/data/**/*.json",
|
|
36
|
+
"lib/principles/views/prompts/**/*.{md,json}"]].sort
|
|
37
|
+
spec.bindir = "exe"
|
|
38
|
+
spec.executables = ["principles"]
|
|
39
|
+
spec.require_paths = ["lib"]
|
|
40
|
+
# No runtime dependency: this tool runs on the standard library alone, so it starts on any Ruby that
|
|
41
|
+
# satisfies required_ruby_version. A run checks files against their schemas with its own validator;
|
|
42
|
+
# json_schemer is a development dependency that the specs compare it with.
|
|
43
|
+
spec.metadata["rubygems_mfa_required"] = "true"
|
|
44
|
+
end
|