endomorphosis's picture
Show readable formula examples and distinguish fallback failures from formalization
ad3b263 verified
|
Raw History Blame
13.9 kB
metadata
configs:
  - config_name: formal_logic_text
    data_files:
      - split: train
        path: autoformal/uscode/formula-text/v1/*/formulas.parquet
  - config_name: paired_spans
    default: true
    data_files:
      - split: train
        path: autoformal/uscode/paired-v1/paired_spans/**/*.parquet
  - config_name: deferred_goals
    data_files:
      - split: train
        path: autoformal/uscode/paired-v1/goals/**/*.parquet
  - config_name: evidence_artifacts
    data_files:
      - split: train
        path: autoformal/uscode/paired-v1/artifacts/**/*.parquet
  - config_name: retained_outputs_v1
    data_files:
      - split: train
        path: autoformal/uscode/outputs/**/*.parquet
  - config_name: census_v3
    data_files:
      - split: train
        path: autoformal/uscode/census-v3/**/*.parquet
  - config_name: census_v2
    data_files:
      - split: train
        path: autoformal/uscode/census/**/*.parquet
  - config_name: supervisor_goals_v2
    data_files:
      - split: train
        path: autoformal/uscode/goals/**/*.parquet

Paired US Code conversions, diagnostic census and deferred repair goals

Read the actual formula strings

Select formal_logic_text for source text and emitted formula text as the first columns, or read the annotated examples. This is a fixed audit of the four archived reports below, not a live count of the whole corpus. JSONL, Parquet, and manifest are pinned to an immutable commit.

For source 116–283, §1847(d)(1)(D)(i), redesignated pars., the stored strings include:

Lifecycle(N1847, RedesignatedPars)
LifecycleState(sym_1847(), redesignated_pars())
O(redesignated_pars(n_1847))

These disagree: the last expression introduces an obligation into an amendment-history fragment. Another source, L., produces O(l(actor)); that is a conversion failure, even though the producer's syntax flag is true. The operative 10 U.S.C. 4873 example in the linked audit has an omitted condition and canonical action="to".

The 56-span audit has 372 formula occurrences from 45 available documents, with repeats preserved. 41 of 45 TDFOL records use the text fallback; eleven documents are unavailable. These counts are not successful formalizations. The formula rows retain exact strings, JSON pointers, source-report revisions, fallback provenance and reported validation/omission/blocker evidence. Unknown fallback status is null, not a claim that the output avoided fallback.

These are source compiler/bridge outputs. The legacy autoencoder has no learned formula decoder; the guided compiler path emits ASTs. None of this sample has Lake admission or qualification as a correct/gold semantic training target. Failed outputs remain useful diagnostic evidence and potential repair-training examples. The readable view supplements the full reports and linked paired data.

New observations use three linked tables. Historical files remain available; no original observations or goal packets are removed by this migration.

Configuration Content Join key
paired_spans (default) Source text; raw and projected autoencoder vectors; guided and direct compiler formulas; canonical typed compiler results; comparison; provenance; Lake status observation_id, source.span_id, goal_ids
deferred_goals Disagreement, compiler failure and capability records; source/observation bindings; immutable packet/task references goal_id, observation_ids
evidence_artifacts Losslessly compressed complete producer receipts, source bridge documents, compiler components, original packets and tasks artifact_sha256

uscode-paired-span-bundle/v1 manifests under autoformal/uscode/paired-v1/manifests/ bind all three tables by exact SHA-256, size, row count and immutable repository paths. Read a pinned commit when comparing runs. The train split is a storage label, not a training-quality gate.

from datasets import load_dataset
rows = load_dataset('justicedao/uscode-autoformal-span-cache', 'paired_spans',
                    split='train', streaming=True, revision='<immutable-commit>')
for row in rows:
    print(row['source']['span_id'], row['comparison']['status'],
          row['compiler']['canonical_formal_outputs'], row['goal_ids'])

What is being compared

The local legacy autoencoder emits eight-dimensional diagnostic vectors and compiler guidance. Its input representation is mock:stable-sha256/8, with no verified semantic embedding provenance. It has no learned legal formula decoder. The explicitly labeled autoencoder-guided compiler converts the original text using that learned guidance. The direct deterministic modal compiler processes the same source without that guidance. Both native formula collections are stored, with their exact payloads and origin labels.

Their agreement is diagnostic, not independent validation. The current comparison checks exact AST sequences including metadata; it does not prove semantic equivalence. Counts, ordering, polarity, temporal fields, conditions, exceptions and duplicate components are not silently discarded. Missing outputs, partial collections and incompatible representations have explicit statuses. complete means the emitted collection was captured; it does not establish that the compiler represented every legal meaning in the source.

