struc-stratum / README.md
tailot's picture
publish struc-stratum bundle
13a6b66 verified
|
Raw History Blame Contribute Delete
23.5 kB
---
language:
- it
- en
- es
- zh
- hi
- ar
tags:
- multilingual
- structural-engineering
- natural-language-to-formal-language
- multi-agent-systems
- benchmark
- conversational-interfaces
- formal-verification
- semantic-parsing
pretty_name: "LingoLOGOS struc-stratum: a question about a frame in six written varieties, the answer of the structures topology, and an assurance that includes the reading"
configs:
- config_name: corpus
data_files:
- split: train
path: problems/corpus.jsonl
size_categories:
- n<1K
---
# LingoLOGOS struc-stratum topology
A conversational layer over the `struc` topology: a person asks about a frame in one of six written
varieties, and gets the answer of the structures topology back in that same language, at an assurance
that includes the fallibility of the reading. The layer never decides a problem and never raises a
verdict; the only direction it can move the assurance of the structures topology is down.
```
python tools/ask.py --lang it "scegli la sezione rettangolo 1/5 2/5"
Reading state : AGREED
Assurance shown : 2 (reading ceiling 2, structures assurance 2)
Structures topology : VERIFIED
Orchestrator Z3 check : 8 of 8 envelopes confirmed
Answer in the language of the question (italiano):
Stato: i due lettori sono d'accordo
Problema capito (properties): properties section rect 1/5 2/5
Risposta: A = 2/25 m^2, centroid = 0 m, I = 2/1875 m^4, W = 2/375 m^3, S = 1/250 m^3
livello 2 di 2
topologia delle strutture: VERIFIED
Controllo SMT dello strato : 8 di 8 buste confermate
```
This dataset is the `struc-stratum/` folder of the LingoLOGOS project published as it stands: 67 files,
code and data together, plus this card in place of their README. Only the standard library and
`z3-solver` are required, and `pytest` for the tests; both are named in `requirements.txt`. Every
command below is written from inside the folder. The structures are not part of this dataset: they live
in the `struc` bundle, published at https://huggingface.co/datasets/tailot/lingologos-struc, and section
10 says how to point this folder at a copy of it.
## 1. What the stratum is, and what it refuses
The certainty of a translation cannot be verified the way the certainty of a proof can: there is no
SMT check that says that a sentence of Hindi was read correctly. That is the definition this bundle
works with, and it is why the topology is built the way it is: two readers that reach their sentence
by different roads, an SMT claim about what each reading kept, a referee that rechecks every envelope,
and a decision that is re-derived from the transcript instead of being trusted from the arbiter.
The rule the whole bundle exists to enforce:
```
assurance shown = min(assurance of the structures topology, ceiling of the reading)
```
| Reading state | ceiling | when |
|---|---|---|
| `AGREED` | 2 | both readers produced the same structure, and the structures topology is what decides it |
| `PASSTHROUGH` | 2 | the question was already a sentence of the structures language: nothing was translated |
| `SINGLE` | 1 | one reader understood it and the other abstained: no witness, one level less |
| `DISPUTED` | 0 | the two readers produced different structures, or a reading lost a number: the topology is not even asked |
| `AMBIGUOUS` | 0 | a reader reports that the question announces more than one problem, or leaves a slot with several readings: the person has to choose |
| `NOT COVERED` | 0 | neither reader found anything: this variety does not say it in a covered way |
| `TAMPERED` | 0 | the topology says it solved something other than the agreed sentence |
| `NONE` | 0 | the session ended without a verdict: no arbiter decision, or evidence this layer could not read |
Two is the top, and it is a shared top. The structures topology itself never shows more than two:
`VERIFIED` at 2 when its own two readers and its checker agree, `SINGLE_PROVER` at 1, every refusal and
every abstention at 0. So the minimum above can only ever lower what this layer shows -- a reading can
lose a level by being alone, disputed, ambiguous or uncovered, and it can never buy one. The `math-stratum` bundle of this project, at
https://huggingface.co/datasets/tailot/math-stratum, had a level three that no translation could
reach; here there is no level to reach, and the rule still says what a person is shown.
The ceiling is not the only thing that holds on its own. The count of numbers is checked on a lone
reading too: a reading that no longer holds the numbers the person wrote is a different problem, not a
weaker reading of the same one, and it ends `DISPUTED` even when it is the only reader that understood
the question. A single witness therefore answers at level one only when it kept every number.
## 2. The eight nodes
The session runs through the orchestrator (`src/lingologos_orchestrator`) with the same envelope
protocol as the `struc` topology: a marker `@@DOSSIER@@` inside `payload.naturalLanguage`, and
`payload.smtConstraints` carrying what each node claims about its own output, which the referee of
every node recomputes with Z3. The seed sits in the `arbiter`; `maxTurns` is the number of arcs.
| Node | What it does | The claim it carries |
|---|---|---|
| `reader_a` | reads the question against the patterns written in the lexicon | the numbers of the question are still in my reading |
| `reader_b` | reads it by finding the frame of the kind and the markers that sit in its gaps | the same, independently |
| `equivalence` | proves the two readings one structure, slot by slot and then with SMT | `not (A = B)` is unsatisfiable |
| `coverage` | counts that every number the person wrote survived into the reading | conjunction of the element equalities |
| `invoker` | asks the structures topology, in a separate process, the agreed sentence | the numbers I sent are the numbers that came back |
| `boundary` | checks the echo of the topology instead of trusting it | elementwise on the echo, or the empty claim |
| `adversary` | re-derives the bound and writes its negation | `shown > ceiling` is unsatisfiable |
| `arbiter` | runs the decision and renders the answer in the language of the question | the same inequality |
## 3. Two readers, one lexicon
`read_a.py` matches the shapes stored in `lexicon/<lang>.json` (`patterns`: one template per family of
the structures language, with slots). `read_b.py` never looks at those shapes: it finds the verb that
announces a problem, then walks the markers of the structures language -- `frame`, the blocks `nodes`,
`members`, `props`, `supports`, `loads`, and the joints `at`, `ends`, `length`, `limit`, `modulus`,
`node`, `member`, `section` -- and cuts the slots out of the gaps between them. They share only the
lexicon, the atomizer (`segment.py`) and the templates of the structures language
(`canonical.py`). Each of the six lexicons carries the 34 marker names of that language, between 18
and 24 verb phrases and between 21 and 25 question patterns; Arabic words arrive with their prefixes
attached, so the lexicon also carries the prefixes and both readers strip them before they compare an
atom with a stored phrase.
That sharing is deliberate and it is also the known blind spot: a wrong description of a variety is
a wrong description for both readers, and the topology cannot see it. What shows it is the corpus of
section 5, whose questions were written and checked by a person. When the two readers disagree the
assurance goes down, never up: `DISPUTED` does not even consult the structures topology.
## 4. Talking to the structures topology
`invoker.py` is the only door. It launches `python <root>/tools/ask.py --json <sentence>` as a separate
process and reads its JSON verdict back; nothing in this folder imports the mechanics of the structures
topology to decide anything here. The referee then checks the echo: the structure the topology says it
solved has to carry the numbers of the sentence the readers agreed on, otherwise the session is
`TAMPERED`.
| Variable | Meaning |
|---|---|
| `LGSTRATUM_STRUC_ROOT` | where the `struc` bundle is (default: the sibling folder `datasets/struc`) |
| `LGSTRATUM_STRUC_BACKEND` | `in-process` (default), `orchestrated` or `none`: the first runs the thirteen nodes of the partner in one process, the second lets the partner run them its own way, the third refuses to call at all |
| `LGSTRATUM_STRUC_TIMEOUT` | seconds to wait for the partner, 300 by default |
| `LGSTRATUM_FAULTS` | comma separated `node:fault` pairs, experiments only |
The environment of the partner is left alone: `LGSTRUC_FAULTS` and `LGSTRUC_MATH_ROOT` belong to it,
and the outcome it returns carries its own `math_status`, the verdict of the `math` bundle it consults
in turn. This layer copies that field and does not read it: a translation layer that reached past the
mechanics it consults would be deciding what they are allowed to prove.
A disabled topology is not tampering: the reading stands, the assurance falls to zero because there is
no structures assurance to take the minimum with, and no answer is shown.
## 5. The corpus
`problems/corpus.jsonl` holds 72 questions, written and checked by a person: the eight families of the
structures language (`classify`, `reactions`, `cut`, `peak`, `deflect`, `properties`, `verify`,
`euler`) in each of the six varieties, plus 18 questions that must not be read -- chit chat, a check
with the `limit` joint missing, an Euler request whose pair of ends is not one of the five the language
knows -- and 6 questions that are already sentences of the structures language, handed to a session in
another variety. Each line carries what the answer has to look like (`state`, `sentence`,
`answer_contains`, `min_assurance`, `max_assurance`, `no_answer`, `referee_clean`) and a `why` that
says why, including the cases where the expected outcome is an abstention.
Graded against the in-process pipeline: **72 of 72** rows agree with their gold
(`lgstratum/corpus.py` grades one row, `tests/test_corpus.py` runs all of them). With the topology
consulted the states come out 47 `AGREED`, 1 `SINGLE`, 6 `PASSTHROUGH`, 18 `NOT COVERED`;
`tools/coverage_report.py` writes `results/coverage.json` and counts **54** questions read by
`reader_a`, **53** by `reader_b` and **1** by `reader_a` alone. Two rows (`en-04`, `hi-05`) are agreed
readings on which the structures topology abstains: assurance 0 and no answer, which is the layer
refusing to add an availability it does not have. One row (`en-03`) stays `SINGLE`, assurance 1, for
the reason in section 7.
## 6. Commands
```
python tools/ask.py --lang it "scegli la sezione rettangolo 1/5 2/5" # one session, eight processes
python tools/ask.py --lang en --json "cut member 1 at 1 frame nodes [ 1 0 0 ; 2 4 0 ] members [ 1 1 2 ] props [ 1 210000000 1/5 2/1875 ] supports [ 1 pin ; 2 roller 0 1 ] loads [ member 1 udl 0 -15 ]"
python tools/ask.py --lang ar --corpus problems/corpus.jsonl --limit 6
python tools/coverage_report.py --out results/coverage.json # which patterns each variety carries
python tools/ablation.py --probe 12 --out results/ablation.json
```
`tools/ask.py` prints the verdict it re-derives from the transcript, not the one the arbiter wrote,
and exits with code 3 when that re-derivation disagrees with a node about its own envelope, with code
2 when the assurance is zero, and with code 1 in corpus mode when a gold expectation fails.
`tools/ablation.py` walks the configurations of the topology
one node at a time, injects every fault of the catalogue singly and in pairs, and reports each cell as
`raised | lowered | masked | caught | abstained | silent_error`: a cell counted `raised` is a violation
of the rule of section 1, and the tool exits 1 if any happened. A `caught` cell is one where an answer
was shown that the gold does not accept, but the session said so itself -- a claim fell to the referee
of its node, or the assurance sits below the honest one because the configuration lost a node.
On this checkout `--probe 12` (two questions per variety) fills **147 cells** and **1764 sessions**, the
fault takes hold in **660** of them, and the totals are `raised 0`, `lowered 0`, `silent_error 0`,
`caught 48`, `abstained 348`, `masked 264` -- about six minutes. Nothing was ever raised above the
honest assurance. The 48 `caught` cells all sit in the two configurations that lost a reader, where a
rubber stamped verification node -- `equivalence`, `coverage` or `adversary` -- cannot buy back the
level the missing witness costs: the transcript itself says `SINGLE` at assurance 1.
## 7. Limits that are written down, not hidden
* English places the section of a cut after the verb, and a phrasing that names the section being cut
hides the `at` joint from `reader_b`: that question is read by one reader only and stays `SINGLE`,
assurance 1 (`en-03`). `tools/coverage_report.py` shows it as one of two readers.
* The fragment of the structures topology is unchanged here. The maximum of the axial force is not in
it, so `peak axial` ends `UNKNOWN`; a displacement asked at a point of a member that is a node of the
mesh is stopped by the guard of the topology, `GUARD_BLOCKED`. Both end at assurance 0 with no answer
even when the reading is agreed, and the corpus keeps them as probes (`en-04`, `hi-05`).
* The five pairs of ends the language knows are five and no more. `pinned free` is refused before the
topology is asked, in every variety (`it-12`, `en-12`, `es-12`, `zh-12`, `hi-12`, `ar-12`).
* The two readers share their data, so a systematic error in the description of a variety is invisible
to the topology and can only be found in the corpus.
## 8. Tests
From the repository root:
```
python -m pytest -q datasets/struc-stratum/tests
```
The suite is **288** tests: 120 on the two readers against every row of the corpus, 78 on the corpus
itself, 38 on the pinned invariant, 14 on the topology file, 13 on the faults, 13 on the decision
table, 10 on the lexicons and 2 end-to-end sessions. It checks the topology file against the node
order, the shape and the completeness of the lexicons, both readers against the corpus, the decision
table, the faults, and every gold answer of the corpus; `tests/test_pinned_invariant.py` runs the same questions through every node
configuration and every fault and asserts that the verdict of the structures topology does not move,
and that nothing is ever shown above it. `tests/test_orchestrator_e2e.py` runs two real sessions
through the orchestrator and is skipped when `lingologos_orchestrator` is not importable. The corpus
and the invariant tests call the tools of the structures topology as subprocesses, which here means a copy of the
`struc` dataset named by `LGSTRATUM_STRUC_ROOT` (section 10); the suite passed in 2 minutes inside a
LingoLOGOS checkout, and the two end to end tests skip on their own when `lingologos_orchestrator` is
not importable.
Real sessions, measured: `scegli la sezione rettangolo 1/5 2/5` comes back `AGREED` at assurance 2
against a structures assurance of 2, with **8 of 8** envelope claims confirmed by the referee of the
session, and `python tools/ask.py --corpus problems/corpus.jsonl --limit 9` grades **9 of 9** real
sessions against gold. The same question in the five varieties outside Italian (`en-06`, `es-06`,
`zh-06`, `hi-06`, `ar-06`) comes back the same way: `AGREED`, assurance 2, the structures topology
`VERIFIED`, 8 of 8 claims confirmed, nothing detected -- and the block the person reads is written in
the language of the question (36, 94 and 91 non-ASCII characters in the Chinese, Hindi and Arabic
replies).
A gate in `tests/test_topology.py` keeps every Python source of this bundle ASCII only, and pins that
`lgstruc` may be imported for its SMT plumbing by `lgstratum/compare.py` alone.
## 9. Language policy
The prose of this folder -- code, docstrings, comments, tool output, test messages -- is English, and
the Python sources are ASCII, as the repository requires. The exception is the language under study,
and it is confined to data: `lexicon/*.json` (the words, patterns, markers and labels of the six
varieties), `problems/corpus.jsonl` (the questions and their gold answers), and the answer block that
`tools/ask.py` shows a person, which is written in the language of the question because that block is
the object this bundle measures.
## 10. Putting this dataset back into a LingoLOGOS checkout
This dataset is 67 files plus this card: 72 questions in one corpus file, the six lexicons, the eight
node definitions, the two readers, the decision rule of section 1, the corpus grading and fault results
under `results/`, and the fault catalogue of section 6. To answer anything it needs the `struc` bundle:
download https://huggingface.co/datasets/tailot/lingologos-struc somewhere, set
`LGSTRATUM_STRUC_ROOT` to that copy, and the `invoker` node calls `tools/ask.py` there as a separate
process, which is the only door through which this bundle ever reaches a solver. Inside a LingoLOGOS
checkout the folder sits at `datasets/struc-stratum`, finds `datasets/struc` by itself, and needs
`src/lingologos_orchestrator` importable for the two end to end sessions of section 8. This card keeps the wording and numbers of the README of
the folder in its sections 1 to 10, and adds sections 11 to 14 for readers who met the bundle here
rather than in a checkout: the fields of the corpus file, how to load it, rights and citation. Every
file of the upload, this card among them, was compared by sha256 afterwards: the hub holds one object
per file of the folder plus `.gitattributes`, so the remote count is one above the number the publisher
prints. What the LingoLOGOS repository carries is the link to this
dataset in the table of published resources at the top of its README; the documentation of the asset
lives here, in this card, and not in the technical documentation of the project. `tools/publish_dataset.py`
in the folder of the project republishes a changed working copy with the token taken from an environment
variable. Republishing is a separate step,
never a side effect of a test run: `tools/publish_dataset.py` does it with the token taken from an
environment variable and verifies the tree by sha256.
## 11. The corpus file
`problems/corpus.jsonl` holds 72 questions, one JSON object per line, written and checked by a person.
It is a benchmark for the stratum: there is no prompt, no response pair and nothing to fine tune on.
Each row says what the session has to end like, including the rows whose expected outcome is a refusal
to answer, and a `why` that says why.
| Field | Type | Meaning |
|---|---|---|
| `id` | string | unique; the prefix names the variety (`it`, `en`, `es`, `zh`, `hi`, `ar`) and the number is the position of the row inside that variety |
| `lang` | string | one of `it`, `en`, `es`, `zh`, `hi`, `ar`: the variety the question is written in |
| `kind` | string | one of the 8 families of the structures language, or `negative` (18 rows that must not be read) or `passthrough` (6 rows already written in the structures language) |
| `question` | string | the question, between 7 and 256 characters, in the script of its variety |
| `why` | string | the reason the row behaves as it does, written by the person who wrote the row |
| `expect` | object | the expectation, described below |
| Variety (`lang`) | Rows | Id prefix | Rows | Kind | Rows |
|---|---|---|---|---|---|
| `it` | 12 | `it` | 12 | `classify` | 6 |
| `en` | 12 | `en` | 12 | `reactions` | 6 |
| `es` | 12 | `es` | 12 | `cut` | 6 |
| `zh` | 12 | `zh` | 12 | `peak` | 6 |
| `hi` | 12 | `hi` | 12 | `deflect` | 6 |
| `ar` | 12 | `ar` | 12 | `properties` | 6 |
| | | | | `verify` | 6 |
| | | | | `euler` | 6 |
| | | | | `negative` | 18 |
| | | | | `passthrough` | 6 |
Every row carries a `state` and a `referee_clean`; the other fields are optional.
| Field | Rows | Meaning |
|---|---|---|
| `state` | 72 | the reading state the session must end in: `AGREED` 47, `NOT COVERED` 18, `PASSTHROUGH` 6, `SINGLE` 1 |
| `sentence` | 54 | the sentence of the structures language both readers have to produce, exactly |
| `answer_contains` | 52 | a substring the answer has to contain, exact rationals written as strings |
| `min_assurance` | 52 | the lowest assurance that is acceptable, on the scale of section 1: 2 on 51 rows, 1 on the single `SINGLE` row |
| `max_assurance` | 27 | the highest assurance that is acceptable: this is what pins the probes that must not rise, 0 on 20 rows |
| `no_answer` | 20 | `true` where the row is graded by the refusal: no answer may be shown at all |
| `referee_clean` | 72 | every envelope claim of the session must match what the referee of its node recomputed |
The 20 rows that refuse an answer are graded on an assurance of 0 and on the absence of an answer: 18 of
them are questions this stratum does not read -- chit chat, a check with the `limit` joint missing, an
Euler request with a pair of ends outside the five the language knows -- and two (`en-04`, `hi-05`) are
agreed readings on which the structures topology abstains, which is the stratum refusing to add an
availability it does not have.
## 12. Loading it
Load the file with the `datasets` library, or with one `json.loads` per line, which needs no
dependency:
```python
from datasets import load_dataset
rows = load_dataset("tailot/struc-stratum", "corpus", split="train")
print(rows[0])
```
This is the same file `tools/ask.py --corpus` walks over, and `lgstratum/corpus.py` plus
`tests/test_corpus.py` read it to grade the stratum against the gold. Graded on the checkout this folder was published from: 72 of 72
rows agree with what they expect.
## 13. Rights
No license is declared for this dataset, its lexicons, its corpus or its code: reuse is not granted by
this page. The six lexicons, the 72 questions with their gold expectations, the grammar specifications,
the node data and the Python sources were written by hand as part of the LingoLOGOS project. Ask before
redistributing or building on them, and expect the answer to be yes for academic work with attribution.
Z3 is a separate product with its own license and is not redistributed here; `z3-solver` is only named
as a dependency in `requirements.txt`. The lexicons of Hindi, Arabic and Chinese describe written
varieties as this project needs them for questions about frames and their internal forces: they are not
a general purpose dictionary of those languages, and the answers they hand to the structures topology
are answers about the idealized bar model of that bundle, not about a real building.
## 14. Citation
```
@misc{lingologos_struc_stratum,
title = {LingoLOGOS struc-stratum: a question about a frame in six written varieties, the answer of the structures topology, and an assurance that includes the reading},
author = {LingoLOGOS project},
year = {2026},
url = {https://huggingface.co/datasets/tailot/struc-stratum},
note = {bundle of the struc-stratum folder of the LingoLOGOS repository: 72 questions in six written
varieties, six lexicons, two independent readers, eight node definitions with SMT claims, the
assurance rule min(structures, reading) with both terms capped at 2, fault catalogue and
ablation over the node configurations, 147 cells and 1764 fault sessions, 288 tests}
}
```