[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M78JBYP66T400EGX5WNXK2TJ":3,"skill-same:01M78JBYP66T400EGX5WNXK2TJ":101},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":15,"categories":16,"keywords":17,"publishedAt":18,"linkOnly":19,"markdownContent":20,"markdownBody":21,"frontMatter":22,"refName":34,"commitSha":35,"skillDirectory":36,"forksCount":13,"repositoryHtmlUrl":37,"repositoryHomepageUrl":38,"ownerHtmlUrl":39,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":40,"install":41,"resources":54},"01M78JBYP66T400EGX5WNXK2TJ","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.","matheussluzz\u002FZeuZ-Agent","matheussluzz","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F209255758?v=4","01M78HKHH1D1ASC9KC9BG583DH","01M78HKHHP6W7XRXQM2SBCAM3R",0,"Apache-2.0","https:\u002F\u002Fgithub.com\u002Fmatheussluzz\u002FZeuZ-Agent\u002Fblob\u002Fmain\u002Fcatalog\u002Fbundles\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":23,"license":14,"metadata":29,"description":7,"allowed-tools":32,"compatibility":33},[24,25,26,27,28],"data","routing","vcn","aoi","sda",{"author":30,"version":31},"NVIDIA Corporation","0.1.0","Read Bash","Standalone — no external runtime requirements.","main","fc4f2c7759ae400c66cd38656db70ead882a0d08","catalog\u002Fbundles\u002Fnvidia\u002Ftao-route-visual-changenet-samples","https:\u002F\u002Fgithub.com\u002Fmatheussluzz\u002FZeuZ-Agent","https:\u002F\u002Fgithub.com\u002Fmatheussluzz\u002FZeuZ-Agent#readme","https:\u002F\u002Fgithub.com\u002Fmatheussluzz","2026-08-27 05:21:51",{"source":8,"skillName":5,"commands":42,"prompt":52,"zipAvailable":53},[43,46,49],{"tool":44,"command":45},"npx","npx skills add matheussluzz\u002FZeuZ-Agent --skill tao-route-visual-changenet-samples",{"tool":47,"command":48},"bunx","bunx skills add matheussluzz\u002FZeuZ-Agent --skill tao-route-visual-changenet-samples",{"tool":50,"command":51},"pnpm","pnpm dlx skills add matheussluzz\u002FZeuZ-Agent --skill tao-route-visual-changenet-samples","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fmatheussluzz\u002FZeuZ-Agent\u002Fblob\u002Fmain\u002Fcatalog\u002Fbundles\u002Fnvidia\u002Ftao-route-visual-changenet-samples\u002FSKILL.md",true,[55,61,67,71,75,79,83,87,91,97],{"path":56,"resourceType":57,"resourceTypeDesc":58,"sizeBytes":59,"sourceHtmlUrl":60},"BENCHMARK.md","REFERENCE","参考文档",4162,"https:\u002F\u002Fgithub.com\u002Fmatheussluzz\u002FZeuZ-Agent\u002Fblob\u002Fmain\u002Fcatalog\u002Fbundles\u002Fnvidia\u002Ftao-route-visual-changenet-samples\u002FBENCHMARK.md",{"path":62,"resourceType":63,"resourceTypeDesc":64,"sizeBytes":65,"sourceHtmlUrl":66},"hooks\u002F_parse-stdin.sh","SCRIPT","脚本",1471,"https:\u002F\u002Fgithub.com\u002Fmatheussluzz\u002FZeuZ-Agent\u002Fblob\u002Fmain\u002Fcatalog\u002Fbundles\u002Fnvidia\u002Ftao-route-visual-changenet-samples\u002Fhooks\u002F_parse-stdin.sh",{"path":68,"resourceType":63,"resourceTypeDesc":64,"sizeBytes":69,"sourceHtmlUrl":70},"hooks\u002Frouting-artifacts-check.sh",3595,"https:\u002F\u002Fgithub.com\u002Fmatheussluzz\u002FZeuZ-Agent\u002Fblob\u002Fmain\u002Fcatalog\u002Fbundles\u002Fnvidia\u002Ftao-route-visual-changenet-samples\u002Fhooks\u002Frouting-artifacts-check.sh",{"path":72,"resourceType":63,"resourceTypeDesc":64,"sizeBytes":73,"sourceHtmlUrl":74},"hooks\u002Frouting-coverage-check.sh",2893,"https:\u002F\u002Fgithub.com\u002Fmatheussluzz\u002FZeuZ-Agent\u002Fblob\u002Fmain\u002Fcatalog\u002Fbundles\u002Fnvidia\u002Ftao-route-visual-changenet-samples\u002Fhooks\u002Frouting-coverage-check.sh",{"path":76,"resourceType":63,"resourceTypeDesc":64,"sizeBytes":77,"sourceHtmlUrl":78},"hooks\u002Frouting-package.sh",2544,"https:\u002F\u002Fgithub.com\u002Fmatheussluzz\u002FZeuZ-Agent\u002Fblob\u002Fmain\u002Fcatalog\u002Fbundles\u002Fnvidia\u002Ftao-route-visual-changenet-samples\u002Fhooks\u002Frouting-package.sh",{"path":80,"resourceType":63,"resourceTypeDesc":64,"sizeBytes":81,"sourceHtmlUrl":82},"hooks\u002Frouting-script-check.sh",3173,"https:\u002F\u002Fgithub.com\u002Fmatheussluzz\u002FZeuZ-Agent\u002Fblob\u002Fmain\u002Fcatalog\u002Fbundles\u002Fnvidia\u002Ftao-route-visual-changenet-samples\u002Fhooks\u002Frouting-script-check.sh",{"path":84,"resourceType":63,"resourceTypeDesc":64,"sizeBytes":85,"sourceHtmlUrl":86},"hooks\u002Frouting-section-check.sh",3462,"https:\u002F\u002Fgithub.com\u002Fmatheussluzz\u002FZeuZ-Agent\u002Fblob\u002Fmain\u002Fcatalog\u002Fbundles\u002Fnvidia\u002Ftao-route-visual-changenet-samples\u002Fhooks\u002Frouting-section-check.sh",{"path":88,"resourceType":57,"resourceTypeDesc":58,"sizeBytes":89,"sourceHtmlUrl":90},"skill-card.md",3816,"https:\u002F\u002Fgithub.com\u002Fmatheussluzz\u002FZeuZ-Agent\u002Fblob\u002Fmain\u002Fcatalog\u002Fbundles\u002Fnvidia\u002Ftao-route-visual-changenet-samples\u002Fskill-card.md",{"path":92,"resourceType":93,"resourceTypeDesc":94,"sizeBytes":95,"sourceHtmlUrl":96},"skill.oms.sig","OTHER","其他",6061,"https:\u002F\u002Fgithub.com\u002Fmatheussluzz\u002FZeuZ-Agent\u002Fblob\u002Fmain\u002Fcatalog\u002Fbundles\u002Fnvidia\u002Ftao-route-visual-changenet-samples\u002Fskill.oms.sig",{"path":98,"resourceType":57,"resourceTypeDesc":58,"sizeBytes":99,"sourceHtmlUrl":100},"zeuz.manifest.yaml",172,"https:\u002F\u002Fgithub.com\u002Fmatheussluzz\u002FZeuZ-Agent\u002Fblob\u002Fmain\u002Fcatalog\u002Fbundles\u002Fnvidia\u002Ftao-route-visual-changenet-samples\u002Fzeuz.manifest.yaml",[102,110,117,124,131,138],{"skillNo":103,"name":104,"nameZh":6,"description":105,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":106,"licenseFileUrl":6,"sourceHtmlUrl":107,"categories":108,"keywords":109,"publishedAt":18},"01M78JQ2R0QR8H2Z6662RFX804","gamma","Fixture skill gamma for discovery benchmarks.","MIT","https:\u002F\u002Fgithub.com\u002Fmatheussluzz\u002FZeuZ-Agent\u002Fblob\u002Fmain\u002Ftest\u002Ffixtures\u002Fskill-registry-mini\u002Fskills\u002Fgamma\u002FSKILL.md",[],[],{"skillNo":111,"name":112,"nameZh":6,"description":113,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":106,"licenseFileUrl":6,"sourceHtmlUrl":114,"categories":115,"keywords":116,"publishedAt":18},"01M78JQ1KCVZ15APZG3FFF29K0","beta","Fixture skill beta for discovery benchmarks.","https:\u002F\u002Fgithub.com\u002Fmatheussluzz\u002FZeuZ-Agent\u002Fblob\u002Fmain\u002Ftest\u002Ffixtures\u002Fskill-registry-mini\u002Fskills\u002Fbeta\u002FSKILL.md",[],[],{"skillNo":118,"name":119,"nameZh":6,"description":120,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":106,"licenseFileUrl":6,"sourceHtmlUrl":121,"categories":122,"keywords":123,"publishedAt":18},"01M78JQ0FJTK4Q9JKZMX9SVSEN","alpha","Fixture skill alpha for discovery benchmarks.","https:\u002F\u002Fgithub.com\u002Fmatheussluzz\u002FZeuZ-Agent\u002Fblob\u002Fmain\u002Ftest\u002Ffixtures\u002Fskill-registry-mini\u002Fskills\u002Falpha\u002FSKILL.md",[],[],{"skillNo":125,"name":126,"nameZh":6,"description":127,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":106,"licenseFileUrl":6,"sourceHtmlUrl":128,"categories":129,"keywords":130,"publishedAt":18},"01M78JPYVYPY7R8QS10KADQPWE","writing-for-agents","Writing documents for agents. Use when creating or editing skills, or modifying AGENTS.md or CLAUDE.md.","https:\u002F\u002Fgithub.com\u002Fmatheussluzz\u002FZeuZ-Agent\u002Fblob\u002Fmain\u002Fskills\u002Fwriting-for-agents\u002FSKILL.md",[],[],{"skillNo":132,"name":133,"nameZh":6,"description":134,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":106,"licenseFileUrl":6,"sourceHtmlUrl":135,"categories":136,"keywords":137,"publishedAt":18},"01M78JPVYHB88RF5ATZVGX84RR","wizard","Generate an interactive bash wizard that walks a human through steps only they can perform. Use when provisioning infrastructure, setting up credentials or CI secrets, walking an unfamiliar third-party dashboard, or running a one-off migration or cutover. Don't invoke this for steps the agent can perform itself.","https:\u002F\u002Fgithub.com\u002Fmatheussluzz\u002FZeuZ-Agent\u002Fblob\u002Fmain\u002Fskills\u002Fwizard\u002FSKILL.md",[],[],{"skillNo":139,"name":140,"nameZh":6,"description":141,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":106,"licenseFileUrl":6,"sourceHtmlUrl":142,"categories":143,"keywords":144,"publishedAt":18},"01M78JPSSWNTZW89DWGJTX7716","wayfinder","Plan a huge chunk of work (more than one agent session can hold) as a shared map of decision tickets on your issue tracker, and resolve them one at a time until the way to the destination is clear.","https:\u002F\u002Fgithub.com\u002Fmatheussluzz\u002FZeuZ-Agent\u002Fblob\u002Fmain\u002Fskills\u002Fwayfinder\u002FSKILL.md",[],[]]