code-review-forge 2.0.0a1__tar.gz

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 (124) hide show
  1. code_review_forge-2.0.0a1/LICENSE +179 -0
  2. code_review_forge-2.0.0a1/MANIFEST.in +1 -0
  3. code_review_forge-2.0.0a1/PKG-INFO +237 -0
  4. code_review_forge-2.0.0a1/README.md +221 -0
  5. code_review_forge-2.0.0a1/pyproject.toml +36 -0
  6. code_review_forge-2.0.0a1/setup.cfg +4 -0
  7. code_review_forge-2.0.0a1/src/code_forge/__init__.py +14 -0
  8. code_review_forge-2.0.0a1/src/code_forge/__main__.py +8 -0
  9. code_review_forge-2.0.0a1/src/code_forge/autofix.py +78 -0
  10. code_review_forge-2.0.0a1/src/code_forge/baseline.py +216 -0
  11. code_review_forge-2.0.0a1/src/code_forge/cli.py +983 -0
  12. code_review_forge-2.0.0a1/src/code_forge/delta.py +65 -0
  13. code_review_forge-2.0.0a1/src/code_forge/diagnose.py +109 -0
  14. code_review_forge-2.0.0a1/src/code_forge/diff.py +82 -0
  15. code_review_forge-2.0.0a1/src/code_forge/disposition.py +32 -0
  16. code_review_forge-2.0.0a1/src/code_forge/e2e_check.py +641 -0
  17. code_review_forge-2.0.0a1/src/code_forge/env_resolver.py +91 -0
  18. code_review_forge-2.0.0a1/src/code_forge/errors.py +34 -0
  19. code_review_forge-2.0.0a1/src/code_forge/exit_codes.py +37 -0
  20. code_review_forge-2.0.0a1/src/code_forge/factories.py +191 -0
  21. code_review_forge-2.0.0a1/src/code_forge/falsify.py +85 -0
  22. code_review_forge-2.0.0a1/src/code_forge/gate_check.py +466 -0
  23. code_review_forge-2.0.0a1/src/code_forge/git.py +351 -0
  24. code_review_forge-2.0.0a1/src/code_forge/hold.py +126 -0
  25. code_review_forge-2.0.0a1/src/code_forge/install_hooks.py +331 -0
  26. code_review_forge-2.0.0a1/src/code_forge/lock.py +162 -0
  27. code_review_forge-2.0.0a1/src/code_forge/machine.py +792 -0
  28. code_review_forge-2.0.0a1/src/code_forge/mode_resolver.py +60 -0
  29. code_review_forge-2.0.0a1/src/code_forge/mutation.py +380 -0
  30. code_review_forge-2.0.0a1/src/code_forge/parsers/__init__.py +56 -0
  31. code_review_forge-2.0.0a1/src/code_forge/parsers/_sarif.py +77 -0
  32. code_review_forge-2.0.0a1/src/code_forge/parsers/base.py +65 -0
  33. code_review_forge-2.0.0a1/src/code_forge/parsers/checkpatch.py +66 -0
  34. code_review_forge-2.0.0a1/src/code_forge/parsers/clippy.py +85 -0
  35. code_review_forge-2.0.0a1/src/code_forge/parsers/non_ascii.py +47 -0
  36. code_review_forge-2.0.0a1/src/code_forge/parsers/ruff.py +18 -0
  37. code_review_forge-2.0.0a1/src/code_forge/parsers/semgrep.py +18 -0
  38. code_review_forge-2.0.0a1/src/code_forge/parsers/shellcheck.py +56 -0
  39. code_review_forge-2.0.0a1/src/code_forge/registry.py +153 -0
  40. code_review_forge-2.0.0a1/src/code_forge/reporter.py +133 -0
  41. code_review_forge-2.0.0a1/src/code_forge/runner.py +205 -0
  42. code_review_forge-2.0.0a1/src/code_forge/sarif.py +226 -0
  43. code_review_forge-2.0.0a1/src/code_forge/skills/adversarial-qe/SKILL.md +272 -0
  44. code_review_forge-2.0.0a1/src/code_forge/skills/code-forge/SKILL.md +1193 -0
  45. code_review_forge-2.0.0a1/src/code_forge/skills/code-review-expert/SKILL.md +162 -0
  46. code_review_forge-2.0.0a1/src/code_forge/skills/code-review-expert/references/code-quality-checklist.md +130 -0
  47. code_review_forge-2.0.0a1/src/code_forge/skills/code-review-expert/references/removal-plan.md +52 -0
  48. code_review_forge-2.0.0a1/src/code_forge/skills/code-review-expert/references/security-checklist.md +118 -0
  49. code_review_forge-2.0.0a1/src/code_forge/skills/code-review-expert/references/solid-checklist.md +65 -0
  50. code_review_forge-2.0.0a1/src/code_forge/skills/kernel-fp-verify/SKILL.md +101 -0
  51. code_review_forge-2.0.0a1/src/code_forge/skills/qodo-review/SKILL.md +135 -0
  52. code_review_forge-2.0.0a1/src/code_forge/skills/smoke-test/SKILL.md +253 -0
  53. code_review_forge-2.0.0a1/src/code_forge/skills/smoke-test/references/boundary-cases.md +114 -0
  54. code_review_forge-2.0.0a1/src/code_forge/skills/smoke-test/references/concurrency-patterns.md +306 -0
  55. code_review_forge-2.0.0a1/src/code_forge/skills/smoke-test/references/injection-payloads.md +124 -0
  56. code_review_forge-2.0.0a1/src/code_forge/skills/smoke-test/test-library/shell/README.md +271 -0
  57. code_review_forge-2.0.0a1/src/code_forge/skills/smoke-test/test-library/shell/primitives.sh +352 -0
  58. code_review_forge-2.0.0a1/src/code_forge/skills/smoke-test/test-library/shell/primitives_test.sh +324 -0
  59. code_review_forge-2.0.0a1/src/code_forge/snapshot.py +196 -0
  60. code_review_forge-2.0.0a1/src/code_forge/source.py +64 -0
  61. code_review_forge-2.0.0a1/src/code_forge/state.py +246 -0
  62. code_review_forge-2.0.0a1/src/code_forge/verdict.py +43 -0
  63. code_review_forge-2.0.0a1/src/code_review_forge.egg-info/PKG-INFO +237 -0
  64. code_review_forge-2.0.0a1/src/code_review_forge.egg-info/SOURCES.txt +122 -0
  65. code_review_forge-2.0.0a1/src/code_review_forge.egg-info/dependency_links.txt +1 -0
  66. code_review_forge-2.0.0a1/src/code_review_forge.egg-info/entry_points.txt +2 -0
  67. code_review_forge-2.0.0a1/src/code_review_forge.egg-info/requires.txt +6 -0
  68. code_review_forge-2.0.0a1/src/code_review_forge.egg-info/top_level.txt +1 -0
  69. code_review_forge-2.0.0a1/tests/test_baseline.py +229 -0
  70. code_review_forge-2.0.0a1/tests/test_baseline_integration.py +209 -0
  71. code_review_forge-2.0.0a1/tests/test_cli_e2e_check.py +165 -0
  72. code_review_forge-2.0.0a1/tests/test_cli_hold_resume.py +240 -0
  73. code_review_forge-2.0.0a1/tests/test_cli_install_skill.py +208 -0
  74. code_review_forge-2.0.0a1/tests/test_cli_integration.py +184 -0
  75. code_review_forge-2.0.0a1/tests/test_cli_lock.py +149 -0
  76. code_review_forge-2.0.0a1/tests/test_cli_mutation_check.py +160 -0
  77. code_review_forge-2.0.0a1/tests/test_cli_parser.py +209 -0
  78. code_review_forge-2.0.0a1/tests/test_cli_phase1_compat.py +179 -0
  79. code_review_forge-2.0.0a1/tests/test_cli_sarif.py +311 -0
  80. code_review_forge-2.0.0a1/tests/test_delta.py +148 -0
  81. code_review_forge-2.0.0a1/tests/test_diagnose.py +181 -0
  82. code_review_forge-2.0.0a1/tests/test_diff.py +175 -0
  83. code_review_forge-2.0.0a1/tests/test_dispo04_lifecycle.py +205 -0
  84. code_review_forge-2.0.0a1/tests/test_dispo05_promotion.py +134 -0
  85. code_review_forge-2.0.0a1/tests/test_dispo06_revert.py +234 -0
  86. code_review_forge-2.0.0a1/tests/test_disposition.py +52 -0
  87. code_review_forge-2.0.0a1/tests/test_e2e_check.py +826 -0
  88. code_review_forge-2.0.0a1/tests/test_env_resolver.py +152 -0
  89. code_review_forge-2.0.0a1/tests/test_escalated_frozen.py +153 -0
  90. code_review_forge-2.0.0a1/tests/test_exit_codes.py +82 -0
  91. code_review_forge-2.0.0a1/tests/test_factories.py +243 -0
  92. code_review_forge-2.0.0a1/tests/test_falsify_stub.py +189 -0
  93. code_review_forge-2.0.0a1/tests/test_fresh_start.py +166 -0
  94. code_review_forge-2.0.0a1/tests/test_gate_check.py +744 -0
  95. code_review_forge-2.0.0a1/tests/test_git.py +214 -0
  96. code_review_forge-2.0.0a1/tests/test_hold_entry.py +126 -0
  97. code_review_forge-2.0.0a1/tests/test_hold_ui.py +182 -0
  98. code_review_forge-2.0.0a1/tests/test_install_hooks.py +597 -0
  99. code_review_forge-2.0.0a1/tests/test_integration.py +246 -0
  100. code_review_forge-2.0.0a1/tests/test_lock.py +174 -0
  101. code_review_forge-2.0.0a1/tests/test_lock_signals.py +96 -0
  102. code_review_forge-2.0.0a1/tests/test_machine_ci.py +133 -0
  103. code_review_forge-2.0.0a1/tests/test_machine_e2e.py +307 -0
  104. code_review_forge-2.0.0a1/tests/test_machine_l2.py +413 -0
  105. code_review_forge-2.0.0a1/tests/test_machine_local.py +230 -0
  106. code_review_forge-2.0.0a1/tests/test_mode_resolver.py +91 -0
  107. code_review_forge-2.0.0a1/tests/test_mutation.py +375 -0
  108. code_review_forge-2.0.0a1/tests/test_ordering.py +141 -0
  109. code_review_forge-2.0.0a1/tests/test_parsers.py +334 -0
  110. code_review_forge-2.0.0a1/tests/test_pass_determinism.py +150 -0
  111. code_review_forge-2.0.0a1/tests/test_phase1_migration.py +24 -0
  112. code_review_forge-2.0.0a1/tests/test_phase3.py +526 -0
  113. code_review_forge-2.0.0a1/tests/test_promotion_tracking.py +115 -0
  114. code_review_forge-2.0.0a1/tests/test_pseudo_refs.py +210 -0
  115. code_review_forge-2.0.0a1/tests/test_registry.py +229 -0
  116. code_review_forge-2.0.0a1/tests/test_round.py +234 -0
  117. code_review_forge-2.0.0a1/tests/test_runner.py +385 -0
  118. code_review_forge-2.0.0a1/tests/test_sarif.py +477 -0
  119. code_review_forge-2.0.0a1/tests/test_snapshot.py +219 -0
  120. code_review_forge-2.0.0a1/tests/test_source_hash.py +130 -0
  121. code_review_forge-2.0.0a1/tests/test_state_04_extensions.py +76 -0
  122. code_review_forge-2.0.0a1/tests/test_state_extensions.py +208 -0
  123. code_review_forge-2.0.0a1/tests/test_state_schema.py +308 -0
  124. code_review_forge-2.0.0a1/tests/test_verdict.py +105 -0
