@homericintelligence/athena-opencode 0.5.0 → 0.5.2

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 (146) hide show
  1. package/README.md +30 -17
  2. package/package.json +2 -2
  3. package/plugin.js +20 -5
  4. package/skills/TECHNICAL_ENGLISH.md +78 -0
  5. package/skills/_cli.py +33 -22
  6. package/skills/_plugin.json +1 -0
  7. package/skills/_support/docs/dependency-resolution.md +203 -0
  8. package/skills/_support/docs/policies/development.md +131 -0
  9. package/skills/_support/docs/policies/evidence-integrity.md +40 -0
  10. package/skills/_support/docs/principles/README.md +565 -0
  11. package/skills/_support/docs/principles/details/p001-kiss.md +114 -0
  12. package/skills/_support/docs/principles/details/p002-yagni.md +109 -0
  13. package/skills/_support/docs/principles/details/p003-dry.md +126 -0
  14. package/skills/_support/docs/principles/details/p004-solid.md +165 -0
  15. package/skills/_support/docs/principles/details/p005-modularity.md +123 -0
  16. package/skills/_support/docs/principles/details/p006-principle-of-least-astonishment.md +115 -0
  17. package/skills/_support/docs/principles/details/p007-subtraction-over-addition.md +113 -0
  18. package/skills/_support/docs/principles/details/p008-understand-before-subtracting.md +115 -0
  19. package/skills/_support/docs/principles/details/p009-general-mechanisms-over-special-cases.md +108 -0
  20. package/skills/_support/docs/principles/details/p010-scope-fidelity.md +117 -0
  21. package/skills/_support/docs/principles/details/p011-minimal-coherent-change.md +128 -0
  22. package/skills/_support/docs/principles/details/p012-evidence-before-modification.md +115 -0
  23. package/skills/_support/docs/principles/details/p013-avoid-hasty-abstractions.md +112 -0
  24. package/skills/_support/docs/principles/details/p014-preserve-unrequested-behavior.md +110 -0
  25. package/skills/_support/docs/principles/details/p015-architecture-conformance.md +124 -0
  26. package/skills/_support/docs/principles/details/p016-separation-of-concerns.md +125 -0
  27. package/skills/_support/docs/principles/details/p017-high-cohesion-low-coupling.md +130 -0
  28. package/skills/_support/docs/principles/details/p018-information-hiding.md +128 -0
  29. package/skills/_support/docs/principles/details/p019-explicit-contracts.md +134 -0
  30. package/skills/_support/docs/principles/details/p020-executable-architecture.md +130 -0
  31. package/skills/_support/docs/principles/details/p021-evolutionary-and-reversible-design.md +126 -0
  32. package/skills/_support/docs/principles/details/p022-test-behavior-not-implementation.md +129 -0
  33. package/skills/_support/docs/principles/details/p023-parameterized-table-driven-testing.md +129 -0
  34. package/skills/_support/docs/principles/details/p024-boundary-value-testing.md +128 -0
  35. package/skills/_support/docs/principles/details/p025-property-based-testing-for-invariants.md +133 -0
  36. package/skills/_support/docs/principles/details/p026-regression-before-repair.md +134 -0
  37. package/skills/_support/docs/principles/details/p027-deterministic-and-hermetic-tests.md +128 -0
  38. package/skills/_support/docs/principles/details/p028-test-failure-paths.md +133 -0
  39. package/skills/_support/docs/principles/details/p029-generalize-error-policy-preserve-specific-cause.md +131 -0
  40. package/skills/_support/docs/principles/details/p030-nearest-responsible-error-boundary.md +133 -0
  41. package/skills/_support/docs/principles/details/p031-propagate-rather-than-swallow.md +131 -0
  42. package/skills/_support/docs/principles/details/p032-handle-once-preserve-causality.md +137 -0
  43. package/skills/_support/docs/principles/details/p033-state-safe-failure-semantics.md +140 -0
  44. package/skills/_support/docs/principles/details/p034-fail-fast.md +132 -0
  45. package/skills/_support/docs/principles/details/p035-fail-secure-fail-closed.md +137 -0
  46. package/skills/_support/docs/principles/details/p036-graceful-degradation.md +137 -0
  47. package/skills/_support/docs/principles/details/p037-idempotency-before-retry.md +139 -0
  48. package/skills/_support/docs/principles/details/p038-bounded-retry.md +145 -0
  49. package/skills/_support/docs/principles/details/p039-bounded-waiting.md +151 -0
  50. package/skills/_support/docs/principles/details/p040-bounded-resources.md +138 -0
  51. package/skills/_support/docs/principles/details/p041-backpressure-and-load-shedding.md +141 -0
  52. package/skills/_support/docs/principles/details/p042-fault-isolation-bulkheads.md +140 -0
  53. package/skills/_support/docs/principles/details/p043-circuit-breakers.md +148 -0
  54. package/skills/_support/docs/principles/details/p044-atomicity-where-possible.md +141 -0
  55. package/skills/_support/docs/principles/details/p045-compensation-where-atomicity-is-impossible.md +163 -0
  56. package/skills/_support/docs/principles/details/p046-resumability.md +138 -0
  57. package/skills/_support/docs/principles/details/p047-observability-is-part-of-correctness.md +134 -0
  58. package/skills/_support/docs/principles/details/p048-secure-by-design.md +132 -0
  59. package/skills/_support/docs/principles/details/p049-secure-by-default.md +126 -0
  60. package/skills/_support/docs/principles/details/p050-least-privilege.md +123 -0
  61. package/skills/_support/docs/principles/details/p051-complete-mediation.md +124 -0
  62. package/skills/_support/docs/principles/details/p052-separation-of-duties.md +129 -0
  63. package/skills/_support/docs/principles/details/p053-validate-at-trust-boundaries.md +126 -0
  64. package/skills/_support/docs/principles/details/p054-defense-in-depth.md +135 -0
  65. package/skills/_support/docs/principles/details/p055-minimize-attack-surface.md +133 -0
  66. package/skills/_support/docs/principles/details/p056-secrets-stay-out-of-code-and-context.md +137 -0
  67. package/skills/_support/docs/principles/details/p057-supply-chain-integrity.md +135 -0
  68. package/skills/_support/docs/principles/details/p058-bounded-agent-authority.md +137 -0
  69. package/skills/_support/docs/principles/details/p059-data-is-not-instruction.md +130 -0
  70. package/skills/_support/docs/principles/details/p060-constrain-sub-agents.md +136 -0
  71. package/skills/_support/docs/principles/details/p061-separate-decision-from-high-impact-execution.md +131 -0
  72. package/skills/_support/docs/principles/details/p062-human-approval-for-irreversible-or-high-risk-actions.md +129 -0
  73. package/skills/_support/docs/principles/details/p063-requirement-to-code-traceability.md +116 -0
  74. package/skills/_support/docs/principles/details/p064-requirement-to-test-traceability.md +116 -0
  75. package/skills/_support/docs/principles/details/p065-verify-before-claiming-completion.md +131 -0
  76. package/skills/_support/docs/principles/details/p066-preserve-existing-work.md +114 -0
  77. package/skills/_support/docs/principles/details/p067-no-test-cheating.md +126 -0
  78. package/skills/_support/docs/principles/details/p068-no-validation-bypass.md +119 -0
  79. package/skills/_support/docs/principles/details/p069-independent-review-for-high-risk-changes.md +129 -0
  80. package/skills/_support/docs/principles/details/p070-code-health-must-not-regress.md +116 -0
  81. package/skills/_support/docs/principles/details/p071-consistency-over-personal-preference.md +117 -0
  82. package/skills/_support/docs/principles/details/p072-technical-evidence-over-preference.md +122 -0
  83. package/skills/_support/docs/principles/details/p073-optimize-only-with-evidence.md +123 -0
  84. package/skills/_support/docs/principles/details/p074-prefer-existing-mechanisms.md +121 -0
  85. package/skills/_support/docs/principles/details/p075-make-invalid-states-hard-to-represent.md +128 -0
  86. package/skills/_support/docs/principles/details/p076-parse-then-validate-then-operate.md +133 -0
  87. package/skills/_support/docs/principles/details/p077-separate-policy-from-mechanism.md +112 -0
  88. package/skills/_support/docs/principles/details/p078-single-source-of-truth.md +131 -0
  89. package/skills/_support/docs/principles/details/p079-explicit-ownership-and-lifetimes.md +124 -0
  90. package/skills/_support/docs/principles/details/p080-make-concurrency-deliberate.md +122 -0
  91. package/skills/_support/docs/principles/details/p081-forward-progress-with-safety.md +125 -0
  92. package/skills/_support/docs/principles/details/p082-design-for-cancellation.md +133 -0
  93. package/skills/_support/docs/principles/details/p083-irreversible-actions-last.md +124 -0
  94. package/skills/_support/docs/principles/details/p084-prefer-local-reasoning.md +131 -0
  95. package/skills/_support/docs/principles/details/p085-explicit-is-better-than-implicit.md +123 -0
  96. package/skills/_support/docs/principles/details/p086-readability-counts.md +113 -0
  97. package/skills/_support/docs/principles/details/p087-comments-explain-why-code-explains-what.md +120 -0
  98. package/skills/_support/docs/principles/details/p088-delete-dead-code.md +125 -0
  99. package/skills/_support/docs/principles/details/p089-delete-obsolete-configuration-and-dependencies.md +125 -0
  100. package/skills/_support/docs/principles/details/p090-prefer-negative-code.md +134 -0
  101. package/skills/_support/docs/principles/details/p091-test-driven-development.md +149 -0
  102. package/skills/_support/docs/review/README.md +63 -0
  103. package/skills/_support/docs/review/behavior-first-testing.md +78 -0
  104. package/skills/_support/docs/review/common.md +400 -0
  105. package/skills/_support/docs/review/design-docs.md +74 -0
  106. package/skills/_support/docs/review/issue-planning.md +247 -0
  107. package/skills/_support/docs/review/language-routing.md +141 -0
  108. package/skills/_support/docs/review/repository-scorecard.md +170 -0
  109. package/skills/advise/SKILL.md +108 -74
  110. package/skills/advise/scripts/list_retrievable_skills.py +20 -8
  111. package/skills/advise/scripts/resolve_knowledge_checkout.py +533 -0
  112. package/skills/brainstorm/SKILL.md +163 -127
  113. package/skills/change-review/SKILL.md +91 -71
  114. package/skills/change-review/references/scope-resolution.md +69 -46
  115. package/skills/change-review/scripts/resolve_scope.py +144 -84
  116. package/skills/finalize-plan/SKILL.md +205 -139
  117. package/skills/git-worktrees/SKILL.md +100 -80
  118. package/skills/git-worktrees/scripts/prepare_worktree.py +34 -15
  119. package/skills/issue-review/SKILL.md +136 -79
  120. package/skills/learn/SKILL.md +359 -192
  121. package/skills/myrmidon-swarm/SKILL.md +126 -86
  122. package/skills/plan-issue/SKILL.md +122 -81
  123. package/skills/pr-review/SKILL.md +184 -116
  124. package/skills/pr-review/references/criteria.md +61 -37
  125. package/skills/pr-review/references/delivery.md +277 -101
  126. package/skills/pr-review/references/evidence.md +346 -149
  127. package/skills/pr-review/references/prevalidated.md +93 -61
  128. package/skills/pr-review/scripts/collect_evidence.py +312 -162
  129. package/skills/pr-review/scripts/deliver_go.py +701 -0
  130. package/skills/pr-review/scripts/diff_context.py +34 -15
  131. package/skills/pr-review/scripts/materialize_snapshot.py +141 -130
  132. package/skills/pr-review/scripts/pr_identity.py +27 -15
  133. package/skills/pr-review/scripts/resolve_pr.py +77 -41
  134. package/skills/realign/SKILL.md +516 -0
  135. package/skills/realign/references/aislop-integration.md +215 -0
  136. package/skills/realign/references/architecture-and-structure.md +271 -0
  137. package/skills/realign/references/control-flow-and-errors.md +344 -0
  138. package/skills/realign/references/tests-dependencies-and-security.md +261 -0
  139. package/skills/realign/scripts/resolve_assessment.py +1525 -0
  140. package/skills/repo-review/SKILL.md +202 -131
  141. package/skills/simplify/SKILL.md +174 -0
  142. package/skills/systematic-debugging/SKILL.md +212 -192
  143. package/skills/systematic-debugging/scripts/repository_evidence.py +26 -8
  144. package/skills/test-driven-development/SKILL.md +126 -96
  145. package/skills/tidy/SKILL.md +104 -59
  146. package/skills/tidy/scripts/run_tidy.py +54 -6
