Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
69 changes: 64 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,66 @@ python -m pip install -e '.[test]'

This installs the `ecm-tqag` command-line entry point.

## 6. Reproduce the complete offline software check
## 6. Quick start: input → TQA output

There are two supported workflows:

### A. Generate a TQA item from a normalized document (offline)

Prepare one JSON document that follows
[`schemas/normalized-document.schema.json`](schemas/normalized-document.schema.json).
It must contain a document ID, typed layout nodes/edges, and at least one
supported evidence motif. Then run:

```bash
ecm-tqag generate path/to/document.json output/
ecm-tqag validate-generated output/ --source path/to/document.json
```

The command writes a generated TQA item, matched evidence packages for
`text_only`, `text_layout`, and `full_pixels` when available, and a manifest
with SHA-256 receipts. The included examples are runnable immediately:

```bash
ecm-tqag generate fixtures/documents/layout.json run-output/generated-layout
```

This workflow is deterministic and uses no model or network. It is intended
for the documented normalized JSON input, not for arbitrary PDF files.

### B. Run an answerer on evidence packages (offline or with a model)

Prepare a directory of JSON evidence packages following
[`schemas/condition-package.schema.json`](schemas/condition-package.schema.json),
then create a run configuration containing:

- `packages`: the package directory;
- `conditions`: one or more of `text_only`, `text_layout`, `full_pixels`;
- `output`: where to write the run summary;
- `mode`: `offline` or `openai-compatible`.

Run it with:

```bash
ecm-tqag run path/to/config.json
ecm-tqag verify-run path/to/summary.json --config path/to/config.json
ecm-tqag export-dataset path/to/summary.json path/to/dataset.jsonl
```

In `offline` mode, the runner validates the packages and produces a
structural test answer; it does not call a model. In `openai-compatible` mode,
add `endpoint`, `model`, and `api_key_env` to the config, export the named API
key in the environment, and run the same command:

```bash
export ECM_TQAG_API_KEY='your-key'
ecm-tqag run configs/openai-compatible.local.json
```

The output is a JSON summary containing one answer record per package and
condition, package/config receipts, and a summary SHA-256.

## 7. Reproduce the complete offline software check

Run from the repository root:

Expand All @@ -158,7 +217,7 @@ python tools/machine_semantic_audit.py --repo . --output machine-policy-audit.js

Successful commands return exit code `0`; malformed input or failed verification returns non-zero. The offline runner does not call a model or make a network request.

## 7. Command reference
## 8. Command reference

| Command | Input | Output/check |
|---|---|---|
Expand Down Expand Up @@ -255,7 +314,7 @@ independent human behavior, or annotation truth. SHA-256 values are consistency
checksums, not signatures. Consequently this report is not evidence of answer
correctness, modality necessity, baseline superiority, or generalization.

## 8. Repository layout
## 9. Repository layout

