# Industry sample packs — selection index

Four live-proven packs, each exercised against this bundle's own tools. Every
command below runs from the extracted bundle root. Each pack's `TEMPLATE.md`
carries the full record shapes and honest-scope notes; expected outcomes below
are quoted from the packs' witnessed runs.

**Honesty notes, up front:**
- **Medical and engineering are teach-surface packs by design** — they exercise
  the self-teaching skill creator only. They do NOT map clinical or QC data
  onto the reconcile / duplicate / anomaly tools; those are money-shaped
  instruments, and faking a fit would misrepresent both.
- **Medical data is fully synthetic — placeholder IDs only** (`P0001-E01`-style
  chart IDs; no name, DOB, SSN, address, insurance ID, or anything traceable
  to a real person). A rule the engine adopts is a decision aid learned from
  labels the pack author wrote; it is not a clinical judgment and carries no
  medical authority.

## Medical (teach-surface)

Demonstrates: a threshold rule over 4-field synthetic vitals records taught
through the real S053 engine, and a constructive refusal when examples leave
a gap — "an engine that will not paper over missing clinical judgment with a
confident-sounding number."

```bash
ai_node/teach_skill.sh samples/industries/medical/teach_families/triage_review_adopt.json
ai_node/teach_skill.sh samples/industries/medical/teach_families/triage_review_refuse.json
ai_node/teach_skill.sh samples/industries/medical/teach_families/news2_escalation_adopt.json
ai_node/teach_skill.sh samples/industries/medical/teach_families/news2_escalation_refuse.json
```

