Organize paired spans, deferred goals and full evidence artifacts
Browse files
README.md
CHANGED
|
@@ -1,5 +1,18 @@
|
|
| 1 |
---
|
| 2 |
configs:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3 |
- config_name: retained_outputs_v1
|
| 4 |
data_files:
|
| 5 |
- split: train
|
|
@@ -18,166 +31,140 @@ configs:
|
|
| 18 |
path: autoformal/uscode/goals/**/*.parquet
|
| 19 |
---
|
| 20 |
|
| 21 |
-
# US Code
|
| 22 |
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
`ipfs_accelerate_py` agent supervisor. It is a work-in-progress evidence corpus.
|
| 26 |
-
An uploaded observation, compiled rule, decompiled sentence, reconstruction
|
| 27 |
-
score, or bridge target does not establish formalization. Lake admission
|
| 28 |
-
requires a separate source-bound `lake build <Lib>` receipt. The Constitution
|
| 29 |
-
is not formalized.
|
| 30 |
|
| 31 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 32 |
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
| `census_v2` | Original historical observations; complete retained outputs remain in `input_json` |
|
| 38 |
-
| `supervisor_goals_v2` | Full repair packets and training goals, source context, acceptance criteria, and evidence hashes |
|
| 39 |
-
|
| 40 |
-
Each configuration has a separate schema. The `train` split name is a storage
|
| 41 |
-
label and does not assert qualification for training. The progress ledger and
|
| 42 |
-
older operational tables are not included in these observation configurations.
|
| 43 |
|
| 44 |
```python
|
| 45 |
from datasets import load_dataset
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
streaming=True,
|
| 52 |
-
revision="<immutable-commit-sha>",
|
| 53 |
-
)
|
| 54 |
-
for row in observations:
|
| 55 |
-
if row["compiler_rule_count"]:
|
| 56 |
-
print(row["source_span_id"], row["compiler_rules_json"])
|
| 57 |
-
```
|
| 58 |
-
|
| 59 |
-
Use an immutable commit revision when comparing runs or importing evidence.
|
| 60 |
-
Multiple observations of the same source may have different compiler/model
|
| 61 |
-
identities. Join goals by `census_sha256`; retain `source_span_id`,
|
| 62 |
-
`source_text_sha256`, `code_identity`, and `model_identity` as provenance.
|
| 63 |
-
|
| 64 |
-
## What the autoencoder emitted
|
| 65 |
-
|
| 66 |
-
The legacy CUDA campaign reconstructs eight-dimensional diagnostic vectors.
|
| 67 |
-
The input representation is `mock:stable-sha256/8`; it has no verified semantic
|
| 68 |
-
embedding provenance. Its raw decoder embedding, cosine similarity, and
|
| 69 |
-
reconstruction loss are distinct from its target-conditioned safety-projected
|
| 70 |
-
embedding and scores. These observations do not establish legal understanding.
|
| 71 |
-
|
| 72 |
-
The model does not emit legal formulas or reconstructed legal sentences in
|
| 73 |
-
this campaign. Empty `autoencoder_text` and `autoencoder_compiled` remain empty.
|
| 74 |
-
Compiler formulas and source-derived target documents are retained under their
|
| 75 |
-
own names, never relabeled as learned model outputs. This campaign performs
|
| 76 |
-
diagnostic inference, not training or weight publication.
|
| 77 |
-
|
| 78 |
-
## Compiler and logic artifacts
|
| 79 |
-
|
| 80 |
-
`compiler_rules_json` exposes retained structured rules.
|
| 81 |
-
`compiler_components_json` in census v3 preserves individual clause outcomes;
|
| 82 |
-
`compilation_complete` distinguishes a complete compilation from partial
|
| 83 |
-
evidence. `compiler_status`, `compiler_reason`, and `compiler_decompiled` expose
|
| 84 |
-
success, abstention, and text reconstruction. The full original observation
|
| 85 |
-
and producer context remain in `input_json`.
|
| 86 |
-
|
| 87 |
-
`logic_target_observation_json` captures the independent source-derived target
|
| 88 |
-
used during evaluation. `bridge_names_json` reports adapters invoked;
|
| 89 |
-
`observed_logic_views_json` records actual view names and
|
| 90 |
-
`observed_logic_families_json` records explicitly declared family metadata.
|
| 91 |
-
These fields do not certify that every requested logic family compiled or
|
| 92 |
-
passed a syntax validator. External prover evaluation is disabled in this
|
| 93 |
-
legacy diagnostic campaign.
|
| 94 |
-
|
| 95 |
-
Large graph payloads inside newly captured target documents use the lossless
|
| 96 |
-
`recursive-zlib-json/v1` document encoding. Compact formal views stay readable;
|
| 97 |
-
compressed nested payloads retain their exact uncompressed byte lengths and
|
| 98 |
-
SHA-256 digests. The canonical checkout provides `unpack_document` in
|
| 99 |
-
`ipfs_datasets_py.optimizers.logic_theorem_optimizer.legacy_span_logic_artifacts`
|
| 100 |
-
to reconstruct and verify the full document within explicit bounds. Packing
|
| 101 |
-
does not discard graph evidence or convert a target into model output.
|
| 102 |
-
|
| 103 |
-
From the canonical checkout, decode a retained observation with:
|
| 104 |
-
|
| 105 |
-
```python
|
| 106 |
-
import json
|
| 107 |
-
from ipfs_datasets_py.optimizers.logic_theorem_optimizer.legacy_span_logic_artifacts import (
|
| 108 |
-
DOCUMENT_ENCODING, unpack_document,
|
| 109 |
-
)
|
| 110 |
-
|
| 111 |
-
observation = json.loads(row["logic_target_observation_json"])
|
| 112 |
-
document = observation.get("document") if observation else None
|
| 113 |
-
if document is not None and observation.get("document_encoding") == DOCUMENT_ENCODING:
|
| 114 |
-
document = unpack_document(document, max_decoded_bytes=16 * 1024 * 1024)
|
| 115 |
```
|
| 116 |
|
| 117 |
-
|
| 118 |
-
|
| 119 |
-
|
| 120 |
-
|
| 121 |
-
|
| 122 |
-
|
| 123 |
-
|
| 124 |
-
|
| 125 |
-
|
| 126 |
-
|
| 127 |
-
|
| 128 |
-
|
| 129 |
-
|
| 130 |
-
|
| 131 |
-
|
| 132 |
-
|
| 133 |
-
|
| 134 |
-
|
| 135 |
-
|
| 136 |
-
compiler
|
| 137 |
-
|
| 138 |
-
|
| 139 |
-
|
| 140 |
-
|
| 141 |
-
|
| 142 |
-
|
| 143 |
-
|
| 144 |
-
|
| 145 |
-
|
| 146 |
-
|
| 147 |
-
|
| 148 |
-
|
| 149 |
-
|
| 150 |
-
|
| 151 |
-
|
| 152 |
-
|
| 153 |
-
|
| 154 |
-
|
| 155 |
-
|
| 156 |
-
|
| 157 |
-
|
| 158 |
-
|
| 159 |
-
|
| 160 |
-
|
| 161 |
-
|
| 162 |
-
|
| 163 |
-
|
| 164 |
-
|
| 165 |
-
|
| 166 |
-
|
| 167 |
-
|
| 168 |
-
|
| 169 |
-
|
| 170 |
-
|
| 171 |
-
|
| 172 |
-
|
| 173 |
-
|
| 174 |
-
|
| 175 |
-
|
| 176 |
-
|
| 177 |
-
|
| 178 |
-
|
| 179 |
-
|
| 180 |
-
|
| 181 |
-
|
| 182 |
-
|
| 183 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
---
|
| 2 |
configs:
|
| 3 |
+
- config_name: paired_spans
|
| 4 |
+
default: true
|
| 5 |
+
data_files:
|
| 6 |
+
- split: train
|
| 7 |
+
path: autoformal/uscode/paired-v1/paired_spans/**/*.parquet
|
| 8 |
+
- config_name: deferred_goals
|
| 9 |
+
data_files:
|
| 10 |
+
- split: train
|
| 11 |
+
path: autoformal/uscode/paired-v1/goals/**/*.parquet
|
| 12 |
+
- config_name: evidence_artifacts
|
| 13 |
+
data_files:
|
| 14 |
+
- split: train
|
| 15 |
+
path: autoformal/uscode/paired-v1/artifacts/**/*.parquet
|
| 16 |
- config_name: retained_outputs_v1
|
| 17 |
data_files:
|
| 18 |
- split: train
|
|
|
|
| 31 |
path: autoformal/uscode/goals/**/*.parquet
|
| 32 |
---
|
| 33 |
|
| 34 |
+
# Paired US Code conversions, diagnostic census and deferred repair goals
|
| 35 |
|
| 36 |
+
New observations use three linked tables. Historical files remain available;
|
| 37 |
+
no original observations or goal packets are removed by this migration.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 38 |
|
| 39 |
+
| Configuration | Content | Join key |
|
| 40 |
+
| --- | --- | --- |
|
| 41 |
+
| `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` |
|
| 42 |
+
| `deferred_goals` | Disagreement, compiler failure and capability records; source/observation bindings; immutable packet/task references | `goal_id`, `observation_ids` |
|
| 43 |
+
| `evidence_artifacts` | Losslessly compressed complete producer receipts, source bridge documents, compiler components, original packets and tasks | `artifact_sha256` |
|
| 44 |
|
| 45 |
+
`uscode-paired-span-bundle/v1` manifests under
|
| 46 |
+
`autoformal/uscode/paired-v1/manifests/` bind all three tables by exact SHA-256,
|
| 47 |
+
size, row count and immutable repository paths. Read a pinned commit when
|
| 48 |
+
comparing runs. The `train` split is a storage label, not a training-quality gate.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 49 |
|
| 50 |
```python
|
| 51 |
from datasets import load_dataset
|
| 52 |
+
rows = load_dataset('justicedao/uscode-autoformal-span-cache', 'paired_spans',
|
| 53 |
+
split='train', streaming=True, revision='<immutable-commit>')
|
| 54 |
+
for row in rows:
|
| 55 |
+
print(row['source']['span_id'], row['comparison']['status'],
|
| 56 |
+
row['compiler']['canonical_formal_outputs'], row['goal_ids'])
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 57 |
```
|
| 58 |
|
| 59 |
+
## What is being compared
|
| 60 |
+
|
| 61 |
+
The local legacy autoencoder emits eight-dimensional diagnostic vectors and
|
| 62 |
+
compiler guidance. Its input representation is `mock:stable-sha256/8`, with
|
| 63 |
+
no verified semantic embedding provenance. It has no learned legal formula
|
| 64 |
+
decoder. The explicitly labeled **autoencoder-guided compiler** converts the
|
| 65 |
+
original text using that learned guidance. The direct deterministic modal
|
| 66 |
+
compiler processes the same source without that guidance. Both native formula
|
| 67 |
+
collections are stored, with their exact payloads and origin labels.
|
| 68 |
+
|
| 69 |
+
Their agreement is **diagnostic, not independent validation**. The current
|
| 70 |
+
comparison checks exact AST sequences including metadata; it does not prove
|
| 71 |
+
semantic equivalence. Counts, ordering, polarity, temporal fields, conditions,
|
| 72 |
+
exceptions and duplicate components are not silently discarded. Missing outputs,
|
| 73 |
+
partial collections and incompatible representations have explicit statuses.
|
| 74 |
+
`complete` means the emitted collection was captured; it does not establish
|
| 75 |
+
that the compiler represented every legal meaning in the source.
|
| 76 |
+
|
| 77 |
+
`compiler.canonical_formal_outputs` separately retains actual typed-deontic
|
| 78 |
+
compiler results. Its abstentions and completeness remain visible even when
|
| 79 |
+
the two modal paths agree. `syntax_status=not_checked` remains explicit for
|
| 80 |
+
native modal ASTs that have no independently invoked syntax validator.
|
| 81 |
+
Bridge names are requested adapters; they are not proof that all logic
|
| 82 |
+
families compiled or passed their validators.
|
| 83 |
+
|
| 84 |
+
No result in this diagnostic campaign grants admission. `admitted=false`,
|
| 85 |
+
`formalized=false`, and Lake `not_run` stay explicit. A separate source-bound
|
| 86 |
+
`lake build <Lib>` receipt is the only Lean admission. The Constitution is not
|
| 87 |
+
formalized and must never receive `roundtrip_ok` here.
|
| 88 |
+
|
| 89 |
+
## Complete evidence and later supervisor import
|
| 90 |
+
|
| 91 |
+
Every batch archives its full original producer receipt once. Rows point into
|
| 92 |
+
that content-addressed artifact for bridge documents and compiler components.
|
| 93 |
+
It retains source text, direct/guided native documents, guidance, raw evaluation,
|
| 94 |
+
failures, scores, source/checkpoint hashes and execution configuration. No target
|
| 95 |
+
is relabeled as a learned formula. Artifact rows encode exact bytes as base64
|
| 96 |
+
of zlib data and record the uncompressed SHA-256 and size.
|
| 97 |
+
|
| 98 |
+
The canonical package's `logic.autoformal.paired_span_census` provides
|
| 99 |
+
`load_paired_census_bundle()` and `decode_artifact()` with explicit expansion
|
| 100 |
+
bounds and hash verification. Nested `recursive-zlib-json/v1` bridge payloads
|
| 101 |
+
use `optimizers.logic_theorem_optimizer.legacy_span_logic_artifacts.unpack_document`.
|
| 102 |
+
|
| 103 |
+
Goals remain dataset records with `enqueued=false`. The existing
|
| 104 |
+
`scripts/ops/legal_ir/import_span_cache_exchange.py` validates either new paired
|
| 105 |
+
bundles or historical exchange bundles. Its default is a review plan. It can
|
| 106 |
+
later import sealed packet/task pairs to a machine-local supervisor database;
|
| 107 |
+
capability gaps without such packets stay preserved descriptive deferrals.
|
| 108 |
+
Publishing a goal never executes it or authorizes source edits.
|
| 109 |
+
|
| 110 |
+
## Bounded processing and resume
|
| 111 |
+
|
| 112 |
+
One resident CUDA model serves a hardware-bounded CPU compiler pool. At most
|
| 113 |
+
two batches overlap. Full target/report caches are disabled for this isolated
|
| 114 |
+
campaign; chunked compiler work checks the pinned source generation before and
|
| 115 |
+
after each chunk. One controller writes the local DuckDB progress queue.
|
| 116 |
+
Interrupted work is requeued; immutable Hub uploads use parent-commit checks.
|
| 117 |
+
Local batch evidence is removed only after all four remote files are verified
|
| 118 |
+
at the exact publication commit. Other machines can read immutable bundles and
|
| 119 |
+
later reimport goals; this inference campaign does not synchronize or train weights.
|
| 120 |
+
|
| 121 |
+
The five bridge adapters are `modal_frame_logic`, `deontic_norms`, `fol_tdfol`,
|
| 122 |
+
`cec_dcec`, and `external_prover_router`. Provers are off, disk cache is off,
|
| 123 |
+
sample memory is off, temperature is zero. Per-batch receipts record worker
|
| 124 |
+
counts, target counts and wall times. A target count of zero is not a faster
|
| 125 |
+
legal-IR evaluation.
|
| 126 |
+
|
| 127 |
+
## Historical schemas
|
| 128 |
+
|
| 129 |
+
The four existing configurations (`retained_outputs_v1`, `census_v3`,
|
| 130 |
+
`census_v2`, and `supervisor_goals_v2`) preserve previous observations and goals.
|
| 131 |
+
They are separate from the default paired schema. Older vector-only observations
|
| 132 |
+
cannot be retrospectively treated as guided conversions. Some older records
|
| 133 |
+
retain only target hashes; absent evidence is not reconstructed or invented.
|
| 134 |
+
The original dataset card is retained in the canonical source repository at
|
| 135 |
+
`docs/datasets/uscode_autoformal_span_cache_historical_card.md`.
|
| 136 |
+
|
| 137 |
+
## Published full reports and measured sample
|
| 138 |
+
|
| 139 |
+
Four lossless original receipts preserve 56 span observations, 45 captured
|
| 140 |
+
source logic documents, raw/projected vectors, three canonical compiler rules,
|
| 141 |
+
and all available failures, metrics and provenance. Eleven documents were
|
| 142 |
+
not captured by the producer limits (ten historical 4 MiB omissions and one
|
| 143 |
+
new 16 MiB omission); their identities and reasons remain explicit.
|
| 144 |
+
|
| 145 |
+
| Receipt | Spans | Captured documents | Full report | Manifest |
|
| 146 |
+
| --- | ---: | ---: | --- | --- |
|
| 147 |
+
| Historical | 32 | 22 | [gzip JSON](https://huggingface.co/datasets/justicedao/uscode-autoformal-span-cache/resolve/4f7922a2188c111e30841a08769f0f989d0b7c61/autoformal/uscode/reports/v1/reports/43a822841e7192587a190bf56381bc55cdb1249a97ff3fa0a8a876d90bd75e90.json.gz) | [hashes and inventory](https://huggingface.co/datasets/justicedao/uscode-autoformal-span-cache/blob/4f7922a2188c111e30841a08769f0f989d0b7c61/autoformal/uscode/reports/v1/manifests/0f2431a7c4746625fdbf693b312447f138d7ff4b820774ed4990dc334caa84ed.json) |
|
| 148 |
+
| Paired smoke 1 | 8 | 7 | [gzip JSON](https://huggingface.co/datasets/justicedao/uscode-autoformal-span-cache/resolve/48cd0a5b666a8ef6cbaf259e9f1cc94792740e8b/autoformal/uscode/reports/v1/reports/49f60d4504a5b8df4d87b0c57eca52eecebdfbcbe5e52c1b74070de960d946fc.json.gz) | [hashes and inventory](https://huggingface.co/datasets/justicedao/uscode-autoformal-span-cache/blob/48cd0a5b666a8ef6cbaf259e9f1cc94792740e8b/autoformal/uscode/reports/v1/manifests/376e7def7c18e0851908190de9dae6d5535eba0efd46e09d45b4fede75d36c18.json) |
|
| 149 |
+
| Paired smoke 2 | 8 | 8 | [gzip JSON](https://huggingface.co/datasets/justicedao/uscode-autoformal-span-cache/resolve/45acc122f3f9c11da46c039e057a38ab5054a699/autoformal/uscode/reports/v1/reports/5fe4185488765685d8b4449f2bfbc1fab8d56f853ef333d0bab3ef06a98e812e.json.gz) | [hashes and inventory](https://huggingface.co/datasets/justicedao/uscode-autoformal-span-cache/blob/45acc122f3f9c11da46c039e057a38ab5054a699/autoformal/uscode/reports/v1/manifests/93d2f5a4779f6888bdf8938607e5a8990dbf019f00cf003faa704fc2d56d40f9.json) |
|
| 150 |
+
| Paired smoke 3 | 8 | 8 | [gzip JSON](https://huggingface.co/datasets/justicedao/uscode-autoformal-span-cache/resolve/f1ff72b4b171fca4ac63a44e4f263982e9129f03/autoformal/uscode/reports/v1/reports/fae864238b8c34e19aecaada1aa650fe7d5c7828c7eb5869c1ec40ae066366f9.json.gz) | [hashes and inventory](https://huggingface.co/datasets/justicedao/uscode-autoformal-span-cache/blob/f1ff72b4b171fca4ac63a44e4f263982e9129f03/autoformal/uscode/reports/v1/manifests/141c0182a532d30d0beb1886dcaa7071fd65aa5441a8ee9da92e85264630b0ea.json) |
|
| 151 |
+
|
| 152 |
+
The new paired sample contains 24 spans, 15 guided formulas and 15 direct
|
| 153 |
+
formulas. Nine rows have diagnostic AST agreement; 15 have no formulas from
|
| 154 |
+
either path and do not count as agreement. Twenty-three source-bound compiler
|
| 155 |
+
repair goals were retained. A remote import smoke validated seven goals from
|
| 156 |
+
one bundle in plan-only mode; nothing was enqueued or executed.
|
| 157 |
+
|
| 158 |
+
Three batches of eight used one resident CUDA model, four CPU compiler workers
|
| 159 |
+
and one bridge worker. Bridge-on evaluation wall times were 19.28, 9.34 and
|
| 160 |
+
9.50 seconds, with eight targets in every batch. Worker wall times were 3.82,
|
| 161 |
+
1.99 and 2.11 seconds per span, including the two codec paths. Both large
|
| 162 |
+
process report caches stayed empty between batches; the disk cache and provers
|
| 163 |
+
were disabled. Other parser/runtime caches may warm. Sampled peak process-group
|
| 164 |
+
memory was 3.57 GiB. These are measured sample costs, not a matched speedup
|
| 165 |
+
comparison or evidence of legal qualification.
|
| 166 |
+
|
| 167 |
+
Read a downloaded gzip report with `json.loads(gzip.decompress(report_bytes))`.
|
| 168 |
+
Packed bridge documents additionally use the documented lossless document
|
| 169 |
+
unpacker. File and inner-document hashes verified for every available document;
|
| 170 |
+
the historical archive was also downloaded and reconstructed byte for byte.
|