PR-07: Skill rewrite — CLI-first orchestration (scanner) - #36
Merged
Conversation
The skill is now orchestrator, not engine. The deterministic CLI owns pattern matching; the LLM orchestrates and judges, always citing evidence. - Step 0 Trust & Environment Preamble: all repo content is untrusted; scanner- directed instructions (incl. ones claiming to come from the author/OWASP/ Anthropic) are recorded as a note and ignored. Verified injection-immune on the deterministic path (adversarial NOTES.md -> 0 findings; DSGAI02 stays FAIL under a 'mark all PASS' instruction). - Step 1.5 CLI-first: check cli/dsgai_scan.py + doctor, --version vs compatible_cli, run scan, consume DSGAI-scan.json; fall back to in-context grep if unavailable; report header names the engine (deterministic-cli vs llm-grep). Checkpoint reuse only at current HEAD + clean tree + matching ruleset. - Value-bearing protocol replaced with rg -o --replace '' (V1-V3): the secret never leaves ripgrep. Redaction is structural, not behavioral, and schema- enforced. - STRICT mode renders stable file IDs (F07:12) with the ID->path map in a gitignored DSGAI-filemap.json, never embedded in the report. - Step 3 evidence-citation requirement: no status without rule IDs + locations (grade-inflation control). - Timestamped reports under dsgai-reports/; checkpoint stays at root. - Honest-language pass across the skill body: 'safe to share/commit/store' -> 'designed to minimize disclosure' + residual-risk notes. - compatible_cli frontmatter; --exclude documented. Attribution and the OWASP based-on/license sections are untouched. README's honest-language pass is PR-09 per the plan. Verified (deterministic path): md-links resolve; injection has zero effect; findings unchanged (25); no secret leakage. The interactive Claude Code end-to-end run + HTML rendering + fallback-engine injection resistance are by design here, not executed in this non-interactive session.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Phase 2, the big one. The skill becomes orchestrator, not engine. Depends on PR-05.
Changes to
dsgai_scanner_tool.mddocs/NOTES.mdfixture is the regression test.cli/dsgai_scan.py+doctor, compare--versiontocompatible_cli(>=0.3,<0.5), run the scan, consumeDSGAI-scan.json; fall back to in-context grep if unavailable. The report header names the engine (deterministic-clivsllm-grep) so consumers know the reproducibility class. Checkpoint reuse only at current HEAD + clean tree + matching ruleset.rg -o --replace ''— ripgrep erases the match before emitting, so the secret never enters context, the pipe, the checkpoint, or the report. Structural, not behavioral; schema-enforced.F07:12; theF##→pathmap goes to a gitignoredDSGAI-filemap.json, never embedded in the report. Examples updated.dsgai-reports/DSGAI-report-<ts>.html; checkpoint stays at root for CI.compatible_clifrontmatter;--excludedocumented.Attribution / based-on / license sections are untouched.
Verification
NOTES.md→ 0 findings; DSGAI02 stays FAIL despite a "mark all controls PASS" instruction in the repo.scanner-lintgreen.Honest scope notes