# Financial-services × GL — the INTERSECTION skill (a composition manifest, NOT a re-spec).
# It COMPOSES the base gl suite + the validated gl/overlays/finserv 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/finserv.skill.yaml.
# check:skills binds it to its post; the human walkthrough is posts/.../industries/finserv.md.

id: gl/finserv
version: 1.0.0
summary: >-
  The GL suite reshaped for a regulated (SOX-style) close — every journal carries a prepared_by, an
  approved_by and an approval_state, a journal_approvals trail records every approval transition, and posting
  is fronted by a deterministic SEGREGATION-OF-DUTIES hard gate (a self-approved or unapproved journal never
  posts, even when it balances). The period close inherits a sign-off gate: a period cannot close while any
  journal in it is unapproved. Composes the base suite plus the finserv overlay; no fork.
module: gl
category: enterprise-software
industry: finserv                  # reuses the `finance` category chip
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/finserv

# Binding to the narrative (published id = finserv-gl -> route below; route wins over the derived page_url).
post: posts/enterprise_software/gl/industries/finserv.md
route: /library/finserv-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: [journal_approvals]                # + prepared_by/approved_by/approval_state on journals
  graph_edges_add: []                            # finserv adds SoD columns + gates, not topology
  gate_change: "journal-entry balance gate + a DETERMINISTIC segregation-of-duties hard gate (a self-approved/unapproved journal never posts, even balanced); period-close gains a sign-off gate (a period with any unapproved journal cannot close)"
  onto: [gl/core, gl/journal-entry, gl/period-close]

# Cites the overlay's live validation (2026-09-03, org IHDIASH) — not re-run here.
tested_branches:
  - overlay: finserv
    tested_at: 2026-09-03
    cites: gl/overlays/finserv
    live:
      - "ALTER journals ADD prepared_by/approved_by/approval_state (all nullable); journal_approvals created + seeded (4 approval-trail rows)"
      - "SoD hard gate: J2 (alice/alice, balanced) = blocked (preparer=approver); J3 (alice/bob, approved) = post_ok; J4 (no approver) = blocked. Guarded post: J2 stayed draft, J3 -> posted"
      - "close sign-off gate: period 2026-09 with 2 unapproved journals = close blocked; after voiding both -> close_ok. Trial balance exact '0.00' throughout (ledger 4 rows: Cash 1000000.00, AR 40000.00, Common Stock -1000000.00, Product Revenue -40000.00)"
