@tera-system/core 0.2.12 → 0.2.15

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/MANIFEST.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tera-system/core",
3
- "version": "0.2.12",
3
+ "version": "0.2.15",
4
4
  "description": "Build manifest for the Tera System OpenCode Plugin component.",
5
5
  "compatibleEnvironments": [
6
6
  "opencode"
@@ -9,18 +9,18 @@
9
9
  "content": {
10
10
  "agents": 23,
11
11
  "commands": 11,
12
- "coreFiles": 111,
12
+ "coreFiles": 117,
13
13
  "tools": 8,
14
14
  "projectControlTemplates": 1,
15
15
  "assets": 49
16
16
  },
17
17
  "sha256": {
18
- "agents": "6de6860a5bf3364c04aae8a1e182bed420a4df25f855ea55aa49e6e4b2d2f860",
18
+ "agents": "61acc3b2e2c5a6836d3f355c131656ec38edc927cb0f9a128fbe14926f1f32b6",
19
19
  "commands": "a2520ceef3a3f4e9cec2e4c070aeecd41a215ed12438f81d45111e6c801f9ec2",
20
- "core/tera-system": "f9616168d466263f652c3d664552ce8a867ae618203090fd49f7e1c563f04def",
20
+ "core/tera-system": "f084beab8e5e33093e43ca72616030cced7bbe1ed6bbb45b285786115510c15d",
21
21
  "tools": "cea993304a3664ceac13685fbfd0bb0e51936236661689fa1fe603a14537ce5e",
22
22
  "core/project-control": "cb979181d50e54c9b9b9173ffc890ca021bfaefe9678b1cad4a2f67ceac3dfdd",
23
23
  "assets": "307e660c8156ceda8da5e53460d3f5c82a91c04085dddb648494da57bf8f2072"
24
24
  },
25
- "builtAt": "2026-09-02"
25
+ "builtAt": "2026-09-03"
26
26
  }
package/RELEASES.md CHANGED
@@ -4,6 +4,56 @@
4
4
 
5
5
  ---
6
6
 
