Skip to content

[codex] add no-leak Mine exports - #7

Draft
divo12 wants to merge 4 commits into
codex/mine-diagnosis-clusteringfrom
codex/mine-exports-ledger
Draft

[codex] add no-leak Mine exports#7
divo12 wants to merge 4 commits into
codex/mine-diagnosis-clusteringfrom
codex/mine-exports-ledger

Conversation

@divo12

@divo12 divo12 commented Aug 22, 2026

Copy link
Copy Markdown
Owner

Stack

Depends on #6. Review against codex/mine-diagnosis-clustering.

Problem

Admitted traces and failure clusters cannot be exported independently: exact/template families would leak between training, memory, regression, selection, and admission. OFW needs one authoritative family ledger before materializing any downstream artifact.

Implementation

  • Adds MineExports(revision, mine_result, diagnosis_result, policy).run().
  • Derives conservative trace families from normalized privacy-safe observation topology.
  • Canonicalizes topology order so reordered copies remain one family.
  • Uses stable cluster family IDs from diagnosis revisions.
  • Assigns every eligible trace/cluster family exactly one typed partition.
  • Carries previous ledger assignments forward and fails closed if a family flips good/failure role.
  • Supports explicit typed cluster partition rules; unlisted clusters use stable family hashing, never sorted position.
  • Produces a GoodTraceDataset of safe content-addressed snapshot references with family-consistent train/validation splits.
  • Requires approved consent, explicit license, and metadata-only privacy transform provenance.
  • Produces separate developer frontier/regression, selection holdout, and admission holdout suites.
  • Produces immutable memory proposals without changing harness files.
  • Produces a benchmark manifest bound to harness execution/lifecycle fingerprints.
  • Writes owner-only atomic ledger, dataset, suite, memory, benchmark, and bundle artifacts.

TDD evidence

  • Same-topology traces share one family assignment and one dataset split.
  • Training families never appear in developer or holdout suites.
  • Selection/admission artifacts are physically separate from developer-visible suites.
  • Same family requested for training and eval fails closed.
  • Memory partition creates a proposal while leaving the harness unchanged.
  • Adding a lexically earlier cluster cannot reassign existing cluster families.
  • Identical inputs produce identical content-addressed bundles.
  • Real Mine-produced snapshots pass digest verification; writer and reader hash identical bytes.
  • Same topology in different observation order cannot cross training and eval.

Verification

  • pytest -q — 101 passed; latest full coverage remains 93%
  • Ruff and strict mypy across src and tests — clean
  • forbidden construct scan — no Any, raw dict, object, getattr, setattr, lambdas, or __import__
  • Bandit — zero findings
  • pip-audit — no known vulnerabilities
  • source distribution and wheel build successfully

Deliberate scope

  • Exports reference privacy-safe snapshots; raw Langfuse I/O hydration remains an explicit later read-policy surface.
  • Benchmark execution, candidate mutation, A/B gates, scheduler, and promotion are not included.
  • Conservative topology families may over-group; loosen only with reviewed family evidence, never by silently splitting holdouts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant