@sjawhar/pi-legion 0.0.0 → 8.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +74 -0
- package/agents/deep-worker.md +64 -0
- package/agents/oracle.md +38 -0
- package/agents/plan-gap-analyst.md +59 -0
- package/agents/plan-reviewer.md +61 -0
- package/agents/thermonuclear-code-quality.md +28 -0
- package/agents/thermonuclear-deep-review.md +28 -0
- package/dist/THIRD_PARTY_NOTICES +30 -0
- package/dist/legion.js +16807 -0
- package/dist/skills/ce-simplify-code/LICENSE +21 -0
- package/dist/skills/ce-simplify-code/SKILL.md +64 -0
- package/dist/skills/ce-simplify-code/references/personas/code-quality-reviewer.md +17 -0
- package/dist/skills/ce-simplify-code/references/personas/code-reuse-reviewer.md +7 -0
- package/dist/skills/ce-simplify-code/references/personas/efficiency-reviewer.md +11 -0
- package/dist/skills/legion-architect/SKILL.md +370 -0
- package/dist/skills/legion-controller/SKILL.md +419 -0
- package/dist/skills/legion-oracle/SKILL.md +74 -0
- package/dist/skills/legion-retro/SKILL.md +196 -0
- package/dist/skills/legion-worker/SKILL.md +482 -0
- package/dist/skills/legion-worker/references/cleanup-deletion.md +22 -0
- package/dist/skills/legion-worker/references/conflicts-and-rewrites.md +126 -0
- package/dist/skills/legion-worker/references/merge-gate.md +117 -0
- package/dist/skills/legion-worker/references/pr-body.md +146 -0
- package/dist/skills/legion-worker/references/review-threads.md +101 -0
- package/dist/skills/legion-worker/references/systematic-rename.md +19 -0
- package/dist/skills/thermonuclear-code-quality/LICENSE +21 -0
- package/dist/skills/thermonuclear-code-quality/SKILL.md +192 -0
- package/dist/skills/thermonuclear-deep-review/LICENSE +21 -0
- package/dist/skills/thermonuclear-deep-review/SKILL.md +98 -0
- package/package.json +43 -1
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: thermonuclear-deep-review
|
|
3
|
+
description: Comprehensive security and correctness audit of a branch's changes. Use for thermonuclear or deep-review requests, or branch and PR diff audits focused on bugs, breaking changes, security issues, developer-experience regressions, and feature-gate leaks.
|
|
4
|
+
disable-model-invocation: true
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Thermonuclear Deep Review
|
|
8
|
+
|
|
9
|
+
Use this skill for a comprehensive security and correctness audit of a checked-out branch.
|
|
10
|
+
|
|
11
|
+
## Prompt
|
|
12
|
+
|
|
13
|
+
You are a security reviewer performing a comprehensive review of a checked-out branch. Audit its changes for bugs, regressions, and security vulnerabilities. Be rigorous, careful, and evidence-led.
|
|
14
|
+
|
|
15
|
+
# Scope
|
|
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.
|
|
22
|
+
|
|
23
|
+
# Guidelines
|
|
24
|
+
|
|
25
|
+
## Breaking Functionality Guidelines
|
|
26
|
+
This is a complex codebase with many cross-package and module dependencies. Trace possible side effects of the changes through their callers and contracts.
|
|
27
|
+
|
|
28
|
+
## Downstream Consumer Guidelines
|
|
29
|
+
A diff cannot show you what depends on the behavior it changes, and "trace the callers" does not
|
|
30
|
+
cover it: nothing *calls* a log line, but a monitor predicate consumes it. For EVERY behavior the
|
|
31
|
+
diff alters — a log level, a status code, an exception type, a metric or field name, a payload
|
|
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.
|
|
67
|
+
|
|
68
|
+
## Security Guidelines
|
|
69
|
+
|
|
70
|
+
For each row whose surface the diff touches, answer with a file:line citation. End your 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.
|
|
71
|
+
|
|
72
|
+
| Tag | If the diff touches… | Answer, with file:line |
|
|
73
|
+
| --- | --- | --- |
|
|
74
|
+
| `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
|
+
| `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 was neutralized (order, not coverage) |
|
|
77
|
+
| `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
|
+
| `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
|
+
| `sandbox` | a sandbox or pod manifest, a capability, or a network policy | which isolation property changed, and against whom |
|
|
80
|
+
| `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/certificate verification, a signature, HMAC, or randomness source, or an unbounded read/write sized by untrusted input | what changed, the check or bound it relies on, and the ASVS V11/V12 identifier it maps to |
|
|
82
|
+
|
|
83
|
+
Cite an OWASP ASVS v5.0.0 identifier where one applies (`v5.0.0-1.2.5` style). 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 folded into hardening. Report at most two hardening items, ranked, and fold the rest into one hardening paragraph. Start each security finding with its row's tag, `Security[<tag>]:`, so it can be told from the others and counted by row.
|
|
84
|
+
|
|
85
|
+
## Over-reporting Guidelines
|
|
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.
|
|
88
|
+
|
|
89
|
+
# Final Response
|
|
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.
|
|
93
|
+
|
|
94
|
+
|
|
95
|
+
# Critical Rules
|
|
96
|
+
- NEVER present issues with unfinished research. E.g. Never say something like, "The client has issue X, but if handled in the backend then this is ok." if you have access to the backend code and can check for yourself.
|
|
97
|
+
- Wait to check PR discussion until after the independent audit so fresh evidence drives the review.
|
|
98
|
+
- Be rigorous, careful, and specific about what the evidence supports.
|
package/package.json
CHANGED
|
@@ -1 +1,43 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"name": "@sjawhar/pi-legion",
|
|
3
|
+
"version": "8.0.0",
|
|
4
|
+
"license": "Apache-2.0",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"omp": {
|
|
7
|
+
"extensions": [
|
|
8
|
+
"dist/legion.js"
|
|
9
|
+
],
|
|
10
|
+
"skills": [
|
|
11
|
+
"dist/skills"
|
|
12
|
+
]
|
|
13
|
+
},
|
|
14
|
+
"legion": {
|
|
15
|
+
"daemonApiVersion": 14
|
|
16
|
+
},
|
|
17
|
+
"repository": {
|
|
18
|
+
"type": "git",
|
|
19
|
+
"url": "https://github.com/sjawhar/legion"
|
|
20
|
+
},
|
|
21
|
+
"files": [
|
|
22
|
+
"dist",
|
|
23
|
+
"agents"
|
|
24
|
+
],
|
|
25
|
+
"scripts": {
|
|
26
|
+
"build": "bun build extensions/legion.ts --outdir dist --target bun --format esm --external @oh-my-pi/pi-coding-agent --external @oh-my-pi/pi-tui --external @oh-my-pi/pi-utils",
|
|
27
|
+
"prepack": "../../scripts/pi-plugin-prepack.sh",
|
|
28
|
+
"postpack": "rm -rf dist/skills",
|
|
29
|
+
"typecheck": "bunx tsc --noEmit",
|
|
30
|
+
"test": "bun test",
|
|
31
|
+
"lint": "bunx biome lint extensions/ src/"
|
|
32
|
+
},
|
|
33
|
+
"devDependencies": {
|
|
34
|
+
"@biomejs/biome": "^2.3.14",
|
|
35
|
+
"@legion/contracts": "0.10.0",
|
|
36
|
+
"@legion/envoy-client": "0.1.0",
|
|
37
|
+
"@legion/pi-shared": "0.1.0",
|
|
38
|
+
"@oh-my-pi/pi-utils": "^18.1.15",
|
|
39
|
+
"@types/bun": "latest",
|
|
40
|
+
"typescript": "^5.3.0",
|
|
41
|
+
"zod": "4.3.6"
|
|
42
|
+
}
|
|
43
|
+
}
|