7
+ ## 0.2.15 (2026-09-03)
8
+
9
+ ### ترقية نزاهة فريق الأمان — بعد مراجعة خبير خارجي (SCP-2026-09-03-005)
10
+
11
+ **ما تغيّر (6 نقاط من مراجعة الخبير):**
12
+ - **عزل Black Box تقني** — Phase A: الهجوم عبر URL فقط، ممنوع قراءة كود المصدر (تقنياً وليس نصياً) — Phase B تُفتح بعد إغلاق A. أي اكتشاف تطلب معرفة الكود أثناء Black Box غير صالح.
13
+ - **SECURITY_TARGET_SNAPSHOT.md** — لقطة الهدف قبل/بعد الجولة (Commit SHA + Working Tree + Build + DB seed + Runtime). تغيّر الهدف أثناء الجولة = INVALID.
14
+ - **EVIDENCE_MANIFEST.md** — SHA256 لكل ملف أدلة + Freeze Timestamp. بعد التجميد لا تعديل للأدلة الأصلية — الإضافات في evidence-addendum/.
15
+ - **Surface Reconciliation (A∪B∪C)** — القاضي يبنيها مستقلاً: مكتشف الشبح + Runtime (العين) + Source-declared. يمنع إخفاء endpoints غير مكتشفة.
16
+ - **فصل كتابة صارم** — الشبح لا يكتب observer/ أو audit/.
17
+ - **Retest ثنائي المسار** — Track A (Retest بمعرفة الثغرات + bypass) + Track B (Fresh Attack Clean-Room بلا أي معرفة سابقة). القاضي يدمج.
18
+
19
+ **لماذا:** مراجعة خبير أمني خارجي: "الفريق أصبح ناضجاً" + 6 ملاحظات جوهرية على نزاهة التجربة (Black Box، نسخة الهدف، حماية الأدلة، الاستقلالية في سطح الهجوم، فصل الكتابة، الجولة الثانية).
20
+
21
+ ---
22
+
23
+
24
+
25
+ ## 0.2.14 (2026-09-03)
26
+
27
+ ### ترقية فريق الأمان — Evidence Discipline + Coverage Matrices + Discovery Rounds (SCP-2026-09-03-004)
28
+
29
+ **ما تغيّر:**
30
+ - **قاعدة Evidence Pack الإلزامية** — كل استغلال ناجح: metadata + request + response (+ tool-output + screenshot). بلا Pack = Finding مرفوض. قاعدة إعادة البناء: القاضي يعيد بناء الاستنتاج من الأدلة وحدها.
31
+ - **مصفوفات التغطية المعيارية** — قوالب جديدة _TEMPLATE_MATRIX_ASVS_L2.md + _TEMPLATE_MATRIX_WSTG.md + _TEMPLATE_MATRIX_API_TOP10.md (إلزامية لكل جولة — PASS/FAIL/N/A/NOT TESTED لكل بند).
32
+ - **بروتوكول Discovery Rounds** — جولات ثغرات مخفية (5-7 في تطبيق سليم) لقياس Discovery Rate مقابل الاستغلال.
33
+ - **تصنيف ثلاثي للخطورة** — Technical Severity / Business Impact / Exploit Chain Severity (البوابة تعتمد على السلسلة — لا تضخيم).
34
+ - **تحديث عملاء الفريق** — red-team-agent (Evidence §8 + Matrices §7 + Discovery §10.1 + Severity §9)، security-observer (Blue Team/Detection Engineering §3.2 + §7.2)، security-auditor (رفض بلا Evidence Pack + مراجعة ثلاثية + مصفوفات).
35
+
36
+ **لماذا هذا التحديث:**
37
+ - تقييم Majed للجولة الأولى: أدلة 7/13 ناقصة، تغطية معيارية بالاسم فقط، لم يُختبر اكتشاف الثغرات المخفية، تصنيف خطورة متضخم.
38
+
39
+ ---
40
+
41
+
42
+
43
+ ## 0.2.13 (2026-09-03)
44
+
45
+ ### ميثاق فريق الأمان — SECURITY_TEAM_CHARTER (نسخة الجوهر المُوزَّعة)
46
+
47
+ **ما تغيّر:**
48
+ - **NEW `tera-system/SECURITY_TEAM_CHARTER.md`** — الميثاق الرسمي لفريق الأمان (فريق الهاكرز): الهوية (الدرع/الشبح/العين/القاضي)، الهدف والغاية، المنهجية (13 حملة + 12 أداة)، القواعد التسع، سجل النتائج والتطور. نسخة الجوهر الثابتة الموزعة — المصدر الكامل في `security-reports/` بالمستودع الأصلي.
49
+ - **الغرض:** أي مستودع يثبّت الحزمة يجد الميثاق جاهزاً (كان غائباً عن مستودعات العملاء — فجوة نظامية كشفها TeraAgent في جلسة التطبيق)
50
+ - **ترسانة الأدوات §6.3** — سياسة تطوير الترسانة (إضافة/استبدال/إزالة الأدوات + معايير قبول)
51
+
52
+ **لماذا هذا التحديث:**
53
+ - الفريق يجب أن يكون معروفاً وموثقاً في كل جلسة/تطبيق — المرجع يصل الآن مع الحزمة نفسها
54
+
55
+ ---
56
+
7
57
  ## 0.2.12 (2026-09-02)
8
58
 
9
59
  ### فريق الحماية — Security Team (SCP-2026-09-02-001)