Expected (quoted from the pack's witnessed run):
- triage adopt: `DECISION: ADOPT` with
  `learned rule: op=classify params={"rule": ["ge", 137.5, "review", "no_review"], "src": ["key", "bp_systolic_mmhg"]}`
- triage refuse: `DECISION: REFUSE (underdetermined)` with
  `missing labeled input: {"bp_systolic_mmhg": 150, "chart_id": "C0098", "heart_rate_bpm": 80, "temp_c_x10": 370}`
- news2 adopt (evidence-aligned family — NEWS2 aggregate-score escalation
  band, see the pack TEMPLATE's evidence appendix): `DECISION: ADOPT` with
  `learned rule: op=classify params={"rule": ["ge", 6.5, "met_call", "ward_review"], "src": ["key", "news2_score"]}`
  (on integer scores, `>= 6.5` is behaviorally identical to `>= 7` — the
  intended band boundary)
- news2 refuse: `DECISION: REFUSE (underdetermined)` with
  `missing labeled input: {"news2_score": 6, "patient_ref": "P0198-E01", "resp_rate_bpm": 24, "spo2_pct": 93}`
  (score 6 is exactly where the two NEWS2 bands genuinely disagree)

## Engineering / QC tolerance (teach-surface)

Demonstrates: a tolerance threshold over integer-micrometer measurement
records (no float touches a measurement), a designed `reach_limit` refusal
proving the operator algebra has no `abs()` (a feature — the engine names the
missing operation instead of faking one), and an underdetermined refusal.

```bash
ai_node/teach_skill.sh samples/industries/engineering/teach_families/qc_tolerance_adopt.json
ai_node/teach_skill.sh samples/industries/engineering/teach_families/qc_tolerance_refuse.json
ai_node/teach_skill.sh samples/industries/engineering/teach_families/qc_tolerance_no_abs_probe.json
ai_node/teach_skill.sh samples/industries/engineering/teach_families/we_rule1_adopt.json
ai_node/teach_skill.sh samples/industries/engineering/teach_families/we_rule4_adopt.json
```

Expected (quoted):
- qc adopt: `DECISION: ADOPT` with
  `learned rule: op=classify params={"rule": ["ge", 47.5, "out_of_tolerance", "in_tolerance"], "src": ["key", "deviation_um"]}`
- qc refuse: `DECISION: REFUSE (underdetermined)` with
  `missing labeled input: {"deviation_um": 65, "machine_id": "M9", "measured_um": 5065, "nominal_um": 5000, "part_id": "PT-2099"}`
- no-abs probe: `DECISION: REFUSE (reach_limit)` — "No enumerated candidate
  (57 proposed ...) fits all 6 worked examples ... This needs an operation
  outside my current algebra"
- Western Electric Rule 1 adopt (evidence-aligned family — |z| >= 3.0 in
  tenths, see the pack TEMPLATE's pattern section): `DECISION: ADOPT` with
  `learned rule: op=classify params={"rule": ["ge", 29.5, "out_of_control", "in_control"], "src": ["key", "abs_z_x10"]}`
  (on integer tenths, `>= 29.5` is behaviorally identical to `>= 30`,
  i.e. |z| >= 3.0)
- Western Electric Rule 4 adopt (run-of-8 same side): `DECISION: ADOPT` with
  `learned rule: op=classify params={"rule": ["ge", 8, "flag_run", "no_flag"], "src": ["key", "consecutive_same_side"]}`

## Fintech (payments/settlement reconciliation)

Demonstrates: a processor settlement export vs internal ledger through the
real reconciler, duplicate-settlement detection, just-under-threshold
structuring flags, and a chargeback-window teach pair. 6 planted defects
(see `plants.json`), 6 found, 0 false positives in the witnessed run.

```bash
bash run_reconcile.sh samples/industries/fintech/samples/settlement_export.csv samples/industries/fintech/samples/internal_ledger.csv
ai_node/run_duplicates.sh samples/industries/fintech/samples/settlement_export.csv
ai_node/run_anomaly.sh samples/industries/fintech/samples/internal_ledger.csv
ai_node/teach_skill.sh samples/industries/fintech/teach/chargeback_window_adopt.json
ai_node/teach_skill.sh samples/industries/fintech/teach/chargeback_window_refuse.json
```

Expected (quoted):
- duplicates TASK 1: `Fuzzy proposed pairs : 2` / `CONFIRMED duplicates : 2`
  (DUP-1 NorthStar Retail x2 $4,520.00; DUP-2 BluePeak Coffee x2 $1,275.50).
  KNOWN LIMITATION (from the pack's TEMPLATE): the module's TASK 2 self-check
  is calibrated to its 200-row research fixture (drop indices up to 180); on
  this 26-row file it reports `Bank rows: 0`, M3 FAILs, and the script exits
  1. TASK 1 — the result this pack targets — is unaffected and exact.
- anomaly: Benford abstains (`n=26 < param:BENFORD_MIN_N=100`, correct by the
  module's own bar); just-under-threshold flags exactly 3 rows: $47,500.00,
  $48,900.00, $49,250.00 (TG-1..TG-3), window [45000.00, 50000.00).
- reconcile: the chargeback reversal REM-1 (-$3,415.10) surfaces as an
  unmatched statement exception; 3+3 designed timing exceptions also appear.
- teach adopt: `DECISION: ADOPT` with
  `learned rule: op=classify params={"rule": ["ge", 45.5, "no_flag", "flag_review"], "src": ["key", "days_to_chargeback"]}`
- teach refuse: `DECISION: REFUSE (underdetermined)` with
  `missing labeled input: {"days_to_chargeback": 47}`

## Accounting (month-end close + engagement index)

Demonstrates: a 5-line month-end lead-sheet tie-out with one planted $1,200.00
AR exception, a fixed-asset rollforward with one planted $200.00 TB break, and
an accrual-flag teach pair. This pack curates: the bundle's own
`samples/bank.csv`+`ledger.csv`, the batch engagement, and the auditor-skills
examples already serve accounting work (see the pack's TEMPLATE.md index).

```bash
ai_node/run_auditor.sh leadsheet   samples/industries/accounting/samples/month_end_leadsheet.json
ai_node/run_auditor.sh rollforward samples/industries/accounting/samples/fixed_asset_rollforward.json
ai_node/teach_skill.sh samples/industries/accounting/teach/accrual_flag_adopt.json
ai_node/teach_skill.sh samples/industries/accounting/teach/accrual_flag_refuse.json
```

Expected (quoted):
- leadsheet: `5 lead-sheet lines, 4 tie exactly, 1 do not` — the one false
  row is `("AR", 980000, 860000, False)` (computed $9,800.00 vs reported
  $8,600.00, a $1,200.00 unposted adjustment); Cash / AP / Accrued
  Liabilities / Fixed Assets (Net) all tie `true`.
- rollforward: `rollforward_check: computed ending 1590000 vs TB ending
  1610000; difference 20000` → `value: false` (the planted $200.00 break).
- teach adopt: `DECISION: ADOPT` with
  `learned rule: op=classify params={"rule": ["ge", 28.5, "no_flag", "flag"], "src": ["key", "days_outstanding"]}`
- teach refuse: `DECISION: REFUSE (underdetermined)` with
  `missing labeled input: {"days_outstanding": 45}`