@@ -2,110 +2,274 @@
2
2
 
3
3
  ## Why
4
4
 
5
- A review verdict is evidence, not a forge-scope expansion. Rebinding immediately before
6
- one scoped publication prevents a correct review from commenting on, approving,
7
- or automating a later artifact.
5
+ A review verdict is evidence. It does not expand the forge scope. Immediately before one scoped
6
+ publication, bind the exact artifact again. This check prevents the review from adding a comment or
7
+ automation to a later artifact. It also prevents approval of a later artifact.
8
+
9
+ Use the [ASD-STE100 technical-English policy](../../TECHNICAL_ENGLISH.md) for all technical prose
10
+ and review output.
8
11
 
9
12
  ```text
10
13
  [complete review] -> [verdict] -> [rebind exact artifact]
11
14
  |
12
- [one comment-only batch, when requested]
15
+ [finding batch or verified GO finalization]
13
16
  |
14
17
  [optional separate auto-merge opt-in after GO]
15
18
  ```
16
19
 
17
20
  ## Engineering principle routes
18
21
 
19
- - [P037 Idempotency Before Retry](../../../docs/principles/README.md#p037) and
20
- [P044 Atomicity Where Possible](../../../docs/principles/README.md#p044) require one bound,
21
- atomic comment batch where the forge supports it and prohibit blind retry after a failed or
22
- indeterminate write.
23
- - [P050 Least Privilege](../../../docs/principles/README.md#p050),
24
- [P051 Complete Mediation](../../../docs/principles/README.md#p051),
25
- [P052 Separation of Duties](../../../docs/principles/README.md#p052), and
26
- [P058 Bounded Agent Authority](../../../docs/principles/README.md#p058) keep review, publication,
27
- approval, and merge capabilities distinct and limited to the selected profile and requested task.
28
- - [P061 Separate Decision from High-Impact Execution](../../../docs/principles/README.md#p061),
29
- [P062 Human Approval for Irreversible or High-Risk Actions](../../../docs/principles/README.md#p062),
30
- and [P083 Irreversible Actions Last](../../../docs/principles/README.md#p083) require a fresh
31
- authority and identity check immediately before a requested write or guarded auto-merge opt-in;
32
- existing specific authorization is honored without a redundant approval prompt.
33
- - [P065 Verify Before Claiming Completion](../../../docs/principles/README.md#p065) and
34
- [P068 No Validation Bypass](../../../docs/principles/README.md#p068) prohibit a favorable verdict,
35
- successful-publication claim, or automation state based on stale, incomplete, bypassed, or
36
- unverified evidence.
22
+ - [P037 Idempotency Before Retry](../../_support/docs/principles/README.md#p037) and
23
+ [P044 Atomicity Where Possible](../../_support/docs/principles/README.md#p044) require one bound atomic
24
+ comment batch when the forge supports it. They prohibit a blind retry after a failed or indeterminate
25
+ write.
26
+ - [P050 Least Privilege](../../_support/docs/principles/README.md#p050),
27
+ [P051 Complete Mediation](../../_support/docs/principles/README.md#p051),
28
+ [P052 Separation of Duties](../../_support/docs/principles/README.md#p052), and
29
+ [P058 Bounded Agent Authority](../../_support/docs/principles/README.md#p058) keep the review, publication,
30
+ approval, and merge capabilities separate. They limit these capabilities to the selected profile and
31
+ requested task.
32
+ - [P061 Separate Decision from High-Impact Execution](../../_support/docs/principles/README.md#p061),
33
+ [P062 Human Approval for Irreversible or High-Risk Actions](../../_support/docs/principles/README.md#p062),
34
+ and [P083 Irreversible Actions Last](../../_support/docs/principles/README.md#p083) require a new authority
35
+ and identity check immediately before a requested write or guarded auto-merge opt-in. If the user
36
+ already gave specific authorization, do not request the same approval again.
37
+ - [P065 Verify Before Claiming Completion](../../_support/docs/principles/README.md#p065) and
38
+ [P068 No Validation Bypass](../../_support/docs/principles/README.md#p068) prohibit a favorable verdict,
39
+ successful-publication claim, or automation state from stale, incomplete, bypassed, or unverified
40
+ evidence.
37
41
 
38
42
  ## Decision
39
43
 
40
- For default and CI-free normal reports, calculate findings and score before
41
- emitting exactly one terminal verdict. The prevalidated profile emits only its
42
- structured audit; it has no verdict, scorecard, publication, or auto-merge
43
- path. GitLab may report a verdict, but this skill never enables its auto-merge.
44
+ For a default or continuous-integration-free (CI-free) normal report, calculate the findings. Then,
45
+ calculate the score. Emit exactly one terminal verdict. For the prevalidated profile, emit only its structured
46
+ audit. Do not emit a verdict, scorecard, or publication. The prevalidated profile has no auto-merge
47
+ workflow. GitLab can report a verdict. This skill must not enable GitLab auto-merge.
44
48
 
45
49
  | Verdict | Required conditions |
46
50
  | --- | --- |
47
- | **GO** | Default profile; A (93–100); architecture aligned or evidenced intentional change; zero `required` findings; complete applicable source, scope, requirements, language, and validation coverage; and host-selected local checks passing on the reviewed head. |
48
- | **CONDITIONAL GO** | Architecture passes, no `required` source finding is open, and score is at least B, but a remediable review condition remains: for example incomplete source, scope, requirement, language, or validation coverage, a local validation gap, or CI-free's deliberately limited evidence. State every condition. |
49
- | **NO-GO** | Score below B; any `required` finding; material or unexplained architecture violation; failed required local validation; or invalid/stale/drifted identity, scope, requirement, path, or current-head binding. |
51
+ | **GO** | Use only for the default profile. Require grade A (93–100). Require aligned architecture or an evidenced intentional change. Require zero `required` findings. Require complete applicable source, scope, requirements, language, and validation coverage. Require all host-selected local checks to pass on the reviewed head. A delivered GO also requires the verified GO-delivery postconditions. |
52
+ | **CONDITIONAL GO** | Require architecture to pass. Require no open `required` source finding. Require a score of at least B. Use when a remediable review condition remains. Examples include incomplete source, scope, requirement, language, or validation coverage; a local validation gap; or deliberately limited CI-free evidence. State each condition. Use NO-GO for a required finding, a material architecture violation, failed required validation, or an invalid or stale exact-head binding. |
53
+ | **NO-GO** | Use for a score below B or a `required` finding. Also use it for a material or unexplained architecture violation, failed required validation, or an invalid, stale, or drifted identity, scope, requirement, path, or current-head binding. |
54
+
55
+ ### Merge readiness
56
+
57
+ Report forge approval and required-gate state as a separate **Merge readiness** fact when default-profile
58
+ evidence is available. For example: `Blocked — one independent approval required by repository policy`.
59
+ Use GitHub `reviewDecision` and GitLab merge-request approval state as repository-policy evidence. This
60
+ state does not lower the review score or verdict. GO is a review verdict, not an approval, merge
61
+ authorization, or claim that every branch-protection rule is satisfied.
62
+
63
+ `--report-only` can report that the review evidence is GO-eligible. It must record
64
+ `delivery: withheld (read-only)` and `auto_merge: withheld (read-only)`. It must not report a
65
+ delivered GO. Without `--enable-auto-merge-on-go`, a delivered GO records
66
+ `auto_merge: withheld (not requested)`. For
67
+ `CONDITIONAL GO`, `NO-GO`, CI-free, prevalidated, and GitLab, record `auto_merge: not-eligible` with
68
+ the blocker.
69
+
70
+ ## Verified GO delivery
71
+
72
+ A direct default-profile GitHub review owns this narrow finalization unless an enclosing coordinator
73
+ declares itself as the single delivery owner. Complete the finalization before you emit terminal GO.
74
+ The finalization can make only these changes:
75
+
76
+ - add one verified reviewer response to each open review thread;
77
+ - resolve each thread after its response is visible;
78
+ - add `state:implementation-go`; and
79
+ - remove `state:implementation-no-go`.
80
+
81
+ Do not create a missing label. Do not change another label. Treat the two implementation-state labels
82
+ as mutually exclusive.
83
+
84
+ Read the complete conversation for every open thread. A response must state the disposition and the
85
+ exact reviewed-head evidence that makes resolution correct. If a finding is not addressed, keep its
86
+ thread open and change the verdict to NO-GO. Do not use a general PR comment as a thread response. Do
87
+ not alter already-resolved history.
88
+
89
+ For direct GitHub delivery, invoke the installed `deliver_go.py` helper. Give it every retained target
90
+ and immutable identity value. Give it a response manifest that binds each initially open thread to its
91
+ complete conversation digest and non-empty reviewer response. The helper must do these actions:
92
+
93
+ First, use the read-only preparation mode with the same target arguments and `--prepare-manifest`.
94
+ This mode returns each open thread, its complete conversation, and its digest. Add the verified
95
+ response body to each entry. Preserve all binding, thread, and digest values. Save that JSON as the
96
+ response manifest. Then, run the delivery command:
97
+
98
+ ```bash
99
+ <installed-skill>/scripts/deliver_go.py \
100
+ --target-host github.com \
101
+ --target-repository <owner/repository> \
102
+ --expected-pr-url <canonical-pr-url> \
103
+ --expected-base-oid <base-oid> \
104
+ --expected-head-oid <head-oid> \
105
+ --prepare-manifest \
106
+ <number>
107
+ ```
108
+
109
+ ```bash
110
+ <installed-skill>/scripts/deliver_go.py \
111
+ --target-host github.com \
112
+ --target-repository <owner/repository> \
113
+ --expected-pr-url <canonical-pr-url> \
114
+ --expected-base-oid <base-oid> \
115
+ --expected-head-oid <head-oid> \
116
+ --responses-file <response-manifest.json> \
117
+ <number>
118
+ ```
119
+
120
+ Use this response-manifest shape:
121
+
122
+ ```json
123
+ {
124
+ "binding": {
125
+ "repository": "owner/repository",
126
+ "number": 123,
127
+ "url": "https://github.com/owner/repository/pull/123",
128
+ "base_oid": "<40-lowercase-hex>",
129
+ "head_oid": "<40-lowercase-hex>"
130
+ },
131
+ "responses": [
132
+ {
133
+ "thread_id": "<review-thread-node-id>",
134
+ "conversation_sha256": "<complete-conversation-digest>",
135
+ "body": "Verified response with disposition and exact-head evidence."
136
+ }
137
+ ]
138
+ }
139
+ ```
50
140
 
51
- `--report-only` may report GO but records `auto_merge: withheld (read-only)`.
52
- Without `--enable-auto-merge-on-go`, a GO records `auto_merge: withheld (not
53
- requested)`. CONDITIONAL GO, NO-GO, CI-free, prevalidated, and GitLab records
54
- `auto_merge: not-eligible` with the blocker.
141
+ Use an empty `responses` list only when there are no open threads. The helper adds its own
142
+ deterministic delivery marker. Do not put a marker in `body`.
143
+
144
+ 1. Bind the canonical open, non-draft PR and exact base and head again.
145
+ 2. Enumerate all open threads and their complete conversations.
146
+ 3. Reject a response manifest that has a missing, extra, duplicate, stale, or empty entry.
147
+ 4. Before each response, verify the exact PR head and bound conversation.
148
+ 5. Post one deterministic response and verify its receipt and visibility.
149
+ 6. Resolve that thread only after the verified response is visible on the unchanged head.
150
+ 7. Verify the resolution before it continues.
151
+ 8. Before the label change, bind the exact open head again and require zero open threads.
152
+ 9. In one target-scoped command, add `state:implementation-go` and remove
153
+ `state:implementation-no-go`.
154
+ 10. Read the PR and all threads again. Require the unchanged head, zero open threads, and exactly one
155
+ implementation-state label: `state:implementation-go`.
156
+
157
+ If a read, response, resolution, label change, or readback fails or is indeterminate, stop. Do not
158
+ retry blindly. Do not unresolve a thread. Do not make a compensating label change. Report the known
159
+ partial state and withhold terminal GO. A later review can recognize an exact deterministic response,
160
+ but it must repeat all current-head and final-state checks.
161
+
162
+ GitHub does not provide a head-conditional thread-resolution or label mutation. Therefore, the helper
163
+ guarantees the immediate pre-write and post-write bindings. If the post-write binding detects a race,
164
+ report the external state as partial. Never report a delivered GO for that run.
165
+
166
+ If an enclosing coordinator is the declared single delivery owner, do not invoke the helper or make a
167
+ second write. Return the bound structured GO result to that coordinator. The coordinator must perform
168
+ and verify the same sequence. It must not expose terminal GO until the final postconditions pass.
169
+
170
+ `--report-only`, `--ci-free`, and `--prevalidated` never run this finalization. A GitLab review can use
171
+ an authenticated capability that proves equivalent exact-head, discussion-response, resolution, and
172
+ exclusive-label postconditions. If that capability is absent, report the eligible assessment and the
173
+ delivery blocker. Do not claim a delivered GO.
55
174
 
56
175
  ## Guarded GitHub auto-merge
57
176
 
58
- An explicit direct-user `--enable-auto-merge-on-go` request is the only
59
- auto-merge selection. It applies only to an exact eligible default-profile
60
- GitHub GO, after any requested comment batch is verified; it never permits a
61
- direct merge, retry, approval, label, bypass, or policy change.
62
-
63
- 1. Re-resolve canonical host, repository, PR number and node ID, OPEN/non-draft
64
- state, target, base/head OIDs, both lenses, scope digest,
65
- linked-requirements digest, path manifest, all effective pre-admission gates,
66
- and required queue route. Withhold on drift, missing binding, gate failure or
67
- pending state, changed author/reviewer, required unresolved thread, or failed
68
- or indeterminate comment publication.
69
- 2. Require an authenticated capability that binds the canonical target and can
70
- enable normal auto-merge without administrator bypass. It returns the one
71
- repository-supported permitted method; never choose, guess, or change one.
72
- If a merge queue is required, require a separate exact-head queue-admission
73
- capability instead; normal auto-merge is never a queue-admission proxy.
74
- 3. Invoke exactly one bound operation: enable auto-merge with retained PR node
75
- ID and `expectedHeadOid`, or queue admission with the same target and head.
76
- Do not use ambient repository or branch state, generic CLI defaults, a direct
77
- merge command, fallback mutation, or retry after failure or indeterminate
78
- results.
79
- 4. Re-fetch the exact PR. Report `enabled` only when auto-merge is enabled for
80
- the same node ID, head, and supported method; report `queue-enqueued` only
81
- when its entry binds the same PR, target, and reviewed head. Never report the
82
- PR as merged.
177
+ Enable auto-merge only when the user directly requests `--enable-auto-merge-on-go`. Apply this option
178
+ only after an exact delivered default-profile GitHub `GO`. Before you apply it, verify each requested
179
+ comment batch and the verified GO-delivery postconditions. This option does not permit a direct merge,
180
+ retry, approval, additional label change, bypass, or policy change.
181
+
182
+ 1. Resolve these values again:
183
+ - canonical host;
184
+ - repository;
185
+ - pull request (PR) number and node ID;
186
+ - `OPEN` and non-draft state;
187
+ - target;
188
+ - base and head object identifiers (OIDs);
189
+ - both lenses;
190
+ - scope digest;
191
+ - linked-requirements digest;
192
+ - path manifest;
193
+ - all effective pre-admission gates, including required approvals; and
194
+ - required queue route.
195
+ 2. If a value changed or a binding is missing, withhold auto-merge.
196
+ 3. If a gate failed or is pending, withhold auto-merge.
197
+ 4. If the author or reviewer changed, withhold auto-merge.
198
+ 5. If a required thread is unresolved, withhold auto-merge.
199
+ 6. If comment publication failed or is indeterminate, withhold auto-merge.
200
+ 7. Require an authenticated capability that binds the canonical target and can enable normal
201
+ auto-merge without administrator bypass.
202
+ 8. Use the one repository-supported method that the capability returns.
203
+ 9. Do not select the method.
204
+ 10. Do not guess the method.
205
+ 11. Do not change the method.
206
+ 12. If the repository requires a merge queue, require a separate exact-head queue-admission capability.
207
+ 13. Do not use normal auto-merge as a queue-admission proxy.
208
+ 14. Invoke exactly one bound operation:
209
+
210
+ - Enable auto-merge with the retained PR node ID and `expectedHeadOid`; or
211
+ - Use queue admission with the same target and head.
212
+
213
+ 15. Do not use ambient repository state, ambient branch state, or generic command-line interface
214
+ (CLI) defaults.
215
+ 16. Do not use a direct merge command or fallback mutation.
216
+ 17. Do not retry after a failed or indeterminate result.
217
+ 18. Fetch the exact PR again.
218
+ 19. Report `enabled` only if auto-merge uses the same node ID, head, and supported method.
219
+ 20. Report `queue-enqueued` only if its entry binds the same PR, target, and reviewed head.
220
+ 21. Do not report the PR as merged.
83
221
 
84
222
  ## Normal report
85
223
 
86
224
  Return, in order:
87
225
 
88
- 1. Artifact identity, forge, base/head, immutable scope and path bindings,
89
- behind count, files reviewed, linked issue, acceptance criteria, and each
90
- unbound check as a coverage gap.
91
- 2. Architecture decision, language/surface routes, and N/A reasons.
92
- 3. Findings from CRITICAL through FYI. Every finding has independent
93
- `required`, `suggestion`, `nit`, or `FYI` disposition; exact location;
94
- observed gap; impact and governing evidence; and proportionate fix.
95
- 4. Six-dimension scorecard, weighted grade, terminal verdict, commands and
96
- pass/fail state, coverage gaps, delivery/auto-merge state, and brief
97
- strengths after findings.
226
+ 1. Report the artifact identity, forge, base and head, immutable scope, and path bindings.
227
+ 2. Report the behind count, files reviewed, linked issue, and acceptance criteria.
228
+ 3. Report each unbound check as a coverage gap.
229
+ 4. Report the architecture decision, language routes, surface routes, and not-applicable (N/A) reasons.
230
+ 5. Report findings from `CRITICAL` through `FYI`.
231
+ 6. For each finding, report these items:
232
+ - independent `required`, `suggestion`, `nit`, or `FYI` disposition;
233
+ - exact location;
234
+ - observed gap;
235
+ - impact and governing evidence; and
236
+ - proportionate fix.
237
+ 7. Report the six-dimension scorecard, weighted grade, and terminal verdict.
238
+ 8. Report commands and their pass or fail state.
239
+ 9. Report coverage gaps.
240
+ 10. Report merge readiness or repository-policy state.
241
+ 11. Report delivery state and auto-merge state.
242
+ 12. After the findings, report brief strengths.
243
+
244
+ ## Finding publication
98
245
 
99
- ## Comment-only publication
246
+ The requested review delivery boundary permits normal finding publication. Publish findings as
247
+ comments only. This section does not prohibit the separate verified GO finalization. During finding
248
+ publication, do not do any of these actions:
100
249
 
101
- The requested review delivery boundary permits normal publication. It permits comments only, never approval, request-changes, labels,
102
- issue edits, thread resolution, rebase, push, close, merge, or a follow-up
103
- work-item. Indirect invocation, `--report-only`, absent forge capability, no
104
- findings, or drift returns the complete ready-to-publish batch without a write.
105
- Do not post a clean review.
250
+ - approve;
251
+ - request changes;
252
+ - change labels;
253
+ - edit an issue;
254
+ - resolve a thread;
255
+ - rebase;
256
+ - push;
257
+ - close;
258
+ - merge; or
259
+ - create a follow-up work item.
106
260
 
107
- Before every requested write, re-fetch the exact open artifact and derive the
108
- fully-qualified write target only from the retained identity. Revalidate:
261
+ If any of these conditions applies, return the complete ready-to-publish batch without a write:
262
+
263
+ - The invocation is indirect.
264
+ - The invocation uses `--report-only`.
265
+ - A forge capability is absent.
266
+ - A bound value changed.
267
+
268
+ If there are no findings, do not post a clean review. Continue to verified GO delivery only when all
269
+ GO conditions apply.
270
+
271
+ Before each requested write, fetch the exact open artifact again. Derive the fully qualified write
272
+ target only from the retained identity. Revalidate these values:
109
273
 
110
274
  | Forge/profile | Required rebind |
111
275
  | --- | --- |
@@ -113,13 +277,12 @@ fully-qualified write target only from the retained identity. Revalidate:
113
277
  | CI-free GitHub | Exact repository/PR/base/head plus the final non-CI source-scope binding. Never call `collect_evidence.py` or a CI endpoint. |
114
278
  | GitLab | Exact identity, scope, linked requirements, changed paths, and complete base/start/head position tuple. |
115
279
 
116
- On any drift, withhold the entire set and restart the review. A general summary
117
- is optional and may cover only architecture, scope, coverage, or another truly
118
- cross-cutting point without a changed-line anchor. It must not repeat an inline
119
- finding. Each independently actionable changed-line finding gets exactly one
120
- inline comment or discussion on its one causal changed line; never combine
121
- separate fixes, use a line range instead of a causal line, or duplicate it at
122
- several locations.
280
+ If a value changes, withhold the complete set. Start a new review. Use a general summary only for
281
+ architecture, scope, coverage, or another cross-cutting point that has no changed-line anchor. Do not
282
+ repeat an inline finding in the summary. Publish each independently actionable changed-line finding
283
+ exactly once. Put it in one inline comment or discussion on its causal changed line. Do not combine
284
+ separate fixes. Do not use a line range instead of the causal line. Do not duplicate the finding at
285
+ multiple locations.
123
286
 
124
287
  ### GitHub batch
125
288
 
@@ -133,24 +296,37 @@ body = non-empty (neutral transport body is valid)
133
296
  comments = one entry per anchorable independent finding
134
297
  ```
135
298
 
136
- Each comment entry contains only one verified changed `path`, `side`, causal
137
- `line`, and finding body; `commit_id` is top-level, never per comment. Verify
138
- the returned review and fetched comments identify the target, `COMMENT` or
139
- `COMMENTED` event/state, reviewed commit, and every expected path, side, line,
140
- and body anchor. On failed or indeterminate verification, make no further write
141
- or retry. Do not substitute `gh pr review --comment`.
299
+ Put only one verified changed `path`, `side`, causal `line`, and finding body in each comment entry.
300
+ Put `commit_id` at the top level. Do not put it in an individual comment. Verify that the returned
301
+ review and fetched comments identify these values:
302
+
303
+ - the target;
304
+ - the `COMMENT` or `COMMENTED` event or state;
305
+ - the reviewed commit; and
306
+ - each expected path, side, line, and body anchor.
307
+
308
+ If verification fails or is indeterminate, make no additional write. Do not retry. Do not substitute
309
+ `gh pr review --comment`.
142
310
 
143
311
  ### GitLab discussions
144
312
 
145
- Create one actionable changed-line discussion for each anchorable independent
146
- finding. Every text position includes exact `base_sha`, `start_sha`, `head_sha`,
147
- `old_path`, `new_path`, and `position_type=text`; use only `new_line` for an
148
- added/right-side finding, only `old_line` for deletion/left-side, and both for
149
- an unchanged line. Prefer an atomic draft or batch. If unavailable, rebind
150
- before every ordered discussion; stop on drift, retain created URLs, and return
151
- the remaining batch. Verify each returned target, tuple, paths, and line fields
152
- exactly. If an atomic batch is required but unsupported, withhold the whole set.
153
-
154
- Report review/discussion URLs, posting failure, residual risks, and unverified
155
- assumptions honestly. The forge and its approval policy—not review prose—own
156
- labels, acceptance, and merging.
313
+ Create one actionable changed-line discussion for each anchorable independent finding. Put these
314
+ exact values in each text position:
315
+
316
+ - `base_sha`;
317
+ - `start_sha`;
318
+ - `head_sha`;
319
+ - `old_path`;
320
+ - `new_path`; and
321
+ - `position_type=text`.
322
+
323
+ For an added or right-side finding, use only `new_line`. For a deletion or left-side finding, use only
324
+ `old_line`. For an unchanged line, use both fields. Use an atomic draft or batch when it is available.
325
+ If it is not available, bind the artifact again before each ordered discussion. If a value changes,
326
+ stop. Retain the created uniform resource locators (URLs). Return the remaining batch. Verify each
327
+ returned target, tuple, path, and line field exactly. If the workflow requires an atomic batch and the
328
+ forge does not support it, withhold the complete set.
329
+
330
+ Report review or discussion URLs, publication failures, residual risks, and unverified assumptions
331
+ accurately. The forge and its approval policy control labels, acceptance, and merge. Review prose does
332
+ not control them.