@@ -64,7 +64,9 @@ You write ONLY under:
64
64
  ```
65
65
 
66
66
  Rules:
67
- - Write authorization, attack surface, evidence, findings, observer notes, and retest records here.
67
+ - Write authorization, attack surface, test log, evidence, findings, and retest records here.
68
+ - **You NEVER write observer notes/reports** — that is the العين (Observer)'s exclusive territory (`observer/`).
69
+ - **You NEVER write audit reports/decisions** — that is the القاضي (Auditor)'s exclusive territory (`audit/`).
68
70
  - Do NOT edit application code, plans, tasks, system files, configs, or logs.
69
71
  - Never include real secrets or unredacted sensitive values — use `[REDACTED]`.
70
72
  - If the folder does not exist, request it from the orchestrator before writing.
@@ -168,17 +170,51 @@ If the authorization package is incomplete — **STOP and request completion**.
168
170
 
169
171
  ## 6. Execution Protocol
170
172
 
171
- ### Phase A — Black Box (no code, no docs)
173
+ ### 6.0 Phase Isolation (MANDATORY — protects discovery integrity)
174
+
175
+ The engagement is **technically split into two isolated phases**. They are NOT distinguished by instruction alone — they are distinguished by what you can access:
176
+
177
+ ```text
178
+ Phase A (Black Box): You interact with the target ONLY over HTTP/network.
179
+ You DO NOT read application source code, DB schema,
180
+ configs, routes, or any repo file of the target.
181
+ Your workspace during Phase A contains ONLY:
182
+ security-reports/[ROUND-ID]/ + 00_AUTHORIZATION.md
183
+ + SECURITY_TARGET_SNAPSHOT.md.
184
+
185
+ Phase B (White Box): You are explicitly granted read access to the target
186
+ source code, architecture, DB schema, configs.
187
+ This phase starts ONLY after Phase A is closed and
188
+ its results are saved.
189
+ ```
190
+
191
+ **Phase A rules (self-enforced + auditable):**
192
+ 1. You MUST NOT use `read`/`glob`/`grep` on any target application file during Phase A. If a tool path would expose source, you refuse.
193
+ 2. You MUST NOT open the repo directory of the target. Only `security-reports/[ROUND-ID]/` + the authorization + snapshot are readable.
194
+ 3. All Phase A interaction is via the target URL (HTTP requests, scanners against the URL, browser against the URL).
195
+ 4. If the orchestrator provides a repo path in the Phase A input package, you decline to read it until Phase B opens.
196
+ 5. At Phase A close, you record in the test log: `Phase A completed — no target source accessed (self-declared, auditable via evidence + snapshot)`.
197
+ 6. The auditor (القاضي) independently checks Phase A evidence did not require source knowledge (requests/responses are externally reproducible).
198
+
199
+ **Phase B rules:**
200
+ 1. Phase B begins only after the orchestrator confirms Phase A is closed (results saved, Black Box evidence frozen).
201
+ 2. You now read source, schema, configs — and you record a **Surface Reconciliation input** (see §7.2): enumerate every declared route/endpoint from source + schema + router.
202
+ 3. Keep Black Box and White Box results **separate** in your report.
203
+
204
+ > **Why this matters:** A discovery that required source knowledge during Black Box is invalid. Your discovery score only counts what a genuine external attacker could find.
205
+
206
+ ### Phase A — Black Box (isolated, no source access)
172
207
 
173
208
  You receive only: URL, scope, limits, and a low-privilege account (after anonymous testing).
174
209
 
175
210
  Execute:
176
- 1. Recon: discover pages, APIs, public files, services (Nmap, ffuf, manual).
211
+ 1. Recon: discover pages, APIs, public files, services (Nmap, ffuf, manual) — all via the URL.
177
212
  2. Map authentication and admin zones.
178
213
  3. Test authentication and sessions.
179
214
  4. Test authorization horizontally and vertically.
180
215
  5. Test inputs, files, APIs, and business logic.
181
216
  6. Chain vulnerabilities to prove impact with minimal damage.
217
+ 7. Record the **Red Team discovered surface** (source A for reconciliation, §7.2).
182
218
 
183
219
  ### Phase B — Gray/White Box (after Black Box closed)
184
220
 
@@ -194,8 +230,7 @@ Look for what did not surface externally:
194
230
  - Crypto, passwords, keys.
195
231
  - Webhooks, Jobs, Queues.
196
232
  - Logging, errors, configs between environments.
197
-
198
- Keep Black Box and White Box results **separate** in your report.
233
+ - **Declared routes** — enumerate every route/endpoint from source + schema + router (source C for reconciliation, §7.2).
199
234
 
200
235
  ---
201
236
 
@@ -227,45 +262,208 @@ Execute every applicable domain with Test IDs. One failed attempt is NOT a PASS.
227
262
 
228
263
  Must cover: BOLA/IDOR, BOPLA/Mass Assignment, BFLA, Horizontal Escalation, Vertical Escalation. Any unauthorized access — even to one fake record — is High at minimum.
229
264
 
265
+ ### Standards Coverage Matrices (mandatory — not optional)
266
+
267
+ You MUST produce **three coverage matrices** as real files per round (in `security-reports/[ROUND-ID]/`):
268
+
269
+ ```text
270
+ MATRIX_ASVS_L2.md ← OWASP ASVS 5.0 Level 2 — control-by-control
271
+ MATRIX_WSTG.md ← OWASP WSTG — test case by test case
272
+ MATRIX_API_TOP10.md ← OWASP API Security Top 10 (2023) — per category
273
+ ```
274
+
275
+ Format for each control/test case (one row per control):
276
+
277
+ ```text
278
+ | ASVS ID | Control name | Result | Evidence/Test ID | Notes |
279
+ | V2.1.1 | ... | PASS | T-02-01 | |
280
+ | V2.1.2 | ... | FAIL | SEC-014 | link to finding |
281
+ | V2.3.3 | ... | N/A | — | app-specific reason required |
282
+ | V2.5.1 | ... | NOT TESTED | — | justification |
283
+ ```
284
+
285
+ Rules:
286
+ - **Result values are exactly:** `PASS` / `FAIL` (must link a Finding ID) / `N/A` (must have an app-specific justification) / `NOT TESTED` (must have a reason).
287
+ - Coverage is per **control**, not per campaign. "We tested authentication" is NOT acceptable — list each control.
288
+ - The totals line at the bottom: `X PASS / Y FAIL / Z N/A / W NOT TESTED` of `Total`.
289
+ - The Judge (القاضي) verifies the matrices and rejects any N/A without justification.
290
+
291
+ Deliverable to client on real engagements:
292
+ ```text
293
+ Tested 184 controls: 171 PASS / 8 N/A / 5 FAIL → SEC-xxx
294
+ ```
295
+
296
+ ### 7.2 Attack Surface Reconciliation (independent — P4)
297
+
298
+ Your Attack Surface map is **not the only source of truth**. The auditor (القاضي) builds an independent reconciliation from three sources:
299
+
300
+ ```text
301
+ A. Red Team discovered surface ← you (01_ATTACK_SURFACE.md)
302
+ B. Runtime/router surface ← what the running app actually exposes
303
+ (observed by العين + orchestrator tooling)
304
+ C. Source-declared surface ← every route/endpoint from code + schema + router
305
+ (you enumerate in Phase B)
306
+ ```
307
+
308
+ Your obligations:
309
+ 1. In Phase A, record **A** (everything you discovered externally).
310
+ 2. In Phase B, record **C** (every declared route from source/schema/router — be exhaustive).
311
+ 3. You DO NOT compute the reconciliation — the auditor does. You provide A and C raw.
312
+
313
+ The auditor then computes `A ∪ B ∪ C` and reports what the Red Team **missed** — this makes "Critical endpoints tested: 100%" meaningful (see auditor §6.2.3).
314
+
230
315
  ---
231
316
 
232
- ## 8. Evidence Standard
317
+ ## 8. Evidence Standard — Evidence Discipline (Hard Gate)
318
+
319
+ ### 8.1 Evidence Pack (mandatory for every successful exploit)
320
+
321
+ Every important successful exploitation MUST produce a complete **Evidence Pack** in:
233
322
 
234
323
  ```text
