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