claude-dev-env 1.59.0 → 1.61.0

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 (81) hide show
  1. package/CLAUDE.md +4 -0
  2. package/audit-rubrics/category_rubrics/category-b-selector-engine-compat.md +1 -1
  3. package/audit-rubrics/category_rubrics/category-e-dead-code.md +1 -0
  4. package/audit-rubrics/category_rubrics/category-f-silent-failures.md +1 -1
  5. package/audit-rubrics/category_rubrics/category-o-docstring-vs-impl-drift.md +1 -1
  6. package/audit-rubrics/prompts/category-b-selector-engine-compat.md +2 -2
  7. package/audit-rubrics/prompts/category-e-dead-code.md +17 -4
  8. package/audit-rubrics/prompts/category-f-silent-failures.md +1 -0
  9. package/docs/CODE_RULES.md +2 -2
  10. package/hooks/blocking/code_rules_annotations_length.py +189 -10
  11. package/hooks/blocking/code_rules_dead_module_constant.py +321 -0
  12. package/hooks/blocking/code_rules_duplicate_body.py +152 -0
  13. package/hooks/blocking/code_rules_enforcer.py +38 -15
  14. package/hooks/blocking/code_rules_orphan_css_class.py +196 -0
  15. package/hooks/blocking/code_rules_typeddict_stub.py +172 -0
  16. package/hooks/blocking/config/__init__.py +5 -0
  17. package/hooks/blocking/config/verified_commit_constants.py +118 -0
  18. package/hooks/blocking/destructive_command_blocker.py +483 -61
  19. package/hooks/blocking/test_code_rules_enforcer_annotations.py +240 -0
  20. package/hooks/blocking/test_code_rules_enforcer_cap_meta.py +1 -0
  21. package/hooks/blocking/test_code_rules_enforcer_cross_skill_duplicate.py +146 -0
  22. package/hooks/blocking/test_code_rules_enforcer_dead_module_constant.py +188 -0
  23. package/hooks/blocking/test_code_rules_enforcer_dispatch_wiring.py +82 -0
  24. package/hooks/blocking/test_code_rules_enforcer_orphan_css_class.py +196 -0
  25. package/hooks/blocking/test_code_rules_enforcer_zero_payload_alias.py +415 -0
  26. package/hooks/blocking/test_code_rules_enforcer_zero_payload_alias_hook_routing.py +156 -0
  27. package/hooks/blocking/test_destructive_command_blocker.py +213 -0
  28. package/hooks/blocking/test_verdict_directory_write_blocker.py +720 -0
  29. package/hooks/blocking/test_verification_verdict_store.py +490 -0
  30. package/hooks/blocking/test_verified_commit_gate.py +495 -0
  31. package/hooks/blocking/test_verified_commit_message_accuracy_blocker.py +131 -0
  32. package/hooks/blocking/test_verifier_verdict_minter.py +193 -0
  33. package/hooks/blocking/verdict_directory_write_blocker.py +667 -0
  34. package/hooks/blocking/verification_verdict_store.py +686 -0
  35. package/hooks/blocking/verified_commit_gate.py +535 -0
  36. package/hooks/blocking/verified_commit_message_accuracy_blocker.py +152 -0
  37. package/hooks/blocking/verifier_verdict_minter.py +221 -0
  38. package/hooks/diagnostic/test_hook_log_extractor.py +3 -3
  39. package/hooks/hooks.json +43 -1
  40. package/hooks/hooks_constants/blocking_check_limits.py +1 -0
  41. package/hooks/hooks_constants/code_rules_enforcer_constants.py +6 -0
  42. package/hooks/hooks_constants/dead_module_constant_constants.py +20 -0
  43. package/hooks/hooks_constants/destructive_command_segment_constants.py +15 -0
  44. package/hooks/hooks_constants/duplicate_function_body_constants.py +22 -5
  45. package/hooks/hooks_constants/orphan_css_class_constants.py +40 -0
  46. package/hooks/hooks_constants/precommit_code_rules_gate_constants.py +1 -1
  47. package/hooks/validation/mypy_validator.py +59 -7
  48. package/hooks/validation/test_mypy_validator.py +94 -0
  49. package/package.json +1 -1
  50. package/rules/file-global-constants.md +7 -1
  51. package/rules/no-cross-skill-duplicate-helpers.md +29 -0
  52. package/rules/orphan-css-class.md +23 -0
  53. package/skills/_shared/pr-loop/scripts/preflight_worktree.py +392 -0
  54. package/skills/_shared/pr-loop/scripts/skills_pr_loop_constants/preflight_constants.py +70 -0
  55. package/skills/_shared/pr-loop/scripts/test_preflight_worktree.py +263 -0
  56. package/skills/autoconverge/SKILL.md +54 -17
  57. package/skills/autoconverge/reference/closing-report.md +59 -17
  58. package/skills/autoconverge/workflow/aggregate_runs.py +371 -0
  59. package/skills/autoconverge/workflow/autoconverge_report_constants/render_report_constants.py +192 -76
  60. package/skills/autoconverge/workflow/converge.clean-audit.test.mjs +76 -0
  61. package/skills/autoconverge/workflow/converge.contract.test.mjs +395 -206
  62. package/skills/autoconverge/workflow/converge.mjs +520 -57
  63. package/skills/autoconverge/workflow/convergence_summary.py +110 -0
  64. package/skills/autoconverge/workflow/fixtures/wf_run/subagents/workflows/wf_881252e6-700/agent-ab1c2d3e4f5a6b7c8.jsonl +2 -0
  65. package/skills/autoconverge/workflow/fixtures/wf_run/workflows/wf_881252e6-700.json +7 -0
  66. package/skills/autoconverge/workflow/render_report.py +488 -397
  67. package/skills/autoconverge/workflow/test_aggregate_runs.py +134 -0
  68. package/skills/autoconverge/workflow/test_convergence_summary.py +132 -0
  69. package/skills/autoconverge/workflow/test_render_report.py +518 -259
  70. package/skills/pr-converge/reference/per-tick.md +28 -8
  71. package/skills/rebase/SKILL.md +2 -4
  72. package/system-prompts/software-engineer.xml +2 -6
  73. package/hooks/blocking/content_search_to_zoekt_redirector.py +0 -59
  74. package/hooks/blocking/content_search_zoekt_bash_block_reason.py +0 -25
  75. package/hooks/blocking/content_search_zoekt_block_payload.py +0 -21
  76. package/hooks/blocking/content_search_zoekt_indexed_paths.py +0 -24
  77. package/hooks/blocking/content_search_zoekt_indexed_roots_config.py +0 -131
  78. package/hooks/blocking/content_search_zoekt_redirect_guidance.py +0 -52
  79. package/hooks/blocking/test_content_search_to_zoekt_redirector_integration.py +0 -61
  80. package/hooks/blocking/test_content_search_to_zoekt_redirector_unit.py +0 -92
  81. package/hooks/blocking/test_content_search_zoekt_indexed_roots_config.py +0 -102
