@1aboveio/skills 0.20.2 → 0.20.3

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.
Files changed (85) hide show
  1. package/README.md +12 -5
  2. package/package.json +1 -1
  3. package/runtime/skills/distribution/generated/recipes.json +220 -25
  4. package/runtime/skills/distribution/scripts/bundles.mjs +49 -5
  5. package/runtime/skills/engineering/engineering-runtime/scripts/workflow-coherence.mjs +4 -0
  6. package/runtime/skills/engineering/engineering-runtime/scripts/workflow-policy.mjs +1 -1
  7. package/skills/compliance/compliance-audit/LICENSE +3 -0
  8. package/skills/compliance/compliance-audit/SKILL.md +466 -0
  9. package/skills/compliance/compliance-audit/references/findings-schema.md +290 -0
  10. package/skills/compliance/compliance-audit/references/vars-checklist.md +1068 -0
  11. package/skills/compliance/compliance-audit/references/vars-findings-schema.md +395 -0
  12. package/skills/compliance/compliance-audit/scripts/reconcile_tracker.py +454 -0
  13. package/skills/compliance/compliance-audit/scripts/test_validate_tracker.py +90 -0
  14. package/skills/compliance/compliance-audit/scripts/validate_tracker.py +752 -0
  15. package/skills/compliance/doc-authenticity/LICENSE +3 -0
  16. package/skills/compliance/doc-authenticity/SKILL.md +158 -0
  17. package/skills/compliance/doc-authenticity/references/agreement.md +66 -0
  18. package/skills/compliance/doc-authenticity/references/bank-statement.md +150 -0
  19. package/skills/compliance/doc-authenticity/references/forensic-signals.md +157 -0
  20. package/skills/compliance/doc-authenticity/references/image-signals.md +114 -0
  21. package/skills/compliance/doc-authenticity/references/invoice.md +66 -0
  22. package/skills/compliance/doc-authenticity/references/issuer-profiles.md +86 -0
  23. package/skills/compliance/doc-authenticity/references/verdict-and-report.md +95 -0
  24. package/skills/compliance/doc-authenticity/references/verdict.schema.json +81 -0
  25. package/skills/compliance/doc-authenticity/scripts/image_forensics.py +294 -0
  26. package/skills/compliance/doc-authenticity/scripts/pdf_forensics.py +401 -0
  27. package/skills/compliance/doc-authenticity/scripts/validate_codes.py +224 -0
  28. package/skills/compliance/doc-authenticity/scripts/validate_verdict.py +308 -0
  29. package/skills/compliance/report-writing/LICENSE +3 -0
  30. package/skills/compliance/report-writing/SKILL.md +206 -0
  31. package/skills/compliance/report-writing/references/audit-report-template.md +121 -0
  32. package/skills/compliance/report-writing/references/external-assessment-template.md +167 -0
  33. package/skills/compliance/report-writing/references/management-report-template.md +145 -0
  34. package/skills/compliance/report-writing/references/vars-report-template.md +224 -0
  35. package/skills/document-utils/doc-to-md/LICENSE +3 -0
  36. package/skills/document-utils/doc-to-md/SKILL.md +77 -0
  37. package/skills/document-utils/doc-to-md/scripts/convert.py +157 -0
  38. package/skills/document-utils/reg-parser/LICENSE +3 -0
  39. package/skills/document-utils/reg-parser/SKILL.md +201 -0
  40. package/skills/document-utils/reg-parser/references/checklist-schema.md +223 -0
  41. package/skills/document-utils/reg-parser/references/checklists/hk-amlo-checklist.json +1306 -0
  42. package/skills/document-utils/reg-parser/references/checklists/hk-amlo-checklist.md +469 -0
  43. package/skills/document-utils/reg-parser/references/checklists/hk-fi-corporate-onboarding-cdd-checklist.json +634 -0
  44. package/skills/document-utils/reg-parser/references/checklists/hk-fi-corporate-onboarding-cdd-checklist.md +233 -0
  45. package/skills/document-utils/reg-parser/references/checklists/hk-mso-guideline-checklist.json +2194 -0
  46. package/skills/document-utils/reg-parser/references/checklists/hk-mso-guideline-checklist.md +771 -0
  47. package/skills/document-utils/reg-parser/references/checklists/kyc-aml-checklist.md +258 -0
  48. package/skills/document-utils/reg-parser/references/checklists/visa-vars-checklist.md +1058 -0
  49. package/skills/document-utils/reg-parser/references/mandates/hk-amlo-cap615.md +389 -0
  50. package/skills/document-utils/reg-parser/references/mandates/visa-vars.md +205 -0
  51. package/skills/document-utils/reg-parser/scripts/compare_checklist.py +228 -0
  52. package/skills/document-utils/reg-parser/scripts/dump_checklist.py +348 -0
  53. package/skills/document-utils/reg-parser/scripts/preprocess-mandate.sh +171 -0
  54. package/skills/document-utils/reg-parser/scripts/test_quarantine.sh +102 -0
  55. package/skills/document-utils/reg-parser/scripts/validate_checklist.py +532 -0
  56. package/skills/document-utils/reg-parser/scripts/validate_mandate.py +242 -0
  57. package/skills/engineering/engineering-runtime/coherence/workflow.json +16 -16
  58. package/skills/engineering/engineering-runtime/scripts/workflow-coherence.mjs +4 -0
  59. package/skills/engineering/engineering-runtime/scripts/workflow-policy.mjs +1 -1
  60. package/skills/payment/similar-domain/LICENSE +3 -0
  61. package/skills/payment/similar-domain/SKILL.md +178 -0
  62. package/skills/payment/similar-domain/references/entities.md +58 -0
  63. package/skills/payment/similar-domain/references/fingerprints.md +82 -0
  64. package/skills/payment/similar-domain/references/pivots.md +66 -0
  65. package/skills/payment/similar-domain/references/report-template.md +76 -0
  66. package/skills/payment/similar-domain/references/scoring.md +61 -0
  67. package/skills/payment/similar-domain/references/terminology.md +37 -0
  68. package/skills/payment/similar-domain/references/workflow.md +79 -0
  69. package/skills/payment/tld-detection/SKILL.md +76 -21
  70. package/skills/payment/tld-detection/references/clean.md +1 -1
  71. package/skills/payment/tld-detection/references/clustering.md +21 -6
  72. package/skills/payment/tld-detection/references/decision.md +7 -2
  73. package/skills/payment/tld-detection/references/fx-conversion.md +229 -0
  74. package/skills/payment/tld-detection/references/report-template.md +63 -27
  75. package/skills/payment/tld-detection/references/streams.md +90 -0
  76. package/skills/payment/tld-detection/references/terminology.md +15 -7
  77. package/skills/payment/tld-detection/references/workflow.md +1 -1
  78. package/skills/payment/tld-detection/scripts/detect_streams.py +542 -0
  79. package/skills/engineering/ensure-coverage/evals/evals.json +0 -125
  80. package/skills/engineering/rush-issues/evals/evals.json +0 -65
  81. package/skills/engineering/rush-release/evals/evals.json +0 -58
  82. package/skills/fullstack/shadcn/evals/evals.json +0 -90
  83. package/skills/payment/fraud-analysis/evals/evals.json +0 -40
  84. package/skills/payment/tld-detection/evals/evals.json +0 -107
  85. package/skills/payment/tld-detection/tests/test_detect_ladders.py +0 -132
