8000 feat(metrics): add multi-model empirical difficulty and native analytics exports · Issue #5 · Mnehmos/mathcorpus · GitHub
[go: up one dir, main page]

Skip to content

feat(metrics): add multi-model empirical difficulty and native analytics exports #5

Closed

Description

@Mnehmos

Problem

level and difficulty_bin are primarily author-assigned, and the authoring tool defaults unspecified packets to D0. MathCorpus does not yet preserve multi-model pass rates, attempts, tokens, cost, verifier time, or failure distributions as standardized evidence. Nested enrichment data is also hidden inside packet_json in Parquet exports.

Scope

Add ModelRun and EmpiricalDifficultyAggregate records with:

  • evaluation-suite and policy versions
  • model family/version/config hash
  • episode count and seeds
  • first-attempt and eventual pass rates
  • attempts-to-pass distribution
  • tokens, cost, wall time, and Lean CPU time
  • failure-category distribution
  • observed difficulty score and calibrated bin

Keep author-assigned and empirically observed difficulty separate.

Acceptance criteria

  • Aggregates are reproducible from referenced model-run records.
  • Multiple suites and historical aggregates can coexist.
  • Missing or censored model metadata is represented honestly.
  • Parquet/JSONL exports expose major fields as native columns, not only nested JSON.
  • Corpus-level reports summarize proof classes, dependency depth, negative counts, and model performance.
  • Existing packet difficulty is never silently overwritten by observed difficulty.

Activity

  1. Mnehmos commented on Jul 12, 2026

    @Mnehmos
    OwnerAuthor

    Implemented (local commit ed2e1a7, stacked on b3bfa63/bcdb683/8c74201/7f1ac10 — not yet pushed, see notes on #1-#4):

    • packet.schema.json gains model_runs[] / empirical_difficulty_aggregates[], mirroring MCIP's ModelRun/EmpiricalDifficultyAggregate from feat(schema): define MathCorpus Interchange Protocol v1 for Proof Search enrichment #1, strictly additive to the top-level author-assigned difficulty_bin — no code path in this repo writes to that field from empirical data.
    • Aggregates are genuinely reproducible, not just asserted: tools/mathcorpus/difficulty.py implements a versioned formula (calibration_version: "v1": 1 - mean eventual_pass_rate across referenced runs → fixed-threshold bin). policy.check_empirical_difficulty_aggregates recomputes both observed_difficulty_score and calibrated_difficulty_bin from the packet's own model_runs and rejects a mismatch. A future recalibration gets a new version rather than silently changing what an existing stored score means.
    • Missing vs. censored is represented honestly: model_run.censored_fields[] names fields whose true value is known but deliberately withheld — distinct from null ("not collected").
    • Multiple suites/historical aggregates coexist: empirical_difficulty_aggregates is an array; an exact-duplicate (suite, policy, calibration_version, model_run_ids) signature is flagged as a warning, not blocked.
    • Existing packet difficulty is never silently overwritten: author_difficulty_bin on an aggregate is only ever an echo for comparison; a mismatch against the packet's current difficulty_bin is a warning ("expected for a historical aggregate"), never a write.
    • Corpus-level reports: new shared tools/mathcorpus/aggregates.py (proof-class distribution, dependency transitive depth, negative counts, per-model-family episode-weighted pass rate) used by both build_manifests.py (refactored, removing the duplicate logic feat(schema): standardize dependency manifests and retrieval evidence #3 had added) and an extended corpus_stats.py, so the two reporting surfaces agree.
    • Native Parquet columns, not just packet_json: tools/export_parquet.py now hoists 9 enrichment summaries (proof_variant_count, canonical_proof_class, dependency_transitive_depth, attempt_count, attempt_failed_count, negative_example_count, model_run_count, best_eventual_pass_rate, observed_difficulty_bin) into native columns — the issue's specific complaint. _flatten() logic verified directly against the real 303-row public export since pyarrow isn't installed in this environment. JSONL was already fine (each row is a full nested JSON object); no change needed there.
    • Honest fixture, not fabricated telemetry: no packet in this corpus has real multi-model evaluation data yet — Phase 7 of the roadmap hasn't started. A new explicitly synthetic packets/_fixtures/model_performance_conformance.v1.json (kind: concept, training.eligibility: private_audit_only) demonstrates the schema with two illustrative models and a genuinely recomputed (not hand-picked) aggregate; confirmed excluded from every export lane by grepping a full export run.
    • 9 failure modes smoke-tested directly against scratch copies (dangling model_run_id, score/bin not reproducible, stale author-bin warning, duplicate-aggregate warning, no-usable-rate).
    • Full corpus (357 packets) + full CI-equivalent pipeline (manifests, split, dedupe, export, redaction audit) run locally end-to-end: 0 errors.

    This closes out the "embed MCIP shapes into packet.schema.json" arc from #1 (#2-#5). Tracked in agents/github_issues/DONE.md, FEATURES.md, HANDOFF.md.

  2. added 2 commits that reference this issue on Jul 12, 2026
    ed2e1a7
    928b2be
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      0