8000 feat(schema): standardize dependency manifests and retrieval evidence · Issue #3 · Mnehmos/mathcorpus · GitHub
[go: up one dir, main page]

Skip to content

feat(schema): standardize dependency manifests and retrieval evidence #3

Closed

Description

@Mnehmos

Problem

The current packet dependencies object is too shallow and author_packet.py does not reliably populate actual theorem dependencies from Proof Search. Retrieval candidates, unused retrieved lemmas, obligation dependencies, transitive depth, and verified module-item dependencies are lost.

Scope

Add a versioned DependencyManifest child record with:

  • declared theorem dependencies
  • actually used theorem dependencies
  • Proof Search obligation dependencies
  • verified module-item dependencies
  • transitive dependency count and depth
  • retrieval candidates
  • retrieved-but-unused candidates
  • kits, tactic tags, and prerequisite concepts
  • source of each dependency claim

Acceptance criteria

  • Kernel-verified formal packets generated through Proof Search must reference a dependency manifest.
  • Actual dependency evidence is imported from verifier-backed records, not manually guessed.
  • Declared, retrieved, and used dependencies remain distinct.
  • Dependency identifiers can resolve to Mathlib declarations, MathCorpus packets, or Proof Search verified artifacts.
  • Validation catches dangling, cyclic, or environment-mismatched references.
  • Corpus manifests can aggregate dependency frequency and depth.

Activity

  1. Mnehmos commented on Jul 12, 2026

    @Mnehmos
    OwnerAuthor

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

    • packet.schema.json gains dependency_manifest ($defs.dependency_manifest / dependency_claim_source), mirroring MCIP's DependencyManifest from feat(schema): define MathCorpus Interchange Protocol v1 for Proof Search enrichment #1. Six distinct categories — declared, used, obligation, verified_module_item, retrieval_candidate, retrieved_unused — instead of one merged list, plus per-claim source attribution (manual / proof_search_import / verifier_export).
    • Declared/retrieved/used stay distinct and checkable: policy.check_dependency_manifest rejects a dependency claimed both used and retrieved_unused (direct contradiction), an environment_hash mismatch against the packet's own verification.environment_hash, and any claim_sources entry not actually present in the array its category names.
    • Dangling and cyclic references caught: new corpus-wide policy.check_dependency_manifest_refs resolves any dependency id shaped like a MathCorpus packet_id against the loaded corpus (Mathlib declaration names aren't resolvable this way — no local Mathlib index) and detects cycles through other packets' manifests, deduplicated by edge-set so the same cycle isn't reported once per rotation.
    • Corpus aggregation: tools/build_manifests.py's dependency_graph.json gains a dependency_manifest_summary — frequency per dependency id per category, plus min/max/avg transitive depth.
    • author_packet.py fixed: it was silently dropping theorem_deps from spec input entirely (exactly the issue's own complaint) — now populated. Added optional dependency_manifest spec support so new Proof-Search-authored packets can carry this from the start.
    • 5 elementary algebra packets migrated with dependency evidence read directly from their actual .lean proof bodies (not fabricated).
    • 6 failure modes smoke-tested directly: environment mismatch, used/unused contradiction, unlisted claim, dangling reference, a real 2-packet cycle, and confirming the cycle report fires once (not once per rotation).
    • Full corpus (355 packets) + full CI-equivalent pipeline (manifests, split, dedupe, export, redaction audit) run locally end-to-end: 0 errors.

    One deliberate scope note: the acceptance criterion "kernel-verified Proof-Search packets must reference a dependency manifest" is not implemented as a hard validate_packets.py gate yet. Making it one today would fail all ~350 packets authored before this field existed, breaking CI for the whole corpus on an unrelated PR. It's deferred to the #6 corpus-wide backfill (when it becomes safe to enforce universally) and documented explicitly in schema/ENUMS.md so it isn't silently dropped from the roadmap.

    Tracked in agents/github_issues/DONE.md, FEATURES.md, HANDOFF.md.

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

Metadata

Metadata

3DF9

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