@@ -0,0 +1,466 @@
1
+ ---
2
+ name: compliance-audit
3
+ version: 2.8.3
4
+ description: "Audit operations against a financial-compliance checklist (AML/KYC, VARS, PCI-DSS scope, TPA oversight, onboarding/transaction monitoring). Produces a control-item assessment tracker + phase trail, with layered validation (schema, citation grounding, adversarial subagents) before sign-off. Input: a checklist MD from reg-parser or the built-in VARS checklist; output: tracker.md + phase-trail.md."
5
+ ---
6
+
7
+ # Compliance Audit
8
+
9
+ Guide an auditor/analyst through examining operations, processes, and controls
10
+ against a compliance checklist. Produce an assessment tracker — a worksheet
11
+ keyed by control item that the client can update through remediation —
12
+ alongside a phase trail companion file (work product) that preserves what each
13
+ phase saw before the tracker was finalised.
14
+
15
+ ## Audience
16
+
17
+ The user is a **compliance auditor or analyst** working in regulated financial
18
+ services — payments, banking, fintech, insurance. They audit against financial
19
+ regulatory frameworks: AML regulations, KYC requirements, financial reporting
20
+ standards, local financial authority rules, and card-scheme standards such as
21
+ VARS.
22
+
23
+ ## Audit Workflow
24
+
25
+ The pipeline is eleven steps in three phases:
26
+
27
+ | Phase | Steps | Purpose |
28
+ |---|---|---|
29
+ | **Setup** | 0–4 | Preprocess evidence, load checklist, scope, plan phases, map evidence to controls |
30
+ | **Review** | 5–7 | Run review phases (document / onsite / sample), synthesize tracker rows |
31
+ | **Sign-off** | 8–10 | Produce deliverables; run layered validation (deterministic + LLM judge + adversarial challenger); normalize formatting before reviewer sign-off |
32
+
33
+ For large audits the **chunked** path (Step 6 onward) parallelises across control groups via subagents; the unchunked path (Step 5) is sequential. Pick based on size — VARS (45 controls) and similar always benefit from chunking.
34
+
35
+ ### Step 0: Preprocess Evidence Documents (if needed)
36
+
37
+ If evidence files are in binary formats (PDF, DOCX, PPTX, XLSX, images), spawn a subagent to convert them to markdown before the audit begins.
38
+
39
+ - **Model:** **Small / fast tier.** This is mechanical doc conversion. Capability above the small tier is wasted here.
40
+ - **Task prompt:**
41
+
42
+ ```text
43
+ Convert all documents in <evidence-dir>/ to markdown using the doc-to-md skill.
44
+ Run: python3 {doc-to-md baseDir}/scripts/convert.py <evidence-dir>/ <evidence-md-dir>/
45
+ Report which files succeeded and which failed (if any).
46
+ ```
47
+
48
+ Wait for the subagent to complete before proceeding. Skip this step if evidence is already in text/markdown format.
49
+
50
+ ### Step 1: Load the Checklist
51
+
52
+ 1. Read the compliance checklist file provided by the user.
53
+ 2. Parse control IDs, control titles, archetypes / categories, severity, requirement text, and control criteria.
54
+ 3. Confirm the checklist loaded correctly — list the control groups and total controls in scope.
55
+
56
+ If no checklist is provided, ask the user for the path to their checklist file.
57
+
58
+ ### Step 2: Scope the Audit
59
+
60
+ Determine scope with the user:
61
+
62
+ - **Full audit** — all controls in the checklist.
63
+ - **Targeted audit** — specific archetypes, categories, or control IDs only.
64
+
65
+ Confirm scope before proceeding. Record scope in the tracker metadata header.
66
+
67
+ ### Step 3: Establish the Phase Plan
68
+
69
+ The audit runs through up to three review phases on the same control set, plus a synthesis step that produces the tracker:
70
+
71
+ 1. `document_review` (phase)
72
+ 2. `onsite_review` (phase)
73
+ 3. `sample_test` (phase)
74
+ 4. tracker synthesis (Step 7) — consolidates whichever phases ran into `tracker.md`
75
+
76
+ Phases are **optional and additive** — many engagements stop after `document_review` (a gap analysis) or skip `onsite_review` for remote audits. Confirm with the user which phases are in scope and record the chosen subset under `Audit Phases Completed` in the tracker header. The tracker rating is always produced as the synthesis of whichever phases ran.
77
+
78
+ Rules:
79
+
80
+ - Each phase updates the same `Control ID` records in `phase-trail.md` rather than creating disconnected findings.
81
+ - The tracker (`tracker.md`) is the consolidated deliverable after the completed phases.
82
+ - `Control Effectiveness Rating` (VARS) or `Effectiveness` (generic) is required because it drives the tracker rating.
83
+ - `Recommended Action Ref` is optional. If a co-located best-practice repository keyed by `Control ID` exists, point to it (e.g. `best-practice://AACQ.C14.1`); otherwise inline a one-line remediation pointer or omit. Do not invent links to repositories that do not exist.
84
+
85
+ ### Step 4: Evidence Mapping
86
+
87
+ Map evidence to controls or logical control groups before reviewing:
88
+
89
+ ```text
90
+ AACQ.C1.1 risk-appetite-policy.md, board-minutes.md
91
+ AACQ.C5.1 underwriting-policy.md, onboarding-procedure.md
92
+ ATPA.C8.1 monitoring-rules.md, alert-log-sample.md
93
+ ```
94
+
95
+ Only the mapped evidence for a control or control group should be passed into that review pass.
96
+
97
+ ### Step 5: Run the Audit Phase
98
+
99
+ For each phase in scope, review the controls and record phase-specific observations into `phase-trail.md` using the appropriate schema:
100
+
101
+ - **VARS audits:** `references/vars-findings-schema.md` (Visa-canonical tracker + per-mandatory-item granularity).
102
+ - **All other audits:** `references/findings-schema.md` (generic per-Control-ID tracker).
103
+
104
+ `phase-trail.md` is the audit work product across all phases. The tracker (`tracker.md`) is produced from it in Step 7.
105
+
106
+ Step 5 is the **non-chunked** path; for large audits skip to Step 6. Each phase below appends a phase block per `Control ID` to `phase-trail.md` using Variant A in the chosen schema.
107
+
108
+ #### Phase 5A: Document Review
109
+
110
+ Input: policy documents, procedures, agreements, governance materials, system descriptions.
111
+
112
+ Record `document_review` observations per `Control ID`.
113
+
114
+ #### Phase 5B: Onsite Review
115
+
116
+ Input: interview records, walkthrough notes, live demonstrations, operating context.
117
+
118
+ Record `onsite_review` observations per `Control ID` and note whether onsite work confirms, weakens, or strengthens document-review conclusions.
119
+
120
+ #### Phase 5C: Sample Test
121
+
122
+ Input: sample evidence such as merchant files, alerts, case logs, transactions, approvals, reports, screenshots.
123
+
124
+ Record `sample_test` observations per `Control ID` and capture concrete evidence of operating effectiveness.
125
+
126
+ ### Step 6: Chunked Workflow for Large Audits
127
+
128
+ When the checklist or evidence is large, the **main agent orchestrates** and **spawns one subagent per control group / category** for each phase. Phase outputs are kept in per-group files and consumed directly by Step 7 — there is no merge step in between.
129
+
130
+ #### Step A: Prepare a bounded prompt
131
+
132
+ Before spawning, group controls into logical chunks and attach only the relevant evidence. Extract only the rows for the chunk's `Control ID`s from the checklist — never paste the full checklist into a subagent prompt. The full checklist can be hundreds of KB and bloats every subagent's context.
133
+
134
+ ```text
135
+ Group 1: AACQ Risk Appetite and Written Agreements
136
+ Controls: AACQ.C1.1, AACQ.C2.1, AACQ.C3.1, AACQ.C4.1
137
+ Evidence: risk-appetite-policy.md, merchant-agreement-template.md
138
+ ```
139
+
140
+ #### Step B: Spawn subagents per chunk
141
+
142
+ - **Model:** **Mid tier.** Per-phase review needs careful reasoning across a control's evidence; a small model will miss subtle gaps.
143
+ - **Output schema:** Pick the same schema chosen in Step 5 — generic (`findings-schema.md`) or VARS (`vars-findings-schema.md`). Each schema file owns two subagent prompt templates: **Variant A** for per-phase chunking (this step) and **Variant B** for synthesis chunking (Step 7). Use Variant A here. Do not improvise a third format.
144
+ - **Task prompt skeleton** (fill the bracketed slots from Variant A in the schema):
145
+
146
+ ```text
147
+ You are a compliance auditor. Review the following controls for the specified audit phase.
148
+
149
+ Audit phase: <document_review | onsite_review | sample_test>
150
+ Controls:
151
+ <paste only the checklist rows for these Control IDs>
152
+
153
+ Evidence:
154
+ <paste mapped evidence only>
155
+
156
+ Output format:
157
+ <paste the Variant A block from the chosen schema's "Subagent Prompt Template" section>
158
+
159
+ Rules:
160
+ - Never mark a control effective without direct evidence.
161
+ - If evidence is absent or ambiguous, mark the gap and explain why.
162
+ - Keep observations specific to this phase.
163
+ - Output observations only.
164
+ ```
165
+
166
+ - **Output:** Each subagent writes phase observations to `phase-<phase>-<group>.md`.
167
+ - **Parallelism:** Spawn all independent chunks concurrently. No merge step is required at this point — Step 7 consumes the per-group phase files directly.
168
+
169
+ ### Step 7: Synthesize Tracker (chunked)
170
+
171
+ Synthesis is **chunked the same way as Step 6**. The full per-control tracker plus phase trail can blow main-agent context on a 45-control VARS audit; spawn one synthesis subagent per control group.
172
+
173
+ Use the **same group definitions** as Step 6 so each synthesis subagent reads its group's `phase-<phase>-<group>.md` files and emits both:
174
+
175
+ 1. tracker rows (deliverable)
176
+ 2. merged phase-trail blocks (audit work product)
177
+
178
+ …for that group only.
179
+
180
+ #### Step A: Spawn synthesis subagents per group
181
+
182
+ - **Model:** **Mid tier.** Synthesis consolidates multiple phases per Control ID and applies the rubric; needs balanced reasoning. Don't use a small model here.
183
+ - **Output schema:** Variant B in the chosen schema file (`vars-findings-schema.md` or `findings-schema.md`).
184
+ - **Task prompt skeleton** (fill the bracketed slots from Variant B):
185
+
186
+ ```text
187
+ You are a compliance auditor consolidating an assessment.
188
+
189
+ Controls in scope (this group):
190
+ <paste only the checklist rows for these Control IDs>
191
+
192
+ Phase trail blocks (all completed phases for these Control IDs):
193
+ <paste contents of phase-<phase>-<group>.md for every phase that ran>
194
+
195
+ Output format:
196
+ <paste the "Subagent Prompt Template — Variant B" block from the chosen schema file>
197
+ ```
198
+
199
+ - **Output:** Each subagent writes `synth-<group>.md` containing tracker rows, then a `---` separator, then merged phase-trail blocks.
200
+ - **Parallelism:** Spawn all groups concurrently.
201
+
202
+ #### Step B: Assemble final files
203
+
204
+ Once synthesis subagents complete, the main agent:
205
+
206
+ 1. Reads each `synth-<group>.md`.
207
+ 2. Splits each file on the `---` separator into tracker-rows half and phase-trail half.
208
+ 3. Concatenates all tracker-rows halves under the audit-metadata header and the table header into `tracker.md`.
209
+ 4. Concatenates all phase-trail halves under the `# Phase Trail` (or `# VARS Phase Trail`) heading into `phase-trail.md`.
210
+ 5. Verifies every Control ID in scope appears in both files.
211
+
212
+ The main agent does **not** rewrite or re-rate findings during assembly — that work happened in the subagents. Assembly is concatenation + sanity check only.
213
+
214
+ ### Step 8: Deliverables
215
+
216
+ Two files:
217
+
218
+ - `tracker.md` — the deliverable. One row per Control ID under a metadata header. For VARS, per-mandatory-item detail (`Control 1a:`, `Control 1b:`, …) appears as bulleted entries inside the Observations cell. No executive summary, no roll-up counts, no critical-gaps section.
219
+ - `phase-trail.md` — the audit work product. Per-Control-ID phase-by-phase record. Preserves observations from `document_review`, `onsite_review`, `sample_test` as they were captured.
220
+
221
+ Treat the checklist as the control library and the schema as the tracker format. If the client wants a roll-up or executive summary, generate it from the tracker on demand — do not write one into the deliverable.
222
+
223
+ ### Step 9: Validate the Tracker
224
+
225
+ Before sign-off, run a layered validation pass to catch hallucination, schema drift, and over-claimed coverage. The four sub-steps are cheap-to-expensive; run **9A and 9B always**, run **9C and 9D for high-stakes deliverables** (e.g. VARS findings sent to a regulator).
226
+
227
+ #### Step 9A: Structural validation (deterministic)
228
+
229
+ Run `scripts/validate_tracker.py` against the produced tracker:
230
+
231
+ ```bash
232
+ python3 {compliance-audit baseDir}/scripts/validate_tracker.py tracker.md \
233
+ --checklist {compliance-audit baseDir}/references/vars-checklist.md
234
+ ```
235
+
236
+ Checks performed:
237
+
238
+ - `row_coverage` — every scoped Control ID has exactly one tracker row.
239
+ - `item_coverage` — every numbered checklist item appears as a `Control N:` bullet in Observations.
240
+ - `rating_value` — `Control Effectiveness Rating` is one of the four canonical outcomes: `Satisfactory` / `Improvement Recommended` / `Unsatisfactory` / `N/A`.
241
+ - `rubric_consistency` — the rating obeys the VARS rubric (any mandatory item `Partial` or `Not addressed` ⇒ Unsatisfactory; all mandatory met but a recommended item missing/partial ⇒ Improvement Recommended; all covered ⇒ Satisfactory; `N/A` rows are exempt). Coverage rolls up: a leaf with no bullet inherits its nearest bulleted ancestor's status.
242
+ - `gap_xref` — every `(Control N)` / `[Control N: …]` referenced in Issue Description corresponds to a `Not addressed` or `Partial` Observation bullet (a Recommendations entry may also point to a `Covered` mandatory item flagged for strengthening).
243
+
244
+ Exit 0 = no errors. Errors are blocking; warnings are surfaced for reviewer judgement. Use `--strict` to fail on warnings too.
245
+
246
+ #### Step 9B: Citation grounding (deterministic, requires evidence dir)
247
+
248
+ Add `--evidence` to the same script:
249
+
250
+ ```bash
251
+ python3 {compliance-audit baseDir}/scripts/validate_tracker.py tracker.md \
252
+ --checklist {compliance-audit baseDir}/references/vars-checklist.md \
253
+ --evidence ./evidence-md/
254
+ ```
255
+
256
+ For every `Covered in <doc> section <clause>` citation, the script verifies the doc resolves to an evidence markdown file and the cited clause string actually appears in that file. Phantom citations (clause does not exist) are flagged as warnings.
257
+
258
+ #### Step 9C: Citation judge (subagent — clean context)
259
+
260
+ Spawn one subagent **per control group** (same chunking as Steps 6–7) using **Variant C** in the schema's "Subagent Prompt Template" section. The subagent receives **only**:
261
+
262
+ - the checklist rows for its group (with full Verification text),
263
+ - the tracker rows for its group (Observations + Issue Description),
264
+ - the cited evidence excerpts.
265
+
266
+ It does **not** see the phase trail, other groups' findings, or any synthesis context. Clean context is the point — the judge must verify each citation cold.
267
+
268
+ - **Model:** **Small / fast tier.** Citation verification is local clause-vs-requirement comparison; a small model handles it well at a fraction of the cost.
269
+ - **Output:** `judge-<group>.md` with per-bullet verdicts (`Confirmed` / `Weak` / `Off-target` / `Missing`).
270
+ - **Parallelism:** Spawn all groups concurrently.
271
+
272
+ The main agent collates non-`Confirmed` verdicts into a Citation Judge Report attached to the tracker for reviewer attention.
273
+
274
+ #### Step 9D: Adversarial challenger (subagent — clean context, adversarial system prompt)
275
+
276
+ Spawn one subagent **per control group** using **Variant D** in the schema. The subagent runs with an **explicit adversarial system prompt**: assume the prior auditor was too generous and look for downgrades.
277
+
278
+ Critical: this subagent must run with **clean context** — no access to the phase trail, judge findings, or synthesis reasoning. It must form its own challenge from the checklist + tracker + evidence only. Otherwise it will rationalise rather than challenge.
279
+
280
+ - **Model:** **Mid tier** for routine audits; **large / top-tier** for regulator-facing deliverables where a missed challenge is costly. The challenger has to form a credible adversarial read and articulate concrete downgrades — a too-small model will rubber-stamp.
281
+ - **System prompt:** Variant D in the schema. The system prompt itself frames the adversarial stance — do not soften it in the wrapper.
282
+ - **Output:** `challenge-<group>.md` listing concrete recommended downgrades per coverage claim, with requirement reference and specific weakness.
283
+ - **Parallelism:** Spawn all groups concurrently.
284
+
285
+ The main agent collates challenges into a Challenge Report. The reviewer reads it and decides per-challenge whether to accept the downgrade before finalising the tracker.
286
+
287
+ #### Step 9E: Reconcile validated findings into the tracker
288
+
289
+ Steps 9A–9D produce side files. Step 9E **applies the deterministic ones to `tracker.md`** so hallucinated coverage doesn't survive into the deliverable. The split is deliberate: auto-apply only what's mechanically verifiable; surface the rest for the reviewer.
290
+
291
+ | Source | Treatment |
292
+ |---|---|
293
+ | 9B citation_grounding "missing clause" warnings | **Auto-apply.** The cited `section X` exact-string isn't in the evidence file, so the citation is hallucinated. Bullet flips `Covered`/`Partial` → `Not addressed — cited clause section X not found in DOC`. |
294
+ | 9C judge verdict `Off-target` | **Auto-apply.** Judge confirmed the cited clause doesn't address the requirement. Bullet flips → `Not addressed — judge: <reason>`. |
295
+ | 9C judge verdict `Missing` | **Auto-apply.** Judge couldn't locate the cited clause. Bullet flips → `Not addressed — judge: <reason>`. |
296
+ | 9C judge verdict `Weak` | **Reviewer-mediated.** Judge says clause references the topic but doesn't operationalise it. Surfaced in `reconciliation.md` for human decision; tracker untouched. |
297
+ | 9D challenger recommendations | **Reviewer-mediated.** These are explicit value judgements, not facts. Surfaced in `reconciliation.md`. |
298
+
299
+ Run the reconciler:
300
+
301
+ ```bash
302
+ python3 {compliance-audit baseDir}/scripts/reconcile_tracker.py tracker.md \
303
+ --checklist {compliance-audit baseDir}/references/vars-checklist.md \
304
+ --validation validation.json \
305
+ --judge judge-aacq.json \
306
+ --judge judge-atpa.json \
307
+ --log reconciliation.md
308
+ ```
309
+
310
+ `--validation` takes the JSON output of `validate_tracker.py --json` (re-run with `--json` to capture it). `--judge` may be passed multiple times to merge per-group judge sidecars.
311
+
312
+ The reconciler:
313
+
314
+ 1. Parses `tracker.md` and the checklist.
315
+ 2. Walks every Observations bullet. For each "auto-apply" finding hitting that bullet, transforms the bullet text and flips its status to `Not addressed`.
316
+ 3. Recomputes the row's Control Effectiveness Rating per the rubric using the new statuses.
317
+ 4. Updates Issue Description: adds the newly-confirmed gap to **Actions Required** (mandatory) or **Recommendations** (recommended-only).
318
+ 5. Writes the updated tracker (default: in place) and a `reconciliation.md` log of every change plus the reviewer-mediated items still pending.
319
+
320
+ After 9E runs, re-run 9A as a final structural check on the reconciled tracker. The reviewer then works through `reconciliation.md`'s "pending review" section before sign-off.
321
+
322
+ ### Step 10: Normalize Deliverable Formatting
323
+
324
+ Subagents and reconciler edits produce stylistically inconsistent Observations cells — some bullets are plain text, some bold the item number (`**(1)**`, `**1d**`), some bold the prefix (`**Control 1d:**`), some omit the `Control` prefix entirely, some use `-` instead of `•`, some break with newlines instead of `<br>`. Step 10 enforces the canonical format so the deliverable looks like one document, not a stitched collage.
325
+
326
+ This step is **purely cosmetic** — it must not change ratings, statuses, citations, or which items are present. If a normalization rule would alter meaning, leave the bullet alone and flag it in `normalization.md` for the reviewer.
327
+
328
+ Run normalization **after** Step 9E reconciliation and **before** the reviewer sign-off gate. Re-run Step 9A (structural validation) afterwards to confirm nothing broke.
329
+
330
+ #### Canonical Observations bullet format
331
+
332
+ Per `vars-findings-schema.md` and `findings-schema.md`:
333
+
334
+ - Bullet character: `•` (matches Visa VCA convention). Not `-`, `*`, or `–`.
335
+ - In-cell line break: `<br>` between bullets. No literal newlines inside a table cell.
336
+ - Item prefix: `Control <item>:` — e.g. `Control 1a:`, `Control 3.i:`, `Control 1:` (when the checklist row has no sub-items). No bolding of the prefix or the item number.
337
+ - Status phrase: exactly one of
338
+ - `Covered in <doc> section <clause>` (or `Covered in <doc> section <clause-a> and section <clause-b>` for multiple references)
339
+ - `Partial — <what's weak>`
340
+ - `Not addressed` (optionally `Not addressed — <reason>` after 9E auto-applies)
341
+ - Em-dash: `—` (U+2014). Not `--`, `-`, or `–`.
342
+
343
+ #### Canonical Issue Description format
344
+
345
+ - Up to two labelled groups, each on its own `<br>`-separated line. **Include only the non-empty groups** — omit a group's heading entirely (do not write `**Recommendations:** —`):
346
+ - `**Actions Required:** — Missing controls under mandatory controls` (mandatory items rated `Partial` / `Not addressed`)
347
+ - `**Recommendations:** — Mandatory controls can be improved and/or missing recommended controls` (unmet recommended items + mandatory strengthening)
348
+ - Under each label, list gaps with lowercase roman enumerators: a bracketed item reference (Actions Required carries status; Recommendations may omit it), then ` — ` and a one-line action/recommendation — e.g. `(i) [Control 2.c: Partial] — Document the VMSS listing procedure.`, `(i) [Control R1.c] — Add an Acquirer disclosure clause.`
349
+
350
+ #### Normalization rules (mechanical rewrites)
351
+
352
+ The pass walks every Observations cell and Issue Description cell and applies these rewrites in order:
353
+
354
+ 1. **Bullet character.** Leading `-`, `*`, `–`, or unicode bullet variants → `•`.
355
+ 2. **Line breaks.** Literal `\n` between bullets in a cell → `<br>`. Collapse runs of `<br>` to a single `<br>`.
356
+ 3. **Strip stray bolding around the item label.** `**Control 1d:**` → `Control 1d:`; `**(1)** ...` → `Control 1: ...`; `**1d**: ...` → `Control 1d: ...`.
357
+ 4. **Add missing `Control` prefix.** A bullet that opens with the item alone (`1d: ...`, `(1d) ...`, `Item 1d — ...`) → `Control 1d: ...`. Item ids are matched against the checklist row's numbered items; if no match, leave the bullet alone and log it.
358
+ 5. **Status phrase casing.** Lowercase variants of `Covered`, `Partial`, `Not addressed` → canonical case. `n/a`, `N/A`, `Not applicable` outside the rubric → leave and log (rubric only allows the three statuses; this is a real issue).
359
+ 6. **Em-dash.** ` -- ` or ` - ` separating status from explanation → ` — `.
360
+ 7. **Whitespace.** Trim trailing spaces inside cells; collapse double spaces; ensure a single space after `Control <item>:`.
361
+ 8. **Issue Description groups.** Each group label sits on its own `<br>`-separated line, followed by `(i)/(ii)/(iii)` roman-enumerated `[Control <id>: <status>] — <one-line action>` entries (not `•` bullets — those are Observations-only). Include only non-empty groups; omit an empty group's heading entirely (never pad with `—`). If gap content exists with no label, wrap it under `**Actions Required:**` (safer default — mandatory) and log for reviewer to confirm.
362
+ 9. **Issue Description vs rating.** A `Satisfactory` row's cell reads exactly `No remediation required.`; an `N/A` row has a blank cell. An `Unsatisfactory` row has an Actions Required group with ≥1 entry (a mandatory `Partial`/`Not addressed`). An `Improvement Recommended` row has only a Recommendations group (no Actions Required heading). The script reads the checklist to tell recommended from mandatory item ids; if it can't, it leaves the cell alone and logs the row.
363
+
364
+ The pass does **not**:
365
+ - Rewrite the substance of any observation (e.g., it never changes "Partial" to "Not addressed" or vice versa).
366
+ - Move bullets between Observations and Issue Description.
367
+ - Add or remove items.
368
+ - Touch the `Control Effectiveness Rating` column.
369
+
370
+ #### How to run
371
+
372
+ A deterministic script handles the mechanical rewrites:
373
+
374
+ ```bash
375
+ python3 {compliance-audit baseDir}/scripts/normalize_tracker.py tracker.md \
376
+ --checklist {compliance-audit baseDir}/references/vars-checklist.md \
377
+ --log normalization.md
378
+ ```
379
+
380
+ `normalization.md` records every rewrite plus any bullet the script declined to normalize (unmatched item id, ambiguous status phrase, missing group label with content). The reviewer skims this before sign-off.
381
+
382
+ If the script is not available, the main agent can perform the same rewrites in-place — but only the mechanical ones in the list above. Anything ambiguous goes in `normalization.md`, not silently into the tracker.
383
+
384
+ After normalization, re-run Step 9A:
385
+
386
+ ```bash
387
+ python3 {compliance-audit baseDir}/scripts/validate_tracker.py tracker.md \
388
+ --checklist {compliance-audit baseDir}/references/vars-checklist.md
389
+ ```
390
+
391
+ Zero errors before proceeding to the sign-off gate.
392
+
393
+ #### Reviewer sign-off gate
394
+
395
+ Before delivering `tracker.md` to the client, the human reviewer must:
396
+
397
+ 1. Confirm Step 9A passes with zero errors against the **reconciled and normalized** tracker.
398
+ 2. Read `reconciliation.md`. Confirm the auto-applied changes (9B phantom citations, 9C `Off-target` / `Missing` verdicts) are correct — these are the most mechanical and should rarely need intervention.
399
+ 3. Work through `reconciliation.md`'s "pending review" section: 9C `Weak` verdicts and 9D challenger recommendations. Accept or reject each, recording the decision.
400
+ 4. Confirm any 9B warnings that the reconciler couldn't auto-apply (e.g. ambiguous citations) are resolved or documented as exceptions.
401
+ 5. Skim `normalization.md`. Confirm any bullets the normalizer declined to rewrite (unmatched item ids, ambiguous status phrases) are real issues to fix — not formatting noise to ignore.
402
+
403
+ The reviewer's sign-off — not the tooling's pass — is what makes the tracker deliverable.
404
+
405
+ ## Built-in Checklists
406
+
407
+ The following checklist is bundled locally in `references/` and can be loaded directly:
408
+
409
+ - `references/vars-checklist.md` — Visa VARS control library (table format) keyed by Visa `Control ID` across `AACQ`, `ATPA`, `AHIR`, `AATM`, and `AVDC`. Pair with `references/vars-findings-schema.md` for the tracker format.
410
+
411
+ To use a built-in checklist, load it in Step 1 instead of asking the user to provide one.
412
+
413
+ ## VARS Audits
414
+
415
+ VARS governs acquirer obligations under the Visa network across five archetypes (45 sub-controls total):
416
+
417
+ | Archetype | Code | Applies To | Sub-controls |
418
+ |-----------|------|------------|--------------|
419
+ | All Acquirers | AACQ | Every Visa acquirer | 22 |
420
+ | TPA Sponsors | ATPA | Acquirers sponsoring Third-Party Agents | 15 |
421
+ | High Integrity Risk | AHIR | Acquirers in the VIRP programme | 1 |
422
+ | ATM Acquirers | AATM | Acquirers operating ATM networks | 5 |
423
+ | Visa Direct Clients | AVDC | Acquirers enabling Visa Direct | 2 (recommended-only) |
424
+
425
+ **At audit start:**
426
+ - Confirm which archetypes apply to the entity. Skip non-applicable parts (e.g., skip ATPA if the acquirer does not sponsor TPAs).
427
+ - Load `references/vars-checklist.md` (control library) and follow `references/vars-findings-schema.md` (tracker output).
428
+ - Tracker rows are **per Control ID**. Per-mandatory-item detail (`1a`, `1b`, `3.i`, …) is captured as bulleted entries inside the Observations cell, prefixed `Control 1a:`, `Control 1b:`, etc., per Visa VCA convention.
429
+ - Use the Visa effectiveness rubric (Satisfactory / Improvement Recommended / Unsatisfactory / N/A; a mandatory `Partial` or `Not addressed` is Unsatisfactory). Do **not** import a critical/major/minor severity scheme.
430
+
431
+ **Key evidence areas:**
432
+ - Risk appetite policy (board-approved, version-controlled)
433
+ - Merchant agreements and underwriting records
434
+ - VMSS/sanctions screening logs at onboarding and ongoing
435
+ - Transaction monitoring rules, alert logs, investigation records
436
+ - Suspicious activity reporting (SAR) records and procedures
437
+ - PCI DSS certification and data security documentation
438
+ - TPA agreements, underwriting files, monitoring reports (ATPA only)
439
+ - VIRP registration documentation (AHIR only)
440
+ - ATM operator agreements and KYO verifications (AATM only)
441
+
442
+ ## Additional Checklists from reg-parser
443
+
444
+ For standards not listed above, check `{reg-parser baseDir}/references/checklists/` — additional checklists are added there as they are extracted. Load the relevant checklist and apply the same phased workflow.
445
+
446
+ ## Guidelines
447
+
448
+ - **One control at a time.** Within any review pass — whether the main agent or a subagent chunk — work through controls one by one. Chunking (Step 6) parallelises *across* control groups but the work *within* a chunk is still sequential, control by control.
449
+ - **Evidence first.** Never mark PASS / Green / Satisfactory without reviewing actual evidence.
450
+ - **Phase-specific observations.** Keep document, onsite, and sample-test conclusions distinct before synthesizing.
451
+ - **Be specific.** Observations reference concrete documents, records, interviews, or test samples.
452
+ - **No assumptions.** If evidence is unavailable, mark FAIL / PARTIAL / Unsatisfactory or request more evidence.
453
+ - **Preserve checklist structure.** Findings map 1:1 to `Control ID` records.
454
+ - **Keep the audit trail.** `tracker.md` is the deliverable but `phase-trail.md` is the defensible record — never overwrite phase observations when finalising the tracker.
455
+ - **Model selection.** Match the subagent's model tier to the cognitive load of its task. Adversarial-stance and synthesis work needs more capability; mechanical tasks (doc conversion, citation lookup) do not. Tiers are vendor-neutral — pick whatever your provider offers at each tier.
456
+
457
+ | Step | Task character | Recommended tier |
458
+ |---|---|---|
459
+ | Step 0 — evidence preprocessing | Mechanical doc conversion (binary → md) | **Small / fast** |
460
+ | Step 6B — per-phase review | Careful reasoning across a control's evidence | **Mid** |
461
+ | Step 7A — tracker synthesis | Multi-phase consolidation per Control ID | **Mid** |
462
+ | Step 9C — citation judge | Local clause-vs-requirement comparison | **Small / fast** |
463
+ | Step 9D — adversarial challenger | Forming a credible challenge, recommending downgrades | **Mid** for routine; **large / top-tier** for regulator-facing audits |
464
+ | Step 10 — normalize formatting | Mechanical text rewrites against a fixed rule set | **Deterministic script** (no model); fallback **Small / fast** |
465
+
466
+ Don't run synthesis or the adversarial challenger on a small model — token savings are dwarfed by re-runs caused by sloppy outputs. Don't run preprocessing or the citation judge on a mid-tier model — there's no reasoning improvement to justify the cost.