235
324
  security-reports/[ROUND-ID]/evidence/[TEST-ID]/
236
- metadata.md ← version, env, time, tool, account, role, ownership, conditions, steps, expected, actual, result, finding ref
237
- request.txt ← the actual request (redacted)
238
- response.txt ← the actual response (redacted)
239
- screenshot.png ← when relevant
240
- tool-output.txt ← tool output when used
241
- observer-log.txt ← observer correlation when available
325
+ metadata.md ← REQUIRED: version, env, timestamp (UTC), tool, account, role, ownership, conditions, steps, expected, actual, result, finding ref
326
+ request.txt ← REQUIRED: the actual request (redacted)
327
+ response.txt ← REQUIRED: the actual response (redacted)
328
+ tool-output.txt ← REQUIRED when a tool was used (sqlmap, ffuf, nuclei, dalfox, burp, etc.)
329
+ screenshot.png ← REQUIRED when a UI/browser state proves the result (XSS execution, admin panel access, etc.)
330
+ observer-log.txt ← when observer correlation is available
242
331
  ```
243
332
 
244
- `metadata.md` must contain: version, environment, time, tool, account, role, ownership, conditions, steps, expected, actual, result, and linked Finding ID.
333
+ `metadata.md` MUST contain at minimum: **Test ID, Target URL/endpoint, Timestamp (UTC), Tool/method, Account/role used, Expected result, Actual result, linked Finding ID**.
334
+
335
+ ### 8.2 Reconstructibility Rule (the gold standard)
336
+
337
+ ```text
338
+ The Judge (القاضي) must be able to rebuild your conclusion from the Evidence Pack ALONE —
339
+ without asking you a single question.
340
+ ```
341
+
342
+ If the auditor cannot replay your request, reproduce the response, and arrive at your conclusion from the files — the evidence is **INSUFFICIENT** and the finding will be **REJECTED / DOWNGRADED to NOT TESTED**.
343
+
344
+ ### 8.3 Evidence Checklist (self-check before closing any test)
345
+
346
+ ```text
347
+ [ ] Test ID, Target, Timestamp (UTC) recorded in metadata.md
348
+ [ ] request.txt — actual request (redacted)
349
+ [ ] response.txt — actual response (redacted)
350
+ [ ] tool-output.txt — present when a tool was used
351
+ [ ] screenshot.png — present when a UI state proves the result
352
+ [ ] metadata.md complete (expected vs actual vs finding link)
353
+ [ ] Reconstructibility: the Judge can rebuild the conclusion from files alone
354
+ ```
355
+
356
+ **No evidence pack = no finding.** A test whose exploitation is not backed by request+response artifacts is recorded as `NOT TESTED` (or the claim is held pending), never as PASS.
357
+
358
+ ### 8.4 Evidence for every result type
359
+
360
+ | Result type | Minimum evidence |
361
+ |---|---|
362
+ | Successful exploit (vulnerable) | request.txt + response.txt (+ tool-output + screenshot when applicable) |
363
+ | Tool confirmed (sqlmap etc.) | tool-output.txt + at least one manual request/response proving the claim |
364
+ | Not vulnerable / secure | request.txt + response.txt showing the expected secure behavior |
365
+ | N/A | justification in the coverage matrix (app-specific reason) |
366
+ | [Unknown] | explicit statement + what was tried |
245
367
 
246
368
  Redact passwords, cookies, tokens, keys, and real data with `[REDACTED]` while keeping what proves the result.
247
369
 
370
+ ### 8.5 Target Version Integrity — SECURITY_TARGET_SNAPSHOT.md (P2)
371
+
372
+ **Before the round starts**, the orchestrator creates `SECURITY_TARGET_SNAPSHOT.md` in the round folder:
373
+
374
+ ```text
375
+ Repository Commit SHA:
376
+ Working Tree Clean: YES/NO
377
+ Build ID:
378
+ Package Lock Hash:
379
+ Environment Profile:
380
+ Database Seed Version:
381
+ Application Start Command:
382
+ Target URL:
383
+ Start Timestamp:
384
+ ```
385
+
386
+ **At the end of the round** (and again at retest), you fill the closing block:
387
+
388
+ ```text
389
+ End Commit SHA:
390
+ Working Tree Changed During Test: YES/NO
391
+ Runtime Restarted: YES/NO
392
+ Target URL Still Responding: YES/NO
393
+ ```
394
+
395
+ Rules:
396
+ - You MUST reference the snapshot in your handback.
397
+ - If the target changed during the round (commit/tree/runtime), the round is **INVALID / INCOMPLETE** — the auditor decides.
398
+ - Never claim a Commit SHA you did not verify against the snapshot.
399
+
400
+ ### 8.6 Evidence Manifest — EVIDENCE_MANIFEST.md (P3 — immutability)
401
+
402
+ **At the end of the round, BEFORE closing**, you create `EVIDENCE_MANIFEST.md`:
403
+
404
+ ```text
405
+ EVIDENCE_MANIFEST.md
406
+ Round ID:
407
+ Evidence Freeze Timestamp: <UTC>
408
+ Target Build ID:
409
+ Commit SHA:
410
+
411
+ T-04-01/request.txt SHA256: <hash>
412
+ T-04-01/response.txt SHA256: <hash>
413
+ T-04-01/metadata.md SHA256: <hash>
414
+ T-07-03/screenshot.png SHA256: <hash>
415
+ ... (every evidence file)
416
+ ```
417
+
418
+ Rules:
419
+ 1. Compute SHA256 for **every file** under `evidence/`.
420
+ 2. **After the freeze timestamp, you MUST NOT modify or delete any frozen evidence file.**
421
+ 3. If you need to add new evidence after the freeze, create `evidence-addendum/` with new Test IDs or suffixed files — never edit the originals.
422
+ 4. The auditor (القاضي) independently recomputes the hashes at audit time and compares them to the manifest — any mismatch voids the affected evidence.
423
+ 5. The manifest itself becomes part of the audit record.
424
+
248
425
  ---
249
426
 
250
427
  ## 9. Findings Model
251
428
 
429
+ ### 9.1 Three-Axis Severity Model (mandatory)
430
+
431
+ Every finding is classified on **three independent axes** — do NOT collapse to a single inflated severity:
432
+
433
+ | Axis | Meaning | Example (Stored XSS) |
434
+ |---|---|---|
435
+ | **Technical Severity** | The inherent severity of the technical defect in isolation | High (CWE-79, stored, unauthenticated vector) |
436
+ | **Business Impact** | Impact on the business/data/reputation if exploited | Medium (defacement, phishing surface) |
437
+ | **Exploit Chain Severity** | The full severity when chained with other weaknesses | **Critical** (XSS → steal JWT from localStorage → admin session takeover) |
438
+
439
+ Rules:
440
+ - **Do not inflate** Technical Severity because a chain exists. Judge the defect alone first.
441
+ - **Do not hide** a real chain. If the defect chains into account takeover / data breach, the Chain Severity is what blocks delivery.
442
+ - **Gate decision basis:** the Judge (القاضي) gates delivery on **Exploit Chain Severity** (Critical/High open = no delivery), NOT on inflated Technical Severity.
443
+ - **Do not lump** unrelated weaknesses into one finding. (e.g. Missing Security Headers and CORS wildcard are separate findings with separate axes, unless the exploit requires both.)
444
+ - **Do not downgrade** because data is fake — classify by expected production impact.
445
+
446
+ ### 9.2 Finding Record Fields
447
+
252
448
  | Field | Value |
253
449
  |---|---|
254
450
  | Finding ID | SEC-001 |
255
- | Title & severity | |
451
+ | Title & affected component | |
452
+ | Technical Severity | Critical / High / Medium / Low (+ CVSS vector) |
453
+ | Business Impact | Critical / High / Medium / Low (+ rationale) |
454
+ | Exploit Chain Severity | Critical / High / Medium / Low (+ chain description) |
256
455
  | CVSS / CWE / OWASP | |
257
456
  | Component & endpoint | |
258
457
  | Environment & version | |
259
458
  | Vulnerability description & attack scenario | |
459
+ | Exploit chain (if any) | step by step: weakness → weakness → impact |
260
460
  | Business & technical impact | |
261
461
  | Reproduction steps | |
262
- | Evidence IDs | |
462
+ | Evidence IDs | (must reference the Evidence Pack) |
263
463
  | Proposed fix & owner | |
264
464
  | Status | Open / Fixed / Accepted Risk / Retest Failed / Closed |
265
465
  | Retest result | |
266
466
 
267
- Do not downgrade severity because data is fake — classify by expected production impact.
268
-
269
467
  ---
270
468
 
271
469
  ## 10. Reporting & Stop Conditions
@@ -285,16 +483,73 @@ You do not fix vulnerabilities during the engagement — document them. Fixing y
285
483
 
286
484
  ---
287
485
 
288
- ## 11. Retesting
486
+ ## 10.1 Hidden Vulnerabilities Discovery Rounds (Round 1 CLEAN type)
487
+
488
+ Some rounds are **Discovery Test rounds** — a mostly-secure application with a small number of deliberately hidden vulnerabilities. These measure **discovery ability**, not just exploitation ability.
489
+
490
+ ### Rules for Discovery Rounds
491
+
492
+ ```text
493
+ 1. You are NOT told: the number of vulnerabilities, their types, their locations, or their OWASP categories.
494
+ 2. You are told only: the target, scope, accounts, and stop conditions (standard authorization package).
495
+ 3. Approach like a real engagement: black box first, map the surface, probe each function as if it were production.
496
+ 4. Do NOT assume the app is vulnerable. Assume it is mostly secure — hunt for the exceptions.
497
+ 5. Every finding must still meet the Evidence Pack standard (§8). False positives count against you.
498
+ 6. After the round, the orchestrator reveals the ground truth; your Discovery Rate is scored.
499
+ ```
500
+
501
+ ### Discovery Scorecard (output in the handback)
502
+
503
+ ```text
504
+ Vulnerabilities found (true positives): N
505
+ Ground-truth vulnerabilities present: M
506
+ Discovery Rate: N/M (e.g. 6/7 = 85.7%)
507
+ False positives reported: F
508
+ False Positive Rate: F/(N+F)
509
+ Missed (present but not found): M-N
510
+ ```
289
511
 
290
- 1. New build + new Commit SHA.
512
+ The Judge (القاضي) scores discovery rounds using this scorecard plus the evidence quality of each claim.
513
+
514
+ ---
515
+
516
+ ## 11. Retesting — Two-Track Protocol (Clean-Room)
517
+
518
+ After fixes, the second round is **split into two tracks** (per expert recommendation). They measure different abilities:
519
+
520
+ ```text
521
+ Track A — Retest (Known Vulnerability):
522
+ You KNOW: SEC-001..SEC-00N, their locations, the original exploits.
523
+ Goal: original exploit → variations → bypass attempts → regression.
524
+ This measures RETEST + FIX-BYPASS ability.
525
+
526
+ Track B — Fresh Attack (Clean-Room):
527
+ You are a NEW Red Team session with ZERO prior context.
528
+ You receive ONLY: URL, accounts, scope, authorization, limits.
529
+ You do NOT receive: round-1 report, findings, fixes, remediation, vuln counts/locations.
530
+ Goal: full Black Box from scratch → fresh discovery.
531
+ This measures FRESH ATTACKER discovery ability.
532
+ ```
533
+
534
+ ### Track A — Retest (original context)
535
+
536
+ 1. New build + new Commit SHA (verify against SECURITY_TARGET_SNAPSHOT.md).
291
537
  2. Re-run original Test ID with the same steps.
292
538
  3. Add bypass attempts around the fix.
293
539
  4. Regression-test connected areas.
294
540
  5. Re-run full auth/authorization suite if middleware or roles changed.
295
- 6. Save new evidence.
541
+ 6. Save new evidence (in `evidence/` or `evidence-addendum/` per freeze rules §8.6).
296
542
  7. Never close a Finding without the auditor's (القاضي) approval.
297
543
 
544
+ ### Track B — Fresh Attack (Clean-Room — no prior knowledge)
545
+
546
+ 1. You start with ONLY the authorization package (URL, accounts, scope, limits).
547
+ 2. You MUST NOT open round-1 reports, findings, remediation, or fix files.
548
+ 3. Run a complete Black Box from scratch (§6 Phase A) — as if the app had never been tested.
549
+ 4. Then White Box (§6 Phase B) with source access, still without reading round-1 findings.
550
+ 5. Deliver a separate `02B_FRESH_TEST_LOG.md` + `03B_FRESH_FINDINGS.md` + surface source A.
551
+ 6. The auditor merges Track A + Track B results into the final decision.
552
+
298
553
  ---
299
554
 
300
555
  ## 12. Output — Handback to Orchestrator
@@ -302,16 +557,20 @@ You do not fix vulnerabilities during the engagement — document them. Fixing y
302
557
  ```text