compiler.canonical_formal_outputs separately retains actual typed-deontic compiler results. Its abstentions and completeness remain visible even when the two modal paths agree. syntax_status=not_checked remains explicit for native modal ASTs that have no independently invoked syntax validator. Bridge names are requested adapters; they are not proof that all logic families compiled or passed their validators.

No result in this diagnostic campaign grants admission. admitted=false, formalized=false, and Lake not_run stay explicit. A separate source-bound lake build <Lib> receipt is the only Lean admission. The Constitution is not formalized and must never receive roundtrip_ok here.

Complete evidence and later supervisor import

Every batch archives its full original producer receipt once. Rows point into that content-addressed artifact for bridge documents and compiler components. It retains source text, direct/guided native documents, guidance, raw evaluation, failures, scores, source/checkpoint hashes and execution configuration. No target is relabeled as a learned formula. Artifact rows encode exact bytes as base64 of zlib data and record the uncompressed SHA-256 and size.

The canonical package's logic.autoformal.paired_span_census provides load_paired_census_bundle() and decode_artifact() with explicit expansion bounds and hash verification. Nested recursive-zlib-json/v1 bridge payloads use optimizers.logic_theorem_optimizer.legacy_span_logic_artifacts.unpack_document.

Goals remain dataset records with enqueued=false. The existing scripts/ops/legal_ir/import_span_cache_exchange.py validates either new paired bundles or historical exchange bundles. Its default is a review plan. It can later import sealed packet/task pairs to a machine-local supervisor database; capability gaps without such packets stay preserved descriptive deferrals. Publishing a goal never executes it or authorizes source edits.

Bounded processing and resume

One resident CUDA model serves a hardware-bounded CPU compiler pool. At most two batches overlap. Full target/report caches are disabled for this isolated campaign; chunked compiler work checks the pinned source generation before and after each chunk. One controller writes the local DuckDB progress queue. Interrupted work is requeued; immutable Hub uploads use parent-commit checks. Local batch evidence is removed only after all four remote files are verified at the exact publication commit. Other machines can read immutable bundles and later reimport goals; this inference campaign does not synchronize or train weights.

The five bridge adapters are modal_frame_logic, deontic_norms, fol_tdfol, cec_dcec, and external_prover_router. Provers are off, disk cache is off, sample memory is off, temperature is zero. Per-batch receipts record worker counts, target counts and wall times. A target count of zero is not a faster legal-IR evaluation.

Historical schemas

The four existing configurations (retained_outputs_v1, census_v3, census_v2, and supervisor_goals_v2) preserve previous observations and goals. They are separate from the default paired schema. Older vector-only observations cannot be retrospectively treated as guided conversions. Some older records retain only target hashes; absent evidence is not reconstructed or invented. The original dataset card is retained in the canonical source repository at docs/datasets/uscode_autoformal_span_cache_historical_card.md.

Published full reports and measured sample

Four lossless original receipts preserve 56 span observations, 45 captured source logic documents, raw/projected vectors, three canonical compiler rules, and all available failures, metrics and provenance. Eleven documents were not captured by the producer limits (ten historical 4 MiB omissions and one new 16 MiB omission); their identities and reasons remain explicit.

Receipt Spans Captured documents Full report Manifest
Historical 32 22 gzip JSON hashes and inventory
Paired smoke 1 8 7 gzip JSON hashes and inventory
Paired smoke 2 8 8 gzip JSON hashes and inventory
Paired smoke 3 8 8 gzip JSON hashes and inventory

The new paired sample contains 24 spans, 15 guided modal ASTs and 15 direct modal ASTs. Nine rows have diagnostic AST agreement; 15 have no formulas from either path and do not count as agreement. Twenty-three source-bound compiler repair goals were retained. A remote import smoke validated seven goals from one bundle in plan-only mode; nothing was enqueued or executed.

Three batches of eight used one resident CUDA model, four CPU compiler workers and one bridge worker. Bridge-on evaluation wall times were 19.28, 9.34 and 9.50 seconds, with eight targets in every batch. Worker wall times were 3.82, 1.99 and 2.11 seconds per span, including the two codec paths. Both large process report caches stayed empty between batches; the disk cache and provers were disabled. Other parser/runtime caches may warm. Sampled peak process-group memory was 3.57 GiB. These are measured sample costs, not a matched speedup comparison or evidence of legal qualification.

Read a downloaded gzip report with json.loads(gzip.decompress(report_bytes)). Packed bridge documents additionally use the documented lossless document unpacker. File and inner-document hashes verified for every available document; the historical archive was also downloaded and reconstructed byte for byte.