[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M798YXH2MASNKDZXQCDDHA0V":3,"skill-same:01M798YXH2MASNKDZXQCDDHA0V":104},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":35,"commitSha":36,"skillDirectory":37,"forksCount":38,"repositoryHtmlUrl":39,"repositoryHomepageUrl":6,"ownerHtmlUrl":40,"ownerBlogUrl":41,"ownerDescription":42,"updatedAt":43,"install":44,"resources":57},"01M798YXH2MASNKDZXQCDDHA0V","tao-route-visual-changenet-samples",null,"Routes the weakest VCN samples (output of `tao-analyze-gaps-visual-changenet`) into per-augmentation-module subsets — one parquet for k-NN mining, one for AnomalyGen (Cosmos SDG) — based on each module's label eligibility. Use as the immediate next step after DEFT gap analysis in a VCN AOI SDA iteration.","jukeyman\u002Fjukeyman-skills","jukeyman","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F142960420?v=4","01M78FR4Y3DHMMCBCC0GXXNB3F","RICK JEFFERSON","01M78FR4Z8RVQRAD31Y5J7V6EB",1,"Apache-2.0","https:\u002F\u002Fgithub.com\u002Fjukeyman\u002Fjukeyman-skills\u002Fblob\u002Fmain\u002Fskills\u002Ftao-route-visual-changenet-samples\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: tao-route-visual-changenet-samples\ndescription: Routes the weakest VCN samples (output of `tao-analyze-gaps-visual-changenet`) into per-augmentation-module\n  subsets — one parquet for k-NN mining, one for AnomalyGen (Cosmos SDG) — based on each module's label eligibility. Use as the\n  immediate next step after DEFT gap analysis in a VCN AOI SDA iteration.\nlicense: Apache-2.0\ncompatibility: Standalone — no external runtime requirements.\nmetadata:\n  author: NVIDIA Corporation\n  version: \"0.1.0\"\nallowed-tools: Read Bash\ntags:\n- data\n- routing\n- vcn\n- aoi\n- sda\n---\n\n# TAO VCN Sample Routing Skill\n\nYou are the dispatcher between gap analysis and the augmentation modules in a VCN AOI SDA pipeline. Each augmentation module can only act on labels it knows how to handle:\n\n- **k-NN Mining** can only mine real-image neighbors for labels that already exist in the **source pool CSV**. There is no point looking for `SHIFT` neighbors if the pool has no `SHIFT` rows.\n- **AnomalyGen** (Cosmos SDG) can only generate synthetic anomalies for the classes its inference pipeline supports: `PASS`, `EXCESS_SOLDER`, `MISSING`, `BRIDGE`. A weak sample with a label outside this set is unroutable to AnomalyGen.\n\nThis skill runs **once per SDA iteration immediately after gap analysis**. It splits the gap-analysis parquet into one filtered parquet per module so each module operates on its own eligible subset, and it writes a human-readable summary of the per-label routing decisions.\n\nThe work is intentionally trivial: read a parquet, do two `.isin(...)` filters, write two parquets, write one summary. The skill exists to make those decisions auditable — every label must show up in the summary with a yes\u002Fno verdict for each module so a downstream reviewer can spot when a label is silently dropped because no module accepted it.\n\n---\n\n## Inputs\n\n1. **`gaps_parquet`** — the gap-analysis output (typically `\u003Cexp_dir>\u002Frca_results\u002F\u003Ctimestamp>\u002Fgaps.parquet` from `tao-analyze-gaps-visual-changenet`). Required columns: `filepath`, `label`. Other columns (`siamese_score`, `weakness`) are preserved verbatim.\n2. **`source_pool_csv`** — VCN-format mining source pool CSV with a `label` column. Empty string or non-existent path is allowed; the mining subset will simply be empty in that case.\n3. **Output directory** — where the two routed parquets, the summary, and the report are written. Default: a timestamped folder under the gap-analysis result directory: `\u003Crca_result_dir>\u002Frouting_results\u002F\u003Ctimestamp>\u002F`.\n4. **`anomalygen_supported_labels`** *(optional)* — override the default AnomalyGen-eligible label set. Default: `{\"PASS\", \"EXCESS_SOLDER\", \"MISSING\", \"BRIDGE\"}`. **Warning:** This must stay in sync with `ANOMALYGEN_SUPPORTED_LABELS` in `mdo-kratos-workflows\u002Fpipelines\u002Fsda\u002Frouting.py` and the AnomalyGen integration's actual generator coverage. Adding a new defect class to AnomalyGen means adding it here too.\n\n---\n\n## Method\n\nThe whole skill is two `.isin(...)` masks against the uppercased label column.\n\n### Step 1 — Load and uppercase\n\n```python\ndf = pd.read_parquet(gaps_parquet)\nlabels_upper = df[\"label\"].astype(str).str.upper()\n```\n\nThe match is **case-insensitive** for both module checks. The original `label` column is preserved unchanged in the output parquets — only the comparison key is uppercased.\n\n### Step 2 — Mining subset\n\n```python\nif source_pool_csv and os.path.isfile(source_pool_csv):\n    pool_df = pd.read_csv(source_pool_csv)\n    pool_labels = {str(l).upper() for l in pool_df[\"label\"].unique()}\n    mn_mask = labels_upper.isin(pool_labels)\n    mn_df = df[mn_mask]\nelse:\n    pool_missing = True\n    pool_labels = set()\n    mn_df = df.iloc[0:0]   # empty, but with the same schema\nmn_df.to_parquet(mining_gaps_parquet, index=False)\n```\n\nIf the pool CSV is missing or empty, the mining subset is an empty DataFrame **with the same columns as the input** so downstream readers don't crash on schema mismatch. Flag this case in the summary.\n\n### Step 3 — AnomalyGen subset\n\n```python\nANOMALYGEN_SUPPORTED = {\"PASS\", \"EXCESS_SOLDER\", \"MISSING\", \"BRIDGE\"}\nag_mask = labels_upper.isin(ANOMALYGEN_SUPPORTED)\nag_df = df[ag_mask]\nag_df.to_parquet(anomalygen_gaps_parquet, index=False)\n```\n\nRows whose label is in the AnomalyGen-supported set are written verbatim to `anomalygen_gaps.parquet`. The schema matches the input parquet exactly — downstream AnomalyGen (Cosmos SDG) needs no other changes.\n\n### Step 4 — Per-label routing breakdown\n\nFor every distinct label in the input gaps parquet (uppercased), record:\n- `count` — how many rows have this label\n- `mining` — yes if the label is in `pool_labels`, otherwise no\n- `anomalygen` — yes if the label is in `ANOMALYGEN_SUPPORTED`, otherwise no\n\nA label can route to **both** modules (e.g. PASS rows route to AnomalyGen, and if the source pool also contains PASS rows they route to Mining too). A label can also route to **none** — flag those, since they are silently dropped and may signal a configuration mismatch.\n\nWrite the breakdown to `routing_summary.txt`. The format mirrors the reference component exactly:\n\n```\nWeak-sample routing summary\nTotal weak samples: \u003CN>\nMining subset:      \u003CN_mn> -> \u003Cmining_gaps_parquet>\nAnomalyGen subset:  \u003CN_ag> -> \u003Canomalygen_gaps_parquet>\n\n[If pool missing:]\nNo source pool CSV at '\u003Cpath>'; mining subset is empty.\n\nPer-label breakdown (count, mining, anomalygen):\n  PASS: 50 (mining=yes, anomalygen=yes)\n  MISSING: 32 (mining=no, anomalygen=yes)\n  SHIFT: 14 (mining=yes, anomalygen=no)\n  EXCESS_SOLDER: 9 (mining=yes, anomalygen=yes)\n  ...\n```\n\n### Step 5 — Sanity checks\n\nAfter both subsets are written, verify:\n- The sum of subset sizes is *not* required to equal `len(df)` — overlap is allowed (a label can route to both modules). What matters is that **every input row appears in at least one subset, OR appears in the \"none\" list with an explicit reason**.\n- If `len(mn_df) == 0` and `len(ag_df) == 0`, something is wrong — flag prominently in the report.\n- If an entire label group routes to no module, the `Recommended Actions` section must call this out so the user can either seed the source pool with that label or extend AnomalyGen's supported set.\n\n---\n\n## Reference Python Recipe\n\nThis is the exact computation, lifted from `mdo-kratos-workflows\u002Fpipelines\u002Fsda\u002Frouting.py`. Run as a single Python script via Bash; it produces every artifact except the report.\n\n```python\nimport os\nimport pandas as pd\n\nANOMALYGEN_SUPPORTED = {\"PASS\", \"EXCESS_SOLDER\", \"MISSING\", \"BRIDGE\"}\n\ndf = pd.read_parquet(gaps_parquet)\nlabels_upper = df[\"label\"].astype(str).str.upper()\n\n# Mining subset\npool_missing = False\nif source_pool_csv and os.path.isfile(source_pool_csv):\n    pool_df = pd.read_csv(source_pool_csv)\n    pool_labels = {str(l).upper() for l in pool_df[\"label\"].unique()}\n    mn_mask = labels_upper.isin(pool_labels)\n    mn_df = df[mn_mask]\nelse:\n    pool_missing = True\n    pool_labels = set()\n    mn_df = df.iloc[0:0]\nos.makedirs(os.path.dirname(mining_gaps_parquet) or \".\", exist_ok=True)\nmn_df.to_parquet(mining_gaps_parquet, index=False)\n\n# AnomalyGen subset\nag_mask = labels_upper.isin(ANOMALYGEN_SUPPORTED)\nag_df = df[ag_mask]\nos.makedirs(os.path.dirname(anomalygen_gaps_parquet) or \".\", exist_ok=True)\nag_df.to_parquet(anomalygen_gaps_parquet, index=False)\n\n# Per-label breakdown\nsummary_lines = [\n    \"Weak-sample routing summary\",\n    f\"Total weak samples: {len(df)}\",\n    f\"Mining subset:      {len(mn_df)} -> {mining_gaps_parquet}\",\n    f\"AnomalyGen subset:  {len(ag_df)} -> {anomalygen_gaps_parquet}\",\n    \"\",\n]\nif pool_missing:\n    summary_lines.append(f\"No source pool CSV at {source_pool_csv!r}; mining subset is empty.\")\n    summary_lines.append(\"\")\nsummary_lines.append(\"Per-label breakdown (count, mining, anomalygen):\")\nlabel_counts = labels_upper.value_counts()\nfor label, count in label_counts.items():\n    in_mn = (not pool_missing) and label in pool_labels\n    in_ag = label in ANOMALYGEN_SUPPORTED\n    summary_lines.append(\n        f\"  {label}: {count} \"\n        f\"(mining={'yes' if in_mn else 'no'}, \"\n        f\"anomalygen={'yes' if in_ag else 'no'})\"\n    )\nsummary_text = \"\\n\".join(summary_lines) + \"\\n\"\n\nos.makedirs(logs_dir, exist_ok=True)\nwith open(os.path.join(logs_dir, \"routing_summary.txt\"), \"w\", encoding=\"utf-8\") as f:\n    f.write(summary_text)\nprint(summary_text.strip())\n```\n\n---\n\n## Outputs\n\nWrite everything into a timestamped folder. The packaging hook will copy `routing_config\u002F` and `claude_session.jsonl` automatically when `Routing_Report.md` is written.\n\n```\n\u003Coutput_dir>\u002Frouting_results\u002FYYYY-MM-DD_HHMMSS\u002F\n├── Routing_Report.md           # Full routing report\n├── mining_gaps.parquet         # Subset routed to k-NN Mining\n├── anomalygen_gaps.parquet     # Subset routed to AnomalyGen (Cosmos SDG)\n├── routing_summary.txt         # Plain-text per-label breakdown\n├── routing_config\u002F             # Auto-copied by hook\n└── claude_session.jsonl        # Auto-copied by hook\n```\n\nAt the start of the run, get the real timestamp by running `date +%Y-%m-%d_%H%M%S` in Bash. If the user specifies a custom output path, use it directly but maintain the internal layout.\n\n---\n\n## Report Structure\n\nKeep the report short (400–800 words). Routing is a deterministic decision; the value is making the decisions auditable, not narrative.\n\n```\n# VCN Routing Report: \u003CIteration \u002F Experiment Name>\n\n## 1. Verdict\n- Total weak samples in: \u003CN>\n- Mining subset:     \u003CN_mn> rows  →  `mining_gaps.parquet`\n- AnomalyGen subset: \u003CN_ag> rows  →  `anomalygen_gaps.parquet`\n- Source pool present? \u003Cyes\u002Fno — and the path>\n- One-line headline: \"\u003CX> labels routed, \u003CY> labels dropped (no module accepted)\"\n\n## 2. Inputs\n| Input | Path | Notes |\n|-------|------|-------|\n| gaps_parquet     | … | rows=\u003CN>, columns=\u003Ccol list> |\n| source_pool_csv  | … | rows=\u003CM> or \"not provided\" \u002F \"missing\" |\n\n## 3. Per-Label Routing Decisions\n| Label | Count in gaps | In source pool? | Mining? | AnomalyGen? | Routed To |\n|-------|----------------|------------------|----------|--------------|-----------|\n\n(One row per distinct label in `gaps_parquet`, uppercased. `Routed To` is one of:\n`mining only`, `anomalygen only`, `mining+anomalygen`, `neither (DROPPED)`.\nUse `neither (DROPPED)` whenever no module accepted the label. Sort by count descending.)\n\n## 4. Module-Level Summaries\n### 4.1 k-NN Mining\n- Pool labels (from source_pool_csv): \u003Clist, or \"pool missing\">\n- Labels accepted from input: \u003Clist>\n- Total rows routed: \u003CN_mn>\n- Per-label row counts: \u003Cbreakdown>\n\n### 4.2 AnomalyGen (Cosmos SDG)\n- Eligible labels (configured): PASS, EXCESS_SOLDER, MISSING, BRIDGE\n- Labels accepted from input: \u003Clist>\n- Total rows routed: \u003CN_ag>\n- Per-label row counts: \u003Cbreakdown>\n\n## 5. Dropped Labels (routed to NEITHER module)\n| Label | Count | Why dropped | Suggested fix |\n|-------|-------|-------------|----------------|\n\n(Empty table is OK and means no labels were dropped. If non-empty, every row needs a\n\"why\" — typically one of: \"not in source pool AND not in AnomalyGen supported set\",\n\"source pool missing entirely AND label not in AnomalyGen set\", \"label name doesn't\nmatch any module's expected canonicalization\".)\n\n## 6. Recommended Actions\n1. **If any labels are dropped**: seed the source pool with that label, OR extend\n   `ANOMALYGEN_SUPPORTED_LABELS` (and the AnomalyGen generator coverage).\n2. **If source pool is missing**: provide `source_pool_csv` to enable the Mining branch.\n   Without it, half of the augmentation pipeline is dark.\n3. **If AnomalyGen subset is empty**: gap analysis only surfaced labels AnomalyGen cannot\n   generate; rely on Mining for this iteration, or extend the AnomalyGen integration.\n4. **If both subsets are empty**: stop the SDA iteration. Nothing downstream can run.\n```\n\n---\n\n## Execution Order\n\n1. Run `date +%Y-%m-%d_%H%M%S` to get the timestamp; create `\u003Coutput_dir>\u002Frouting_results\u002F\u003Ctimestamp>\u002F`.\n2. Run the Python recipe (Steps 1–4) to produce `mining_gaps.parquet`, `anomalygen_gaps.parquet`, and `routing_summary.txt`. Print summary stats to stdout so the script-check hook can verify it ran.\n3. Build the per-label decision table by reading both parquets and computing the routed-to verdict per label.\n4. Write `Routing_Report.md` last — writing it triggers the packaging hook, which copies session logs and skill config alongside.\n","# TAO VCN Sample Routing Skill\n\nYou are the dispatcher between gap analysis and the augmentation modules in a VCN AOI SDA pipeline. Each augmentation module can only act on labels it knows how to handle:\n\n- **k-NN Mining** can only mine real-image neighbors for labels that already exist in the **source pool CSV**. There is no point looking for `SHIFT` neighbors if the pool has no `SHIFT` rows.\n- **AnomalyGen** (Cosmos SDG) can only generate synthetic anomalies for the classes its inference pipeline supports: `PASS`, `EXCESS_SOLDER`, `MISSING`, `BRIDGE`. A weak sample with a label outside this set is unroutable to AnomalyGen.\n\nThis skill runs **once per SDA iteration immediately after gap analysis**. It splits the gap-analysis parquet into one filtered parquet per module so each module operates on its own eligible subset, and it writes a human-readable summary of the per-label routing decisions.\n\nThe work is intentionally trivial: read a parquet, do two `.isin(...)` filters, write two parquets, write one summary. The skill exists to make those decisions auditable — every label must show up in the summary with a yes\u002Fno verdict for each module so a downstream reviewer can spot when a label is silently dropped because no module accepted it.\n\n---\n\n## Inputs\n\n1. **`gaps_parquet`** — the gap-analysis output (typically `\u003Cexp_dir>\u002Frca_results\u002F\u003Ctimestamp>\u002Fgaps.parquet` from `tao-analyze-gaps-visual-changenet`). Required columns: `filepath`, `label`. Other columns (`siamese_score`, `weakness`) are preserved verbatim.\n2. **`source_pool_csv`** — VCN-format mining source pool CSV with a `label` column. Empty string or non-existent path is allowed; the mining subset will simply be empty in that case.\n3. **Output directory** — where the two routed parquets, the summary, and the report are written. Default: a timestamped folder under the gap-analysis result directory: `\u003Crca_result_dir>\u002Frouting_results\u002F\u003Ctimestamp>\u002F`.\n4. **`anomalygen_supported_labels`** *(optional)* — override the default AnomalyGen-eligible label set. Default: `{\"PASS\", \"EXCESS_SOLDER\", \"MISSING\", \"BRIDGE\"}`. **Warning:** This must stay in sync with `ANOMALYGEN_SUPPORTED_LABELS` in `mdo-kratos-workflows\u002Fpipelines\u002Fsda\u002Frouting.py` and the AnomalyGen integration's actual generator coverage. Adding a new defect class to AnomalyGen means adding it here too.\n\n---\n\n## Method\n\nThe whole skill is two `.isin(...)` masks against the uppercased label column.\n\n### Step 1 — Load and uppercase\n\n```python\ndf = pd.read_parquet(gaps_parquet)\nlabels_upper = df[\"label\"].astype(str).str.upper()\n```\n\nThe match is **case-insensitive** for both module checks. The original `label` column is preserved unchanged in the output parquets — only the comparison key is uppercased.\n\n### Step 2 — Mining subset\n\n```python\nif source_pool_csv and os.path.isfile(source_pool_csv):\n    pool_df = pd.read_csv(source_pool_csv)\n    pool_labels = {str(l).upper() for l in pool_df[\"label\"].unique()}\n    mn_mask = labels_upper.isin(pool_labels)\n    mn_df = df[mn_mask]\nelse:\n    pool_missing = True\n    pool_labels = set()\n    mn_df = df.iloc[0:0]   # empty, but with the same schema\nmn_df.to_parquet(mining_gaps_parquet, index=False)\n```\n\nIf the pool CSV is missing or empty, the mining subset is an empty DataFrame **with the same columns as the input** so downstream readers don't crash on schema mismatch. Flag this case in the summary.\n\n### Step 3 — AnomalyGen subset\n\n```python\nANOMALYGEN_SUPPORTED = {\"PASS\", \"EXCESS_SOLDER\", \"MISSING\", \"BRIDGE\"}\nag_mask = labels_upper.isin(ANOMALYGEN_SUPPORTED)\nag_df = df[ag_mask]\nag_df.to_parquet(anomalygen_gaps_parquet, index=False)\n```\n\nRows whose label is in the AnomalyGen-supported set are written verbatim to `anomalygen_gaps.parquet`. The schema matches the input parquet exactly — downstream AnomalyGen (Cosmos SDG) needs no other changes.\n\n### Step 4 — Per-label routing breakdown\n\nFor every distinct label in the input gaps parquet (uppercased), record:\n- `count` — how many rows have this label\n- `mining` — yes if the label is in `pool_labels`, otherwise no\n- `anomalygen` — yes if the label is in `ANOMALYGEN_SUPPORTED`, otherwise no\n\nA label can route to **both** modules (e.g. PASS rows route to AnomalyGen, and if the source pool also contains PASS rows they route to Mining too). A label can also route to **none** — flag those, since they are silently dropped and may signal a configuration mismatch.\n\nWrite the breakdown to `routing_summary.txt`. The format mirrors the reference component exactly:\n\n```\nWeak-sample routing summary\nTotal weak samples: \u003CN>\nMining subset:      \u003CN_mn> -> \u003Cmining_gaps_parquet>\nAnomalyGen subset:  \u003CN_ag> -> \u003Canomalygen_gaps_parquet>\n\n[If pool missing:]\nNo source pool CSV at '\u003Cpath>'; mining subset is empty.\n\nPer-label breakdown (count, mining, anomalygen):\n  PASS: 50 (mining=yes, anomalygen=yes)\n  MISSING: 32 (mining=no, anomalygen=yes)\n  SHIFT: 14 (mining=yes, anomalygen=no)\n  EXCESS_SOLDER: 9 (mining=yes, anomalygen=yes)\n  ...\n```\n\n### Step 5 — Sanity checks\n\nAfter both subsets are written, verify:\n- The sum of subset sizes is *not* required to equal `len(df)` — overlap is allowed (a label can route to both modules). What matters is that **every input row appears in at least one subset, OR appears in the \"none\" list with an explicit reason**.\n- If `len(mn_df) == 0` and `len(ag_df) == 0`, something is wrong — flag prominently in the report.\n- If an entire label group routes to no module, the `Recommended Actions` section must call this out so the user can either seed the source pool with that label or extend AnomalyGen's supported set.\n\n---\n\n## Reference Python Recipe\n\nThis is the exact computation, lifted from `mdo-kratos-workflows\u002Fpipelines\u002Fsda\u002Frouting.py`. Run as a single Python script via Bash; it produces every artifact except the report.\n\n```python\nimport os\nimport pandas as pd\n\nANOMALYGEN_SUPPORTED = {\"PASS\", \"EXCESS_SOLDER\", \"MISSING\", \"BRIDGE\"}\n\ndf = pd.read_parquet(gaps_parquet)\nlabels_upper = df[\"label\"].astype(str).str.upper()\n\n# Mining subset\npool_missing = False\nif source_pool_csv and os.path.isfile(source_pool_csv):\n    pool_df = pd.read_csv(source_pool_csv)\n    pool_labels = {str(l).upper() for l in pool_df[\"label\"].unique()}\n    mn_mask = labels_upper.isin(pool_labels)\n    mn_df = df[mn_mask]\nelse:\n    pool_missing = True\n    pool_labels = set()\n    mn_df = df.iloc[0:0]\nos.makedirs(os.path.dirname(mining_gaps_parquet) or \".\", exist_ok=True)\nmn_df.to_parquet(mining_gaps_parquet, index=False)\n\n# AnomalyGen subset\nag_mask = labels_upper.isin(ANOMALYGEN_SUPPORTED)\nag_df = df[ag_mask]\nos.makedirs(os.path.dirname(anomalygen_gaps_parquet) or \".\", exist_ok=True)\nag_df.to_parquet(anomalygen_gaps_parquet, index=False)\n\n# Per-label breakdown\nsummary_lines = [\n    \"Weak-sample routing summary\",\n    f\"Total weak samples: {len(df)}\",\n    f\"Mining subset:      {len(mn_df)} -> {mining_gaps_parquet}\",\n    f\"AnomalyGen subset:  {len(ag_df)} -> {anomalygen_gaps_parquet}\",\n    \"\",\n]\nif pool_missing:\n    summary_lines.append(f\"No source pool CSV at {source_pool_csv!r}; mining subset is empty.\")\n    summary_lines.append(\"\")\nsummary_lines.append(\"Per-label breakdown (count, mining, anomalygen):\")\nlabel_counts = labels_upper.value_counts()\nfor label, count in label_counts.items():\n    in_mn = (not pool_missing) and label in pool_labels\n    in_ag = label in ANOMALYGEN_SUPPORTED\n    summary_lines.append(\n        f\"  {label}: {count} \"\n        f\"(mining={'yes' if in_mn else 'no'}, \"\n        f\"anomalygen={'yes' if in_ag else 'no'})\"\n    )\nsummary_text = \"\\n\".join(summary_lines) + \"\\n\"\n\nos.makedirs(logs_dir, exist_ok=True)\nwith open(os.path.join(logs_dir, \"routing_summary.txt\"), \"w\", encoding=\"utf-8\") as f:\n    f.write(summary_text)\nprint(summary_text.strip())\n```\n\n---\n\n## Outputs\n\nWrite everything into a timestamped folder. The packaging hook will copy `routing_config\u002F` and `claude_session.jsonl` automatically when `Routing_Report.md` is written.\n\n```\n\u003Coutput_dir>\u002Frouting_results\u002FYYYY-MM-DD_HHMMSS\u002F\n├── Routing_Report.md           # Full routing report\n├── mining_gaps.parquet         # Subset routed to k-NN Mining\n├── anomalygen_gaps.parquet     # Subset routed to AnomalyGen (Cosmos SDG)\n├── routing_summary.txt         # Plain-text per-label breakdown\n├── routing_config\u002F             # Auto-copied by hook\n└── claude_session.jsonl        # Auto-copied by hook\n```\n\nAt the start of the run, get the real timestamp by running `date +%Y-%m-%d_%H%M%S` in Bash. If the user specifies a custom output path, use it directly but maintain the internal layout.\n\n---\n\n## Report Structure\n\nKeep the report short (400–800 words). Routing is a deterministic decision; the value is making the decisions auditable, not narrative.\n\n```\n# VCN Routing Report: \u003CIteration \u002F Experiment Name>\n\n## 1. Verdict\n- Total weak samples in: \u003CN>\n- Mining subset:     \u003CN_mn> rows  →  `mining_gaps.parquet`\n- AnomalyGen subset: \u003CN_ag> rows  →  `anomalygen_gaps.parquet`\n- Source pool present? \u003Cyes\u002Fno — and the path>\n- One-line headline: \"\u003CX> labels routed, \u003CY> labels dropped (no module accepted)\"\n\n## 2. Inputs\n| Input | Path | Notes |\n|-------|------|-------|\n| gaps_parquet     | … | rows=\u003CN>, columns=\u003Ccol list> |\n| source_pool_csv  | … | rows=\u003CM> or \"not provided\" \u002F \"missing\" |\n\n## 3. Per-Label Routing Decisions\n| Label | Count in gaps | In source pool? | Mining? | AnomalyGen? | Routed To |\n|-------|----------------|------------------|----------|--------------|-----------|\n\n(One row per distinct label in `gaps_parquet`, uppercased. `Routed To` is one of:\n`mining only`, `anomalygen only`, `mining+anomalygen`, `neither (DROPPED)`.\nUse `neither (DROPPED)` whenever no module accepted the label. Sort by count descending.)\n\n## 4. Module-Level Summaries\n### 4.1 k-NN Mining\n- Pool labels (from source_pool_csv): \u003Clist, or \"pool missing\">\n- Labels accepted from input: \u003Clist>\n- Total rows routed: \u003CN_mn>\n- Per-label row counts: \u003Cbreakdown>\n\n### 4.2 AnomalyGen (Cosmos SDG)\n- Eligible labels (configured): PASS, EXCESS_SOLDER, MISSING, BRIDGE\n- Labels accepted from input: \u003Clist>\n- Total rows routed: \u003CN_ag>\n- Per-label row counts: \u003Cbreakdown>\n\n## 5. Dropped Labels (routed to NEITHER module)\n| Label | Count | Why dropped | Suggested fix |\n|-------|-------|-------------|----------------|\n\n(Empty table is OK and means no labels were dropped. If non-empty, every row needs a\n\"why\" — typically one of: \"not in source pool AND not in AnomalyGen supported set\",\n\"source pool missing entirely AND label not in AnomalyGen set\", \"label name doesn't\nmatch any module's expected canonicalization\".)\n\n## 6. Recommended Actions\n1. **If any labels are dropped**: seed the source pool with that label, OR extend\n   `ANOMALYGEN_SUPPORTED_LABELS` (and the AnomalyGen generator coverage).\n2. **If source pool is missing**: provide `source_pool_csv` to enable the Mining branch.\n   Without it, half of the augmentation pipeline is dark.\n3. **If AnomalyGen subset is empty**: gap analysis only surfaced labels AnomalyGen cannot\n   generate; rely on Mining for this iteration, or extend the AnomalyGen integration.\n4. **If both subsets are empty**: stop the SDA iteration. Nothing downstream can run.\n```\n\n---\n\n## Execution Order\n\n1. Run `date +%Y-%m-%d_%H%M%S` to get the timestamp; create `\u003Coutput_dir>\u002Frouting_results\u002F\u003Ctimestamp>\u002F`.\n2. Run the Python recipe (Steps 1–4) to produce `mining_gaps.parquet`, `anomalygen_gaps.parquet`, and `routing_summary.txt`. Print summary stats to stdout so the script-check hook can verify it ran.\n3. Build the per-label decision table by reading both parquets and computing the routed-to verdict per label.\n4. Write `Routing_Report.md` last — writing it triggers the packaging hook, which copies session logs and skill config alongside.\n",{"name":5,"tags":24,"license":15,"metadata":30,"description":7,"allowed-tools":33,"compatibility":34},[25,26,27,28,29],"data","routing","vcn","aoi","sda",{"author":31,"version":32},"NVIDIA Corporation","0.1.0","Read Bash","Standalone — no external runtime requirements.","main","99825ad3f3bcc6597ddcc7294a14e6e922f2b67b","skills\u002Ftao-route-visual-changenet-samples",0,"https:\u002F\u002Fgithub.com\u002Fjukeyman\u002Fjukeyman-skills","https:\u002F\u002Fgithub.com\u002Fjukeyman","https:\u002F\u002FRJBUSINESSSOLUTIONS.ORG","Credit and Finance Expert | Developer\r\n\r\nI'm Rick Jefferson, a seasoned credit and finance expert with over a decade of experience in financial literacy,","2026-07-13 07:03:29",{"source":8,"skillName":5,"commands":45,"prompt":55,"zipAvailable":56},[46,49,52],{"tool":47,"command":48},"npx","npx skills add jukeyman\u002Fjukeyman-skills --skill tao-route-visual-changenet-samples",{"tool":50,"command":51},"bunx","bunx skills add jukeyman\u002Fjukeyman-skills --skill tao-route-visual-changenet-samples",{"tool":53,"command":54},"pnpm","pnpm dlx skills add jukeyman\u002Fjukeyman-skills --skill tao-route-visual-changenet-samples","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fjukeyman\u002Fjukeyman-skills\u002Fblob\u002Fmain\u002Fskills\u002Ftao-route-visual-changenet-samples\u002FSKILL.md",true,[58,64,68,74,78,82,86,90,94,98],{"path":59,"resourceType":60,"resourceTypeDesc":61,"sizeBytes":62,"sourceHtmlUrl":63},"BENCHMARK.md","REFERENCE","参考文档",4583,"https:\u002F\u002Fgithub.com\u002Fjukeyman\u002Fjukeyman-skills\u002Fblob\u002Fmain\u002Fskills\u002Ftao-route-visual-changenet-samples\u002FBENCHMARK.md",{"path":65,"resourceType":60,"resourceTypeDesc":61,"sizeBytes":66,"sourceHtmlUrl":67},"evals\u002Fevals.json",873,"https:\u002F\u002Fgithub.com\u002Fjukeyman\u002Fjukeyman-skills\u002Fblob\u002Fmain\u002Fskills\u002Ftao-route-visual-changenet-samples\u002Fevals\u002Fevals.json",{"path":69,"resourceType":70,"resourceTypeDesc":71,"sizeBytes":72,"sourceHtmlUrl":73},"hooks\u002F_parse-stdin.sh","SCRIPT","脚本",1471,"https:\u002F\u002Fgithub.com\u002Fjukeyman\u002Fjukeyman-skills\u002Fblob\u002Fmain\u002Fskills\u002Ftao-route-visual-changenet-samples\u002Fhooks\u002F_parse-stdin.sh",{"path":75,"resourceType":70,"resourceTypeDesc":71,"sizeBytes":76,"sourceHtmlUrl":77},"hooks\u002Frouting-artifacts-check.sh",3595,"https:\u002F\u002Fgithub.com\u002Fjukeyman\u002Fjukeyman-skills\u002Fblob\u002Fmain\u002Fskills\u002Ftao-route-visual-changenet-samples\u002Fhooks\u002Frouting-artifacts-check.sh",{"path":79,"resourceType":70,"resourceTypeDesc":71,"sizeBytes":80,"sourceHtmlUrl":81},"hooks\u002Frouting-coverage-check.sh",2893,"https:\u002F\u002Fgithub.com\u002Fjukeyman\u002Fjukeyman-skills\u002Fblob\u002Fmain\u002Fskills\u002Ftao-route-visual-changenet-samples\u002Fhooks\u002Frouting-coverage-check.sh",{"path":83,"resourceType":70,"resourceTypeDesc":71,"sizeBytes":84,"sourceHtmlUrl":85},"hooks\u002Frouting-package.sh",2544,"https:\u002F\u002Fgithub.com\u002Fjukeyman\u002Fjukeyman-skills\u002Fblob\u002Fmain\u002Fskills\u002Ftao-route-visual-changenet-samples\u002Fhooks\u002Frouting-package.sh",{"path":87,"resourceType":70,"resourceTypeDesc":71,"sizeBytes":88,"sourceHtmlUrl":89},"hooks\u002Frouting-script-check.sh",3173,"https:\u002F\u002Fgithub.com\u002Fjukeyman\u002Fjukeyman-skills\u002Fblob\u002Fmain\u002Fskills\u002Ftao-route-visual-changenet-samples\u002Fhooks\u002Frouting-script-check.sh",{"path":91,"resourceType":70,"resourceTypeDesc":71,"sizeBytes":92,"sourceHtmlUrl":93},"hooks\u002Frouting-section-check.sh",3462,"https:\u002F\u002Fgithub.com\u002Fjukeyman\u002Fjukeyman-skills\u002Fblob\u002Fmain\u002Fskills\u002Ftao-route-visual-changenet-samples\u002Fhooks\u002Frouting-section-check.sh",{"path":95,"resourceType":60,"resourceTypeDesc":61,"sizeBytes":96,"sourceHtmlUrl":97},"skill-card.md",3748,"https:\u002F\u002Fgithub.com\u002Fjukeyman\u002Fjukeyman-skills\u002Fblob\u002Fmain\u002Fskills\u002Ftao-route-visual-changenet-samples\u002Fskill-card.md",{"path":99,"resourceType":100,"resourceTypeDesc":101,"sizeBytes":102,"sourceHtmlUrl":103},"skill.oms.sig","OTHER","其他",6057,"https:\u002F\u002Fgithub.com\u002Fjukeyman\u002Fjukeyman-skills\u002Fblob\u002Fmain\u002Fskills\u002Ftao-route-visual-changenet-samples\u002Fskill.oms.sig",[105,113,120,127,134,142],{"skillNo":106,"name":107,"nameZh":6,"description":108,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":109,"licenseFileUrl":6,"sourceHtmlUrl":110,"categories":111,"keywords":112,"publishedAt":19},"01M79ANS2SM329NEP5ZCX106RR","zustand-store-creator","Create zustand store creator operations. Auto-activating skill for Frontend Development.\nTriggers on: zustand store creator, zustand store creator\nPart of the Frontend Development skill category. Use when working with zustand store creator functionality. Trigger with phrases like \"zustand store creator\", \"zustand creator\", \"zustand\".","MIT","https:\u002F\u002Fgithub.com\u002Fjukeyman\u002Fjukeyman-skills\u002Fblob\u002Fmain\u002Fskills\u002Fzustand-store-creator\u002FSKILL.md",[],[],{"skillNo":114,"name":115,"nameZh":6,"description":116,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":109,"licenseFileUrl":6,"sourceHtmlUrl":117,"categories":118,"keywords":119,"publishedAt":19},"01M79AMZKP4YDEZ7EHG1Y7PP74","zero-trust-config-helper","Configure with zero trust config helper operations. Auto-activating skill for Security Advanced.\nTriggers on: zero trust config helper, zero trust config helper\nPart of the Security Advanced skill category. Use when configuring systems or services. Trigger with phrases like \"zero trust config helper\", \"zero helper\", \"zero\".","https:\u002F\u002Fgithub.com\u002Fjukeyman\u002Fjukeyman-skills\u002Fblob\u002Fmain\u002Fskills\u002Fzero-trust-config-helper\u002FSKILL.md",[],[],{"skillNo":121,"name":122,"nameZh":6,"description":123,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":109,"licenseFileUrl":6,"sourceHtmlUrl":124,"categories":125,"keywords":126,"publishedAt":19},"01M79AMJSBCEJQNBTYNAHYN5HM","zapier-integration-helper","Assist with zapier integration helper operations. Auto-activating skill for Business Automation.\nTriggers on: zapier integration helper, zapier integration helper\nPart of the Business Automation skill category. Use when working with APIs or building integrations. Trigger with phrases like \"zapier integration helper\", \"zapier helper\", \"zapier\".","https:\u002F\u002Fgithub.com\u002Fjukeyman\u002Fjukeyman-skills\u002Fblob\u002Fmain\u002Fskills\u002Fzapier-integration-helper\u002FSKILL.md",[],[],{"skillNo":128,"name":129,"nameZh":6,"description":130,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":109,"licenseFileUrl":6,"sourceHtmlUrl":131,"categories":132,"keywords":133,"publishedAt":19},"01M79AHJZGVMARS13VFQYRR1MP","yaml-config-validator","Validate yaml config validator operations. Auto-activating skill for DevOps Basics.\nTriggers on: yaml config validator, yaml config validator\nPart of the DevOps Basics skill category. Use when configuring systems or services. Trigger with phrases like \"yaml config validator\", \"yaml validator\", \"yaml\".","https:\u002F\u002Fgithub.com\u002Fjukeyman\u002Fjukeyman-skills\u002Fblob\u002Fmain\u002Fskills\u002Fyaml-config-validator\u002FSKILL.md",[],[],{"skillNo":135,"name":136,"nameZh":6,"description":137,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":109,"licenseFileUrl":138,"sourceHtmlUrl":139,"categories":140,"keywords":141,"publishedAt":19},"01M79AHGDZRN0020RDQSQDPAM8","xvary-stock-research","Thesis-driven equity analysis from public SEC EDGAR and market data; \u002Fanalyze, \u002Fscore, \u002Fcompare workflows with bundled Python tools (Claude Code, Cursor, Codex).","https:\u002F\u002Fgithub.com\u002Fjukeyman\u002Fjukeyman-skills\u002Fblob\u002Fmain\u002Fskills\u002Fxvary-stock-research\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fjukeyman\u002Fjukeyman-skills\u002Fblob\u002Fmain\u002Fskills\u002Fxvary-stock-research\u002FSKILL.md",[],[],{"skillNo":143,"name":144,"nameZh":6,"description":145,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":109,"licenseFileUrl":6,"sourceHtmlUrl":146,"categories":147,"keywords":148,"publishedAt":19},"01M79AHCYJ9FV9RMHQ24HDRN33","xss-vulnerability-scanner","Scan xss vulnerability scanner operations. Auto-activating skill for Security Fundamentals.\nTriggers on: xss vulnerability scanner, xss vulnerability scanner\nPart of the Security Fundamentals skill category. Use when working with xss vulnerability scanner functionality. Trigger with phrases like \"xss vulnerability scanner\", \"xss scanner\", \"xss\".","https:\u002F\u002Fgithub.com\u002Fjukeyman\u002Fjukeyman-skills\u002Fblob\u002Fmain\u002Fskills\u002Fxss-vulnerability-scanner\u002FSKILL.md",[],[]]