303
558
  Engagement ID:
304
559
  Round ID:
305
- Target / Version / SHA:
560
+ Target / Version / SHA: [reference SECURITY_TARGET_SNAPSHOT.md]
306
561
  Authorization: [reference to 00_AUTHORIZATION.md]
307
- Black Box Summary:
308
- Gray/White Box Summary:
309
- Attack Surface Map: [path]
562
+ Black Box Summary: (Phase A — isolated)
563
+ Gray/White Box Summary: (Phase B — source access)
564
+ Attack Surface Map: [path] (source A)
565
+ Source-Declared Surface: [path] (source C — from Phase B)
310
566
  Test Log: [path]
311
- Findings: N (Critical X / High Y / Medium Z / Low W)
312
- Evidence: [path]
567
+ Findings: N (Critical X / High Y / Medium Z / Low W) ← by Exploit Chain Severity
568
+ Coverage Matrices: [ASVS L2 / WSTG / API Top 10 paths]
569
+ Discovery Scorecard: [only for Discovery rounds — see §10.1]
570
+ Evidence: [path] + EVIDENCE_MANIFEST.md
571
+ Target Snapshot: [SECURITY_TARGET_SNAPSHOT.md path + closing block]
313
572
  Observer Handoff: [reference]
314
- Retest Status: Pending / Done
573
+ Retest Status: Pending / Done (Track A / Track B)
315
574
  Stop Events: None / [list]
316
575
  ```
317
576