@juicesharp/rpiv-pi 0.8.0 → 0.8.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@juicesharp/rpiv-pi",
3
- "version": "0.8.0",
3
+ "version": "0.8.2",
4
4
  "description": "Skill-based development workflow for Pi Agent — discover, research, design, plan, implement, validate",
5
5
  "keywords": [
6
6
  "pi-package",
@@ -111,21 +111,33 @@ Spawn these agents in parallel using the Agent tool. Each receives the `## Disco
111
111
  [paste Discovery Map verbatim]
112
112
 
113
113
  Task: Grep each changed hunk for the following sink patterns and list every match with `file:line` + surrounding 3 lines. Cross-reference the Discovery Map's Auth-boundary crossings.
114
+ For each hit, additionally return `confidence: N/10` reflecting how certain you are that a user-controlled input can reach this sink under current deployment. Do NOT report hits with confidence < 8.
114
115
  - Command execution: `exec(`, `execSync(`, `execFile(`, `child_process`, `spawn(`
115
116
  - Dynamic evaluation: `eval(`, `new Function(`
116
117
  - SQL template-interpolation: multi-line `` `SELECT ... ${ ``, `` `INSERT ... ${ ``, `` `UPDATE ... ${ ``, `` `DELETE ... ${ ``
117
118
  - XSS sinks: `innerHTML =`, `dangerouslySetInnerHTML`, `document.write(`
118
119
  - Path traversal: string concatenation into `fs.readFile`, `fs.writeFile`, `path.join` with user input
119
- - SSRF: `fetch(`, `http.request(`, `axios(`, `got(` with user-controlled origin
120
+ - SSRF: `fetch(`, `http.request(`, `axios(`, `got(` where HOST or PROTOCOL (not just path) is user-controlled
120
121
  - Secrets in diff: `api_key`, `secret`, `password`, `BEGIN PRIVATE KEY`, `.env` content literal
121
- - Missing hardening: auth-boundary crossings without a guard upstream; rate-limit-free POST handlers
122
+ - Missing auth guard: auth-boundary crossings (from Discovery Map) reaching a traced sink without an upstream guard
123
+
124
+ Hard exclusions — do NOT report:
125
+ - DOS / resource exhaustion / rate limiting / memory or CPU exhaustion
126
+ - Missing hardening in isolation (no traced sink), lack of audit logs
127
+ - Theoretical race conditions / timing attacks without a concrete reproducer
128
+ - Log spoofing, prototype pollution, tabnabbing, open redirects, XS-Leaks, regex DOS, regex injection
129
+ - Client-side-only authn/authz gaps (server is the authority)
130
+ - XSS in React/Angular/tsx files unless via `dangerouslySetInnerHTML`, `bypassSecurityTrustHtml`, or equivalent
131
+ - Findings whose sole source is an environment variable, CLI flag, or UUID (trusted in our threat model)
132
+ - Findings in test-only files or `.ipynb` notebooks without a concrete untrusted-input path
133
+ - Outdated-dependency CVEs (handled by the dependencies/CVE lens)
122
134
 
123
135
  For each hit, name the pattern and quote the line. Return evidence only. No CVE lookups — that is a separate agent.
124
136
  ```
125
137
 
126
138
  **Dependencies lens:**
127
139
  - subagent_type: `codebase-analyzer`
128
- - Prompt (only when `ManifestChanged` is true; otherwise SKIP and set `dependency_issues: 0`, `passes: [quality, security]`):
140
+ - Prompt (only when `ManifestChanged` is true; otherwise SKIP this lens and omit the `### Dependencies` H3 block from the artifact):
129
141
  ```
130
142
  Known Context:
131
143
  [paste Discovery Map verbatim]
@@ -174,9 +186,9 @@ Spawn these agents in parallel using the Agent tool. Each receives the `## Disco
174
186
  - 🔵 Suggestion: pattern divergence with a concrete nearby template.
175
187
  - 💭 Discussion: composite-lesson architecture concerns.
176
188
  - Security evidence → classify:
177
- - 🔴 sink hit with user-reachable exploitability (trace via Discovery Map auth-boundary crossings).
178
- - 🟡 missing hardening (rate-limit, weak hash, non-constant-time compare).
179
- - 🔵 pattern divergence from secure examples in the same file.
189
+ - 🔴 sink hit with a CONCRETE user-reachable source→sink path traced through Discovery Map auth-boundary crossings. Reject any hit lacking an explicit trace.
190
+ - 🟡 crypto-only concrete issues: weak hash in an auth/integrity role (MD5/SHA1), non-constant-time compare on secrets, hardcoded key material in diff. Do NOT use 🟡 for "missing hardening".
191
+ - 🔵 pattern divergence from a secure example in the SAME file (cite the nearby secure `file:line`).
180
192
  - 💭 architectural question.
181
193
  - Dependencies evidence → classify:
182
194
  - 🔴 Known-exploitable CVE in a touched dep (Critical/High per advisory DB) OR lockstep-contract violation (would trip `scripts/sync-versions.js`).
@@ -188,11 +200,8 @@ Spawn these agents in parallel using the Agent tool. Each receives the `## Disco
188
200
  2. **Probe advisor availability** — attempt a probe by checking whether `advisor` is in the active tool set (main-thread visibility). If yes, proceed to advisor path; otherwise take the inline path.
189
201
 
190
202
  3. **Advisor path** (when advisor is active):
191
- - Print a main-thread `## Pre-Adjudication Findings` block containing the compiled evidence and tentative severity map. This ensures the findings are persisted into `getBranch()` before the advisor call.
192
- - Call `advisor()` (zero-param). Wait for the response.
193
- - On success: paste the advisor's prose verbatim into the artifact's `## Advisor Adjudication` section (Step 6) and note `advisor_used: true` + `advisor_model: [model-id]` in frontmatter.
194
- - On `"aborted"` or empty text: set `advisor_used: false`, skip the adjudication section, fall through to the inline path.
195
- - On `"error"`: note the error inline in the adjudication section as `advisor error: <message>`; continue with inline reconciliation alongside.
203
+ - Print a main-thread `## Pre-Adjudication Findings` block first the advisor reads `getBranch()`, so evidence must be flushed before the call.
204
+ - Call `advisor()` (zero-param). If it returns usable prose, paste it verbatim into `## Advisor Adjudication` and skip the inline path. Otherwise fall through.
196
205
 
197
206
  4. **Inline path** (advisor unavailable or errored):
198
207
  - Run a dimension-sweep modeled on `skills/design/SKILL.md:83-116`: Data model / API surface / Integration / Scope / Verification / Performance.
@@ -214,7 +223,7 @@ Quality: [C🔴/I🟡/S🔵/D💭]
214
223
  Security: [C/I/S/D]
215
224
  Dependencies: [C/I/S/D | not-applicable]
216
225
  Precedents: [N composite lessons, top: "[one-line]"]
217
- Advisor: [used (model) | unavailable]
226
+ Advisor: [adjudicated | inline]
218
227
  ```
219
228
 
220
229
  Wait for the developer's response. Then ask **one question at a time**, waiting for each answer.
@@ -249,16 +258,9 @@ branch: [Branch]
249
258
  commit: [Short hash]
250
259
  review_type: [commit|pr|staged|working]
251
260
  scope: "[What was reviewed]"
252
- files_changed: [N]
253
261
  critical_issues: [Count across all lenses]
254
262
  important_issues: [Count]
255
263
  suggestions: [Count]
256
- quality_issues: [Count]
257
- security_issues: [Count]
258
- dependency_issues: [Count | 0 when not-applicable]
259
- passes: [quality, security, dependencies] # omit dependencies when not-applicable
260
- advisor_used: [true|false]
261
- advisor_model: [provider:id] # only when advisor_used is true
262
264
  status: [approved|needs_changes|requesting_changes]
263
265
  tags: [code-review, relevant-components]
264
266
  last_updated: [YYYY-MM-DD]
@@ -299,7 +301,7 @@ last_updated_by: [User]
299
301
  - `file:line` — [architectural question]
300
302
 
301
303
  ### Dependencies
302
- (Omit this H3 block entirely when `passes` excludes `dependencies`.)
304
+ (Omit this H3 block entirely when the Dependencies lens was skipped — i.e., `ManifestChanged` was false.)
303
305
  #### 🔴 Critical
304
306
  - `dep@ver` (`package.json:line`) — [CVE id + link + affected-range + fix version]
305
307
  #### 🟡 Important
@@ -325,8 +327,8 @@ last_updated_by: [User]
325
327
  [Links to thoughts/ docs referenced by precedent-locator; one line each, no summaries.]
326
328
 
327
329
  ## Advisor Adjudication
328
- (Omit when `advisor_used: false`.)
329
- [Advisor model prose pasted VERBATIM. Do not edit or paraphrase. If `advisor error:` prefix is present, leave it as-is.]
330
+ (Omit this H2 entirely when the advisor did not run — its presence IS the signal that adjudication occurred.)
331
+ [Advisor model prose pasted VERBATIM. Do not edit or paraphrase.]
330
332
 
331
333
  ## Reconciliation Notes
332
334
  (Include only when the inline path ran, OR when developer dispute in Step 5 moved a severity.)
@@ -343,7 +345,7 @@ Review written to:
343
345
  `thoughts/shared/reviews/[filename].md`
344
346
 
345
347
  [C] critical, [I] important, [S] suggestions across [Q] quality, [Se] security, [D] dependency issues.
346
- Advisor: [used (model) | unavailable]
348
+ Advisor: [adjudicated | inline]
347
349
  Status: [verdict]
348
350
 
349
351
  Top items:
@@ -366,6 +368,7 @@ Ask follow-ups, or run `/skill:revise` to address the findings.
366
368
  - **Always use parallel Agent tool calls** in Phase-2 to maximise efficiency.
367
369
  - **Always read the full diff FIRST** (Step 1) before spawning any Phase-1 or Phase-2 agent.
368
370
  - **Always pass the Discovery Map inline** as `Known Context` to every Phase-2 agent — agents are `isolated: true` and cannot see sibling transcripts.
371
+ - **Security-lens precision stance**: prefer false negatives over false positives. Security evidence must carry `confidence ≥ 8` and 🔴 requires an explicit source→sink trace. Missing hardening without a traced sink is NOT a finding. Keep the Security-lens exclusion list in sync with the reference FP-filter precedents.
369
372
  - **Critical ordering**: Follow the numbered steps exactly.
370
373
  - ALWAYS resolve scope and bail on empty diff (Step 1) before Phase-1.
371
374
  - ALWAYS wait for Phase-1 completion before Phase-2 dispatch.