@@ -0,0 +1,179 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship made available under
36
+ the License, as indicated by a copyright notice that is included in
37
+ or attached to the work (an example is provided in the Appendix below).
38
+
39
+ "Derivative Works" shall mean any work, whether in Source or Object
40
+ form, that is based on (or derived from) the Work and for which the
41
+ editorial revisions, annotations, elaborations, or other modifications
42
+ represent, as a whole, an original work of authorship. For the purposes
43
+ of this License, Derivative Works shall not include works that remain
44
+ separable from, or merely link (or bind by name) to the interfaces of,
45
+ the Work and Derivative Works thereof.
46
+
47
+ "Contribution" shall mean, as submitted to the Licensor for inclusion
48
+ in the Work by the copyright owner or by an individual or Legal Entity
49
+ authorized to submit on behalf of the copyright owner. For the purposes
50
+ of this definition, "submitted" means any form of electronic, verbal,
51
+ or written communication sent to the Licensor or its representatives,
52
+ including but not limited to communication on electronic mailing lists,
53
+ source code control systems, and issue tracking systems that are managed
54
+ by, or on behalf of, the Licensor for the purpose of discussing and
55
+ improving the Work, but excluding communication that is conspicuously
56
+ marked or otherwise designated in writing by the copyright owner as
57
+ "Not a Contribution."
58
+
59
+ "Contributor" shall mean Licensor and any Legal Entity on behalf of
60
+ whom a Contribution has been received by the Licensor and subsequently
61
+ incorporated within the Work.
62
+
63
+ 2. Grant of Copyright License. Subject to the terms and conditions of
64
+ this License, each Contributor hereby grants to You a perpetual,
65
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
66
+ copyright license to reproduce, prepare Derivative Works of,
67
+ publicly display, publicly perform, sublicense, and distribute the
68
+ Work and such Derivative Works in Source or Object form.
69
+
70
+ 3. Grant of Patent License. Subject to the terms and conditions of
71
+ this License, each Contributor hereby grants to You a perpetual,
72
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
73
+ (except as stated in this section) patent license to make, have made,
74
+ use, offer to sell, sell, import, and otherwise transfer the Work,
75
+ where such license applies only to those patent claims licensable
76
+ by such Contributor that are necessarily infringed by their
77
+ Contribution(s) alone or by combination of their Contribution(s)
78
+ with the Work to which such Contribution(s) was submitted. If You
79
+ institute patent litigation against any entity (including a cross-claim
80
+ or counterclaim in a lawsuit) alleging that the Work or any Contribution
81
+ incorporated within the Work constitutes direct or contributory patent
82
+ infringement, then any patent licenses granted to You under this License
83
+ for that Work shall terminate as of the date such litigation is filed.
84
+
85
+ 4. Redistribution. You may reproduce and distribute copies of the
86
+ Work or Derivative Works thereof in any medium, with or without
87
+ modifications, and in Source or Object form, provided that You
88
+ meet the following conditions:
89
+
90
+ (a) You must give any other recipients of the Work or Derivative Works
91
+ a copy of this License; and
92
+
93
+ (b) You must cause any modified files to carry prominent notices
94
+ stating that You changed the files; and
95
+
96
+ (c) You must retain, in the Source form of any Derivative Works that
97
+ You distribute, all copyright, patent, trademark, and attribution
98
+ notices from the Source form of the Work, excluding those notices
99
+ that do not pertain to any part of the Derivative Works; and
100
+
101
+ (d) If the Work includes a "NOTICE" file as part of its distribution,
102
+ You must include a readable copy of the attribution notices contained
103
+ within such NOTICE file, in at least one of the following places:
104
+ within the Source form or documentation, if provided along with
105
+ the Derivative Works; or, within a display generated by the
106
+ Derivative Works, if and wherever such third-party notices normally
107
+ appear. The contents of the NOTICE file are for informational
108
+ purposes only and do not modify the License. You may add Your own
109
+ attribution notices within Derivative Works that You distribute,
110
+ alongside or as an addendum to the NOTICE text from the Work,
111
+ provided that such additional attribution notices cannot be
112
+ construed as modifying the License.
113
+
114
+ You may add Your own license statement for Your modifications and
115
+ may provide additional grant of rights to use, copy, modify, merge,
116
+ publish, distribute, sublicense, and/or sell copies of the
117
+ Derivative Works.
118
+
119
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
120
+ any Contribution intentionally submitted for inclusion in the Work
121
+ by You to the Licensor shall be under the terms and conditions of
122
+ this License, without any additional terms or conditions.
123
+ Notwithstanding the above, nothing herein shall supersede or modify
124
+ the terms of any separate license agreement you may have executed
125
+ with Licensor regarding such Contributions.
126
+
127
+ 6. Trademarks. This License does not grant permission to use the trade
128
+ names, trademarks, service marks, or product names of the Licensor,
129
+ except as required for reasonable and customary use in describing the
130
+ origin of the Work and reproducing the content of the NOTICE file.
131
+
132
+ 7. Disclaimer of Warranty. Unless required by applicable law or
133
+ agreed to in writing, Licensor provides the Work (and each
134
+ Contributor provides its Contributions) on an "AS IS" BASIS,
135
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
136
+ implied, including, without limitation, any warranties or conditions
137
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
138
+ PARTICULAR PURPOSE. You are solely responsible for determining the
139
+ appropriateness of using or reproducing the Work and assume any
140
+ risks associated with Your exercise of permissions under this License.
141
+
142
+ 8. Limitation of Liability. In no event and under no legal theory,
143
+ whether in tort (including negligence), contract, or otherwise,
144
+ unless required by applicable law (such as deliberate and grossly
145
+ negligent acts) or agreed to in writing, shall any Contributor be
146
+ liable to You for damages, including any direct, indirect, special,
147
+ incidental, or exemplary damages of any character arising as a
148
+ result of this License or out of the use or inability to use the
149
+ Work (including but not limited to damages for loss of goodwill,
150
+ work stoppage, computer failure or malfunction, or all other
151
+ commercial damages or losses), even if such Contributor has been
152
+ advised of the possibility of such damages.
153
+
154
+ 9. Accepting Warranty or Additional Liability. While redistributing
155
+ the Work or Derivative Works thereof, You may choose to offer,
156
+ and charge a fee for, acceptance of support, warranty, indemnity,
157
+ or other liability obligations and/or rights consistent with this
158
+ License. However, in accepting such obligations, You may act only
159
+ on Your own behalf and on Your sole responsibility, not on behalf
160
+ of any other Contributor, and only if You agree to indemnify,
161
+ defend, and hold each Contributor harmless for any liability
162
+ incurred by, or claims asserted against, such Contributor by reason
163
+ of your accepting any such warranty or additional liability.
164
+
165
+ END OF TERMS AND CONDITIONS
166
+
167
+ Copyright 2026 Minxi Hou
168
+
169
+ Licensed under the Apache License, Version 2.0 (the "License");
170
+ you may not use this file except in compliance with the License.
171
+ You may obtain a copy of the License at
172
+
173
+ http://www.apache.org/licenses/LICENSE-2.0
174
+
175
+ Unless required by applicable law or agreed to in writing, software
176
+ distributed under the License is distributed on an "AS IS" BASIS,
177
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
178
+ See the License for the specific language governing permissions and
179
+ limitations under the License.
@@ -0,0 +1 @@
1
+ recursive-include src/code_forge/skills *
@@ -0,0 +1,237 @@
1
+ Metadata-Version: 2.4
2
+ Name: code-review-forge
3
+ Version: 2.0.0a1
4
+ Summary: 3-state quality gate for code review
5
+ Author-email: Minxi Hou <houminxi@gmail.com>
6
+ License-Expression: Apache-2.0
7
+ Requires-Python: >=3.12
8
+ Description-Content-Type: text/markdown
9
+ License-File: LICENSE
10
+ Requires-Dist: pyyaml>=6.0
11
+ Requires-Dist: unidiff<0.8.0,>=0.7.5
12
+ Provides-Extra: dev
13
+ Requires-Dist: pytest>=8.0; extra == "dev"
14
+ Requires-Dist: mutmut<4.0,>=3.3; extra == "dev"
15
+ Dynamic: license-file
16
+
17
+ # code-forge
18
+
19
+ [![PyPI version](https://img.shields.io/pypi/v/code-review-forge.svg)](https://pypi.org/project/code-review-forge/)
20
+ [![Python](https://img.shields.io/pypi/pyversions/code-review-forge.svg)](https://pypi.org/project/code-review-forge/)
21
+ [![License](https://img.shields.io/badge/license-Apache--2.0-blue.svg)](https://github.com/HouMinXi/forge/blob/main/LICENSE)
22
+
23
+ A 5-step code review pipeline for AI coding assistants. Treats review as a
24
+ state machine: three independent passes per cycle, three consecutive clean
25
+ cycles required, any finding resets the counter. The minimum path to a
26
+ commit is 9 static review passes plus a runtime smoke test.
27
+
28
+ ## Why
29
+
30
+ AI coding assistants ship code that compiles, runs, and looks right.
31
+ Single-pass review (Copilot, Cursor, CodeRabbit, etc.) catches the obvious
32
+ defects but misses two failure modes:
33
+
34
+ - **Author and reviewer collapse.** When the same model writes and reviews
35
+ the change, it inherits its own blind spots. code-forge runs three
36
+ independent review perspectives (qodo, expert, adversarial) and treats
37
+ their findings as untrusted claims that must be reproduced before any fix.
38
+ - **Self-claimed completion.** Hooks that gate on "I finished" markers are
39
+ bypassable by any agent that can write a string. code-forge gates on
40
+ actual state: a real `pre-commit` hook running the test suite, a mutation
41
+ runner proving the tests catch regressions, and a coverage heuristic
42
+ detecting drift across components.
43
+
44
+ ## Quick start
45
+
46
+ ```bash
47
+ pip install code-review-forge
48
+ code-forge install-skill
49
+ ```
50
+
51
+ The first command installs the CLI (Python >=3.12). The second copies the
52
+ 6 review skills into `~/.claude/skills/`. Then in Claude Code, run the
53
+ full pipeline:
54
+
55
+ ```
56
+ /code-forge
57
+ ```
58
+
59
+ Or invoke individual passes:
60
+
61
+ ```
62
+ /qodo-review # change-aware pre-review (Pass 1)
63
+ /code-review-expert # SOLID, architecture, security (Pass 2)
64
+ /adversarial-qe # red-team QE, 12 attack dimensions (Pass 3)
65
+ /kernel-fp-verify # false-positive verification (Step 3.5)
66
+ /smoke-test # runtime verification (Step 4)
67
+ ```
68
+
69
+ Other agent targets:
70
+
71
+ ```bash
72
+ code-forge install-skill --target vscode # <cwd>/.claude/skills/
73
+ code-forge install-skill --target universal # <cwd>/.agents/skills/
74
+ code-forge install-skill --dest /path/to/dir # explicit location
75
+ code-forge install-skill --skill code-forge # one skill only
76
+ code-forge install-skill --force # overwrite existing
77
+ ```
78
+
79
+ ## The pipeline
80
+
81
+ ```
82
+ Code Change
83
+ |
84
+ v
85
+ [Step 0] Syntax (0a) + Lint (0b) + Non-ASCII (0c)
86
+ |
87
+ v
88
+ [Cycle 1] Pass 1: qodo-review
89
+ Pass 2: code-review-expert
90
+ Pass 3: adversarial-qe
91
+ |
92
+ | zero findings -> counter += 1
93
+ | any finding -> fix, counter = 0, restart Cycle 1
94
+ v
95
+ [Cycle 2] (same 3 passes)
96
+ |
97
+ v
98
+ [Cycle 3] (same 3 passes)
99
+ | counter = 3
100
+ v
101
+ [Step 3.5] kernel-fp-verify (if fixes were applied during cycles)
102
+ |
103
+ v
104
+ [Step 4] smoke-test (runtime verification)
105
+ |
106
+ v
107
+ [COMMIT GATE] # post-review-c3
108
+ ```
109
+
110
+ ## What ships
111
+
112
+ | Skill | Step | Purpose |
113
+ |--------------------|-----------|----------------------------------------------------------|
114
+ | code-forge | Orchestrator | Runs the full 5-step pipeline |
115
+ | qodo-review | Pass 1 | Change-aware pre-review with feature-grouped walkthrough |
116
+ | code-review-expert | Pass 2 | SOLID, architecture, security analysis |
117
+ | adversarial-qe | Pass 3 | Red-team QE with 12 attack dimensions |
118
+ | kernel-fp-verify | Step 3.5 | 10-step false-positive verification protocol |
119
+ | smoke-test | Step 4 | Runtime verification with bash assertion primitives |
120
+
121
+ ## What code-forge does that others don't
122
+
123
+ - **Multi-pass convergence.** Three consecutive clean cycles from three
124
+ independent perspectives. Any finding resets the counter to zero.
125
+ Copilot, CodeRabbit, Cursor, and Devin are single-pass.
126
+ - **Anti-hallucination gates.** code-forge treats LLM review output as
127
+ untrusted claims. Parser-deterministic findings auto-confirm; LLM
128
+ findings require falsification before disposition; Step 4 runs the
129
+ actual code. Prompt-only mitigations cap at 15% hallucination
130
+ reduction; tool grounding reaches 65-80% (CodeAnt and Suprmind data,
131
+ 2026).
132
+ - **Real commit gate (R1).** A real `.git/hooks/pre-commit` that runs the
133
+ test suite and blocks on NEW failures vs a baseline. Gates on diff
134
+ content and test results, not a self-claimed marker. Closes the
135
+ terminal-and-IDE bypass that PreToolUse hooks cannot reach.
136
+ - **Mutation-gated review (R2).** Diff-scoped mutation runs after static
137
+ review and before the verdict. Each mutant introduced into the changed
138
+ code is run against the test suite; a surviving mutant flags tests that
139
+ cannot catch the change. Toothless tests block the same cycle that
140
+ finds the defect.
141
+ - **Cross-component coverage heuristic (R3).** Detects diffs that span
142
+ multiple source areas with a changed function signature. An opt-in
143
+ components mapping raises an uncertain finding when a hub and a
144
+ dependent both change in the same diff and no integration test under
145
+ the dependent's paths matches the configured test patterns.
146
+
147
+ ## Honest limitations
148
+
149
+ - **No cross-repo impact.** code-forge reviews a single repository.
150
+ Multi-repo dependency analysis requires CodeRabbit-style tooling or
151
+ Chromium's `Cq-Depend`.
152
+ - **No feedback learning.** code-forge does not adapt to dismissed
153
+ findings or developer preferences. Each review is independent.
154
+ - **No long-term maintainability scoring.** code-forge does not assess
155
+ technical debt accumulation. SonarQube's tech-debt tracking is the
156
+ closest automated approximation.
157
+ - **No performance regression suite.** No benchmark harness equivalent to
158
+ Rust's `perf.rust-lang.org`.
159
+ - **R3 is artifact-presence, not coverage proof.** The cross-component
160
+ check confirms an integration test file exists under the expected path;
161
+ it does not verify that the test exercises the specific code that
162
+ changed. A present-but-stale test passes the gate.
163
+
164
+ Static review (3-cycle convergence) is one layer. code-forge learned
165
+ from its own Phase 2 experience where 9 static passes and 639 mock tests
166
+ missed 3 bugs that dynamic verification caught. Verification grounding
167
+ (test suite + mutation + e2e coverage check) is the thesis -- not a
168
+ passes count.
169
+
170
+ ## Requirements
171
+
172
+ - Python 3.12 or newer
173
+ - `jq` for the bash smoke primitives
174
+ - Claude Code or a compatible AI coding assistant for skill invocation
175
+
176
+ ## Installation alternatives
177
+
178
+ ### git clone
179
+
180
+ ```bash
181
+ git clone https://github.com/HouMinXi/forge.git
182
+ cd forge
183
+ ./install.sh
184
+ ```
185
+
186
+ Symlinks each of the 6 skills from `~/.claude/skills/<name>` to this
187
+ repo's `skills/<name>`. Hook installation is manual -- see
188
+ `hooks/README.md` and `hooks/settings-snippet.json`.
189
+
190
+ ## Hooks (reference implementations)
191
+
192
+ | Hook | Trigger | Purpose |
193
+ |-------------------------------|-----------------------|-------------------------------|
194
+ | `check_worktree.sh` | PreToolUse Edit/Write | Block edits in main worktree |
195
+ | `check_non_ascii.sh` | PreToolUse Write/Edit | Non-ASCII character detection |
196
+ | `check_read_before_edit.sh` | PreToolUse Edit | 1:1 read-before-edit ratio |
197
+ | `check_review_tracker.sh` | PostToolUse Bash | Review cycle state machine |
198
+ | `check_git_commit_review.sh` | PreToolUse Bash | Block unreviewed commits |
199
+ | `check_git_push_review.sh` | PreToolUse Bash | Block unreviewed pushes |
200
+
201
+ Some hooks contain environment-specific logic (Kerberos auth, pattern
202
+ matching) you will need to adapt. See `hooks/README.md`.
203
+
204
+ ## Bash smoke primitives
205
+
206
+ `skills/smoke-test/test-library/shell/` ships 19 reusable bash assertion
207
+ functions with no dependencies beyond `jq`:
208
+
209
+ - `run_and_capture`, `run_concurrent`, `concurrent_wait`
210
+ - `assert_success`, `assert_failure`, `assert_exit_code`
211
+ - `assert_output_contains`, `assert_output_not_contains`
212
+ - `assert_stderr_contains`, `assert_stderr_empty`
213
+ - `assert_file_exists`, `assert_file_not_exists`, `assert_file_contains`
214
+ - `assert_json_valid`
215
+ - `assert_no_zombie`, `assert_temp_clean`
216
+ - `assert_no_command_exec`, `assert_no_command_exec_json`, `assert_no_path_traversal`
217
+
218
+ A backward-compatible symlink at `test-library/` points to
219
+ `skills/smoke-test/test-library/` for users migrating from
220
+ [bash-smoke-primitives](https://github.com/HouMinXi/bash-smoke-primitives).
221
+
222
+ ## Documentation
223
+
224
+ - `evidence/cross-model-complementarity.md` -- why 3 different review passes
225
+ - `evidence/design-iterations.md` -- how the pipeline evolved
226
+ - `evidence/ground-truth-verification.md` -- why smoke tests must inject bugs
227
+ - `evidence/shell-assertion-footguns.md` -- 5 bash-specific traps
228
+ - `evidence/v9-model-coverage-matrix.md` -- 4-model coverage data
229
+ - `hooks/README.md` -- hook installation and adaptation guide
230
+
231
+ ## Contributing
232
+
233
+ Issues and discussion: <https://github.com/HouMinXi/forge/issues>.
234
+
235
+ ## License
236
+
237
+ Apache-2.0
@@ -0,0 +1,221 @@
1
+ # code-forge
2
+
3
+ [![PyPI version](https://img.shields.io/pypi/v/code-review-forge.svg)](https://pypi.org/project/code-review-forge/)
4
+ [![Python](https://img.shields.io/pypi/pyversions/code-review-forge.svg)](https://pypi.org/project/code-review-forge/)
5
+ [![License](https://img.shields.io/badge/license-Apache--2.0-blue.svg)](https://github.com/HouMinXi/forge/blob/main/LICENSE)
6
+
7
+ A 5-step code review pipeline for AI coding assistants. Treats review as a
8
+ state machine: three independent passes per cycle, three consecutive clean
9
+ cycles required, any finding resets the counter. The minimum path to a
10
+ commit is 9 static review passes plus a runtime smoke test.
11
+
12
+ ## Why
13
+
14
+ AI coding assistants ship code that compiles, runs, and looks right.
15
+ Single-pass review (Copilot, Cursor, CodeRabbit, etc.) catches the obvious
16
+ defects but misses two failure modes:
17
+
18
+ - **Author and reviewer collapse.** When the same model writes and reviews
19
+ the change, it inherits its own blind spots. code-forge runs three
20
+ independent review perspectives (qodo, expert, adversarial) and treats
21
+ their findings as untrusted claims that must be reproduced before any fix.
22
+ - **Self-claimed completion.** Hooks that gate on "I finished" markers are
23
+ bypassable by any agent that can write a string. code-forge gates on
24
+ actual state: a real `pre-commit` hook running the test suite, a mutation
25
+ runner proving the tests catch regressions, and a coverage heuristic
26
+ detecting drift across components.
27
+
28
+ ## Quick start
29
+
30
+ ```bash
31
+ pip install code-review-forge
32
+ code-forge install-skill
33
+ ```
34
+
35
+ The first command installs the CLI (Python >=3.12). The second copies the
36
+ 6 review skills into `~/.claude/skills/`. Then in Claude Code, run the
37
+ full pipeline:
38
+
39
+ ```
40
+ /code-forge
41
+ ```
42
+
43
+ Or invoke individual passes:
44
+
45
+ ```
46
+ /qodo-review # change-aware pre-review (Pass 1)
47
+ /code-review-expert # SOLID, architecture, security (Pass 2)
48
+ /adversarial-qe # red-team QE, 12 attack dimensions (Pass 3)
49
+ /kernel-fp-verify # false-positive verification (Step 3.5)
50
+ /smoke-test # runtime verification (Step 4)
51
+ ```
52
+
53
+ Other agent targets:
54
+
55
+ ```bash
56
+ code-forge install-skill --target vscode # <cwd>/.claude/skills/
57
+ code-forge install-skill --target universal # <cwd>/.agents/skills/
58
+ code-forge install-skill --dest /path/to/dir # explicit location
59
+ code-forge install-skill --skill code-forge # one skill only
60
+ code-forge install-skill --force # overwrite existing
61
+ ```
62
+
63
+ ## The pipeline
64
+
65
+ ```
66
+ Code Change
67
+ |
68
+ v
69
+ [Step 0] Syntax (0a) + Lint (0b) + Non-ASCII (0c)
70
+ |
71
+ v
72
+ [Cycle 1] Pass 1: qodo-review
73
+ Pass 2: code-review-expert
74
+ Pass 3: adversarial-qe
75
+ |
76
+ | zero findings -> counter += 1
77
+ | any finding -> fix, counter = 0, restart Cycle 1
78
+ v
79
+ [Cycle 2] (same 3 passes)
80
+ |
81
+ v
82
+ [Cycle 3] (same 3 passes)
83
+ | counter = 3
84
+ v
85
+ [Step 3.5] kernel-fp-verify (if fixes were applied during cycles)
86
+ |
87
+ v
88
+ [Step 4] smoke-test (runtime verification)
89
+ |
90
+ v
91
+ [COMMIT GATE] # post-review-c3
92
+ ```
93
+
94
+ ## What ships
95
+
96
+ | Skill | Step | Purpose |
97
+ |--------------------|-----------|----------------------------------------------------------|
98
+ | code-forge | Orchestrator | Runs the full 5-step pipeline |
99
+ | qodo-review | Pass 1 | Change-aware pre-review with feature-grouped walkthrough |
100
+ | code-review-expert | Pass 2 | SOLID, architecture, security analysis |
101
+ | adversarial-qe | Pass 3 | Red-team QE with 12 attack dimensions |
102
+ | kernel-fp-verify | Step 3.5 | 10-step false-positive verification protocol |
103
+ | smoke-test | Step 4 | Runtime verification with bash assertion primitives |
104
+
105
+ ## What code-forge does that others don't
106
+
107
+ - **Multi-pass convergence.** Three consecutive clean cycles from three
108
+ independent perspectives. Any finding resets the counter to zero.
109
+ Copilot, CodeRabbit, Cursor, and Devin are single-pass.
110
+ - **Anti-hallucination gates.** code-forge treats LLM review output as
111
+ untrusted claims. Parser-deterministic findings auto-confirm; LLM
112
+ findings require falsification before disposition; Step 4 runs the
113
+ actual code. Prompt-only mitigations cap at 15% hallucination
114
+ reduction; tool grounding reaches 65-80% (CodeAnt and Suprmind data,
115
+ 2026).
116
+ - **Real commit gate (R1).** A real `.git/hooks/pre-commit` that runs the
117
+ test suite and blocks on NEW failures vs a baseline. Gates on diff
118
+ content and test results, not a self-claimed marker. Closes the
119
+ terminal-and-IDE bypass that PreToolUse hooks cannot reach.
120
+ - **Mutation-gated review (R2).** Diff-scoped mutation runs after static
121
+ review and before the verdict. Each mutant introduced into the changed
122
+ code is run against the test suite; a surviving mutant flags tests that
123
+ cannot catch the change. Toothless tests block the same cycle that
124
+ finds the defect.
125
+ - **Cross-component coverage heuristic (R3).** Detects diffs that span
126
+ multiple source areas with a changed function signature. An opt-in
127
+ components mapping raises an uncertain finding when a hub and a
128
+ dependent both change in the same diff and no integration test under
129
+ the dependent's paths matches the configured test patterns.
130
+
131
+ ## Honest limitations
132
+
133
+ - **No cross-repo impact.** code-forge reviews a single repository.
134
+ Multi-repo dependency analysis requires CodeRabbit-style tooling or
135
+ Chromium's `Cq-Depend`.
136
+ - **No feedback learning.** code-forge does not adapt to dismissed
137
+ findings or developer preferences. Each review is independent.
138
+ - **No long-term maintainability scoring.** code-forge does not assess
139
+ technical debt accumulation. SonarQube's tech-debt tracking is the
140
+ closest automated approximation.
141
+ - **No performance regression suite.** No benchmark harness equivalent to
142
+ Rust's `perf.rust-lang.org`.
143
+ - **R3 is artifact-presence, not coverage proof.** The cross-component
144
+ check confirms an integration test file exists under the expected path;
145
+ it does not verify that the test exercises the specific code that
146
+ changed. A present-but-stale test passes the gate.
147
+
148
+ Static review (3-cycle convergence) is one layer. code-forge learned
149
+ from its own Phase 2 experience where 9 static passes and 639 mock tests
150
+ missed 3 bugs that dynamic verification caught. Verification grounding
151
+ (test suite + mutation + e2e coverage check) is the thesis -- not a
152
+ passes count.
153
+
154
+ ## Requirements
155
+
156
+ - Python 3.12 or newer
157
+ - `jq` for the bash smoke primitives
158
+ - Claude Code or a compatible AI coding assistant for skill invocation
159
+
160
+ ## Installation alternatives
161
+
162
+ ### git clone
163
+
164
+ ```bash
165
+ git clone https://github.com/HouMinXi/forge.git
166
+ cd forge
167
+ ./install.sh
168
+ ```
169
+
170
+ Symlinks each of the 6 skills from `~/.claude/skills/<name>` to this
171
+ repo's `skills/<name>`. Hook installation is manual -- see
172
+ `hooks/README.md` and `hooks/settings-snippet.json`.
173
+
174
+ ## Hooks (reference implementations)
175
+
176
+ | Hook | Trigger | Purpose |
177
+ |-------------------------------|-----------------------|-------------------------------|
178
+ | `check_worktree.sh` | PreToolUse Edit/Write | Block edits in main worktree |
179
+ | `check_non_ascii.sh` | PreToolUse Write/Edit | Non-ASCII character detection |
180
+ | `check_read_before_edit.sh` | PreToolUse Edit | 1:1 read-before-edit ratio |
181
+ | `check_review_tracker.sh` | PostToolUse Bash | Review cycle state machine |
182
+ | `check_git_commit_review.sh` | PreToolUse Bash | Block unreviewed commits |
183
+ | `check_git_push_review.sh` | PreToolUse Bash | Block unreviewed pushes |
184
+
185
+ Some hooks contain environment-specific logic (Kerberos auth, pattern
186
+ matching) you will need to adapt. See `hooks/README.md`.
187
+
188
+ ## Bash smoke primitives
189
+
190
+ `skills/smoke-test/test-library/shell/` ships 19 reusable bash assertion
191
+ functions with no dependencies beyond `jq`:
192
+
193
+ - `run_and_capture`, `run_concurrent`, `concurrent_wait`
194
+ - `assert_success`, `assert_failure`, `assert_exit_code`
195
+ - `assert_output_contains`, `assert_output_not_contains`
196
+ - `assert_stderr_contains`, `assert_stderr_empty`
197
+ - `assert_file_exists`, `assert_file_not_exists`, `assert_file_contains`
198
+ - `assert_json_valid`
199
+ - `assert_no_zombie`, `assert_temp_clean`
200
+ - `assert_no_command_exec`, `assert_no_command_exec_json`, `assert_no_path_traversal`
201
+
202
+ A backward-compatible symlink at `test-library/` points to
203
+ `skills/smoke-test/test-library/` for users migrating from
204
+ [bash-smoke-primitives](https://github.com/HouMinXi/bash-smoke-primitives).
205
+
206
+ ## Documentation
207
+
208
+ - `evidence/cross-model-complementarity.md` -- why 3 different review passes
209
+ - `evidence/design-iterations.md` -- how the pipeline evolved
210
+ - `evidence/ground-truth-verification.md` -- why smoke tests must inject bugs
211
+ - `evidence/shell-assertion-footguns.md` -- 5 bash-specific traps
212
+ - `evidence/v9-model-coverage-matrix.md` -- 4-model coverage data
213
+ - `hooks/README.md` -- hook installation and adaptation guide
214
+
215
+ ## Contributing
216
+
217
+ Issues and discussion: <https://github.com/HouMinXi/forge/issues>.
218
+
219
+ ## License
220
+
221
+ Apache-2.0
@@ -0,0 +1,36 @@
1
+ # SPDX-License-Identifier: Apache-2.0
2
+ # Copyright (c) 2026, Minxi Hou <houminxi@gmail.com>
3
+
4
+ [build-system]
5
+ requires = ["setuptools>=68.0"]
6
+ build-backend = "setuptools.build_meta"
7
+
8
+ [project]
9
+ name = "code-review-forge"
10
+ version = "2.0.0a1"
11
+ description = "3-state quality gate for code review"
12
+ readme = "README.md"
13
+ requires-python = ">=3.12"
14
+ license = "Apache-2.0"
15
+ authors = [
16
+ {name = "Minxi Hou", email = "houminxi@gmail.com"},
17
+ ]
18
+ dependencies = [
19
+ "pyyaml>=6.0",
20
+ "unidiff>=0.7.5,<0.8.0",
21
+ ]
22
+
23
+ [project.optional-dependencies]
24
+ dev = [
25
+ "pytest>=8.0",
26
+ "mutmut>=3.3,<4.0",
27
+ ]
28
+
29
+ [project.scripts]
30
+ code-forge = "code_forge.cli:main"
31
+
32
+ [tool.setuptools.packages.find]
33
+ where = ["src"]
34
+
35
+ [tool.setuptools.package-data]
36
+ code_forge = ["skills/**/*", "skills/**/.gitkeep"]
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+