@@ -34,14 +34,21 @@ Execute the critic evaluation as follows:
3434 that false positives can be properly logged to long-term memory. If none
3535 exist, notify the user.
3636
37- 2 . ** Acquire Targeted Code Snippets:** For each finding where ` status ` is
37+ 2 . ** Evaluate Global Repository Intent:** Read ` workspace/kb/THREAT_MODEL.md `
38+ (if it exists). Check the ** Deployment Intent** section. If the threat model
39+ explicitly states the entire repository is exclusively a tutorial, sample
40+ project, or test suite (e.g., ` Intent: SAMPLE_OR_TEST_ONLY ` ), you MUST mark
41+ all findings as ** ` SAMPLE_OR_TEST ` ** regardless of where they are located in
42+ the file structure, and skip the remaining per-finding viability checks.
43+
44+ 3 . ** Acquire Targeted Code Snippets:** For each finding where ` status ` is
3845 ` "VALID" ` , read the target file. Read at least ** 15 lines of preceding
3946 context** and ** 15 lines of succeeding context** around the designated line
4047 numbers. This targeted window is necessary to analyze surrounding structures
4148 and macro definitions. (Skip this and the following evaluation steps for
4249 ` "FALSE POSITIVE" ` findings).
4350
44- 3 . ** Evaluate Domain-Specific Viability Constraints:**
51+ 4 . ** Evaluate Domain-Specific Viability Constraints:**
4552
4653 - ** For Memory Safety Flaws:** Locate the allocation source of the
4754 affected buffer. Determine if it is allocated with safety margins or
@@ -52,7 +59,7 @@ Execute the critic evaluation as follows:
5259 deployments. If the flaw relies on a debug-only backdoor, a mock
5360 authentication provider, or a test-only route, mark it ** NON_VIABLE** .
5461
55- 4 . ** Check Critical Non-Viable Criteria:** Mark a finding as ** NON_VIABLE** if
62+ 5 . ** Check Critical Non-Viable Criteria:** Mark a finding as ** NON_VIABLE** if
5663 it meets any of the following criteria to ensure we do not waste patching
5764 resources on unreachable or compiled-out code:
5865
@@ -65,37 +72,42 @@ Execute the critic evaluation as follows:
6572 - ** Debug-Only Features:** Security flaws that exist inside files or
6673 sections conditionally compiled with debug flags (e.g. ` #ifdef DEBUG ` )
6774 are NON_VIABLE.
68- - ** Harnesses & Mocks:** Issues residing in the helper configurations of
69- testing libraries, fuzzing suites, or validation frameworks rather than
70- the production library core are NON_VIABLE.
71-
72- 5 . ** Token-Optimized File Updates:** To minimize LLM output tokens, ** do not
75+ - ** Harnesses, Mocks, & Examples:** Issues residing in example code, test
76+ suites, fuzzing harnesses, or validation frameworks are technically not
77+ deployed to production. However, because developers often copy sample
78+ code, these should NOT be marked NON_VIABLE. Instead, mark them as
79+ ** SAMPLE_OR_TEST** so the pipeline can properly adjust their risk
80+ severity.
81+
82+ 6 . ** Token-Optimized File Updates:** To minimize LLM output tokens, ** do not
7383 re-emit or manually rewrite the entire JSON object in your output.**
7484 Instead, use in-place editing tools (like a short script in your preferred
7585 language, or ` jq ` ) to programmatically append the new fields to the existing
7686 ` workspace/findings/<id>.json ` file.
7787
7888 You must append the following to the existing object:
7989
80- - A ` "production_viability" ` field (either ` "VIABLE" ` or ` "NON_VIABLE" ` ).
90+ - A ` "production_viability" ` field (` "VIABLE" ` , ` "NON_VIABLE" ` , or
91+ ` "SAMPLE_OR_TEST" ` ).
8192 - A ` "critic_reasoning" ` field explaining your evaluation.
8293 - An entry to the ` "history" ` array:
8394
8495 ``` json
8596 {
8697 "stage" : " critic" ,
8798 "action" : " evaluated" ,
88- "details" : " Determined production viability as [VIABLE/NON_VIABLE] because [reason]"
99+ "details" : " Determined production viability as [VIABLE/NON_VIABLE/SAMPLE_OR_TEST ] because [reason]"
89100 }
90101 ```
91102
92- 6 . **Append to Long-Term Memory:** For each finding you loaded (including both
93- `NON_VIABLE` ones and `FALSE POSITIVE`s), append a single structured JSON
94- line to a workspace database file named `learnings.jsonl` (using append
95- mode). This ensures false positives and non-viable paths are remembered
96- across runs, helping the strategist avoid re-scanning them.
103+ 7 . **Append to Long-Term Memory:** For each finding you loaded (including
104+ `NON_VIABLE`, `SAMPLE_OR_TEST`, and `FALSE POSITIVE`s), append a single
105+ structured JSON line to a workspace database file named `learnings.jsonl`
106+ (using append mode). This ensures false positives and non-viable paths are
107+ remembered across runs, helping the strategist avoid re-scanning them.
97108
98109 - **Memory Entry Format:** `{"title": "[finding_title]", "code_paths":
99- [" [path1:line1]" ], "status" : " [NON_VIABLE / FALSE_POSITIVE / VIABLE]" }`
110+ [" [path1:line1]" ], "status" : "[NON_VIABLE / SAMPLE_OR_TEST /
111+ FALSE_POSITIVE / VIABLE]"}`
100112
101113When complete, notify the user.
0 commit comments