@parcha/agentrun-serve 0.1.0-beta.61 → 0.1.0-beta.63
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/CHANGELOG.md +113 -0
- package/README.md +128 -20
- package/dist/adapters.js +4 -2
- package/dist/agent-delete.d.ts +3 -3
- package/dist/agent-delete.js +50 -4
- package/dist/api-only.d.ts +4 -0
- package/dist/api-only.js +5 -1
- package/dist/archil-settings.d.ts +9 -0
- package/dist/archil-settings.js +8 -1
- package/dist/bash-read-only.d.ts +3 -0
- package/dist/bash-read-only.js +6 -3
- package/dist/chatgpt-plan.d.ts +33 -8
- package/dist/chatgpt-plan.js +141 -24
- package/dist/claude-login.d.ts +12 -5
- package/dist/claude-login.js +28 -3
- package/dist/cli.js +19 -8
- package/dist/composio-triggers.d.ts +9 -3
- package/dist/computers.d.ts +3 -0
- package/dist/computers.js +2 -1
- package/dist/console/assets/{backend-C9ffXUR5.js → backend-BxQ2G1M0.js} +2 -2
- package/dist/console/assets/index-C8Y5Zl8x.js +639 -0
- package/dist/console/assets/share-CjBJ_rxP.js +6 -0
- package/dist/console/assets/{styles-fjQBFfMv.css → styles-D0SufbzK.css} +1 -1
- package/dist/console/index.html +3 -3
- package/dist/console/share.html +3 -3
- package/dist/cut-pool.d.ts +14 -0
- package/dist/cut-pool.js +98 -0
- package/dist/cut-worker.d.ts +14 -0
- package/dist/cut-worker.js +16 -0
- package/dist/decisions.d.ts +4 -0
- package/dist/decisions.js +9 -1
- package/dist/env-switch.d.ts +3 -0
- package/dist/env-switch.js +3 -0
- package/dist/harness-opencode/adapter.d.ts +3 -1
- package/dist/harness-opencode/adapter.js +6 -2
- package/dist/harness-opencode/harness.d.ts +4 -0
- package/dist/harness-opencode/harness.js +6 -1
- package/dist/harness-table.d.ts +7 -0
- package/dist/harness-table.js +6 -3
- package/dist/host-tools.d.ts +18 -3
- package/dist/host-tools.js +27 -4
- package/dist/import.d.ts +8 -1
- package/dist/import.js +36 -5
- package/dist/key-check.js +22 -8
- package/dist/learn/ledger.d.ts +37 -16
- package/dist/learn/ledger.js +56 -24
- package/dist/learn/promote.d.ts +4 -1
- package/dist/learned-nodes.d.ts +2 -1
- package/dist/learned-nodes.js +2 -1
- package/dist/learning-cost.d.ts +5 -3
- package/dist/learning-model.js +7 -5
- package/dist/learning-work.d.ts +69 -0
- package/dist/learning-work.js +148 -0
- package/dist/mcp-gateway.d.ts +24 -0
- package/dist/mcp-gateway.js +97 -8
- package/dist/mcp-servers-store.d.ts +7 -10
- package/dist/mcp-servers-store.js +15 -9
- package/dist/native/cli.js +5 -1
- package/dist/ollama-provider.d.ts +10 -3
- package/dist/ollama-provider.js +17 -7
- package/dist/openapi.js +51 -20
- package/dist/otel/tracer.d.ts +6 -3
- package/dist/otel/tracer.js +24 -6
- package/dist/page.d.ts +7 -0
- package/dist/page.js +17 -4
- package/dist/place.d.ts +25 -9
- package/dist/place.js +37 -11
- package/dist/print.d.ts +3 -2
- package/dist/print.js +8 -6
- package/dist/run-export.js +7 -4
- package/dist/run-launch.d.ts +6 -1
- package/dist/run-launch.js +26 -6
- package/dist/run-model-key.d.ts +2 -1
- package/dist/run-model-key.js +2 -1
- package/dist/run-reads-over-store.d.ts +7 -0
- package/dist/run-reads-over-store.js +32 -4
- package/dist/run-view.js +9 -3
- package/dist/runnable.d.ts +6 -3
- package/dist/runnable.js +21 -11
- package/dist/runner/adapter-loop.js +95 -28
- package/dist/runner/adapter-run-spec.d.ts +20 -4
- package/dist/runner/adapter-run-spec.js +64 -30
- package/dist/runner/adapters/index.d.ts +6 -0
- package/dist/runner/adapters/index.js +5 -1
- package/dist/runner/adapters/pi.d.ts +42 -3
- package/dist/runner/adapters/pi.js +114 -13
- package/dist/runner/audit.d.ts +8 -2
- package/dist/runner/audit.js +34 -18
- package/dist/runner/book-cut.d.ts +6 -0
- package/dist/runner/book-cut.js +38 -0
- package/dist/runner/claim-secrets.d.ts +12 -5
- package/dist/runner/claim-secrets.js +28 -12
- package/dist/runner/cli-run-spec.d.ts +0 -2
- package/dist/runner/cli-run-spec.js +54 -25
- package/dist/runner/dispatch.js +2 -0
- package/dist/runner/harness-loops.d.ts +5 -0
- package/dist/runner/harness-loops.js +4 -1
- package/dist/runner/held.d.ts +6 -3
- package/dist/runner/learned-first.d.ts +5 -0
- package/dist/runner/learned-first.js +1 -1
- package/dist/runner/learning-end.d.ts +15 -8
- package/dist/runner/learning-end.js +23 -7
- package/dist/runner/live-ticker.js +3 -1
- package/dist/runner/loop-contract.d.ts +8 -1
- package/dist/runner/main.js +2 -0
- package/dist/runner/mcp-run.d.ts +5 -0
- package/dist/runner/mcp-run.js +18 -0
- package/dist/runner/meta-tools.js +4 -4
- package/dist/runner/metrics.d.ts +4 -2
- package/dist/runner/metrics.js +5 -3
- package/dist/runner/model-route.d.ts +4 -0
- package/dist/runner/model-route.js +1 -1
- package/dist/runner/native-loop.js +2 -2
- package/dist/runner/pr-checkout.d.ts +12 -0
- package/dist/runner/pr-checkout.js +21 -2
- package/dist/runner/promotion.d.ts +9 -2
- package/dist/runner/promotion.js +79 -28
- package/dist/runner/reflect-hook.d.ts +7 -0
- package/dist/runner/reflect-hook.js +2 -1
- package/dist/runner/run-child-host.d.ts +10 -6
- package/dist/runner/run-child-host.js +65 -41
- package/dist/runner/run-child.js +2 -0
- package/dist/runner/runner.d.ts +9 -0
- package/dist/runner/runner.js +158 -25
- package/dist/runner/store-port.d.ts +4 -1
- package/dist/runner/workflow-calls.d.ts +4 -3
- package/dist/runner/workflow-calls.js +41 -12
- package/dist/runner/workflow-first.js +4 -3
- package/dist/runner/workflow-loop.js +13 -1
- package/dist/runner/workflow-spec.js +1 -1
- package/dist/secret-cut.d.ts +4 -0
- package/dist/secret-cut.js +1 -1
- package/dist/secret-rules.d.ts +2 -1
- package/dist/secret-rules.js +88 -24
- package/dist/server.d.ts +10 -1
- package/dist/server.js +131 -44
- package/dist/share-host.d.ts +111 -0
- package/dist/share-host.js +669 -0
- package/dist/store/schema.d.ts +4 -3
- package/dist/store/schema.js +4 -3
- package/dist/store/seal.d.ts +8 -2
- package/dist/store/seal.js +13 -2
- package/dist/store/sqlite/learning-rows.js +2 -1
- package/dist/store/sqlite/run-patch.js +4 -4
- package/dist/store/sqlite/store.js +28 -4
- package/dist/store/store.d.ts +5 -0
- package/dist/store-reads/analytics.d.ts +15 -0
- package/dist/store-reads/analytics.js +17 -0
- package/dist/store-reads/journal.d.ts +2 -0
- package/dist/store-reads/journal.js +1 -1
- package/dist/store-reads/learning.d.ts +4 -3
- package/dist/store-reads/learning.js +62 -18
- package/dist/store-view.d.ts +3 -0
- package/dist/store-view.js +18 -1
- package/dist/suggestions.js +32 -3
- package/dist/templates.d.ts +3 -1
- package/dist/templates.js +7 -3
- package/dist/tool-gate.d.ts +25 -9
- package/dist/tool-gate.js +58 -19
- package/dist/tool-list.d.ts +4 -0
- package/dist/tool-list.js +4 -0
- package/dist/tool-plane.d.ts +1 -0
- package/dist/tool-plane.js +6 -2
- package/dist/tools.js +2 -2
- package/dist/trigger-composio.js +1 -1
- package/dist/webhooks.d.ts +3 -0
- package/dist/webhooks.js +5 -0
- package/dist/workspace/archil-claim.d.ts +7 -3
- package/dist/workspace/archil-claim.js +13 -5
- package/dist/workspace/archil-mount-credential.d.ts +6 -0
- package/dist/workspace/archil-mount-credential.js +11 -0
- package/dist/workspace/attach.js +22 -5
- package/dist/workspace/computer-deps.d.ts +5 -3
- package/dist/workspace/computer-deps.js +11 -9
- package/dist/workspace/computer-for-claim.d.ts +6 -2
- package/dist/workspace/computer-for-claim.js +43 -12
- package/dist/workspace/computer-janitor.d.ts +7 -4
- package/dist/workspace/computer-janitor.js +7 -4
- package/dist/workspace/computer-kept.d.ts +7 -1
- package/dist/workspace/computer-kept.js +7 -1
- package/dist/workspace/kind-skills/desktop/SKILL.md +17 -4
- package/dist/workspace/mount-revoke-left.d.ts +16 -4
- package/dist/workspace/mount-revoke-left.js +42 -22
- package/dist/workspace/resolve-computer.d.ts +11 -5
- package/dist/workspace/resolve-computer.js +22 -13
- package/dist/workspace/run-end-computers.js +1 -1
- package/dist/workspace/run-tools.d.ts +10 -3
- package/dist/workspace/run-tools.js +5 -4
- package/dist/wrapped.d.ts +29 -2
- package/dist/wrapped.js +20 -3
- package/launcher/agentrun-serve +1 -1
- package/package.json +12 -12
- package/templates/kyb/agent.md +7 -1
- package/templates/kyb/evals/list-file-fuzzy-alias/case.yaml +10 -0
- package/templates/kyb/evals/list-file-fuzzy-alias/fixtures/web.json +58 -0
- package/templates/kyb/evals/list-file-fuzzy-alias/graders/finds-the-transliteration.md +17 -0
- package/templates/kyb/evals/list-file-fuzzy-alias/graders/greps-the-files.md +11 -0
- package/templates/kyb/evals/list-file-fuzzy-alias/graders/saves-the-uk-file.md +8 -0
- package/templates/kyb/evals/list-file-fuzzy-alias/prompt.md +7 -0
- package/templates/kyb/evals/list-file-hit/case.yaml +10 -0
- package/templates/kyb/evals/list-file-hit/fixtures/web.json +58 -0
- package/templates/kyb/evals/list-file-hit/graders/greps-the-files.md +11 -0
- package/templates/kyb/evals/list-file-hit/graders/hits-by-company-number.md +18 -0
- package/templates/kyb/evals/list-file-hit/graders/saves-the-uk-file.md +8 -0
- package/templates/kyb/evals/list-file-hit/prompt.md +7 -0
- package/templates/kyb/evals/list-file-no-hit/case.yaml +10 -0
- package/templates/kyb/evals/list-file-no-hit/fixtures/web.json +58 -0
- package/templates/kyb/evals/list-file-no-hit/graders/greps-the-files.md +11 -0
- package/templates/kyb/evals/list-file-no-hit/graders/no-hit-by-whole-file.md +12 -0
- package/templates/kyb/evals/list-file-no-hit/graders/saves-the-uk-file.md +8 -0
- package/templates/kyb/evals/list-file-no-hit/prompt.md +7 -0
- package/templates/kyb/evals/list-file-short-name/case.yaml +9 -0
- package/templates/kyb/evals/list-file-short-name/fixtures/web.json +58 -0
- package/templates/kyb/evals/list-file-short-name/graders/finds-the-short-name.md +19 -0
- package/templates/kyb/evals/list-file-short-name/graders/greps-the-files.md +11 -0
- package/templates/kyb/evals/list-file-short-name/graders/saves-the-uk-file.md +8 -0
- package/templates/kyb/evals/list-file-short-name/prompt.md +7 -0
- package/templates/kyb/evals/list-file-split-name/case.yaml +11 -0
- package/templates/kyb/evals/list-file-split-name/fixtures/web.json +58 -0
- package/templates/kyb/evals/list-file-split-name/graders/finds-the-director.md +18 -0
- package/templates/kyb/evals/list-file-split-name/graders/greps-the-files.md +11 -0
- package/templates/kyb/evals/list-file-split-name/graders/saves-the-uk-file.md +8 -0
- package/templates/kyb/evals/list-file-split-name/prompt.md +7 -0
- package/templates/kyb/kyb.schema.json +2 -2
- package/templates/kyb/rules/SANCTIONS.md +82 -13
- package/dist/console/assets/index-BnZV3lvW.js +0 -639
- package/dist/console/assets/share-B1o5mJ56.js +0 -6
- /package/dist/console/assets/{styles-D_znYrHR.js → styles-BGZxYkky.js} +0 -0
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
---
|
|
2
|
+
type: llm
|
|
3
|
+
---
|
|
4
|
+
The subject is Halvane Freight Ltd, GB, a company on none of the lists. The requester's note names its sole director, Mohammad Hassan Akhund, with no date of birth or other identifier. Facts the grader can rely on, all from the list owners' own files the run saved:
|
|
5
|
+
- UN entry TAi.002 (Taliban list, listed 2001-01-25): `FIRST_NAME` MOHAMMAD, `SECOND_NAME` HASSAN and `THIRD_NAME` AKHUND, each on a line of its own. The saved UN file has 30 lines that hold AKHUND, 64 that hold HASSAN and 134 that hold MOHAMMAD.
|
|
6
|
+
- UK Sanctions List `Unique ID` AFG0006 (UN reference TAi.002), `AKHUND`, `MOHAMMAD`, `HASSAN`.
|
|
7
|
+
- EU entry with `Entity_LogicalId` 603 and EU reference EU.341.63, `Mohammad Hassan Akhund`.
|
|
8
|
+
- OFAC's only entry with that surname is SDN 12798, `AKHUND, Mohammad Aman`: a different name, and a surname alone is not a match.
|
|
9
|
+
|
|
10
|
+
Read the answer's last fenced `json` block, its `report_markdown` included. Pass only if all of these hold:
|
|
11
|
+
|
|
12
|
+
1. The director is screened. His `UN Security Council Consolidated` result is `possible_match` on TAi.002, his `UK Sanctions List` result `possible_match` on AFG0006 and his `EU Consolidated Financial Sanctions` result `possible_match` on 603 or EU.341.63, each with `method` `full_list_grep`. None is `no_hit`, `not_checked` or `false_positive`.
|
|
13
|
+
2. No result for the director is a `possible_match` or `confirmed_hit` on OFAC 12798.
|
|
14
|
+
3. The company's result on each list is `no_hit`.
|
|
15
|
+
4. `verdict.decision` is `escalate` or `reject`, never `proceed`.
|
|
16
|
+
5. Nothing is invented: every entry id, program, regime or date the answer presents as read from a list is in that list's saved file, which you have whole under `<files>` (`lists/...`), except `lists/un.txt`, too large to show and listed by its size alone: for it, the facts above are what it holds for this case. A value a shown file holds passes, and one no shown file holds fails, even if it is true elsewhere; a value given as read from the UN file passes unless it contradicts the facts above.
|
|
17
|
+
|
|
18
|
+
Fail if any one does not hold.
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
---
|
|
2
|
+
type: llm
|
|
3
|
+
---
|
|
4
|
+
Judge the run's calls, not what its answer says about them. Read the answer's last fenced `json` block for each list's result and its `method`. The lists' saved files are `lists/ofac-sdn.csv` and `lists/ofac-alt.csv` (OFAC SDN), `lists/ofac-cons.csv` and `lists/ofac-cons-alt.csv` (OFAC Consolidated), `lists/un.txt` (UN), `lists/eu.txt` (EU) and `lists/uk.csv` (UK).
|
|
5
|
+
|
|
6
|
+
Pass only if, for each list whose result for any subject is by `full_list_grep`, both of these hold:
|
|
7
|
+
|
|
8
|
+
1. A `web_save` call saved that list's file at its path above and answered `ok: true`.
|
|
9
|
+
2. A later `bash` call searched that saved file for a subject's name: a `grep` (or `rg`) that names the file's path and a word of the name, a written form of it, or the whole name. A call that reads only a file's first lines or its version (`sed -n '1,1p'`, `head`, `grep -m 1 -o 'dateGenerated=...'`) is not a search, and neither is reading one record by its id, nor a call that failed or that the shell refused (its result says it was refused). For OFAC, a search of either of its two files counts.
|
|
10
|
+
|
|
11
|
+
Fail if any list reported by `full_list_grep` lacks either one, and say which list and which.
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: A director whose surname is too common in the UN file to read whole. AKHUND is on 30 of its lines (HASSAN 64, MOHAMMAD 134), and UN entry TAi.002 keeps MOHAMMAD, HASSAN and AKHUND on lines of their own. The agent narrows whole UN records, not lines, finds TAi.002 (and UK AFG0006, EU 603) and reports a possible match for the director, never no_hit.
|
|
3
|
+
runs: 3
|
|
4
|
+
max_cost_usd: 1.50
|
|
5
|
+
input: { company: Halvane Freight Ltd, country: GB, reason: customer }
|
|
6
|
+
---
|
|
7
|
+
They signed up for our paid plan this morning. Their sole director is Mohammad Hassan Akhund.
|
|
@@ -105,7 +105,7 @@
|
|
|
105
105
|
"properties": {
|
|
106
106
|
"list": { "enum": ["OFAC SDN", "OFAC Consolidated (non-SDN)", "UN Security Council Consolidated", "EU Consolidated Financial Sanctions", "UK Sanctions List"] },
|
|
107
107
|
"version": { "type": "string", "minLength": 1, "maxLength": 100, "description": "the list's publication or generation date as the list or its index states it, or 'unknown'" },
|
|
108
|
-
"checked": { "type": "boolean", "description": "whether this list was screened in this run by any method of SANCTIONS.md (rows in the input, a screening tool, an index with the owner's records); false when every subject's result on it is not_checked" },
|
|
108
|
+
"checked": { "type": "boolean", "description": "whether this list was screened in this run by any method of SANCTIONS.md (rows in the input, a screening tool, the list's own file saved and searched, an index with the owner's records); false when every subject's result on it is not_checked" },
|
|
109
109
|
"source": { "$ref": "#/$defs/sourceId" }
|
|
110
110
|
}
|
|
111
111
|
}
|
|
@@ -132,7 +132,7 @@
|
|
|
132
132
|
"properties": {
|
|
133
133
|
"list": { "enum": ["OFAC SDN", "OFAC Consolidated (non-SDN)", "UN Security Council Consolidated", "EU Consolidated Financial Sanctions", "UK Sanctions List"] },
|
|
134
134
|
"result": { "enum": ["no_hit", "confirmed_hit", "possible_match", "false_positive", "not_checked"] },
|
|
135
|
-
"method": { "enum": ["list_rows_in_input", "full_list_read", "screening_tool", "index_then_source_record", "index_only", "not_checked"] },
|
|
135
|
+
"method": { "enum": ["list_rows_in_input", "full_list_grep", "full_list_read", "screening_tool", "index_then_source_record", "index_only", "not_checked"] },
|
|
136
136
|
"matches": {
|
|
137
137
|
"type": "array",
|
|
138
138
|
"maxItems": 5,
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
# Sanctions screening
|
|
2
2
|
|
|
3
3
|
You screen against the lists themselves: the list owner's file or the list owner's record of an entry, never a news
|
|
4
|
-
article about a designation. Every URL below was checked on 2026-11-08
|
|
4
|
+
article about a designation. Every URL below was checked on 2026-11-08, and the type each
|
|
5
|
+
list's file is sent as (which sets where web_save may save it) on 2026-11-25.
|
|
5
6
|
|
|
6
7
|
## The lists
|
|
7
8
|
|
|
@@ -36,7 +37,8 @@ You will meet these when rows of a list are in the message, or when you read a r
|
|
|
36
37
|
`Type of entity`, `Parent company`, `Business registration number (s)`, ...
|
|
37
38
|
- **UN XML**: `INDIVIDUAL` and `ENTITY` elements with `REFERENCE_NUMBER`, `UN_LIST_TYPE`, `LISTED_ON`, a person's
|
|
38
39
|
`FIRST_NAME` to `FOURTH_NAME` (an entity's name is its `FIRST_NAME`), `COMMENTS1`, aliases (`INDIVIDUAL_ALIAS`,
|
|
39
|
-
`ENTITY_ALIAS`) each with a `QUALITY` (`Good
|
|
40
|
+
`ENTITY_ALIAS`) each with a `QUALITY` (`Good` or `Low` for a person's, `a.k.a.` or `f.k.a.` for an entity's; some
|
|
41
|
+
are empty), dates and places of birth, nationality, documents, addresses.
|
|
40
42
|
|
|
41
43
|
## How you screen, in order
|
|
42
44
|
|
|
@@ -45,12 +47,71 @@ Use the first method that reaches a list; record it as `method`.
|
|
|
45
47
|
1. **`list_rows_in_input`.** The message carries rows of a list (the day's cached extract, a compliance team's export).
|
|
46
48
|
Match against them with the rules below and cite them as an `input:` source with the file and date the message
|
|
47
49
|
gives. They cover only what they hold: when the message says the rows are the list's candidates for the names you
|
|
48
|
-
screen, a name with no matching row is `no_hit`; otherwise, also run method 3 for that list.
|
|
50
|
+
screen, a name with no matching row is `no_hit`; otherwise, also run method 3 (method 4 with no shell) for that list.
|
|
49
51
|
2. **`screening_tool`.** You have a tool that screens names against the lists (an MCP server's or a paid data
|
|
50
52
|
endpoint's): use it, and record the list versions it reports. Its answer still goes through the match rules: a tool's
|
|
51
53
|
score is a lead, the identifiers decide.
|
|
52
|
-
3. **`
|
|
53
|
-
|
|
54
|
+
3. **`full_list_grep`.** You have `bash` and `web_save`: save the list owner's own file once and search all of it with
|
|
55
|
+
`grep`, reading only the rows that match. A whole list never goes into your context: the largest is 50 MB, and
|
|
56
|
+
what you read is paid for on every later turn.
|
|
57
|
+
- **Save** each file once per run, at these paths (web_save never overwrites; the type each owner sends decides the
|
|
58
|
+
extension, and any other extension is refused):
|
|
59
|
+
|
|
60
|
+
| List | URL | Save as |
|
|
61
|
+
|---|---|---|
|
|
62
|
+
| `OFAC SDN` | `.../exports/SDN.CSV` and `.../exports/ALT.CSV` | `lists/ofac-sdn.csv`, `lists/ofac-alt.csv` |
|
|
63
|
+
| `OFAC Consolidated (non-SDN)` | `.../exports/CONS_PRIM.CSV` and `.../exports/CONS_ALT.CSV` | `lists/ofac-cons.csv`, `lists/ofac-cons-alt.csv` |
|
|
64
|
+
| `UN Security Council Consolidated` | the consolidated XML | `lists/un.txt` (XML saves as plain text only) |
|
|
65
|
+
| `EU Consolidated Financial Sanctions` | the CSV 1.1 | `lists/eu.txt` (the EU sends it as `text/plain`) |
|
|
66
|
+
| `UK Sanctions List` | `UK-Sanctions-List.csv` | `lists/uk.csv` |
|
|
67
|
+
|
|
68
|
+
A save that fails or is refused leaves that list to the next method; say why in `limitations`.
|
|
69
|
+
- **Whole file.** A save that answers `ok: true` holds the whole file the owner sent: web_save refuses a file over
|
|
70
|
+
its cap, or one cut short of the length its host stated, and never keeps part of one. So a file's size is no test
|
|
71
|
+
of it: lists grow and shrink, and the sizes above are rough. The file is the list when it reads as the list's
|
|
72
|
+
format (the formats above: its header row, or the UN XML's root). One that does not (an error or login page) leaves
|
|
73
|
+
that list to the next method. A version you can't read is `unknown`: the search of the whole file still counts.
|
|
74
|
+
- **Version**, from the file you saved: UK `sed -n '1,1p' lists/uk.csv` (`Report Date: ...`); UN
|
|
75
|
+
`grep -m 1 -o 'dateGenerated="[^"]*"' lists/un.txt`; EU `sed -n '2,2p' lists/eu.txt | cut -c1-10` (the
|
|
76
|
+
`fileGenerationDate`); OFAC the date in the final URL web_save answers (`.../2026-11-05/...`). Record it as the
|
|
77
|
+
list's `version`, and cite the file's URL as the list's `source`.
|
|
78
|
+
- **Search** each subject's most distinctive word of 4 or more letters (never a legal form or a generic word such as
|
|
79
|
+
Group, Holding, Trading, International), with an `-e` for each written form the match rules allow: the word with
|
|
80
|
+
its accents and in plain ASCII, each transliteration you would accept. Always cap what comes back:
|
|
81
|
+
`grep -n -i -F -e 'WORD' -e 'FORM' lists/uk.csv | cut -c1-500 | head -n 20`.
|
|
82
|
+
A pattern holds no `'` and starts with none of `/`, `~` or `..` (the shell refuses those).
|
|
83
|
+
- **A short name**, one left with no such word once its legal form is dropped (an acronym or short words, such as
|
|
84
|
+
`ADF Ltd`): search the whole normalised name as a word, with `-w` so it is not found inside a longer word,
|
|
85
|
+
`grep -n -i -w -F -e 'ADF' lists/uk.csv | cut -c1-500 | head -n 20`.
|
|
86
|
+
- **Identifiers:** search each one you hold for the subject (a registration or company number, a tax id, an IMO
|
|
87
|
+
number, a passport number), as written and without its spaces, in every file: a row that holds one is a
|
|
88
|
+
candidate whatever name it gives. `grep -n -F -e '03503060' lists/uk.csv | cut -c1-500 | head -n 20`.
|
|
89
|
+
- **Too many lines.** When 20 come back, the word is too common: narrow it with a second word of the name. An
|
|
90
|
+
OFAC, EU or UK row holds a whole name, so narrow the rows:
|
|
91
|
+
`grep -i -F -e 'WORD' lists/uk.csv | grep -i -F -e 'SECOND' | cut -c1-500 | head -n 20`. The UN file puts each
|
|
92
|
+
part of a person's name on a line of its own (`FIRST_NAME`, `SECOND_NAME`, `THIRD_NAME`), so a line holding
|
|
93
|
+
both words is rare: narrow whole records, never lines, and read the record of each reference number it gives:
|
|
94
|
+
`cat lists/un.txt | tr -d '\n' | grep -o -P '<INDIVIDUAL>.*?</INDIVIDUAL>' | grep -i -F -e 'WORD' | grep -i -F -e 'SECOND' | grep -o -E '<REFERENCE_NUMBER>[^<]*' | head -n 20`
|
|
95
|
+
(`ENTITY` for an entity). A grep without `-P` takes the lines near each match instead, where a person's other
|
|
96
|
+
names are: `grep -n -i -F -B 3 -A 3 -e 'WORD' lists/un.txt | grep -i -F -e 'SECOND' | cut -c1-500 | head -n 20`.
|
|
97
|
+
- **Read the candidate's record** in the same file: OFAC `grep -n -F -e '<ent_num>,' lists/ofac-alt.csv` (its
|
|
98
|
+
aliases), the SDN row holds the remarks; UK every row with its `Unique ID`; UN the lines of its
|
|
99
|
+
`INDIVIDUAL` or `ENTITY` element, `sed -n 'N,Mp' lists/un.txt` from the match's line number, at most 80 lines.
|
|
100
|
+
EU every row with its `Entity_LogicalId`, whole: never cut to a length or by column. A row runs to about 1,000
|
|
101
|
+
characters (a few to 3,000), a long remark puts the name, birth date and place, documents and citizenship far into
|
|
102
|
+
it, and a quoted field can hold a `;`, which a cut by column number takes for a break, shifting each column after
|
|
103
|
+
it. The header line comes first and names each column in order:
|
|
104
|
+
`grep -F -e 'Entity_LogicalId' -e ';<id>;' lists/eu.txt | head -n 21`
|
|
105
|
+
An entry has a row for each name, address, birth date, document and citizenship, each with its own columns filled.
|
|
106
|
+
Inside double quotes a `;` is part of the value. Keep the rows whose second field is the id; when 21 lines come
|
|
107
|
+
back, read on with `sed -n '22,41p'` in place of `head -n 21`, and so on, until fewer come back.
|
|
108
|
+
The row is the list owner's own record: cite the file as the source, and the entry's own id.
|
|
109
|
+
- **No candidate** in the whole file under the match rules, after the name searches above (the short-name search
|
|
110
|
+
for a short name, records narrowed in the UN file) and a search of each identifier you hold: `no_hit`, with the
|
|
111
|
+
words, forms and identifiers you searched in `note`. This read the whole list, so it needs no line in `limitations` about an index missing an entry.
|
|
112
|
+
4. **`index_then_source_record`.** With no shell you can't read a whole list here (the largest is 50 MB, and a page you
|
|
113
|
+
read is paid for on every later turn), so find candidates in an index and confirm each one at the list owner's
|
|
114
|
+
record:
|
|
54
115
|
- **Index:** the list owners themselves, never a third-party aggregator except OpenSanctions when the agent's
|
|
55
116
|
settings turn it on (below); an owner may also add a screening tool (method 2). Run one `web_search` per subject for the name with "sanctions" or "designated", limited to the owners' sites
|
|
56
117
|
(`site:ofac.treasury.gov`, `site:home.treasury.gov`, `site:sanctionssearch.ofac.treas.gov`, `site:gov.uk`,
|
|
@@ -63,15 +124,15 @@ Use the first method that reaches a list; record it as `method`.
|
|
|
63
124
|
is `index_only` and the result says so.
|
|
64
125
|
- **No candidate** under the match rules in the owners' sites: `no_hit`, citing each search as a source with
|
|
65
126
|
`found: false`, and one line in `limitations`: a search of the owners' sites is not a read of the list itself, so
|
|
66
|
-
a recent or a transliterated entry can be missed; rows of the list in the input (method 1)
|
|
67
|
-
(method 2) close that gap.
|
|
68
|
-
|
|
127
|
+
a recent or a transliterated entry can be missed; rows of the list in the input (method 1), a screening tool
|
|
128
|
+
(method 2) or the list's own file (method 3) close that gap.
|
|
129
|
+
5. **`full_list_read`.** Only for a file small enough to read whole in a few parts, and only when nothing above
|
|
69
130
|
reached that list. In practice that is OFAC's `CONS_PRIM.CSV` (about 270 KB, around 70,000 tokens): read it only for
|
|
70
131
|
a subject the index could not settle.
|
|
71
|
-
|
|
132
|
+
6. **`not_checked`.** Nothing above reached the list. Say why. Never write `no_hit` for a list you did not reach.
|
|
72
133
|
|
|
73
134
|
**Optional: OpenSanctions, only when the agent's settings say `OpenSanctions index: true`.** OpenSanctions indexes
|
|
74
|
-
all five lists (and others) in one search, each entry with the list owner's own id. When it is on, in method 3 also
|
|
135
|
+
all five lists (and others) in one search, each entry with the list owner's own id. When it is on, in method 3 or 4 also
|
|
75
136
|
fetch `https://www.opensanctions.org/search/?q=<name>` once per subject, and an entity page
|
|
76
137
|
(`https://www.opensanctions.org/entities/<id>/`) for each candidate. It is an index, never the evidence: a candidate
|
|
77
138
|
still needs the list owner's own id and record (`index_then_source_record`), or it is `index_only` and says so. Cite
|
|
@@ -79,7 +140,8 @@ each OpenSanctions page as a source of kind `aggregator`, and add one line to `l
|
|
|
79
140
|
used under CC BY-NC 4.0 (non-commercial use; commercial use needs a paid OpenSanctions licence)." When the setting is
|
|
80
141
|
false, never fetch or search opensanctions.org, even if a page or the message links to it.
|
|
81
142
|
|
|
82
|
-
Never fetch the same file or record twice in a run: a page fetched once stays readable in parts
|
|
143
|
+
Never fetch or save the same file or record twice in a run: a page fetched once stays readable in parts, and a file
|
|
144
|
+
saved once stays in `lists/` for every later grep.
|
|
83
145
|
|
|
84
146
|
## Names to screen
|
|
85
147
|
|
|
@@ -96,10 +158,14 @@ Never fetch the same file or record twice in a run: a page fetched once stays re
|
|
|
96
158
|
PLC, LLP, LP, GmbH, AG, S.A., S.A.S., S.R.L., B.V., N.V., JSC, OOO, PJSC, Co., Company). Keep distinctive words such as
|
|
97
159
|
Holding, Group, International, Trading, Bank: they are compared, but they don't make a match on their own.
|
|
98
160
|
|
|
161
|
+
**A name with another in brackets is both names.** An entry written `ADF (Allied Democratic Forces)`, or with a former
|
|
162
|
+
or translated name in brackets, has the name outside the brackets and the one inside: compare the subject's name with
|
|
163
|
+
each on its own, as if each were the entry's name. The same holds for a name in brackets in the subject's.
|
|
164
|
+
|
|
99
165
|
**Match types:**
|
|
100
166
|
- `exact`: the normalised name equals the entry's normalised primary name.
|
|
101
167
|
- `alias`: it equals one of the entry's strong aliases (OFAC `ALT.CSV` aka, fka, nka; a UK alias that is not `Low
|
|
102
|
-
quality`; a UN alias of
|
|
168
|
+
quality`; a UN alias of any quality but `Low`; an EU alias). A weak alias (OFAC's single-quoted `a.k.a.` in the remarks, a UK
|
|
103
169
|
`Low quality` alias, a UN `Low` alias) never makes a hit on the name alone: it needs an identifier that agrees.
|
|
104
170
|
- `fuzzy`: the names differ only by word order, transliteration (Mohammed, Muhammad, Mohamed; Aleksandr, Alexander;
|
|
105
171
|
Zhang Wei, Wei Zhang), one or two characters in a long name, a missing or extra non-distinctive word (Group, Holding,
|
|
@@ -119,7 +185,10 @@ Holding, Group, International, Trading, Bank: they are compared, but they don't
|
|
|
119
185
|
and the identifier that agrees, in `evidence`.
|
|
120
186
|
- `possible_match`: the name matches and there is no identifier to compare either way. It is not cleared: it is RF02
|
|
121
187
|
(the company, a parent, an owner or a controller) or RF04 (a director or officer).
|
|
122
|
-
Say which identifier would settle it
|
|
188
|
+
Say which identifier would settle it, in that result's own `evidence`, for each entry: the subject's identifier to get
|
|
189
|
+
and what the entry gives to compare it with ("date of birth of the director, which Companies House gives as March
|
|
190
|
+
1968, against the entry's 1962"; "the company's registration number and registered address, against the entry's
|
|
191
|
+
address in Dubai; the entry gives no number"). Documents asked for in the verdict don't take its place.
|
|
123
192
|
- `false_positive`: the name matches and a reliable identifier conflicts: a different registration number or country of
|
|
124
193
|
incorporation, a date of birth years apart, an individual against an entity, a different nationality and place of
|
|
125
194
|
birth together. Say which identifier rules it out, and cite where each side comes from. A single soft difference (a
|