[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M78D8YRMBKT9860QTQECW8KX":3,"skill-same:01M78D8YRMBKT9860QTQECW8KX":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":14,"repositoryHtmlUrl":38,"repositoryHomepageUrl":39,"ownerHtmlUrl":40,"ownerBlogUrl":41,"ownerDescription":42,"updatedAt":43,"install":44,"resources":57},"01M78D8YRMBKT9860QTQECW8KX","tao-route-visual-changenet-samples",null,"Routes the weakest VCN samples (output of `tao-analyze-gaps-visual-changenet`) into per-augmentation-module subsets based on each module's label eligibility. Use when the user asks to \"route VCN gap samples\", \"split AOI gaps for k-NN mining and AnomalyGen\", or prepare the immediate next step after DEFT gap analysis in a VCN AOI SDA iteration.","Solizardking\u002Fskillhub-main","Solizardking","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F108096810?v=4","01M786KDB10AYV042N0F9BD5B5","Clawd","01M786NYYXSZK1D05WM8JQPC48",0,"Apache-2.0","https:\u002F\u002Fgithub.com\u002FSolizardking\u002Fskillhub-main\u002Fblob\u002Fmain\u002Fskills\u002Fnvidia\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 based on each module's label eligibility. Use when the user asks to \"route VCN gap samples\", \"split AOI gaps for\n  k-NN mining and AnomalyGen\", or prepare the 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. Any runtime packaging hook may add `routing_config\u002F` and session-capture artifacts after `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└── session log\u002Fartifacts       # Optional, runtime-dependent packaging capture\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. Any runtime packaging hook may add `routing_config\u002F` and session-capture artifacts after `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└── session log\u002Fartifacts       # Optional, runtime-dependent packaging capture\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","be3de0244dc1a57e323d8160787ebb40fb64930e","skills\u002Fnvidia\u002Ftao-route-visual-changenet-samples","https:\u002F\u002Fgithub.com\u002FSolizardking\u002Fskillhub-main","https:\u002F\u002Fskills.x402.wtf","https:\u002F\u002Fgithub.com\u002FSolizardking","https:\u002F\u002Fmusebook.trade","Got a mile high and never came down","2026-10-08 23:20:13",{"source":8,"skillName":5,"commands":45,"prompt":55,"zipAvailable":56},[46,49,52],{"tool":47,"command":48},"npx","npx skills add Solizardking\u002Fskillhub-main --skill tao-route-visual-changenet-samples",{"tool":50,"command":51},"bunx","bunx skills add Solizardking\u002Fskillhub-main --skill tao-route-visual-changenet-samples",{"tool":53,"command":54},"pnpm","pnpm dlx skills add Solizardking\u002Fskillhub-main --skill tao-route-visual-changenet-samples","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FSolizardking\u002Fskillhub-main\u002Fblob\u002Fmain\u002Fskills\u002Fnvidia\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","参考文档",4162,"https:\u002F\u002Fgithub.com\u002FSolizardking\u002Fskillhub-main\u002Fblob\u002Fmain\u002Fskills\u002Fnvidia\u002Ftao-route-visual-changenet-samples\u002FBENCHMARK.md",{"path":65,"resourceType":60,"resourceTypeDesc":61,"sizeBytes":66,"sourceHtmlUrl":67},"evals\u002Fevals.json",849,"https:\u002F\u002Fgithub.com\u002FSolizardking\u002Fskillhub-main\u002Fblob\u002Fmain\u002Fskills\u002Fnvidia\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\u002FSolizardking\u002Fskillhub-main\u002Fblob\u002Fmain\u002Fskills\u002Fnvidia\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\u002FSolizardking\u002Fskillhub-main\u002Fblob\u002Fmain\u002Fskills\u002Fnvidia\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\u002FSolizardking\u002Fskillhub-main\u002Fblob\u002Fmain\u002Fskills\u002Fnvidia\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\u002FSolizardking\u002Fskillhub-main\u002Fblob\u002Fmain\u002Fskills\u002Fnvidia\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\u002FSolizardking\u002Fskillhub-main\u002Fblob\u002Fmain\u002Fskills\u002Fnvidia\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\u002FSolizardking\u002Fskillhub-main\u002Fblob\u002Fmain\u002Fskills\u002Fnvidia\u002Ftao-route-visual-changenet-samples\u002Fhooks\u002Frouting-section-check.sh",{"path":95,"resourceType":60,"resourceTypeDesc":61,"sizeBytes":96,"sourceHtmlUrl":97},"skill-card.md",3816,"https:\u002F\u002Fgithub.com\u002FSolizardking\u002Fskillhub-main\u002Fblob\u002Fmain\u002Fskills\u002Fnvidia\u002Ftao-route-visual-changenet-samples\u002Fskill-card.md",{"path":99,"resourceType":100,"resourceTypeDesc":101,"sizeBytes":102,"sourceHtmlUrl":103},"skill.oms.sig","OTHER","其他",6061,"https:\u002F\u002Fgithub.com\u002FSolizardking\u002Fskillhub-main\u002Fblob\u002Fmain\u002Fskills\u002Fnvidia\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},"01M78E0TGCAMNPS207BA3G07S7","zkrouter","Self-hosted OpenAI-compatible LLM router — smart tier-based routing, ZK-stamped routing decisions, mode overrides, free OpenRouter at install via the Birth bot. Save 60-80% on inference costs by routing to the cheapest capable model across 12+ OpenRouter models.","MIT","https:\u002F\u002Fgithub.com\u002FSolizardking\u002Fskillhub-main\u002Fblob\u002Fmain\u002Fskills\u002Fzkrouter\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},"01M78E0R1Z8BDT6EDTHY17MTNB","zk","For custom ZK Solana programs and privacy-preserving applications to prevent double spending. Guide to integrate rent-free nullifier PDAs for double-spend prevention.","https:\u002F\u002Fgithub.com\u002FSolizardking\u002Fskillhub-main\u002Fblob\u002Fmain\u002Fskills\u002Fzk\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},"01M78E0P3ZTZ1YWF8MD5MM23QE","zk-omni-messaging","Zero-knowledge omnichain messaging between Robinhood Chain and Solana using CheshireZkOmniMessenger (msgType 4) with nullifier anti-replay and the zk-omni-relayer service.","https:\u002F\u002Fgithub.com\u002FSolizardking\u002Fskillhub-main\u002Fblob\u002Fmain\u002Fskills\u002Fzk-omni-messaging\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},"01M78E0JXZ2PNB1896VXAGDBWD","zerion-wallet-data","Use when the user asks to check a wallet's portfolio, token balances, DeFi positions, PnL, transaction history, or NFTs. Provides interpreted on-chain data across 40+ EVM chains and Solana via x402 pay-per-request or API key — no raw RPC decoding needed.","https:\u002F\u002Fgithub.com\u002FSolizardking\u002Fskillhub-main\u002Fblob\u002Fmain\u002Fskills\u002Fzerion-wallet-data\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},"01M78E0G14FH9GRRTQYMKD5E59","youtube-clipper","YouTube 视频智能剪辑工具。下载视频和字幕，AI 分析生成精细章节（几分钟级别）， 用户选择片段后自动剪辑、翻译字幕为中英双语、烧录字幕到视频，并生成总结文案。 使用场景：当用户需要剪辑 YouTube 视频、生成短视频片段、制作双语字幕版本时。 关键词：视频剪辑、YouTube、字幕翻译、双语字幕、视频下载、clip video","https:\u002F\u002Fgithub.com\u002FSolizardking\u002Fskillhub-main\u002Fblob\u002Fmain\u002Fskills\u002Fyoutube-clipper\u002FLICENSE","https:\u002F\u002Fgithub.com\u002FSolizardking\u002Fskillhub-main\u002Fblob\u002Fmain\u002Fskills\u002Fyoutube-clipper\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},"01M78E0C2ZYA99CFFDNB7ZMK5S","yield-optimization","Multi-chain yield optimization via yield.xyz (StakeKit). Discover 2,988+ yield opportunities across 75+ blockchains, build deposit\u002Fwithdrawal transactions with shell scripts, and sign them with a MoonPay wallet. Use when the user wants to earn yield, find the best lending or staking rate, enter\u002Fexit a position, or check portfolio balances.","https:\u002F\u002Fgithub.com\u002FSolizardking\u002Fskillhub-main\u002Fblob\u002Fmain\u002Fskills\u002Fyield-optimization\u002FSKILL.md",[],[]]