# Manufacturing × GL — the INTERSECTION skill (a composition manifest, NOT a re-spec).
# It COMPOSES the base gl suite + the validated gl/overlays/manufacturing diff. The full
# mechanics live in the six base skills; this contract only points at the additive overlay.
# Lives at skill/enterprise_software/gl/industries/manufacturing.skill.yaml.
# check:skills binds it to its post; the human walkthrough is posts/.../industries/manufacturing.md.

id: gl/manufacturing
version: 1.0.0
summary: >-
  The GL suite reshaped into a COST-ACCOUNTING ledger — accounts gain a cost_center, the chart of accounts
  gains Inventory + WIP (assets) and COGS + a Cost Variance/PPV account (P&L), a standard_costs table drives
  a standard-cost variance journal (inventory booked at standard, the actual − standard variance routed to
  the P&L, payables at actual — balanced), and inventory flows Inventory -> WIP -> COGS. The balance sheet
  ties and the trial balance stays 0.00. Composes the base suite plus the manufacturing overlay; no fork.
module: gl
category: enterprise-software
industry: manufacturing            # NEW industry key (lib/categories.js)
pillars: [sql, graph]              # GL is SQL + the account-hierarchy graph; no Models

# The composition: this skill IS the suite + one additive overlay (both already tested).
composes:
  suite: gl                        # the six base skills in skill/enterprise_software/gl/*.skill.yaml
  overlay: gl/overlays/manufacturing

# Binding to the narrative (published id = manufacturing-gl -> route below; route wins over the derived page_url).
post: posts/enterprise_software/gl/industries/manufacturing.md
route: /library/manufacturing-gl

# What the overlay ADDS on top of the suite (pointer, not a re-spec — see the overlay for the typed diff).
provides:
  tables_add: [standard_costs]                   # + cost_center on accounts; + Inventory/WIP/COGS/Cost-Variance COA leaves
  graph_edges_add: []                            # cost accounts attach to the existing asset/expense roots — no new topology
  gate_change: "journal-entry posts a standard-cost variance journal (inventory at standard, actual-standard variance to the P&L, payables at actual — balanced); financial-reporting rolls Inventory/WIP into the balance sheet and COGS + variance into the P&L"
  onto: [gl/core, gl/journal-entry, gl/financial-reporting]

# Cites the overlay's live validation (2026-09-03, org IHDIASH) — not re-run here.
tested_branches:
  - overlay: manufacturing
    tested_at: 2026-09-03
    cites: gl/overlays/manufacturing
    live:
      - "ALTER accounts ADD cost_center (nullable); standard_costs created + seeded (WIDGET-1 qty 100, std 100.00, actual 105.00 -> variance derived exact '500.00')"
      - "variance journal balances: DEBIT Inventory 10000.00 + DEBIT Cost Variance 500.00 + CREDIT AP 10500.00 -> debit=credit=10500.00, imbalance '0.00'; cost flow Inventory -> WIP -> COGS leaves Inventory 0.00, WIP 0.00, COGS 10000.00"
      - "variance hits the P&L: expense net 10500.00 (COGS 10000.00 + variance 500.00), net income -10500.00; balance sheet ties (assets 1000000.00 = liabilities 10500.00 + equity 1000000.00 + net income -10500.00, bs_tie '0.00'), trial balance exact '0.00' across 7 accounts"
