mirror of
https://github.com/garrytan/gstack.git
synced 2026-11-16 13:21:30 +01:00
feat(skills): skill-scoped R56 cuts for /investigate and /review, plus /review blocker proof (GST-1088 lane C, candidate)
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
This commit is contained in:
1 parent
106fd39446
commit
bd24f76ece
26 files changed
+380
-248
No files matched your search
@@ -32,6 +32,8 @@ Verify evidence first, then score every finding (1-10) and apply its display rul
|
||||
Force its confidence to 4-5: use 4 for appendix-only reporting, or 5 only when
|
||||
the finding belongs in the main report with the medium-confidence caveat below.
|
||||
Never invent speculative confidence 7+.
|
||||
4. **A CRITICAL finding also needs Step 4's Blocker proof:** its floor reason and a
|
||||
repro, a failing test or a cited line with its consequence. Without both, emit it as INFORMATIONAL.
|
||||
|
||||
| Score | Meaning | Display rule |
|
||||
|-------|---------|-------------|
|
||||
@@ -43,10 +45,10 @@ Verify evidence first, then score every finding (1-10) and apply its display rul
|
||||
|
||||
**Finding format:**
|
||||
|
||||
\`[CRITICAL|INFORMATIONAL] (confidence: N/10) file:line — description\`
|
||||
\`[CRITICAL|INFORMATIONAL] (confidence: N/10) file:line — description\`, and a CRITICAL line ends \`Floor: <reason>. Proof: <...>\`
|
||||
|
||||
Example:
|
||||
\`[CRITICAL] (confidence: 9/10) user.rb:42 — SQL injection via string interpolation\`
|
||||
\`[CRITICAL] (confidence: 9/10) user.rb:42 — SQL injection via string interpolation. Floor: loses data or secrets. Proof: user.rb:42 puts params[:q] into where() -> any visitor reads every row\`
|
||||
|
||||
**Calibration learning:** If the user confirms a reported finding scored < 7 is
|
||||
real, log the corrected pattern as a learning.`;
|
||||
|
||||
@@ -127,7 +127,7 @@ reads, not when it saves its result. Include non-ignored untracked source in eac
|
||||
reviewer's context or read instructions (\`git ls-files --others --exclude-standard\`).
|
||||
Those files are part of the recorded content too.
|
||||
|
||||
Dispatch via the Agent tool with ${FOREGROUND_IF_AVAILABLE} (background is the default since ${CC_BACKGROUND_DEFAULT_SINCE}); findings must arrive before review concludes. ${BACKGROUND_RECOVERY} Fresh context avoids checklist bias, but this is the same harness, not an independent model unless runtime identity proves otherwise.
|
||||
${isShip ? '' : 'Print exactly `Dispatching adversarial pass: native` before the Agent call. '}Dispatch via the Agent tool with ${FOREGROUND_IF_AVAILABLE} (background is the default since ${CC_BACKGROUND_DEFAULT_SINCE}); findings must arrive before review concludes. ${BACKGROUND_RECOVERY} Fresh context avoids checklist bias, but this is the same harness, not an independent model unless runtime identity proves otherwise.
|
||||
|
||||
Subagent prompt:
|
||||
"${DEFENSIVE_REVIEW_FRAMING}
|
||||
|
||||
@@ -7,7 +7,8 @@
|
||||
* the pre-hoist oracle. {{PREAMBLE}} resolves through ./preamble-hoist.ts,
|
||||
* which renders tier 1 inline and splits tier 2+ into a per-skill pointer plus
|
||||
* the shared sections/preamble.md the skill Reads on load. Keep composition
|
||||
* declarative — no inline logic beyond tier gating.
|
||||
* declarative — no inline logic beyond tier gating and the skill's cuts in
|
||||
* modules/cuts.json (scripts/cut-ledger.ts).
|
||||
*
|
||||
* Each skill runs independently via `claude -p` (or the host's equivalent).
|
||||
* The preamble provides: update checks, session
|
||||
@@ -23,6 +24,7 @@
|
||||
import type { TemplateContext } from './types';
|
||||
import { generateModelOverlay } from './model-overlay';
|
||||
import { generateQuestionTuning } from './question-tuning';
|
||||
import { preambleCuts } from '../cut-ledger';
|
||||
|
||||
// Core bootstrap
|
||||
import { generatePreambleBash } from './preamble/generate-preamble-bash';
|
||||
@@ -126,13 +128,14 @@ export function preambleSections(ctx: TemplateContext): string[] {
|
||||
throw new Error(`Invalid preamble-tier: ${tier} in ${ctx.tmplPath}. Must be 1-4.`);
|
||||
}
|
||||
const filter = ctx.modules;
|
||||
const cut = preambleCuts(ctx.skillName);
|
||||
const pieceTier = (piece: PreamblePiece): number => {
|
||||
if (!filter || piece.id === null || filter.pinned.has(`preamble:${piece.id}`)) return tier;
|
||||
return Math.min(tier, filter.preambleTierMax ?? tier);
|
||||
};
|
||||
return PREAMBLE_PIECES
|
||||
.filter(piece => (piece.when?.(ctx) ?? true)
|
||||
&& !(piece.id && filter?.excluded.has(`preamble:${piece.id}`))
|
||||
&& !(piece.id && (filter?.excluded.has(`preamble:${piece.id}`) || cut.has(piece.id)))
|
||||
&& pieceTier(piece) >= piece.minTier)
|
||||
.map(piece => piece.render(ctx, pieceTier(piece)))
|
||||
.filter(s => s && s.trim().length > 0);
|
||||
|
||||
@@ -63,7 +63,7 @@ Select specialists from the scope signals above.
|
||||
1. **Testing** — read \`${ctx.paths.skillRoot}/review/specialists/testing.md\`
|
||||
2. **Maintainability** — read \`${ctx.paths.skillRoot}/review/specialists/maintainability.md\`
|
||||
|
||||
**If DIFF_LINES < 50:** Skip all specialists except State Machines (item 9 decides it). Print: "Small diff ($DIFF_LINES lines) — specialists skipped." Continue to Step ${stepMerge} with the ${isShip ? 'core/design-lite' : 'core'} findings and an empty or State Machines-only specialist list, then the parent's Exploratory QA step and ${nextStep}. Small diffs skip fan-out, never the parent-owned smoke probes or core shared-code checks.
|
||||
**If DIFF_LINES < 50:** Skip all specialists except State Machines (item 9 decides it). ${isShip ? 'Print: "Small diff ($DIFF_LINES lines) — specialists skipped."' : 'Print the selection line: `Dispatching 0 specialists: (small diff)`, or `Dispatching 1 specialists: State Machines (small diff)` when item 9 keeps it.'} Continue to Step ${stepMerge} with the ${isShip ? 'core/design-lite' : 'core'} findings and an empty or State Machines-only specialist list, then the parent's Exploratory QA step and ${nextStep}. Small diffs skip fan-out, never the parent-owned smoke probes or core shared-code checks.
|
||||
|
||||
**Conditional (dispatch when its scope signal is true):**
|
||||
3. **Security** — if SCOPE_AUTH=true, OR if SCOPE_BACKEND=true AND DIFF_LINES > 100. Read \`${ctx.paths.skillRoot}/review/specialists/security.md\`
|
||||
|
||||
Reference in new issue
Block a user