@@ -0,0 +1,110 @@
1
+ """Build the convergence-summary agent prompt over a PR's aggregated findings."""
2
+
3
+ from autoconverge_report_constants.render_report_constants import (
4
+ GITHUB_PR_URL_TEMPLATE,
5
+ SUMMARY_COPILOT_NOTE_TEMPLATE,
6
+ SUMMARY_DETAIL_MAX_CHARS,
7
+ SUMMARY_FINDING_LINE_TEMPLATE,
8
+ SUMMARY_FINDINGS_EMPTY_TEXT,
9
+ SUMMARY_FIX_EMPTY_TEXT,
10
+ SUMMARY_FIX_LINE_TEMPLATE,
11
+ SUMMARY_PR_COORDINATES_TEMPLATE,
12
+ SUMMARY_PROMPT_TEMPLATE,
13
+ SUMMARY_STANDARDS_NOTE_TEMPLATE,
14
+ )
15
+
16
+
17
+ def _format_findings_block(findings: list[dict]) -> str:
18
+ """Return the numbered findings block, or a clean-run sentence when empty.
19
+
20
+ Args:
21
+ findings: Aggregated distinct findings, each carrying severity, category,
22
+ file, line, title, and detail keys.
23
+
24
+ Returns:
25
+ A newline-joined numbered list, or a sentence stating every lens was clean.
26
+ """
27
+ if not findings:
28
+ return SUMMARY_FINDINGS_EMPTY_TEXT
29
+ numbered_lines: list[str] = []
30
+ for position, each_finding in enumerate(findings):
31
+ detail = str(each_finding.get("detail", ""))[:SUMMARY_DETAIL_MAX_CHARS]
32
+ numbered_lines.append(
33
+ SUMMARY_FINDING_LINE_TEMPLATE.format(
34
+ number=position + 1,
35
+ severity=each_finding.get("severity", ""),
36
+ category=each_finding.get("category", ""),
37
+ file=each_finding.get("file", ""),
38
+ line=each_finding.get("line", 0),
39
+ title=each_finding.get("title", ""),
40
+ detail=detail,
41
+ )
42
+ )
43
+ return "\n".join(numbered_lines)
44
+
45
+
46
+ def _format_fix_block(fix_summaries: list[str]) -> str:
47
+ """Return the numbered per-round fix-summary block, or 'none' when empty.
48
+
49
+ Args:
50
+ fix_summaries: One-line fix summaries collected across every round.
51
+
52
+ Returns:
53
+ A newline-joined numbered list, or the empty-state literal.
54
+ """
55
+ if not fix_summaries:
56
+ return SUMMARY_FIX_EMPTY_TEXT
57
+ return "\n".join(
58
+ SUMMARY_FIX_LINE_TEMPLATE.format(number=position + 1, summary=each_summary)
59
+ for position, each_summary in enumerate(fix_summaries)
60
+ )
61
+
62
+
63
+ def build_summary_prompt(
64
+ owner: str,
65
+ repo: str,
66
+ pr_number: int,
67
+ round_count: int,
68
+ findings: list[dict],
69
+ fix_summaries: list[str],
70
+ standards_note: str | None,
71
+ copilot_note: str | None,
72
+ ) -> str:
73
+ """Return the convergence-summary agent prompt for a PR's aggregated findings.
74
+
75
+ Args:
76
+ owner: The PR's repository owner.
77
+ repo: The PR's repository name.
78
+ pr_number: The PR number.
79
+ round_count: Total converge rounds across every run aggregated.
80
+ findings: Aggregated distinct findings across every run.
81
+ fix_summaries: One-line fix summaries collected across every run.
82
+ standards_note: Deferral note when a round was code-standard-only, else None.
83
+ copilot_note: Outage note when the Copilot gate was bypassed, else None.
84
+
85
+ Returns:
86
+ The full agent prompt instructing a StructuredOutput convergence summary.
87
+ """
88
+ pr_url = GITHUB_PR_URL_TEMPLATE.format(owner=owner, repo=repo, number=pr_number)
89
+ pr_coordinates = SUMMARY_PR_COORDINATES_TEMPLATE.format(
90
+ owner=owner, repo=repo, pr_number=pr_number, url=pr_url
91
+ )
92
+ standards_block = (
93
+ SUMMARY_STANDARDS_NOTE_TEMPLATE.format(note=standards_note)
94
+ if standards_note
95
+ else ""
96
+ )
97
+ copilot_block = (
98
+ SUMMARY_COPILOT_NOTE_TEMPLATE.format(note=copilot_note) if copilot_note else ""
99
+ )
100
+ return SUMMARY_PROMPT_TEMPLATE.format(
101
+ pr_coordinates=pr_coordinates,
102
+ owner=owner,
103
+ repo=repo,
104
+ pr_number=pr_number,
105
+ round_count=round_count,
106
+ findings_block=_format_findings_block(findings),
107
+ fix_block=_format_fix_block(fix_summaries),
108
+ standards_block=standards_block,
109
+ copilot_block=copilot_block,
110
+ )
@@ -0,0 +1,2 @@
1
+ {"type": "user", "uuid": "ab1c2d3e4f5a6b7c8-u", "message": {"role": "user", "content": "Return the convergence summary."}}
2
+ {"type": "assistant", "uuid": "ab1c2d3e4f5a6b7c8-a", "message": {"role": "assistant", "content": [{"type": "tool_use", "id": "toolu_ab1c2d3e4f5a6b7c8", "name": "StructuredOutput", "input": {"prProblem": "DataBridge, the service that exports your records in batches, restarted an interrupted export from the beginning instead of continuing.", "prFix": "An interrupted export now resumes from the last finished batch.", "problemScenes": [{"trigger": "export stops at batch 90 of 100", "condition": "you restart it", "result": "starts again at batch 1", "caption": "A halted export threw away the 90 batches it had already finished and began again."}], "fixScenes": [{"trigger": "export stops at batch 90 of 100", "condition": "you restart it", "result": "continues at batch 91", "caption": "A restarted export now picks up at the next unfinished batch."}], "verdictLine": "Converged in 4 rounds; 3 distinct issue classes were caught and fixed.", "issueClasses": [{"plainName": "Tests did not declare their return type", "count": 7, "severity": "P2", "category": "code-standard", "status": "fixed", "cause": "Several new test functions did not state that they return nothing, which the project's type checker wants.", "medium": "code", "beforeLines": ["def test_resume_skip():", " ..."], "afterLines": ["def test_resume_skip() -> None:", " ..."]}, {"plainName": "A vague banned variable name", "count": 2, "severity": "P2", "category": "code-standard", "status": "fixed", "cause": "Two variables used a generic placeholder name the project bans.", "medium": "code", "beforeLines": ["result = fetch()"], "afterLines": ["exported_rows = fetch()"]}, {"plainName": "Hardcoded message strings", "count": 6, "severity": "P2", "category": "code-standard", "status": "fixed", "cause": "Warning text was written inline in code instead of shared configuration.", "medium": "text", "beforeLines": ["inline warning text"], "afterLines": ["shared config message"]}]}}]}}
@@ -254,6 +254,13 @@
254
254
  "phaseTitle": "Finalize",
255
255
  "agentId": "add93d458ce4da043",
256
256
  "state": "done"
257
+ },
258
+ {
259
+ "index": 34,
260
+ "label": "convergence-summary",
261
+ "phaseTitle": "Finalize",
262
+ "agentId": "ab1c2d3e4f5a6b7c8",
263
+ "state": "done"
257
264
  }
258
265
  ]
259
266
  }