Skip to content

COBOL export: emit calibrated PD and reason codes #14

Description

@orgoca

Problem

The COBOL export currently emits score and band only. The SQL export carries the full governed output; COBOL does not.

That is a material limitation of the headline claim. The mainframe path is the differentiating deployment story, but it cannot currently produce a calibrated probability or an adverse-action reason — which means the regulatory artifact that motivates the whole reason-code machinery cannot be generated where the decision actually runs.

Proposed approach

PD is straightforward: the calibration table is already integer piecewise-linear. Emit it as a paragraph performing the same div_rha interpolation the runtime and SQL export use. The spec (§6) already defines the algorithm.

Reason codes are harder and depend on #15 — with the current O(p²) formulation, emitting attribution in COBOL is impractical. Once per-tree decomposition lands, each feature's contribution becomes a bounded computation that COBOL can express.

Suggest splitting: PD now, reasons after leaf-time attribution.

Acceptance criteria

  • export_cobol emits PD-PPM matching decide() exactly, verified by the existing GnuCOBOL run-parity harness
  • Driver-harness mode prints PD alongside latent and band so CI diffs it
  • Docs updated — docs/howto/deploy.md currently states the limitation and should state the new scope

Files

src/compileml/export/cobol.py, tests/test_export.py, docs/howto/deploy.md

Scope

PD alone: medium and self-contained. The CI harness already compiles and runs the generated program, so the parity test is nearly free.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requesthelp wantedExtra attention is needed

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions