@sjawhar/pi-legion 10.16.0 → 10.16.1
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.
package/dist/legion.js
CHANGED
|
@@ -16913,7 +16913,7 @@ async function bootLegionClaim(host2) {
|
|
|
16913
16913
|
// package.json
|
|
16914
16914
|
var package_default = {
|
|
16915
16915
|
name: "@sjawhar/pi-legion",
|
|
16916
|
-
version: "10.16.
|
|
16916
|
+
version: "10.16.1",
|
|
16917
16917
|
license: "Apache-2.0",
|
|
16918
16918
|
type: "module",
|
|
16919
16919
|
omp: {
|
|
@@ -1,192 +1,103 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: thermonuclear-code-quality
|
|
3
|
-
description:
|
|
3
|
+
description: Use when asked for a thermonuclear code-quality review or a deep maintainability audit of a branch or PR diff. Also use when asked to review abstraction quality, oversized files or ad-hoc branching growth.
|
|
4
4
|
disable-model-invocation: true
|
|
5
5
|
---
|
|
6
6
|
|
|
7
7
|
# Thermonuclear Code Quality
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
-
|
|
77
|
-
-
|
|
78
|
-
-
|
|
79
|
-
-
|
|
80
|
-
-
|
|
81
|
-
-
|
|
82
|
-
-
|
|
83
|
-
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
-
|
|
101
|
-
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
- Refactors that technically pass tests but make the code less modular or less readable.
|
|
105
|
-
- "Temporary" branching that is likely to become permanent debt.
|
|
106
|
-
- Bespoke helpers where the codebase already has a canonical utility for the job.
|
|
107
|
-
- Logic added in the wrong layer/package when it should live somewhere more central.
|
|
108
|
-
- Sequential async flow where independent work could use simpler parallel execution.
|
|
109
|
-
- Partial-update logic that leaves state less atomic than necessary.
|
|
110
|
-
|
|
111
|
-
## Preferred Remedies
|
|
112
|
-
|
|
113
|
-
When you identify a code-quality problem, prefer suggestions like:
|
|
114
|
-
|
|
115
|
-
- Delete a whole layer of indirection rather than polishing it.
|
|
116
|
-
- Reframe the state model so conditionals disappear instead of getting centralized.
|
|
117
|
-
- Change the ownership boundary so the feature becomes a natural extension of an existing abstraction.
|
|
118
|
-
- Turn special-case logic into a simpler default flow with fewer exceptions.
|
|
119
|
-
- Extract a helper or pure function.
|
|
120
|
-
- Split a large file into smaller focused modules.
|
|
121
|
-
- Move feature-specific logic behind a dedicated abstraction.
|
|
122
|
-
- Replace condition chains with a typed model or explicit dispatcher.
|
|
123
|
-
- Separate orchestration from business logic.
|
|
124
|
-
- Collapse duplicate branches into a single clearer flow.
|
|
125
|
-
- Delete wrappers that do not meaningfully clarify the API.
|
|
126
|
-
- Reuse the existing canonical helper instead of introducing a near-duplicate.
|
|
127
|
-
- Make type boundaries more explicit so the control flow gets simpler.
|
|
128
|
-
- Move the logic to the package/module/layer that already owns the concept.
|
|
129
|
-
- Parallelize independent work when that also simplifies the orchestration.
|
|
130
|
-
- Restructure related updates into a more atomic flow when partial state would be harder to reason about.
|
|
131
|
-
|
|
132
|
-
Do not be satisfied with "maybe rename this" feedback when the real issue is structural.
|
|
133
|
-
Do not be satisfied with a merely cleaner version of the same messy idea if there is a plausible path to a much simpler idea.
|
|
134
|
-
|
|
135
|
-
## Review Tone
|
|
136
|
-
|
|
137
|
-
Be direct, serious, and demanding about quality.
|
|
138
|
-
Do not be rude, but do not soften major maintainability issues into mild suggestions.
|
|
139
|
-
If the code makes the codebase messier, say so.
|
|
140
|
-
If the implementation missed a substantial simplification, state it.
|
|
141
|
-
|
|
142
|
-
Good phrases:
|
|
143
|
-
|
|
144
|
-
- `this pushes the file past 1k lines. can we decompose this first?`
|
|
145
|
-
- `this adds another special-case branch into an already busy flow. can we move this behind its own abstraction?`
|
|
146
|
-
- `this works, but it makes the surrounding code more spaghetti. let's keep the behavior and restructure the implementation.`
|
|
147
|
-
- `this feels like feature logic leaking into a shared path. can we isolate it?`
|
|
148
|
-
- `this abstraction seems unnecessary. can we just keep the direct flow?`
|
|
149
|
-
- `why does this need a cast / optional here? can we make the boundary more explicit instead?`
|
|
150
|
-
- `this looks like a bespoke helper for something we already have elsewhere. can we reuse the canonical one?`
|
|
151
|
-
- `i think there's a code-judo move here that makes this much simpler. can we reframe this so these branches disappear?`
|
|
152
|
-
- `this refactor moves complexity around, but doesn't really delete it. is there a way to make the model itself simpler?`
|
|
153
|
-
|
|
154
|
-
## Output Expectations
|
|
155
|
-
|
|
156
|
-
Prioritize findings in this order:
|
|
157
|
-
|
|
158
|
-
1. Structural code-quality regressions
|
|
159
|
-
2. Missed opportunities for dramatic simplification / code-judo restructuring
|
|
160
|
-
3. Spaghetti / branching complexity increases
|
|
161
|
-
4. Boundary / abstraction / type-contract problems that make the code harder to reason about
|
|
162
|
-
5. File-size and decomposition concerns
|
|
163
|
-
6. Modularity and abstraction issues
|
|
164
|
-
7. Legibility and maintainability concerns
|
|
165
|
-
|
|
166
|
-
Do not flood the review with low-value nits if there are larger structural issues.
|
|
167
|
-
Prefer a smaller number of high-conviction comments over a long list of cosmetic notes.
|
|
168
|
-
|
|
169
|
-
## Approval Bar
|
|
170
|
-
|
|
171
|
-
Do not approve merely because behavior seems correct.
|
|
172
|
-
The bar for approval is:
|
|
173
|
-
|
|
174
|
-
- no clear structural regression
|
|
175
|
-
- no obvious missed opportunity to make the implementation dramatically simpler when such a path is visible
|
|
176
|
-
- no unjustified file-size explosion
|
|
177
|
-
- no obvious spaghetti-growth from special-case branching
|
|
178
|
-
- no hacky or magical abstraction that makes the code harder to reason about
|
|
179
|
-
- no unnecessary wrapper/cast/optionality churn obscuring the real design
|
|
180
|
-
- no clear architecture-boundary leak or avoidable canonical-helper duplication
|
|
181
|
-
- no missed opportunity for an obvious decomposition that would materially improve maintainability
|
|
182
|
-
|
|
183
|
-
Treat these as presumptive blockers unless the author can justify them with evidence:
|
|
184
|
-
|
|
185
|
-
- the PR preserves a lot of incidental complexity when there is a plausible code-judo move that would delete it
|
|
186
|
-
- the PR pushes a file from below 1000 lines to above 1000 lines
|
|
187
|
-
- the PR adds ad-hoc branching that makes an existing flow more tangled
|
|
188
|
-
- the PR solves a local problem by scattering feature checks across shared code
|
|
189
|
-
- the PR adds an unnecessary abstraction, wrapper, or cast-heavy contract that makes the design more indirect
|
|
190
|
-
- the PR duplicates an existing helper or puts logic in the wrong layer when there is a clear canonical home
|
|
191
|
-
|
|
192
|
-
If those conditions are not met, leave explicit, actionable feedback and push for a cleaner decomposition.
|
|
9
|
+
A strict maintainability audit of the current branch's changes.
|
|
10
|
+
|
|
11
|
+
## Baseline
|
|
12
|
+
|
|
13
|
+
- Rethink how to structure and implement the changes so code quality improves and behavior does not change. The aim is code that is smaller, more direct and easier to maintain.
|
|
14
|
+
- Improve abstractions and modularity. Reduce spaghetti code. Make the code succinct and legible.
|
|
15
|
+
- Restructure when there is a clear path to a simpler implementation. Do not stop at local cleanup when a coherent simplification is available.
|
|
16
|
+
- Be thorough and rigorous. Verify each claim before you report it.
|
|
17
|
+
|
|
18
|
+
## Look for the code-judo move first
|
|
19
|
+
|
|
20
|
+
- For each meaningful change, ask: can a reorganization that uses the existing architecture better make whole branches, helpers, modes, conditionals or layers disappear?
|
|
21
|
+
- Push hard to delete complexity, not to rearrange it. Prefer the solution that looks inevitable in hindsight.
|
|
22
|
+
- A refactor that moves code but leaves the reader the same number of concepts to hold is not a simplification. Ask whether the model itself can be simpler.
|
|
23
|
+
- Do not accept a cleaner version of the same messy idea when a much simpler idea is plausible. Do not give "maybe rename this" feedback when the real issue is structural.
|
|
24
|
+
- "It works" and "tests pass" are not the bar. If the structure can become meaningfully cleaner with the same behavior, push for the cleaner version.
|
|
25
|
+
|
|
26
|
+
## What to flag, and the remedy to propose
|
|
27
|
+
|
|
28
|
+
Flag these aggressively, and any change that makes the surrounding code harder to reason about, even when the code works:
|
|
29
|
+
|
|
30
|
+
| Smell | Remedy |
|
|
31
|
+
|---|---|
|
|
32
|
+
| The PR pushes a file from under 1000 lines to over 1000 | Ask whether to decompose first into helpers, subcomponents, modules or local abstractions. Accept only for a compelling structural reason, with the file still well organized. |
|
|
33
|
+
| Ad-hoc conditionals, special cases, one-off booleans, nullable modes or flags in unrelated or busy flows. Narrow edge cases in the middle of a busy function. "Temporary" branches. | A design problem, not a nit. Reframe the state model so the conditionals disappear, not only move to one place. Make the special case part of a simpler default flow. Else move it behind its own abstraction, helper, state machine, policy object or module. |
|
|
34
|
+
| Repeated conditionals or condition chains | A typed model or an explicit dispatcher. |
|
|
35
|
+
| Copy-pasted logic or duplicate branches | Extract a helper or pure function. Collapse into one flow. |
|
|
36
|
+
| Hacky, brittle or "magic" behavior. Generic mechanisms that hide simple data-shape assumptions. | Direct, boring code. |
|
|
37
|
+
| Thin wrappers, identity abstractions, pass-through helpers | Delete the layer. |
|
|
38
|
+
| Unnecessary optionality, `unknown`, `any`, casts, loose ad-hoc objects. A silent fallback over an unclear invariant. | Explicit typed models or shared contracts, so the control flow gets simpler. |
|
|
39
|
+
| Feature logic in shared paths. Implementation details leaking through APIs. Logic in the wrong file, layer or package. | Move it to the layer that owns the concept, so the feature extends an existing abstraction. |
|
|
40
|
+
| A bespoke helper where a canonical utility exists | Reuse the canonical helper. |
|
|
41
|
+
| A module that became more coupled, stateful or hard to scan. Orchestration mixed with business logic. | Split into focused modules. Separate orchestration from business logic. |
|
|
42
|
+
| Independent work run in sequence for no good reason | Run it in parallel when that also simplifies the orchestration. |
|
|
43
|
+
| Related updates that can leave state half-applied | A more atomic flow. |
|
|
44
|
+
|
|
45
|
+
Flag orchestration only when the cleaner structure is obvious. Do not over-index on micro-optimizations.
|
|
46
|
+
|
|
47
|
+
## Tone
|
|
48
|
+
|
|
49
|
+
- Be direct, serious and demanding. Do not be rude.
|
|
50
|
+
- Do not soften a major maintainability issue into a mild suggestion. If the code makes the codebase messier, or missed a substantial simplification, say so.
|
|
51
|
+
- Examples:
|
|
52
|
+
- `this pushes the file past 1k lines. can we decompose this first?`
|
|
53
|
+
- `this adds another special-case branch into an already busy flow. can we move this behind its own abstraction?`
|
|
54
|
+
- `this works, but it makes the surrounding code more spaghetti. let's keep the behavior and restructure the implementation.`
|
|
55
|
+
- `why does this need a cast / optional here? can we make the boundary more explicit instead?`
|
|
56
|
+
- `i think there's a code-judo move here that makes this much simpler. can we reframe this so these branches disappear?`
|
|
57
|
+
|
|
58
|
+
## Output
|
|
59
|
+
|
|
60
|
+
Order findings:
|
|
61
|
+
|
|
62
|
+
1. Structural regressions
|
|
63
|
+
2. Missed dramatic simplifications (code judo)
|
|
64
|
+
3. Spaghetti and branching growth
|
|
65
|
+
4. Boundary, abstraction and type-contract problems
|
|
66
|
+
5. File size and decomposition
|
|
67
|
+
6. Modularity and abstraction
|
|
68
|
+
7. Legibility and maintainability
|
|
69
|
+
|
|
70
|
+
Give a small number of high-conviction comments. When larger structural issues exist, leave out low-value nits.
|
|
71
|
+
|
|
72
|
+
## Approval bar
|
|
73
|
+
|
|
74
|
+
Correct behavior alone does not earn approval. Approve only when the diff has none of these:
|
|
75
|
+
|
|
76
|
+
- a clear structural regression
|
|
77
|
+
- a missed, visible path to a dramatically simpler implementation
|
|
78
|
+
- unjustified file-size growth
|
|
79
|
+
- spaghetti growth from special-case branching
|
|
80
|
+
- a hacky or magic abstraction
|
|
81
|
+
- wrapper, cast or optionality churn that hides the design
|
|
82
|
+
- a clear boundary leak, or avoidable duplication of a canonical helper
|
|
83
|
+
- a missed obvious decomposition that would materially help maintainability
|
|
84
|
+
|
|
85
|
+
These block unless the author justifies them with evidence:
|
|
86
|
+
|
|
87
|
+
- incidental complexity kept when a plausible code-judo move would delete it
|
|
88
|
+
- a file pushed from under 1000 lines to over 1000
|
|
89
|
+
- ad-hoc branching that tangles an existing flow
|
|
90
|
+
- a local problem solved by scattering feature conditionals across shared code
|
|
91
|
+
- an unnecessary abstraction, wrapper or cast-heavy contract
|
|
92
|
+
- a duplicated helper, or logic in the wrong layer, when a clear canonical home exists
|
|
93
|
+
|
|
94
|
+
When the bar is not met, leave explicit, actionable feedback and push for a cleaner decomposition.
|
|
95
|
+
|
|
96
|
+
## Verdict
|
|
97
|
+
|
|
98
|
+
Make the first line of the report the verdict, in exactly this form, with the short sha of the head commit you reviewed (`git rev-parse --short=8 HEAD`):
|
|
99
|
+
|
|
100
|
+
- `Verdict: APPROVE at <sha>` when the diff meets the approval bar.
|
|
101
|
+
- `Verdict: CHANGES at <sha>` when it does not.
|
|
102
|
+
|
|
103
|
+
A PR gate can read the verdict from the first line of a posted report, and it reads only that line. Put nothing before the verdict.
|
|
@@ -1,98 +1,74 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: thermonuclear-deep-review
|
|
3
|
-
description:
|
|
3
|
+
description: Use when asked for a thermonuclear or deep review, or for a security and correctness audit of a branch or PR diff. Covers bugs, breaking changes, security issues, developer-experience regressions and feature-gate leaks.
|
|
4
4
|
disable-model-invocation: true
|
|
5
5
|
---
|
|
6
6
|
|
|
7
7
|
# Thermonuclear Deep Review
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
As a security reviewer, audit the changes of the checked-out branch for bugs, regressions and security vulnerabilities. Be rigorous. Report only what the evidence supports.
|
|
10
10
|
|
|
11
|
-
##
|
|
11
|
+
## Scope
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
Report only issues in code that the PR adds or modifies. Exception: unchanged code that consumes behavior the diff changes (check 2). A broken consumer is a defect of this diff, but the diff never shows it.
|
|
14
14
|
|
|
15
|
-
|
|
16
|
-
ONLY report issues related to code that is being ADDED or MODIFIED in this PR.
|
|
17
|
-
Focus on changes in the diff.
|
|
18
|
-
DO NOT report vulnerabilities in existing code that is not being changed.
|
|
19
|
-
EXCEPT where that unchanged code CONSUMES behavior the diff alters — see Downstream Consumer
|
|
20
|
-
Guidelines. An unchanged consumer that silently breaks IS a defect in this diff, and it will
|
|
21
|
-
never appear in the diff itself.
|
|
15
|
+
## Checks
|
|
22
16
|
|
|
23
|
-
|
|
17
|
+
1. **Breakage.** Trace each change through its callers and contracts, across packages and modules.
|
|
18
|
+
2. **Consumers.** For each behavior the diff changes, name its consumers and show that each one still works. Behaviors: log level, status code, exception type, metric or field name, payload shape, identity or uniqueness key, timing, retry, default. Tracing callers does not find consumers, and many are outside the diff, the package or the repository:
|
|
19
|
+
- alert and monitor predicates (a monitor on `status:error` stops when a line goes down to WARNING)
|
|
20
|
+
- log-level contracts, structured-log field names, log-derived metric filters
|
|
21
|
+
- status codes and error-type strings in request logs, webhooks and audit records
|
|
22
|
+
- identity or uniqueness keys that a persistence layer arbitrates on (a new id for an existing row collides with a constraint)
|
|
23
|
+
- dashboards, SLOs, saved queries, downstream parsers
|
|
24
24
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
shape, an identity or uniqueness key, a timing/retry characteristic, a default — name its
|
|
33
|
-
downstream consumers and show each one still works. Consumers routinely live outside the diff,
|
|
34
|
-
outside the package, and outside the repository:
|
|
35
|
-
- alert/monitor predicates (a monitor keyed on `status:error` silently stops firing when a line is
|
|
36
|
-
downgraded to WARNING; the monitor appears nowhere in the diff that disables it)
|
|
37
|
-
- log-level contracts, structured-log field names, log-derived metric filters
|
|
38
|
-
- status codes and error-type strings written to request logs, webhooks, or audit records
|
|
39
|
-
- identity/uniqueness keys that a persistence layer arbitrates on (a fresh id for an existing
|
|
40
|
-
logical row collides against a constraint the diff never mentions)
|
|
41
|
-
- dashboards, SLOs, saved queries, downstream parsers
|
|
42
|
-
If you cannot locate a consumer, say so explicitly rather than assuming none exists.
|
|
43
|
-
A change that removes its own alarm is the highest-severity finding of this class, because it also
|
|
44
|
-
removes the signal that would have caught it.
|
|
45
|
-
|
|
46
|
-
## Breaking Devex Guidelines
|
|
47
|
-
It can be easy to break developers' ability to run / build the code locally. You MUST catch changes that will impact users' developer experience. Some examples (not exhaustive):
|
|
48
|
-
- Modifying how secrets are read / where they are read from
|
|
49
|
-
- Updating environment variable names / adding environment variables
|
|
50
|
-
- Remapping ports / networking
|
|
51
|
-
- Adding scripts that must be run for certain functionality to continue working. Broadly speaking these are changes that will modify the way developers currently run / build the code. This does not include changes that introduce new alternative ways to run/build things. Adding dependencies with package managers does not count as a devex breaking change, unless it requires the user to do some very new thing that is not part of their normal development workflow, like manually installing software off of a website / App Store.
|
|
52
|
-
|
|
53
|
-
## Feature Leak Guidelines
|
|
54
|
-
The codebase might gate features behind feature flags or internal-only checks. Do not allow a gated feature to leak. These leaks can be subtle, so trace the relevant gate and its callers.
|
|
55
|
-
|
|
56
|
-
## Intended Breakage Guidelines
|
|
57
|
-
If a high-risk effect is an intentional, well-constrained change, do not report it as a defect. Report it when the scope or consequences appear unclear, including when a safeguard or feature gate is removed.
|
|
58
|
-
|
|
59
|
-
## Claims in the PR body
|
|
60
|
-
|
|
61
|
-
A safety or correctness claim written in a PR body is a claim like any other, and the only reader who catches a wrong one is the reader told to ATTACK it. Verifying reviewers read the code against the claim and pass; that is what they are for. Attack the body's claims, not only its diff.
|
|
62
|
-
|
|
63
|
-
Two shapes to attack first:
|
|
64
|
-
|
|
65
|
-
- **Neutralization ORDER, not coverage.** Any pipeline that sanitizes and then edits can create what it sanitized. The test is not "did it neutralize everything" but "can any later pass CREATE what was being neutralized".
|
|
66
|
-
- **A severity resting on a third party's formatting is a dependency, not a mitigation.** Rate it as the bet it is, and fix rather than disclose.
|
|
25
|
+
If you cannot find a consumer, say so. Never assume that none exists. A change that removes its own alarm is the highest severity here, because it also removes the signal that would catch it.
|
|
26
|
+
3. **Developer experience.** Find changes to how developers run or build the code locally. Examples: where or how the code reads secrets, new or renamed environment variables, remapped ports or networking. A new script that must run for a feature to keep working is also a change. Not a break: a new alternative way to run or build, or a new package-manager dependency. Exception: a dependency that needs a step outside the usual workflow, such as a manual install from a website or app store, is a break.
|
|
27
|
+
4. **Feature leaks.** Trace each feature flag or internal-only check and its callers. Do not let a gated feature leak.
|
|
28
|
+
5. **Intended breakage.** An intended, well-constrained high-risk effect is not a defect. Report it when its scope or consequences are unclear, or when it removes a safeguard or feature gate.
|
|
29
|
+
6. **PR body claims.** Attack each safety or correctness claim in the PR body, not only the diff. Only a reviewer told to attack a claim finds a wrong one. Attack these first:
|
|
30
|
+
- Order, not coverage: after a pipeline sanitizes, can any later pass create or recreate what the sanitizer neutralized?
|
|
31
|
+
- A severity that relies on a third party's formatting is a dependency, not a mitigation. Rate it as that bet, and fix it, do not only disclose it.
|
|
67
32
|
|
|
68
33
|
## Security Guidelines
|
|
69
34
|
|
|
70
|
-
For each row whose surface the diff touches, answer with a file:line citation.
|
|
35
|
+
For each row whose surface the diff touches, answer with a file:line citation.
|
|
71
36
|
|
|
72
37
|
| Tag | If the diff touches… | Answer, with file:line |
|
|
73
38
|
| --- | --- | --- |
|
|
74
39
|
| `authz` | an authorization or refusal check, or a new route, command, or tool | who may call it, who may not, where the diff enforces that, and what the unauthorized caller gets |
|
|
75
40
|
| `secret` | a token, grant, secret file, credential helper, or its lifetime | what widened: who can read it, for how long, in which process |
|
|
76
|
-
| `untrusted-input` | a subprocess, argv, path, template, or query built from text an outside party controls (an issue body, a PR comment, a webhook payload, model output) | the boundary that neutralizes it, and whether any later pass can re-create what
|
|
41
|
+
| `untrusted-input` | a subprocess, argv, path, template, or query built from text an outside party controls (an issue body, a PR comment, a webhook payload, model output) | the boundary that neutralizes it, and whether any later pass can re-create what it neutralized (order, not coverage) |
|
|
77
42
|
| `prompt` | a prompt that embeds untrusted text into an agent's instructions | what delimits the untrusted region, and what the agent may do if it obeys that text (OWASP LLM01 prompt injection, LLM06 excessive agency) |
|
|
78
43
|
| `supply-chain` | a dependency, lockfile, base image, or GitHub Action | the version, the pin (a digest or a SHA checked against its tag), and the permissions the workflow runs with |
|
|
79
44
|
| `sandbox` | a sandbox or pod manifest, a capability, or a network policy | which isolation property changed, and against whom |
|
|
80
45
|
| `agent-def` | an agent definition, skill, role prompt, `.omp/` config, or `AGENTS.md` | whether this diff can steer its own reviewers, and why this edit is trustworthy anyway |
|
|
81
|
-
| `transport` | TLS
|
|
46
|
+
| `transport` | TLS or certificate verification, a signature, an HMAC, a randomness source, or a read or write that untrusted input sizes with no bound | what changed, the check or bound it relies on, and the ASVS V11 or V12 identifier it maps to |
|
|
47
|
+
|
|
48
|
+
- Cite an OWASP ASVS v5.0.0 identifier where one applies (`v5.0.0-1.2.5` style).
|
|
49
|
+
- A security finding with no stated exploit path is not a finding. Call it hardening and rank it Minor. A security finding that states an exploit path is always its own finding at its real priority. Never put it in the hardening items.
|
|
50
|
+
- Report at most two hardening items, ranked. Put the rest in one hardening paragraph.
|
|
51
|
+
- Start each security finding with its row's tag, `Security[<tag>]:`, so readers can count findings by row.
|
|
52
|
+
- End the report with one `Security:` line: each touched row's tag and its answer with file:line, or `Security: no sensitive surface in this diff.` when the diff touches none.
|
|
53
|
+
|
|
54
|
+
## Findings
|
|
55
|
+
|
|
56
|
+
- Never misreport priority. Developers who get false High findings stop listening. Trace each issue end to end.
|
|
57
|
+
- Never report a finding with research still open. If you can read the code that settles it, read it. Not: "the client has issue X, but if the backend handles it, this is ok."
|
|
58
|
+
|
|
59
|
+
## Verdict
|
|
60
|
+
|
|
61
|
+
Make the first line of the report the verdict, in exactly this form, with the short sha of the head commit you reviewed (`git rev-parse --short=8 HEAD`):
|
|
82
62
|
|
|
83
|
-
|
|
63
|
+
- `Verdict: CHANGES at <sha>` when the report has a finding that the author must fix before merge.
|
|
64
|
+
- `Verdict: APPROVE at <sha>` when it has none. Hardening items alone do not block.
|
|
84
65
|
|
|
85
|
-
|
|
86
|
-
If you report issues as High priority when they are not in fact high priority / meaningful issues, devs will lose trust in you and stop listening to you over time.
|
|
87
|
-
Never misreport priority or importance. Trace issues end to end and report only what the evidence supports.
|
|
66
|
+
A PR gate can read the verdict from the first line of a posted report, and it reads only that line. Put nothing before the verdict.
|
|
88
67
|
|
|
89
|
-
|
|
90
|
-
IF you have medium-to-high priority / risk findings, and there is a PR for this branch, then check the PR/MR discussion using gh/glab cli to see if there are comments from BugBot or others present.
|
|
91
|
-
If so, take their findings into account. If they found issues you missed, evaluate them to determine if they are valid and include them in your report. If they found some of the same issues you did, see if there is anything from their findings that are worth incorporating into your response.
|
|
92
|
-
Flag issues found by BugBot or others in the PR/MR discussion that you include in your report.
|
|
68
|
+
## PR discussion
|
|
93
69
|
|
|
70
|
+
Only after your independent audit, and only when you have Medium-to-High findings and the branch has a PR:
|
|
94
71
|
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
- Be rigorous, careful, and specific about what the evidence supports.
|
|
72
|
+
1. Read the PR/MR discussion with `gh` or `glab` for comments from BugBot or others.
|
|
73
|
+
2. Check their findings. Include the valid ones you missed, and add what is useful from the ones you share.
|
|
74
|
+
3. Mark each finding that came from that discussion.
|