```text
src/ecm_tqag/ Installable library and CLI
Expand Down Expand Up @@ -283,12 +342,12 @@ python3 artifacts/stage_b_model_evaluation/reproduce_stage_b.py

These are model-based protocol checks, not human/expert ratings, semantic validation, or factual/legal accuracy. Evidence text, trace text, source images, free-text notes, raw provider envelopes, credentials, and restricted materials are excluded.

## 9. Reproducibility and data boundary
## 10. Reproducibility and data boundary

The public release contains source code, schemas, documentation, and synthetic fixtures. It does not redistribute textbook PDFs, source-derived chunks, source images, historical model outputs, private experiment records, credentials, or deployment-specific endpoints. Users are responsible for obtaining permission before adding external material and for keeping restricted inputs and outputs outside public repositories.

The software checks structure and provenance completeness. Independent human or domain review is required for semantic/legal correctness, answer quality, educational usefulness, and visual-grounding claims.

## Citation and license
## 11. Citation and license

Use the repository metadata in [`CITATION.cff`](CITATION.cff) when citing this software. Code and documentation are released under the [Apache-2.0 License](LICENSE).
63 changes: 63 additions & 0 deletions experiments/census_5arm_framef/MANIFEST.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
{
"files": {
"README.md": {
"bytes": 3533,
"sha256": "8554c84c17f5ab82c8bcf3a570b26cb21006e757a1138039d9be9736ab4533b9"
},
"RIGHTS_AND_LIMITATIONS.md": {
"bytes": 2052,
"sha256": "bad06de47fa5399775aa73228e4a45e9e533368360894bde567cc547a34a5cb5"
},
"records/ablation_generator_answerer.json": {
"bytes": 196649,
"sha256": "2710caf0c95d56dc7c3ce1f29754b3845d66b7c320def2e1127954e397029465"
},
"records/ablation_independent_answerer.json": {
"bytes": 240621,
"sha256": "7cbf6619e91fb6a6d1a5e39e3f22f0aa1aca1ccb9a09aa2a6936e2f519347578"
},
"records/admission_decisions.json": {
"bytes": 91255,
"sha256": "3c7786b594cf2d020de93b0f782ddd77bf1ff2ca949641d0e83edd1e34d9aced"
},
"records/answer_in_question.json": {
"bytes": 70570,
"sha256": "5d0f73a2ee119ad4a2fe9654651f9b90b7b038022965d2692245e0f80944c9fb"
},
"records/frame_strata.json": {
"bytes": 10661,
"sha256": "7e22d705c22bbfcd3e3fd648a703092f46bc1efd95722125b33cd4ecc93e04af"
},
"records/judged_scores.json": {
"bytes": 115933,
"sha256": "b4b237d7c377cd34f172b9675edac02ab4ceefc3423136bb24fda27722aed030"
},
"records/protocol.json": {
"bytes": 52430,
"sha256": "c503ce07d198eaa6e2c5f0db083bd6069daec3d4a61159cbc9ec8539b329f2ae"
},
"records/withdrawn_results.json": {
"bytes": 21767,
"sha256": "633cefc3027ba8f065f3631a586194e6f6912a980556c7fd9bc94494f1c49fe7"
},
"verify_reported_quantities.py": {
"bytes": 49090,
"sha256": "20d68f6fcc45a24bea1d45f6ad18272f1ba2eb713e59dd5d9a07ca6905546b67"
}
},
"not_redistributed": [
"page images and figure crops (copyright: University of Law, Hue University)",
"raw provider responses",
"object.text_evidence_quote, object.question, object.answer, object.visual_evidence",
"returned.answer (the answerer's text; published as graded decisions instead)",
"object.rationale from the raters",
"owner authorisation conversation"
],
"schema": "ecm-tqag.public.release-manifest.v1",
"source_runs": {
"ablation": "ablation_framef_20260831T020000Z",
"census": "round4_framef_census_20260830T140000Z",
"independent_answerer_replication": "ablation_secondary_answerer_20260831T140000Z"
},
"what": "derived decision records for the frame-F census reported in the ACIIDS 2027 submission. Every published quantity is recomputable from these files by verify_reported_quantities.py."
}
59 changes: 59 additions & 0 deletions experiments/census_5arm_framef/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# Frame-F census: released records

Derived records for the five-arm, 60-section census and its two text-only
ablations, as reported in the ECM-TQAG submission to ACIIDS 2027. Every quantity
the paper states recomputes from this directory alone, with no network access,
no model calls, and no dependency outside the Python standard library.

## Recompute the paper's numbers

```bash
python3 verify_reported_quantities.py # print every recomputed quantity
python3 verify_reported_quantities.py --check # also assert them against the paper
```

`--check` exits non-zero if any published quantity fails to reproduce, so the
script doubles as a regression test on these records.

## What is here

| File | Holds |
| --- | --- |
| `records/admission_decisions.json` | per (chunk, arm): the eight gate conditions as booleans, which conditions failed, and whether the five provenance conditions alone passed |
| `records/ablation_generator_answerer.json` | the pre-registered ablation: per item and branch, whether the answer was graded correct, at every F1 threshold that run's report tabulates |
| `records/ablation_independent_answerer.json` | the replication under an answerer from an unrelated family, same shape |
| `records/judged_scores.json` | per (chunk, arm): both raters' five ordinal scores and the critical-provenance flag |
| `records/frame_strata.json` | per chunk: figure role, question type, conditioning length |
| `records/answer_in_question.json` | per item: whether the recorded answer sits inside its own question wording, with its G6 status and whether it cleared all eight conditions |
| `records/withdrawn_results.json` | the symmetric re-grading that withdrew an earlier result of ours; recomputed from sealed records with no new calls |
| `records/protocol.json` | the three pre-registrations, the three execution authorisations, and the route-deviation record, each with the sha256 of the sealed file |
| `MANIFEST.json` | sha256 and byte length of every file here |

## Why decisions rather than text

The source is copyrighted law textbooks. Each sealed generation record carries a
verbatim quotation from a page, and each rater record quotes the item it scored,
so neither can be redistributed. Each endpoint the paper reports is a function of
*decisions* rather than of the words behind them: admission is a conjunction of
eight booleans, the ablation endpoints are functions of one graded boolean per
branch, and the judged endpoints are functions of five integers and one flag.
Grading was therefore performed against the sealed records, using the grading
function imported from the sealed runner, and the resulting decisions are what
appears here. See `RIGHTS_AND_LIMITATIONS.md` for exactly what is and is not
included.

## Threshold grids differ between the two runs

The two ablations do not tabulate the same F1 grid: the pre-registered run
reports seven thresholds, the replication nine. Each file is graded on the grid
its own sealed report tabulates, and `verify_reported_quantities.py` compares the
two answerers only on the seven thresholds both tabulate. Widening the sealed
run's grid after the fact would be re-analysis of a sealed record, which its
pre-registration lists as invalidating.

## Limits

These records establish that the reported quantities follow from the sealed
evidence. They do not establish that an admitted item is pedagogically useful,
that a rater's score is correct, or that any rate generalises beyond this
60-section frame from one institution's holdings.
46 changes: 46 additions & 0 deletions experiments/census_5arm_framef/RIGHTS_AND_LIMITATIONS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# Rights and limitations

## What this directory contains

Item-level **derived** records: per (chunk, arm) gate verdicts, per-item graded
correct/incorrect decisions for both ablation branches, and per (chunk, arm)
rater scores on five ordinal criteria plus one boolean flag. These are
item-level outputs, and they are published deliberately, because the paper's
endpoints cannot be recomputed without them.

## What this directory does not contain

No source text and no source images:

- page images and figure crops (copyright: University of Law, Hue University);
- raw provider responses;
- `object.text_evidence_quote` -- the verbatim span quoted from a textbook page;
- `object.question`, `object.answer`, `object.visual_evidence` -- generated text
carrying source terminology; the answer is published as graded booleans;
- `returned.answer` -- the answerer's own text, likewise published as graded
booleans;
- `object.rationale` from the raters, which quotes the item and its evidence;
- the owner authorisation conversation quoted in the sealed authorisation files.

Every removal is recorded in `records/protocol.json` under `fields_redacted`,
and `MANIFEST.json` under `not_redistributed`.

## Redaction rule

Any string carrying Vietnamese diacritics was treated as source-derived or
private and was not emitted. The builder fails closed on that check, so a
release containing such a string cannot be produced.

## What a passing verification does and does not establish

`verify_reported_quantities.py --check` establishes that every quantity printed
in the manuscript follows arithmetically from these records. It does not
establish semantic correctness of an item, legal accuracy of a quotation,
pedagogical value, or generalisation beyond this frame. Admission certifies that
the declared evidence recomputed against its own source bundle; it does not
certify that the item is a good question.

## Reuse

Anyone adding external documents to this protocol is responsible for confirming
redistribution rights for that material first.
Loading
Loading