Release 10.3 (full): coverage by the store assembled (the search over learned program structures), one judge over every answer, the opening table on the first interrogative, names written another way learned; full: no organ answers over a terminal refusal; release test pre-registration v39, run once; hashes anchored on Solana (part 8)
Browse filesThis view is limited to 50 files because it contains too many changes. See raw diff
Files changed (50)
- root/organs10/physics/specialists/solved-cost-3/program.pyAdded+7
- root/organs10/physics/specialists/solved-cost-3/scorer_formula_v1.pyAdded+31
- root/organs10/physics/specialists/solved-cost-3/spec.jsonAdded+128
- root/organs10/physics/specialists/solved-cost-3/verdict_dev.jsonAdded+32
- root/organs10/physics/specialists/solved-cost-3/verdict_heldout.jsonAdded+41
- root/organs10/physics/specialists/solved-cowling-number/exam_log.jsonlAdded+1
- root/organs10/physics/specialists/solved-cowling-number/manifest.jsonAdded+41
- root/organs10/physics/specialists/solved-cowling-number/narrow_v1.pyAdded+47
- root/organs10/physics/specialists/solved-cowling-number/organ_formula_v2.pyAdded+163
- root/organs10/physics/specialists/solved-cowling-number/organ_formula_v3.pyAdded+205
- root/organs10/physics/specialists/solved-cowling-number/panel.jsonAdded+366
- root/organs10/physics/specialists/solved-cowling-number/program.pyAdded+7
- root/organs10/physics/specialists/solved-cowling-number/scorer_formula_v1.pyAdded+31
- root/organs10/physics/specialists/solved-cowling-number/spec.jsonAdded+128
- root/organs10/physics/specialists/solved-cowling-number/verdict_dev.jsonAdded+38
- root/organs10/physics/specialists/solved-cowling-number/verdict_heldout.jsonAdded+39
- root/organs10/physics/specialists/solved-cross-sectional-area-2/exam_log.jsonlAdded+1
- root/organs10/physics/specialists/solved-cross-sectional-area-2/manifest.jsonAdded+41
- root/organs10/physics/specialists/solved-cross-sectional-area-2/narrow_v1.pyAdded+47
- root/organs10/physics/specialists/solved-cross-sectional-area-2/organ_formula_v2.pyAdded+163
- root/organs10/physics/specialists/solved-cross-sectional-area-2/organ_formula_v3.pyAdded+205
- root/organs10/physics/specialists/solved-cross-sectional-area-2/panel.jsonAdded+366
- root/organs10/physics/specialists/solved-cross-sectional-area-2/program.pyAdded+7
- root/organs10/physics/specialists/solved-cross-sectional-area-2/scorer_formula_v1.pyAdded+31
- root/organs10/physics/specialists/solved-cross-sectional-area-2/spec.jsonAdded+145
- root/organs10/physics/specialists/solved-cross-sectional-area-2/verdict_dev.jsonAdded+38
- root/organs10/physics/specialists/solved-cross-sectional-area-2/verdict_heldout.jsonAdded+39
- root/organs10/physics/specialists/solved-cross-sectional-area/exam_log.jsonlAdded+1
- root/organs10/physics/specialists/solved-cross-sectional-area/manifest.jsonAdded+41
- root/organs10/physics/specialists/solved-cross-sectional-area/narrow_v1.pyAdded+47
- root/organs10/physics/specialists/solved-cross-sectional-area/organ_formula_v2.pyAdded+163
- root/organs10/physics/specialists/solved-cross-sectional-area/organ_formula_v3.pyAdded+205
- root/organs10/physics/specialists/solved-cross-sectional-area/panel.jsonAdded+366
- root/organs10/physics/specialists/solved-cross-sectional-area/program.pyAdded+7
- root/organs10/physics/specialists/solved-cross-sectional-area/scorer_formula_v1.pyAdded+31
- root/organs10/physics/specialists/solved-cross-sectional-area/spec.jsonAdded+145
- root/organs10/physics/specialists/solved-cross-sectional-area/verdict_dev.jsonAdded+38
- root/organs10/physics/specialists/solved-cross-sectional-area/verdict_heldout.jsonAdded+39
- root/organs10/physics/specialists/solved-current-2/exam_log.jsonlAdded+1
- root/organs10/physics/specialists/solved-current-2/manifest.jsonAdded+41
- root/organs10/physics/specialists/solved-current-2/narrow_v1.pyAdded+47
- root/organs10/physics/specialists/solved-current-2/organ_formula_v2.pyAdded+163
- root/organs10/physics/specialists/solved-current-2/organ_formula_v3.pyAdded+205
- root/organs10/physics/specialists/solved-current-2/panel.jsonAdded+366
- root/organs10/physics/specialists/solved-current-2/program.pyAdded+7
- root/organs10/physics/specialists/solved-current-2/scorer_formula_v1.pyAdded+31
- root/organs10/physics/specialists/solved-current-2/spec.jsonAdded+128
- root/organs10/physics/specialists/solved-current-2/verdict_dev.jsonAdded+32
- root/organs10/physics/specialists/solved-current-2/verdict_heldout.jsonAdded+33
- root/organs10/physics/specialists/solved-current-3/exam_log.jsonlAdded+1
1234567"""cost from fuel, fuel price (Fuel cost)The maths organ (systems.py): solved from the system C = F*p; checked by substitution into every equation and by a numeric solution at 12 points"""import math
def compute(fuel, fuel_price): return 1.0*fuel*fuel_price12345678910111213141516171819202122232425262728293031"""scorer_formula_v1 - scorer for composed formula specialists: (good, asserted).A must-decline item answered is a false yes. A valid quantity item is right when the FIRST number in the reply (theanswer, before any working) is within 0.5% of the sealed answer; a valid text item is right when the answer appears in thereply as a whole word, exactly as written."""import re
def _first_num(text): m = re.search(r"-?\d[\d,]*(?:\.\d+)?(?:[eE][+-]?\d+)?", text) if not m: return None try: return float(m.group(0).replace(",", "")) except ValueError: return None
def ok(p, r): r = r or {} text = str(r.get("response", "")) answered = str(r.get("status", "")) == "answered" if not p["valid"]: return (not answered), answered if not answered: return False, False if p.get("dtype") == "quantity": want, got = float(p["expect"]), _first_num(text) if got is None: return False, True return abs(got - want) <= (0.005 * abs(want) if want else 0.005), True return re.search(r"(?<![\w])%s(?![\w])" % re.escape(str(p["expect"])), text) is not None, True123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128{ "title": "cost from fuel, fuel price (Fuel cost)", "inputs": [ "fuel (L)", "fuel price ($/L)" ], "output": "cost ($)", "input_kinds": [ "number", "number" ], "expression": "1.0*F*p", "expression_x": null, "said": "solved from the system C = F*p; checked by substitution into every equation and by a numeric solution at 12 points", "composer": "systems (the maths organ)", "library": [], "system": { "equations": [ "C = F*p" ], "constants": {}, "quantities": { "C": "cost ($)", "F": "fuel (L)", "p": "fuel price ($/L)" }, "symbols": [ "F", "p" ], "out_symbol": "C" }, "points": [ { "in": [ 107.960666, 59.4105 ], "out": 6413.997161494573 }, { "in": [ 8.507283, 17.788778 ], "out": 151.33416360087082 }, { "in": [ 169.526958, 280.773702 ], "out": 47598.71144694985 }, { "in": [ 8.24951, 0.634021 ], "out": 5.230362271972724 }, { "in": [ 1.911952, 82.240072 ], "out": 157.23905034769402 }, { "in": [ 0.318734, 9.566071 ], "out": 3.0490325263462696 }, { "in": [ 1.643795, 252.709024 ], "out": 415.40195557254486 }, { "in": [ 0.671697, 14.249569 ], "out": 9.571395807788361 }, { "in": [ 18.316867, 6.838598 ], "out": 125.26169131331937 }, { "in": [ 21.793126, 29.510609 ], "out": 643.1284273894521 }, { "in": [ 156.50181, 185.886273 ], "out": 29091.538105177155 }, { "in": [ 153.149965, 18.595315 ], "out": 2847.8719160673327 } ], "domain": { "inputs": [ "positive", "positive" ], "output": "positive", "order": [], "facts": [] }}1234567891011121314151617181920212223242526272829303132{ "id": "solved-cost-3", "split": "dev", "decision": "WOULD PASS", "reasons": [], "n": 18, "head": { "ok": 6, "fy": 0, "wrong": 0 }, "with_specialist": { "ok": 18, "fy": 0, "wrong": 0 }, "gain_needed": 3, "core": { "n": 924, "taken": 0, "cap": 9, "examples": [] }, "self_ok": true, "p50_ms": 0.01, "budget_ms": 200.0, "fails": [], "files_sha": "53a9737c61710850af20060cfcd8aee6a8f05d375435d674848e892b3ae2c845", "panel_sha": "4ed728fd864eb1a8eaa1657463b41e40a41052b8a9e78f05cbe8c8b5503b7144", "time": "2026-10-24T00:32:27Z", "core_head": "oracle_release_runtime_w571"}1234567891011121314151617181920212223242526272829303132333435363738394041{ "id": "solved-cost-3", "split": "heldout", "decision": "ADMIT", "reasons": [], "n": 18, "head": { "ok": 5, "fy": 1, "wrong": 0 }, "with_specialist": { "ok": 17, "fy": 1, "wrong": 0 }, "gain_needed": 3, "core": { "n": 924, "taken": 0, "cap": 9, "examples": [] }, "self_ok": true, "p50_ms": 0.01, "budget_ms": 200.0, "fails": [ { "q": "What is a typical cost?", "expected": "", "got": "[ev:unknown] I have no admitted entry for \u201ctypical cost\u201d. The related term \u201cCost\u201d is what the record defines \u2014 cost is defined as the total spent for goods or s", "status": "answered", "by": "core" } ], "files_sha": "53a9737c61710850af20060cfcd8aee6a8f05d375435d674848e892b3ae2c845", "panel_sha": "bab2a628ce268c67fed5297ed53bb40dfd1203c53d70903558ea0df949dee8d4", "time": "2026-10-24T00:32:30Z", "core_head": "oracle_release_runtime_w571", "memory": "written to your group's memory"}1{"t": "2026-10-25T01:06:44Z", "heldout_sha": "86eec1b527cb362b8788e5fc7203e4a4d16c46bd44203f5813a2c4948d663cf8", "files_sha": "5f4d95c29209e5b47b2c1857cdf488c940f55b59bfcff9d3c910f71ef6a6ba90"}1234567891011121314151617181920212223242526272829303132333435363738394041{ "id": "solved-cowling-number", "name": "Solved: Cowling number from first Cowling number, magnetic Reynolds number (first Cowling number (Wikidata Q105084863))", "sources": [ { "name": "the maths organ: solved from the system q0 = q1*q2; checked by substitution into every equation and by a numeric solution at 12 points", "licence": "yours" } ], "organ": { "module": "organ_formula_v3", "class": "FormulaOrgan", "init": {} }, "accept": { "kinds": [ "compute" ], "declines_in_domain": [ "missing_input", "out_of_domain" ], "context_regex": "\\bcowling\\ number\\b" }, "panel": { "path": "panel.json", "scorer_module": "scorer_formula_v1", "scorer_fn": "ok" }, "budgets": { "latency_p50_ms": 200 }, "notes": "Solved by the maths organ from the system first Cowling number (Wikidata Q105084863): 6 checked points used to write the panel's dev half, 6 its held-out half.", "built_from": { "questions": [ "What is the Cowling number for first Cowling number and magnetic Reynolds number?" ], "gap": "", "node": "hod" }}1234567891011121314151617181920212223242526272829303132333435363738394041424344454647#!/usr/bin/env python3"""narrow_v1 - the shared NARROWING rule for specialist organs (2026-09-29, from the full-core sweep):
WORD PROBLEMS AND NARRATIVE TURNS BELONG TO THE HEAD. An organ answers a direct domain question. A turn that tells a story ("Justine wants to put a deck ...", "A new energy drink advertises 106 calories for 8 ounces ...") or relates quantities to each other ("the length is 9 inches more than the width") is a word problem, which the core's word- problem organ owns; organs firing on its nouns declined it or answered a different question. An organ may DECLINE only a short direct question (it is then refusing the domain question that was asked); on anything longer it says nothing and the head answers.
Narrowing only ever removes turns an organ takes, so on any input where it does not fire, the organ's reply isbyte-identical to the frozen version it wraps (checked per specialist by an invariance count before re-gating)."""import re
RELATION = re.compile(r"\b(?:\d+(?:\.\d+)?|one|two|three|four|five|six|seven|eight|nine|ten)\s+(?:\w+\s+){0,2}(?:more|less|fewer|longer|shorter)\s+than\b|" r"\b(?:twice|three times|half)\s+(?:as\s+\w+\s+as\s+)?the\s+\w+\b", re.I)
# a RATE ("106 calories for 8 ounces", "3 apples per 2 dollars") makes the turn a proportion problemRATE = re.compile(r"\b\d+(?:\.\d+)?\s+[a-z]+\s+(?:for|per|every)\s+(?:\d+(?:\.\d+)?|a|an|one|each)\s+[a-z]+", re.I)NUM = re.compile(r"(?<![\w.])\d+(?:\.\d+)?(?!\w|\.\d)") # "leg is 5." counts: a sentence-final period is not a decimal
def numbers(t): return len(NUM.findall(str(t or "")))
def last_sentence(t): parts = [s for s in re.split(r"(?<=[.!?;])\s+", str(t or "").strip()) if s.strip()] return parts[-1] if parts else ""
def sentences(t): return len([s for s in re.split(r"(?<=[.!?])\s+", str(t or "").strip()) if s.strip()])
def narrative(t): """a story-shaped or relational turn: 3+ sentences, 40+ words, or quantities defined relative to each other""" t = str(t or "") return sentences(t) >= 3 or len(t.split()) > 40 or RELATION.search(t) is not None or RATE.search(t) is not None
def short_direct(t): """a direct question an organ may decline: at most 2 sentences, at most 25 words, not narrative""" t = str(t or "") return sentences(t) <= 2 and len(t.split()) <= 25 and not narrative(t)123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163"""organ_formula_v2 - v1 + a question is declined as missing an input only when it names one of the inputs (v1 declined
"What is the largest living animal species that only eats plants?" for the zodiac program, whose output is "animal":
the gate found the core item made worse, 2026-10-20). A question that names the output and no input is not this
program's, and gets no reply.
v2 also keeps to the DOMAIN of its examples (spec.json "domain", written from the worked examples the composer saw): an
input every example gave as positive (or non-negative) must be so in the question, and an answer whose sign no example's
answer had is not given ("ABV for original gravity 1.010 and final gravity 1.050" would be -5.25): out_of_domain, an
in-domain refusal that says why. A program is evidence for the range its examples span in sign, not beyond.
organ_formula_v1 - the GENERIC FORMULA SPECIALIST: one program the code composer wrote (program.py beside this file) and
the typed signature it was written for (spec.json: the inputs and the output, each a label with an optional unit in
parentheses). Built, not trained; no phrasing templates.
Reading, by role: the output is named in the question (its label; when an input has the same label, the output's unit too,
"in F"); each input is its label with a value right after it ("original gravity 1.055", "age of 25", "f-number = 8") or
right before it ("1.055 original gravity"). A value is a number ("1,000", "0.5", "1/125") or, for an input whose examples
were codes, a token mixing digits and letters ("205/55R16").
compute every input found: "The <output> is <value> <unit>." and the program it came from
missing_input a short direct question names the output but not every input's value: an in-domain refusal naming what
is missing
Narrowing (narrow_v1, the factory's shared rule): story-shaped and relational turns belong to the core; a turn carrying
numbers that no input claims is a different calculation and belongs to the core. Everything else: no reply."""
from __future__ import annotations
import importlib.util
import json
import os
import re
from narrow_v1 import narrative, short_direct
HERE = os.path.dirname(os.path.abspath(__file__))
NUM = r"-?\d[\d,]*(?:\.\d+)?(?:\s*/\s*\d[\d,]*(?:\.\d+)?)?"
CODE = r"[A-Za-z0-9]*\d[A-Za-z0-9]*[/\-][A-Za-z0-9/\-]*\d[A-Za-z0-9]*"
ANYNUM = re.compile(r"(?<![\w/.])-?\d[\d,]*(?:\.\d+)?(?![\w/])")
ASKING = re.compile(r"\?\s*$|^\s*(?:what|which|how|tell me|give me|i need|do you know|could you|can you|if |compute|calculate|"
r"work out|find )", re.I)
LINK = r"\s*(?:of|is|=|:|at|equal to|equals)?\s*(?:a|an|the)?\s*"
def split_label(s):
m = re.match(r"\s*(.*?)\s*(?:\(([^)]*)\))?\s*$", s)
return m.group(1).strip(), (m.group(2) or "").strip()
def label_rx(label):
words = [re.escape(w) for w in re.split(r"[\s]+", label) if w]
return r"(?<![\w-])" + r"[\s-]+".join(words) + r"s?(?![\w-])"
def _val(tok):
tok = tok.replace(",", "").replace(" ", "")
if "/" in tok:
a, b = tok.split("/", 1)
return float(a) / float(b)
return float(tok)
def _in_sign(v, sign):
if isinstance(v, str) or sign == "any":
return True
return v > 0 if sign == "positive" else v >= 0
def sign_of(values):
"""the sign every example gave: "positive", "nonnegative" or "any" (text values: "any")"""
if not values or any(isinstance(v, str) for v in values):
return "any"
if all(v > 0 for v in values):
return "positive"
return "nonnegative" if all(v >= 0 for v in values) else "any"
def _fmt(v):
if isinstance(v, str):
return v
v = float(v)
if v == 0:
return "0"
return ("%.6g" % v) if 1e-3 <= abs(v) < 1e7 else ("%.4g" % v)
class FormulaOrgan:
def __init__(self, spec="spec.json"):
self.spec = json.load(open(os.path.join(HERE, spec), encoding="utf-8"))
loader = importlib.util.spec_from_file_location("composed_program", os.path.join(HERE, "program.py"))
mod = importlib.util.module_from_spec(loader)
loader.loader.exec_module(mod)
self.compute = mod.compute
self.out_label, self.out_unit = split_label(self.spec["output"])
self.ins = [split_label(x) for x in self.spec["inputs"]]
self.kinds = self.spec["input_kinds"] # "number" or "code", from the examples
dom = self.spec.get("domain") or {}
self.in_sign = dom.get("inputs") or ["any"] * len(self.kinds) # "positive", "nonnegative" or "any", per input
self.out_sign = dom.get("output", "any")
collide = any(lab.lower() == self.out_label.lower() for lab, _ in self.ins)
out = label_rx(self.out_label)
if collide and self.out_unit: # "the temperature in F"
out += r"\s+(?:in|to)\s+(?:degrees\s+)?" + re.escape(self.out_unit) + r"(?![\w])"
self.rx_out = re.compile(out, re.I)
self.rx_in = []
for (lab, unit), kind in zip(self.ins, self.kinds):
v = CODE if kind == "code" else NUM
after = re.compile(label_rx(lab) + LINK + r"(" + v + r")(?![\w/])", re.I)
before = re.compile(r"(?<![\w/.])(" + v + r")\s+(?:\w+\s+)?" + label_rx(lab), re.I)
self.rx_in.append((after, before))
def _read(self, t):
spans, vals, missing = [], [], []
out_m = self.rx_out.search(t)
for (lab, _), kind, (after, before) in zip(self.ins, self.kinds, self.rx_in):
got = None
for rx in (after, before):
for m in rx.finditer(t):
if out_m and out_m.start() <= m.start() < out_m.end():
continue # the output's own mention is not an input
if any(a <= m.start(1) < b for a, b in spans):
continue
got = m
break
if got:
break
if not got:
missing.append(lab)
continue
spans.append((got.start(1), got.end(1)))
vals.append(got.group(1) if kind == "code" else _val(got.group(1)))
return vals, missing, spans
def answer(self, text, session_id="default"):
t = re.sub(r"\s+", " ", str(text or "")).strip()
if not self.rx_out.search(t) or narrative(t) or not ASKING.search(t):
return None
vals, missing, spans = self._read(t)
stray = [m for m in ANYNUM.finditer(t) if not any(a <= m.start() < b for a, b in spans)]
if stray: # numbers no input claims: another calculation
return None
if missing:
named = any(re.search(label_rx(lab), t, re.I) for lab, _ in self.ins)
if named and short_direct(t):
return {"kind": "missing_input", "status": "declined",
"response": "To work out the %s I need the %s, and the question doesn't give %s."
% (self.out_label, " and the ".join(missing), "it" if len(missing) == 1 else "them")}
return None
for (lab, _), v, sign in zip(self.ins, vals, self.in_sign):
if not _in_sign(v, sign):
return {"kind": "out_of_domain", "status": "declined",
"response": "Every worked example this program was written from has a %s %s; %s is outside that, so I "
"won't extrapolate." % (sign.replace("nonnegative", "non-negative"), lab, _fmt(v))}
try:
y = self.compute(*vals)
except Exception:
return None
if y is None or (isinstance(y, float) and y != y):
return None
if not _in_sign(y, self.out_sign):
return {"kind": "out_of_domain", "status": "declined",
"response": "That would make the %s %s, and every worked example this program was written from gave a %s "
"one, so I won't give it." % (self.out_label, _fmt(y), self.out_sign.replace("nonnegative", "non-negative"))}
unit =(" " + self.out_unit) if self.out_unit and not isinstance(y, str) else ""
return {"kind": "compute", "status": "answered",
"response": "The %s is %s%s. (A composed program: %s; %s.)" % (self.out_label, _fmt(y), unit,
self.spec["expression"], self.spec["said"])}123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205"""organ_formula_v3 - v2 + the DOMAIN beyond signs (pre-registration v11 part C, 2026-10-21). 4.1 and 4.2 published the limit
"a blood pressure of 70/110 or day 400 of a year is answered". spec.json "domain" now also holds:
order an ordering that holds in EVERY worked example between the numbers of one code input ("120/80": systolic above
diastolic) or between two inputs with the same named unit ("original gravity (SG)" above "final gravity (SG)").
Inputs without a named unit are not ordered: four examples cannot show that a chainring always outnumbers a cog.
facts what the quantity can be, cited: a day of 2025 is a whole number from 1 to 365 (Gregorian calendar, a common year);
a temperature is at or above absolute zero (SI Brochure, 9th edition, 2019: 0 K = -273.15 degC = -459.67 degF);
teeth, integers and years are whole numbers.
An input outside either is out_of_domain, an in-domain refusal that says which rule and why.
organ_formula_v2 (the parent) - v1 + a question is declined as missing an input only when it names one of the inputs (v1 declined
"What is the largest living animal species that only eats plants?" for the zodiac program, whose output is "animal":
the gate found the core item made worse, 2026-10-20). A question that names the output and no input is not this
program's, and gets no reply.
v2 also keeps to the DOMAIN of its examples (spec.json "domain", written from the worked examples the composer saw): an
input every example gave as positive (or non-negative) must be so in the question, and an answer whose sign no example's
answer had is not given ("ABV for original gravity 1.010 and final gravity 1.050" would be -5.25): out_of_domain, an
in-domain refusal that says why. A program is evidence for the range its examples span in sign, not beyond.
organ_formula_v1 - the GENERIC FORMULA SPECIALIST: one program the code composer wrote (program.py beside this file) and
the typed signature it was written for (spec.json: the inputs and the output, each a label with an optional unit in
parentheses). Built, not trained; no phrasing templates.
Reading, by role: the output is named in the question (its label; when an input has the same label, the output's unit too,
"in F"); each input is its label with a value right after it ("original gravity 1.055", "age of 25", "f-number = 8") or
right before it ("1.055 original gravity"). A value is a number ("1,000", "0.5", "1/125") or, for an input whose examples
were codes, a token mixing digits and letters ("205/55R16").
compute every input found: "The <output> is <value> <unit>." and the program it came from
missing_input a short direct question names the output but not every input's value: an in-domain refusal naming what
is missing
Narrowing (narrow_v1, the factory's shared rule): story-shaped and relational turns belong to the core; a turn carrying
numbers that no input claims is a different calculation and belongs to the core. Everything else: no reply."""
from __future__ import annotations
import importlib.util
import json
import os
import re
from narrow_v1 import narrative, short_direct
HERE = os.path.dirname(os.path.abspath(__file__))
NUM = r"-?\d[\d,]*(?:\.\d+)?(?:\s*/\s*\d[\d,]*(?:\.\d+)?)?"
CODE = r"[A-Za-z0-9]*\d[A-Za-z0-9]*[/\-][A-Za-z0-9/\-]*\d[A-Za-z0-9]*"
ANYNUM = re.compile(r"(?<![\w/.])-?\d[\d,]*(?:\.\d+)?(?![\w/])")
ASKING = re.compile(r"\?\s*$|^\s*(?:what|which|how|tell me|give me|i need|do you know|could you|can you|if |compute|calculate|"
r"work out|find )", re.I)
LINK = r"\s*(?:of|is|=|:|at|equal to|equals)?\s*(?:a|an|the)?\s*"
def split_label(s):
m = re.match(r"\s*(.*?)\s*(?:\(([^)]*)\))?\s*$", s)
return m.group(1).strip(), (m.group(2) or "").strip()
def label_rx(label):
words = [re.escape(w) for w in re.split(r"[\s]+", label) if w]
return r"(?<![\w-])" + r"[\s-]+".join(words) + r"s?(?![\w-])"
def _val(tok):
tok = tok.replace(",", "").replace(" ", "")
if "/" in tok:
a, b = tok.split("/", 1)
return float(a) / float(b)
return float(tok)
def _in_sign(v, sign):
if isinstance(v, str) or sign == "any":
return True
return v > 0 if sign == "positive" else v >= 0
def sign_of(values):
"""the sign every example gave: "positive", "nonnegative" or "any" (text values: "any")"""
if not values or any(isinstance(v, str) for v in values):
return "any"
if all(v > 0 for v in values):
return "positive"
return "nonnegative" if all(v >= 0 for v in values) else "any"
def _fmt(v):
if isinstance(v, str):
return v
v = float(v)
if v == 0:
return "0"
return ("%.6g" % v) if 1e-3 <= abs(v) < 1e7 else ("%.4g" % v)
class FormulaOrgan:
def __init__(self, spec="spec.json"):
self.spec = json.load(open(os.path.join(HERE, spec), encoding="utf-8"))
loader = importlib.util.spec_from_file_location("composed_program", os.path.join(HERE, "program.py"))
mod = importlib.util.module_from_spec(loader)
loader.loader.exec_module(mod)
self.compute = mod.compute
self.out_label, self.out_unit = split_label(self.spec["output"])
self.ins = [split_label(x) for x in self.spec["inputs"]]
self.kinds = self.spec["input_kinds"] # "number" or "code", from the examples
dom = self.spec.get("domain") or {}
self.in_sign = dom.get("inputs") or ["any"] * len(self.kinds) # "positive", "nonnegative" or "any", per input
self.out_sign = dom.get("output", "any")
collide = any(lab.lower() == self.out_label.lower() for lab, _ in self.ins)
out = label_rx(self.out_label)
if collide and self.out_unit: # "the temperature in F"
out += r"\s+(?:in|to)\s+(?:degrees\s+)?" + re.escape(self.out_unit) + r"(?![\w])"
self.rx_out = re.compile(out, re.I)
self.rx_in = []
for (lab, unit), kind in zip(self.ins, self.kinds):
v = CODE if kind == "code" else NUM
after = re.compile(label_rx(lab) + LINK + r"(" + v + r")(?![\w/])", re.I)
before = re.compile(r"(?<![\w/.])(" + v + r")\s+(?:\w+\s+)?" + label_rx(lab), re.I)
self.rx_in.append((after, before))
def _read(self, t):
spans, vals, missing = [], [], []
out_m = self.rx_out.search(t)
for (lab, _), kind, (after, before) in zip(self.ins, self.kinds, self.rx_in):
got = None
for rx in (after, before):
for m in rx.finditer(t):
if out_m and out_m.start() <= m.start() < out_m.end():
continue # the output's own mention is not an input
if any(a <= m.start(1) < b for a, b in spans):
continue
got = m
break
if got:
break
if not got:
missing.append(lab)
continue
spans.append((got.start(1), got.end(1)))
vals.append(got.group(1) if kind == "code" else _val(got.group(1)))
return vals, missing, spans
def _components(self, vals):
"""every number the inputs give, keyed (input, k): a code input gives its numbers in order ("120/80" -> 120, 80)"""
out = {}
for i, (v, kind) in enumerate(zip(vals, self.kinds)):
if kind == "code":
for k, x in enumerate(re.findall(r"\d+(?:\.\d+)?", str(v))):
out[(i, k)] = float(x)
elif not isinstance(v, str):
out[(i, 0)] = float(v)
return out
def _domain_v3(self, vals):
dom = self.spec.get("domain") or {}
comp = self._components(vals)
for o in dom.get("order") or []:
a, b = tuple(o["greater"]), tuple(o["lesser"])
if a in comp and b in comp and not comp[a] > comp[b]:
return ("In every worked example this program was written from, the %s is greater than the %s; here it is not "
"(%s and %s), so it is not a reading I can work from." % (o["greater_name"], o["lesser_name"],
_fmt(comp[a]), _fmt(comp[b])))
for f in dom.get("facts") or []:
x = comp.get((f["input"], 0))
if x is None:
continue
bad = (f.get("integer") and x != int(x)) or ("min" in f and x < f["min"]) or ("max" in f and x > f["max"])
if bad:
return "%s is not a possible %s: %s. So I won't compute it." % (_fmt(x), f["name"], f["why"])
return None
def answer(self, text, session_id="default"):
t = re.sub(r"\s+", " ", str(text or "")).strip()
if not self.rx_out.search(t) or narrative(t) or not ASKING.search(t):
return None
vals, missing, spans = self._read(t)
stray = [m for m in ANYNUM.finditer(t) if not any(a <= m.start() < b for a, b in spans)]
if stray: # numbers no input claims: another calculation
return None
if missing:
named = any(re.search(label_rx(lab), t, re.I) for lab, _ in self.ins)
if named and short_direct(t):
return {"kind": "missing_input", "status": "declined",
"response": "To work out the %s I need the %s, and the question doesn't give %s."
% (self.out_label, " and the ".join(missing), "it" if len(missing) == 1 else "them")}
return None
for (lab, _), v, sign in zip(self.ins, vals, self.in_sign):
if not _in_sign(v, sign):
return {"kind": "out_of_domain", "status": "declined",
"response": "Every worked example this program was written from has a %s %s; %s is outside that, so I "
"won't extrapolate." % (sign.replace("nonnegative", "non-negative"), lab, _fmt(v))}
refused = self._domain_v3(vals)
if refused:
return {"kind": "out_of_domain", "status": "declined", "response": refused}
try:
y = self.compute(*vals)
except Exception:
return None
if y is None or (isinstance(y, float) and y != y):
return None
if not _in_sign(y, self.out_sign):
return {"kind": "out_of_domain", "status": "declined",
"response": "That would make the %s %s, and every worked example this program was written from gave a %s "
"one, so I won't give it." % (self.out_label, _fmt(y), self.out_sign.replace("nonnegative", "non-negative"))}
unit =(" " + self.out_unit) if self.out_unit and not isinstance(y, str) else ""
return {"kind": "compute", "status": "answered",
"response": "The %s is %s%s. (A composed program: %s; %s.)" % (self.out_label, _fmt(y), unit,
self.spec["expression"], self.spec["said"])}123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366{ "dev": [ { "q": "What is the Cowling number for first Cowling number 107.961 and magnetic Reynolds number 59.4105?", "a": "1.8171983999893246", "valid": true, "kind": "compute", "expect": 1.8171983999893246, "dtype": "quantity", "unit": "1", "why": "Cowling number for [107.960666, 59.4105] (the system first Cowling number (Wikidata Q105084863))" }, { "q": "Tell me the Cowling number with first Cowling number of 107.961 and magnetic Reynolds number of 59.4105.", "a": "1.8171983999893246", "valid": true, "kind": "compute", "expect": 1.8171983999893246, "dtype": "quantity", "unit": "1", "why": "Cowling number for [107.960666, 59.4105] (the system first Cowling number (Wikidata Q105084863))" }, { "q": "What is the Cowling number for first Cowling number 169.527 and magnetic Reynolds number 280.774?", "a": "0.6037850281809957", "valid": true, "kind": "compute", "expect": 0.6037850281809957, "dtype": "quantity", "unit": "1", "why": "Cowling number for [169.526958, 280.773702] (the system first Cowling number (Wikidata Q105084863))" }, { "q": "Tell me the Cowling number with first Cowling number of 169.527 and magnetic Reynolds number of 280.774.", "a": "0.6037850281809957", "valid": true, "kind": "compute", "expect": 0.6037850281809957, "dtype": "quantity", "unit": "1", "why": "Cowling number for [169.526958, 280.773702] (the system first Cowling number (Wikidata Q105084863))" }, { "q": "What is the Cowling number for first Cowling number 1.91195 and magnetic Reynolds number 82.2401?", "a": "0.023248420388592404", "valid": true, "kind": "compute", "expect": 0.023248420388592404, "dtype": "quantity", "unit": "1", "why": "Cowling number for [1.911952, 82.240072] (the system first Cowling number (Wikidata Q105084863))" }, { "q": "Tell me the Cowling number with first Cowling number of 1.91195 and magnetic Reynolds number of 82.2401.", "a": "0.023248420388592404", "valid": true, "kind": "compute", "expect": 0.023248420388592404, "dtype": "quantity", "unit": "1", "why": "Cowling number for [1.911952, 82.240072] (the system first Cowling number (Wikidata Q105084863))" }, { "q": "What is the Cowling number for first Cowling number 1.64379 and magnetic Reynolds number 252.709?", "a": "0.006504696457692342", "valid": true, "kind": "compute", "expect": 0.006504696457692342, "dtype": "quantity", "unit": "1", "why": "Cowling number for [1.643795, 252.709024] (the system first Cowling number (Wikidata Q105084863))" }, { "q": "Tell me the Cowling number with first Cowling number of 1.64379 and magnetic Reynolds number of 252.709.", "a": "0.006504696457692342", "valid": true, "kind": "compute", "expect": 0.006504696457692342, "dtype": "quantity", "unit": "1", "why": "Cowling number for [1.643795, 252.709024] (the system first Cowling number (Wikidata Q105084863))" }, { "q": "What is the Cowling number for first Cowling number 18.3169 and magnetic Reynolds number 6.8386?", "a": "2.6784535160942915", "valid": true, "kind": "compute", "expect": 2.6784535160942915, "dtype": "quantity", "unit": "1", "why": "Cowling number for [18.316867, 6.838598] (the system first Cowling number (Wikidata Q105084863))" }, { "q": "Tell me the Cowling number with first Cowling number of 18.3169 and magnetic Reynolds number of 6.8386.", "a": "2.6784535160942915", "valid": true, "kind": "compute", "expect": 2.6784535160942915, "dtype": "quantity", "unit": "1", "why": "Cowling number for [18.316867, 6.838598] (the system first Cowling number (Wikidata Q105084863))" }, { "q": "What is the Cowling number for first Cowling number 156.502 and magnetic Reynolds number 185.886?", "a": "0.8419223616111585", "valid": true, "kind": "compute", "expect": 0.8419223616111585, "dtype": "quantity", "unit": "1", "why": "Cowling number for [156.50181, 185.886273] (the system first Cowling number (Wikidata Q105084863))" }, { "q": "Tell me the Cowling number with first Cowling number of 156.502 and magnetic Reynolds number of 185.886.", "a": "0.8419223616111585", "valid": true, "kind": "compute", "expect": 0.8419223616111585, "dtype": "quantity", "unit": "1", "why": "Cowling number for [156.50181, 185.886273] (the system first Cowling number (Wikidata Q105084863))" }, { "q": "What is the Cowling number for first Cowling number 107.961?", "a": "", "valid": false, "kind": "missing_input", "expect": null, "dtype": "quantity", "unit": "", "why": "the magnetic Reynolds number is not given" }, { "q": "Tell me the Cowling number with first Cowling number of 169.527.", "a": "", "valid": false, "kind": "missing_input", "expect": null, "dtype": "quantity", "unit": "", "why": "the magnetic Reynolds number is not given" }, { "q": "What is the Cowling number of the Eiffel Tower?", "a": "", "valid": false, "kind": "not_held", "expect": null, "dtype": "quantity", "unit": "", "why": "a named thing, not inputs: a lookup the program cannot do" }, { "q": "What is the Cowling number of Mount Everest?", "a": "", "valid": false, "kind": "not_held", "expect": null, "dtype": "quantity", "unit": "", "why": "a named thing, not inputs: a lookup the program cannot do" }, { "q": "Tell me the Cowling number with first Cowling number of -1.91195 and magnetic Reynolds number of 82.2401.", "a": "", "valid": false, "kind": "out_of_domain", "expect": null, "dtype": "quantity", "unit": "", "why": "a negative first Cowling number: no example had one" }, { "q": "Which Cowling number is the most common?", "a": "", "valid": false, "kind": "output_only", "expect": null, "dtype": "quantity", "unit": "", "why": "names the output and no input: not this program's" } ], "heldout": [ { "q": "If the first Cowling number is 8.50728 and the magnetic Reynolds number is 17.7888, what is the Cowling number?", "a": "0.4782387296673114", "valid": true, "kind": "compute", "expect": 0.4782387296673114, "dtype": "quantity", "unit": "1", "why": "Cowling number for [8.507283, 17.788778] (the system first Cowling number (Wikidata Q105084863))" }, { "q": "Could you work out the Cowling number given first Cowling number = 8.50728, magnetic Reynolds number = 17.7888?", "a": "0.4782387296673114", "valid": true, "kind": "compute", "expect": 0.4782387296673114, "dtype": "quantity", "unit": "1", "why": "Cowling number for [8.507283, 17.788778] (the system first Cowling number (Wikidata Q105084863))" }, { "q": "I need the Cowling number for a first Cowling number of 8.24951 and a magnetic Reynolds number of 0.634021, please.", "a": "13.011414796588832", "valid": true, "kind": "compute", "expect": 13.011414796588832, "dtype": "quantity", "unit": "1", "why": "Cowling number for [8.24951, 0.634021] (the system first Cowling number (Wikidata Q105084863))" }, { "q": "If the first Cowling number is 8.24951 and the magnetic Reynolds number is 0.634021, what is the Cowling number?", "a": "13.011414796588832", "valid": true, "kind": "compute", "expect": 13.011414796588832, "dtype": "quantity", "unit": "1", "why": "Cowling number for [8.24951, 0.634021] (the system first Cowling number (Wikidata Q105084863))" }, { "q": "Could you work out the Cowling number given first Cowling number = 0.318734, magnetic Reynolds number = 9.56607?", "a": "0.03331922249257168", "valid": true, "kind": "compute", "expect": 0.03331922249257168, "dtype": "quantity", "unit": "1", "why": "Cowling number for [0.318734, 9.566071] (the system first Cowling number (Wikidata Q105084863))" }, { "q": "I need the Cowling number for a first Cowling number of 0.318734 and a magnetic Reynolds number of 9.56607, please.", "a": "0.03331922249257168", "valid": true, "kind": "compute", "expect": 0.03331922249257168, "dtype": "quantity", "unit": "1", "why": "Cowling number for [0.318734, 9.566071] (the system first Cowling number (Wikidata Q105084863))" }, { "q": "If the first Cowling number is 0.671697 and the magnetic Reynolds number is 14.2496, what is the Cowling number?", "a": "0.04713807027437235", "valid": true, "kind": "compute", "expect": 0.04713807027437235, "dtype": "quantity", "unit": "1", "why": "Cowling number for [0.671697, 14.249569] (the system first Cowling number (Wikidata Q105084863))" }, { "q": "Could you work out the Cowling number given first Cowling number = 0.671697, magnetic Reynolds number = 14.2496?", "a": "0.04713807027437235", "valid": true, "kind": "compute", "expect": 0.04713807027437235, "dtype": "quantity", "unit": "1", "why": "Cowling number for [0.671697, 14.249569] (the system first Cowling number (Wikidata Q105084863))" }, { "q": "I need the Cowling number for a first Cowling number of 21.7931 and a magnetic Reynolds number of 29.5106, please.", "a": "0.7384844800541926", "valid": true, "kind": "compute", "expect": 0.7384844800541926, "dtype": "quantity", "unit": "1", "why": "Cowling number for [21.793126, 29.510609] (the system first Cowling number (Wikidata Q105084863))" }, { "q": "If the first Cowling number is 21.7931 and the magnetic Reynolds number is 29.5106, what is the Cowling number?", "a": "0.7384844800541926", "valid": true, "kind": "compute", "expect": 0.7384844800541926, "dtype": "quantity", "unit": "1", "why": "Cowling number for [21.793126, 29.510609] (the system first Cowling number (Wikidata Q105084863))" }, { "q": "Could you work out the Cowling number given first Cowling number = 153.15, magnetic Reynolds number = 18.5953?", "a": "8.235943368499306", "valid": true, "kind": "compute", "expect": 8.235943368499306, "dtype": "quantity", "unit": "1", "why": "Cowling number for [153.149965, 18.595315] (the system first Cowling number (Wikidata Q105084863))" }, { "q": "I need the Cowling number for a first Cowling number of 153.15 and a magnetic Reynolds number of 18.5953, please.", "a": "8.235943368499306", "valid": true, "kind": "compute", "expect": 8.235943368499306, "dtype": "quantity", "unit": "1", "why": "Cowling number for [153.149965, 18.595315] (the system first Cowling number (Wikidata Q105084863))" }, { "q": "If the first Cowling number is 8.50728, what is the Cowling number?", "a": "", "valid": false, "kind": "missing_input", "expect": null, "dtype": "quantity", "unit": "", "why": "the magnetic Reynolds number is not given" }, { "q": "Could you work out the Cowling number given first Cowling number = 8.24951?", "a": "", "valid": false, "kind": "missing_input", "expect": null, "dtype": "quantity", "unit": "", "why": "the magnetic Reynolds number is not given" }, { "q": "Do you know the Cowling number of a violin?", "a": "", "valid": false, "kind": "not_held", "expect": null, "dtype": "quantity", "unit": "", "why": "a named thing, not inputs: a lookup the program cannot do" }, { "q": "Do you know the Cowling number of the French Revolution?", "a": "", "valid": false, "kind": "not_held", "expect": null, "dtype": "quantity", "unit": "", "why": "a named thing, not inputs: a lookup the program cannot do" }, { "q": "Could you work out the Cowling number given first Cowling number = -0.318734, magnetic Reynolds number = 9.56607?", "a": "", "valid": false, "kind": "out_of_domain", "expect": null, "dtype": "quantity", "unit": "", "why": "a negative first Cowling number: no example had one" }, { "q": "What is a typical Cowling number?", "a": "", "valid": false, "kind": "output_only", "expect": null, "dtype": "quantity", "unit": "", "why": "names the output and no input: not this program's" } ]}1234567"""Cowling number from first Cowling number, magnetic Reynolds number (first Cowling number (Wikidata Q105084863))The maths organ (systems.py): solved from the system q0 = q1*q2; checked by substitution into every equation and by a numeric solution at 12 points"""import math
def compute(first_cowling_number, magnetic_reynolds_number): return 1.0*first_cowling_number/magnetic_reynolds_number12345678910111213141516171819202122232425262728293031"""scorer_formula_v1 - scorer for composed formula specialists: (good, asserted).A must-decline item answered is a false yes. A valid quantity item is right when the FIRST number in the reply (theanswer, before any working) is within 0.5% of the sealed answer; a valid text item is right when the answer appears in thereply as a whole word, exactly as written."""import re
def _first_num(text): m = re.search(r"-?\d[\d,]*(?:\.\d+)?(?:[eE][+-]?\d+)?", text) if not m: return None try: return float(m.group(0).replace(",", "")) except ValueError: return None
def ok(p, r): r = r or {} text = str(r.get("response", "")) answered = str(r.get("status", "")) == "answered" if not p["valid"]: return (not answered), answered if not answered: return False, False if p.get("dtype") == "quantity": want, got = float(p["expect"]), _first_num(text) if got is None: return False, True return abs(got - want) <= (0.005 * abs(want) if want else 0.005), True return re.search(r"(?<![\w])%s(?![\w])" % re.escape(str(p["expect"])), text) is not None, True123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128{ "title": "Cowling number from first Cowling number, magnetic Reynolds number (first Cowling number (Wikidata Q105084863))", "inputs": [ "first Cowling number (1)", "magnetic Reynolds number (1)" ], "output": "Cowling number (1)", "input_kinds": [ "number", "number" ], "expression": "1.0*q0/q2", "expression_x": null, "said": "solved from the system q0 = q1*q2; checked by substitution into every equation and by a numeric solution at 12 points", "composer": "systems (the maths organ)", "library": [], "system": { "equations": [ "q0 = q1*q2" ], "constants": {}, "quantities": { "q0": "first Cowling number (1)", "q1": "Cowling number (1)", "q2": "magnetic Reynolds number (1)" }, "symbols": [ "q0", "q2" ], "out_symbol": "q1" }, "points": [ { "in": [ 107.960666, 59.4105 ], "out": 1.8171983999893246 }, { "in": [ 8.507283, 17.788778 ], "out": 0.4782387296673114 }, { "in": [ 169.526958, 280.773702 ], "out": 0.6037850281809957 }, { "in": [ 8.24951, 0.634021 ], "out": 13.011414796588832 }, { "in": [ 1.911952, 82.240072 ], "out": 0.023248420388592404 }, { "in": [ 0.318734, 9.566071 ], "out": 0.03331922249257168 }, { "in": [ 1.643795, 252.709024 ], "out": 0.006504696457692342 }, { "in": [ 0.671697, 14.249569 ], "out": 0.04713807027437235 }, { "in": [ 18.316867, 6.838598 ], "out": 2.6784535160942915 }, { "in": [ 21.793126, 29.510609 ], "out": 0.7384844800541926 }, { "in": [ 156.50181, 185.886273 ], "out": 0.8419223616111585 }, { "in": [ 153.149965, 18.595315 ], "out": 8.235943368499306 } ], "domain": { "inputs": [ "positive", "positive" ], "output": "positive", "order": [], "facts": [] }}1234567891011121314151617181920212223242526272829303132333435363738{ "id": "solved-cowling-number", "split": "dev", "decision": "WOULD PASS", "reasons": [], "n": 18, "head": { "ok": 6, "fy": 0, "wrong": 0 }, "with_specialist": { "ok": 18, "fy": 0, "wrong": 0 }, "gain_needed": 3, "core": { "n": 924, "taken": 0, "cap": 9, "examples": [] }, "self_ok": true, "p50_ms": 0.0, "budget_ms": 200.0, "fails": [], "files_sha": "5f4d95c29209e5b47b2c1857cdf488c940f55b59bfcff9d3c910f71ef6a6ba90", "panel_sha": "fc05df3d14f73b202969f66f6035d1b945664fd20d89c203503ade7b89ffdab6", "time": "2026-10-25T01:06:44Z", "core_head": "oracle_release_runtime_w571", "head_probe": { "asked": 2, "core_right": 0, "fillable_declines": 2, "mode": "declines" }}123456789101112131415161718192021222324252627282930313233343536373839{ "id": "solved-cowling-number", "split": "heldout", "decision": "ADMIT", "reasons": [], "n": 18, "head": { "ok": 6, "fy": 0, "wrong": 0 }, "with_specialist": { "ok": 18, "fy": 0, "wrong": 0 }, "gain_needed": 3, "core": { "n": 924, "taken": 0, "cap": 9, "examples": [] }, "self_ok": true, "p50_ms": 0.0, "budget_ms": 200.0, "fails": [], "files_sha": "5f4d95c29209e5b47b2c1857cdf488c940f55b59bfcff9d3c910f71ef6a6ba90", "panel_sha": "86eec1b527cb362b8788e5fc7203e4a4d16c46bd44203f5813a2c4948d663cf8", "time": "2026-10-25T01:06:45Z", "core_head": "oracle_release_runtime_w571", "head_probe": { "asked": 2, "core_right": 0, "fillable_declines": 2, "mode": "declines" }, "memory": "written to your group's memory"}1{"t": "2026-10-25T01:01:18Z", "heldout_sha": "4770d010b8625694a82fa15aa20fbfee388bc89dd4f84d65905b44b44a884cb2", "files_sha": "5ace398b1dd5f55e79c3138fe235ed675d7c6eed331c7d528a669e4a3f7d9f6d"}1234567891011121314151617181920212223242526272829303132333435363738394041{ "id": "solved-cross-sectional-area-2", "name": "Solved: cross-sectional area from specific rotation, angle of optical rotation, mass (specific rotation (Wikidata Q2191631))", "sources": [ { "name": "the maths organ: solved from the system q0 = q1*((q2)/(q3)); checked by substitution into every equation and by a numeric solution at 12 points", "licence": "yours" } ], "organ": { "module": "organ_formula_v3", "class": "FormulaOrgan", "init": {} }, "accept": { "kinds": [ "compute" ], "declines_in_domain": [ "missing_input", "out_of_domain" ], "context_regex": "\\bcross\\-sectional\\ area\\b" }, "panel": { "path": "panel.json", "scorer_module": "scorer_formula_v1", "scorer_fn": "ok" }, "budgets": { "latency_p50_ms": 200 }, "notes": "Solved by the maths organ from the system specific rotation (Wikidata Q2191631): 6 checked points used to write the panel's dev half, 6 its held-out half.", "built_from": { "questions": [ "What is the cross-sectional area for specific rotation and angle of optical rotation and mass?" ], "gap": "", "node": "hod" }}1234567891011121314151617181920212223242526272829303132333435363738394041424344454647#!/usr/bin/env python3"""narrow_v1 - the shared NARROWING rule for specialist organs (2026-09-29, from the full-core sweep):
WORD PROBLEMS AND NARRATIVE TURNS BELONG TO THE HEAD. An organ answers a direct domain question. A turn that tells a story ("Justine wants to put a deck ...", "A new energy drink advertises 106 calories for 8 ounces ...") or relates quantities to each other ("the length is 9 inches more than the width") is a word problem, which the core's word- problem organ owns; organs firing on its nouns declined it or answered a different question. An organ may DECLINE only a short direct question (it is then refusing the domain question that was asked); on anything longer it says nothing and the head answers.
Narrowing only ever removes turns an organ takes, so on any input where it does not fire, the organ's reply isbyte-identical to the frozen version it wraps (checked per specialist by an invariance count before re-gating)."""import re
RELATION = re.compile(r"\b(?:\d+(?:\.\d+)?|one|two|three|four|five|six|seven|eight|nine|ten)\s+(?:\w+\s+){0,2}(?:more|less|fewer|longer|shorter)\s+than\b|" r"\b(?:twice|three times|half)\s+(?:as\s+\w+\s+as\s+)?the\s+\w+\b", re.I)
# a RATE ("106 calories for 8 ounces", "3 apples per 2 dollars") makes the turn a proportion problemRATE = re.compile(r"\b\d+(?:\.\d+)?\s+[a-z]+\s+(?:for|per|every)\s+(?:\d+(?:\.\d+)?|a|an|one|each)\s+[a-z]+", re.I)NUM = re.compile(r"(?<![\w.])\d+(?:\.\d+)?(?!\w|\.\d)") # "leg is 5." counts: a sentence-final period is not a decimal
def numbers(t): return len(NUM.findall(str(t or "")))
def last_sentence(t): parts = [s for s in re.split(r"(?<=[.!?;])\s+", str(t or "").strip()) if s.strip()] return parts[-1] if parts else ""
def sentences(t): return len([s for s in re.split(r"(?<=[.!?])\s+", str(t or "").strip()) if s.strip()])
def narrative(t): """a story-shaped or relational turn: 3+ sentences, 40+ words, or quantities defined relative to each other""" t = str(t or "") return sentences(t) >= 3 or len(t.split()) > 40 or RELATION.search(t) is not None or RATE.search(t) is not None
def short_direct(t): """a direct question an organ may decline: at most 2 sentences, at most 25 words, not narrative""" t = str(t or "") return sentences(t) <= 2 and len(t.split()) <= 25 and not narrative(t)123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163"""organ_formula_v2 - v1 + a question is declined as missing an input only when it names one of the inputs (v1 declined
"What is the largest living animal species that only eats plants?" for the zodiac program, whose output is "animal":
the gate found the core item made worse, 2026-10-20). A question that names the output and no input is not this
program's, and gets no reply.
v2 also keeps to the DOMAIN of its examples (spec.json "domain", written from the worked examples the composer saw): an
input every example gave as positive (or non-negative) must be so in the question, and an answer whose sign no example's
answer had is not given ("ABV for original gravity 1.010 and final gravity 1.050" would be -5.25): out_of_domain, an
in-domain refusal that says why. A program is evidence for the range its examples span in sign, not beyond.
organ_formula_v1 - the GENERIC FORMULA SPECIALIST: one program the code composer wrote (program.py beside this file) and
the typed signature it was written for (spec.json: the inputs and the output, each a label with an optional unit in
parentheses). Built, not trained; no phrasing templates.
Reading, by role: the output is named in the question (its label; when an input has the same label, the output's unit too,
"in F"); each input is its label with a value right after it ("original gravity 1.055", "age of 25", "f-number = 8") or
right before it ("1.055 original gravity"). A value is a number ("1,000", "0.5", "1/125") or, for an input whose examples
were codes, a token mixing digits and letters ("205/55R16").
compute every input found: "The <output> is <value> <unit>." and the program it came from
missing_input a short direct question names the output but not every input's value: an in-domain refusal naming what
is missing
Narrowing (narrow_v1, the factory's shared rule): story-shaped and relational turns belong to the core; a turn carrying
numbers that no input claims is a different calculation and belongs to the core. Everything else: no reply."""
from __future__ import annotations
import importlib.util
import json
import os
import re
from narrow_v1 import narrative, short_direct
HERE = os.path.dirname(os.path.abspath(__file__))
NUM = r"-?\d[\d,]*(?:\.\d+)?(?:\s*/\s*\d[\d,]*(?:\.\d+)?)?"
CODE = r"[A-Za-z0-9]*\d[A-Za-z0-9]*[/\-][A-Za-z0-9/\-]*\d[A-Za-z0-9]*"
ANYNUM = re.compile(r"(?<![\w/.])-?\d[\d,]*(?:\.\d+)?(?![\w/])")
ASKING = re.compile(r"\?\s*$|^\s*(?:what|which|how|tell me|give me|i need|do you know|could you|can you|if |compute|calculate|"
r"work out|find )", re.I)
LINK = r"\s*(?:of|is|=|:|at|equal to|equals)?\s*(?:a|an|the)?\s*"
def split_label(s):
m = re.match(r"\s*(.*?)\s*(?:\(([^)]*)\))?\s*$", s)
return m.group(1).strip(), (m.group(2) or "").strip()
def label_rx(label):
words = [re.escape(w) for w in re.split(r"[\s]+", label) if w]
return r"(?<![\w-])" + r"[\s-]+".join(words) + r"s?(?![\w-])"
def _val(tok):
tok = tok.replace(",", "").replace(" ", "")
if "/" in tok:
a, b = tok.split("/", 1)
return float(a) / float(b)
return float(tok)
def _in_sign(v, sign):
if isinstance(v, str) or sign == "any":
return True
return v > 0 if sign == "positive" else v >= 0
def sign_of(values):
"""the sign every example gave: "positive", "nonnegative" or "any" (text values: "any")"""
if not values or any(isinstance(v, str) for v in values):
return "any"
if all(v > 0 for v in values):
return "positive"
return "nonnegative" if all(v >= 0 for v in values) else "any"
def _fmt(v):
if isinstance(v, str):
return v
v = float(v)
if v == 0:
return "0"
return ("%.6g" % v) if 1e-3 <= abs(v) < 1e7 else ("%.4g" % v)
class FormulaOrgan:
def __init__(self, spec="spec.json"):
self.spec = json.load(open(os.path.join(HERE, spec), encoding="utf-8"))
loader = importlib.util.spec_from_file_location("composed_program", os.path.join(HERE, "program.py"))
mod = importlib.util.module_from_spec(loader)
loader.loader.exec_module(mod)
self.compute = mod.compute
self.out_label, self.out_unit = split_label(self.spec["output"])
self.ins = [split_label(x) for x in self.spec["inputs"]]
self.kinds = self.spec["input_kinds"] # "number" or "code", from the examples
dom = self.spec.get("domain") or {}
self.in_sign = dom.get("inputs") or ["any"] * len(self.kinds) # "positive", "nonnegative" or "any", per input
self.out_sign = dom.get("output", "any")
collide = any(lab.lower() == self.out_label.lower() for lab, _ in self.ins)
out = label_rx(self.out_label)
if collide and self.out_unit: # "the temperature in F"
out += r"\s+(?:in|to)\s+(?:degrees\s+)?" + re.escape(self.out_unit) + r"(?![\w])"
self.rx_out = re.compile(out, re.I)
self.rx_in = []
for (lab, unit), kind in zip(self.ins, self.kinds):
v = CODE if kind == "code" else NUM
after = re.compile(label_rx(lab) + LINK + r"(" + v + r")(?![\w/])", re.I)
before = re.compile(r"(?<![\w/.])(" + v + r")\s+(?:\w+\s+)?" + label_rx(lab), re.I)
self.rx_in.append((after, before))
def _read(self, t):
spans, vals, missing = [], [], []
out_m = self.rx_out.search(t)
for (lab, _), kind, (after, before) in zip(self.ins, self.kinds, self.rx_in):
got = None
for rx in (after, before):
for m in rx.finditer(t):
if out_m and out_m.start() <= m.start() < out_m.end():
continue # the output's own mention is not an input
if any(a <= m.start(1) < b for a, b in spans):
continue
got = m
break
if got:
break
if not got:
missing.append(lab)
continue
spans.append((got.start(1), got.end(1)))
vals.append(got.group(1) if kind == "code" else _val(got.group(1)))
return vals, missing, spans
def answer(self, text, session_id="default"):
t = re.sub(r"\s+", " ", str(text or "")).strip()
if not self.rx_out.search(t) or narrative(t) or not ASKING.search(t):
return None
vals, missing, spans = self._read(t)
stray = [m for m in ANYNUM.finditer(t) if not any(a <= m.start() < b for a, b in spans)]
if stray: # numbers no input claims: another calculation
return None
if missing:
named = any(re.search(label_rx(lab), t, re.I) for lab, _ in self.ins)
if named and short_direct(t):
return {"kind": "missing_input", "status": "declined",
"response": "To work out the %s I need the %s, and the question doesn't give %s."
% (self.out_label, " and the ".join(missing), "it" if len(missing) == 1 else "them")}
return None
for (lab, _), v, sign in zip(self.ins, vals, self.in_sign):
if not _in_sign(v, sign):
return {"kind": "out_of_domain", "status": "declined",
"response": "Every worked example this program was written from has a %s %s; %s is outside that, so I "
"won't extrapolate." % (sign.replace("nonnegative", "non-negative"), lab, _fmt(v))}
try:
y = self.compute(*vals)
except Exception:
return None
if y is None or (isinstance(y, float) and y != y):
return None
if not _in_sign(y, self.out_sign):
return {"kind": "out_of_domain", "status": "declined",
"response": "That would make the %s %s, and every worked example this program was written from gave a %s "
"one, so I won't give it." % (self.out_label, _fmt(y), self.out_sign.replace("nonnegative", "non-negative"))}
unit =(" " + self.out_unit) if self.out_unit and not isinstance(y, str) else ""
return {"kind": "compute", "status": "answered",
"response": "The %s is %s%s. (A composed program: %s; %s.)" % (self.out_label, _fmt(y), unit,
self.spec["expression"], self.spec["said"])}123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205"""organ_formula_v3 - v2 + the DOMAIN beyond signs (pre-registration v11 part C, 2026-10-21). 4.1 and 4.2 published the limit
"a blood pressure of 70/110 or day 400 of a year is answered". spec.json "domain" now also holds:
order an ordering that holds in EVERY worked example between the numbers of one code input ("120/80": systolic above
diastolic) or between two inputs with the same named unit ("original gravity (SG)" above "final gravity (SG)").
Inputs without a named unit are not ordered: four examples cannot show that a chainring always outnumbers a cog.
facts what the quantity can be, cited: a day of 2025 is a whole number from 1 to 365 (Gregorian calendar, a common year);
a temperature is at or above absolute zero (SI Brochure, 9th edition, 2019: 0 K = -273.15 degC = -459.67 degF);
teeth, integers and years are whole numbers.
An input outside either is out_of_domain, an in-domain refusal that says which rule and why.
organ_formula_v2 (the parent) - v1 + a question is declined as missing an input only when it names one of the inputs (v1 declined
"What is the largest living animal species that only eats plants?" for the zodiac program, whose output is "animal":
the gate found the core item made worse, 2026-10-20). A question that names the output and no input is not this
program's, and gets no reply.
v2 also keeps to the DOMAIN of its examples (spec.json "domain", written from the worked examples the composer saw): an
input every example gave as positive (or non-negative) must be so in the question, and an answer whose sign no example's
answer had is not given ("ABV for original gravity 1.010 and final gravity 1.050" would be -5.25): out_of_domain, an
in-domain refusal that says why. A program is evidence for the range its examples span in sign, not beyond.
organ_formula_v1 - the GENERIC FORMULA SPECIALIST: one program the code composer wrote (program.py beside this file) and
the typed signature it was written for (spec.json: the inputs and the output, each a label with an optional unit in
parentheses). Built, not trained; no phrasing templates.
Reading, by role: the output is named in the question (its label; when an input has the same label, the output's unit too,
"in F"); each input is its label with a value right after it ("original gravity 1.055", "age of 25", "f-number = 8") or
right before it ("1.055 original gravity"). A value is a number ("1,000", "0.5", "1/125") or, for an input whose examples
were codes, a token mixing digits and letters ("205/55R16").
compute every input found: "The <output> is <value> <unit>." and the program it came from
missing_input a short direct question names the output but not every input's value: an in-domain refusal naming what
is missing
Narrowing (narrow_v1, the factory's shared rule): story-shaped and relational turns belong to the core; a turn carrying
numbers that no input claims is a different calculation and belongs to the core. Everything else: no reply."""
from __future__ import annotations
import importlib.util
import json
import os
import re
from narrow_v1 import narrative, short_direct
HERE = os.path.dirname(os.path.abspath(__file__))
NUM = r"-?\d[\d,]*(?:\.\d+)?(?:\s*/\s*\d[\d,]*(?:\.\d+)?)?"
CODE = r"[A-Za-z0-9]*\d[A-Za-z0-9]*[/\-][A-Za-z0-9/\-]*\d[A-Za-z0-9]*"
ANYNUM = re.compile(r"(?<![\w/.])-?\d[\d,]*(?:\.\d+)?(?![\w/])")
ASKING = re.compile(r"\?\s*$|^\s*(?:what|which|how|tell me|give me|i need|do you know|could you|can you|if |compute|calculate|"
r"work out|find )", re.I)
LINK = r"\s*(?:of|is|=|:|at|equal to|equals)?\s*(?:a|an|the)?\s*"
def split_label(s):
m = re.match(r"\s*(.*?)\s*(?:\(([^)]*)\))?\s*$", s)
return m.group(1).strip(), (m.group(2) or "").strip()
def label_rx(label):
words = [re.escape(w) for w in re.split(r"[\s]+", label) if w]
return r"(?<![\w-])" + r"[\s-]+".join(words) + r"s?(?![\w-])"
def _val(tok):
tok = tok.replace(",", "").replace(" ", "")
if "/" in tok:
a, b = tok.split("/", 1)
return float(a) / float(b)
return float(tok)
def _in_sign(v, sign):
if isinstance(v, str) or sign == "any":
return True
return v > 0 if sign == "positive" else v >= 0
def sign_of(values):
"""the sign every example gave: "positive", "nonnegative" or "any" (text values: "any")"""
if not values or any(isinstance(v, str) for v in values):
return "any"
if all(v > 0 for v in values):
return "positive"
return "nonnegative" if all(v >= 0 for v in values) else "any"
def _fmt(v):
if isinstance(v, str):
return v
v = float(v)
if v == 0:
return "0"
return ("%.6g" % v) if 1e-3 <= abs(v) < 1e7 else ("%.4g" % v)
class FormulaOrgan:
def __init__(self, spec="spec.json"):
self.spec = json.load(open(os.path.join(HERE, spec), encoding="utf-8"))
loader = importlib.util.spec_from_file_location("composed_program", os.path.join(HERE, "program.py"))
mod = importlib.util.module_from_spec(loader)
loader.loader.exec_module(mod)
self.compute = mod.compute
self.out_label, self.out_unit = split_label(self.spec["output"])
self.ins = [split_label(x) for x in self.spec["inputs"]]
self.kinds = self.spec["input_kinds"] # "number" or "code", from the examples
dom = self.spec.get("domain") or {}
self.in_sign = dom.get("inputs") or ["any"] * len(self.kinds) # "positive", "nonnegative" or "any", per input
self.out_sign = dom.get("output", "any")
collide = any(lab.lower() == self.out_label.lower() for lab, _ in self.ins)
out = label_rx(self.out_label)
if collide and self.out_unit: # "the temperature in F"
out += r"\s+(?:in|to)\s+(?:degrees\s+)?" + re.escape(self.out_unit) + r"(?![\w])"
self.rx_out = re.compile(out, re.I)
self.rx_in = []
for (lab, unit), kind in zip(self.ins, self.kinds):
v = CODE if kind == "code" else NUM
after = re.compile(label_rx(lab) + LINK + r"(" + v + r")(?![\w/])", re.I)
before = re.compile(r"(?<![\w/.])(" + v + r")\s+(?:\w+\s+)?" + label_rx(lab), re.I)
self.rx_in.append((after, before))
def _read(self, t):
spans, vals, missing = [], [], []
out_m = self.rx_out.search(t)
for (lab, _), kind, (after, before) in zip(self.ins, self.kinds, self.rx_in):
got = None
for rx in (after, before):
for m in rx.finditer(t):
if out_m and out_m.start() <= m.start() < out_m.end():
continue # the output's own mention is not an input
if any(a <= m.start(1) < b for a, b in spans):
continue
got = m
break
if got:
break
if not got:
missing.append(lab)
continue
spans.append((got.start(1), got.end(1)))
vals.append(got.group(1) if kind == "code" else _val(got.group(1)))
return vals, missing, spans
def _components(self, vals):
"""every number the inputs give, keyed (input, k): a code input gives its numbers in order ("120/80" -> 120, 80)"""
out = {}
for i, (v, kind) in enumerate(zip(vals, self.kinds)):
if kind == "code":
for k, x in enumerate(re.findall(r"\d+(?:\.\d+)?", str(v))):
out[(i, k)] = float(x)
elif not isinstance(v, str):
out[(i, 0)] = float(v)
return out
def _domain_v3(self, vals):
dom = self.spec.get("domain") or {}
comp = self._components(vals)
for o in dom.get("order") or []:
a, b = tuple(o["greater"]), tuple(o["lesser"])
if a in comp and b in comp and not comp[a] > comp[b]:
return ("In every worked example this program was written from, the %s is greater than the %s; here it is not "
"(%s and %s), so it is not a reading I can work from." % (o["greater_name"], o["lesser_name"],
_fmt(comp[a]), _fmt(comp[b])))
for f in dom.get("facts") or []:
x = comp.get((f["input"], 0))
if x is None:
continue
bad = (f.get("integer") and x != int(x)) or ("min" in f and x < f["min"]) or ("max" in f and x > f["max"])
if bad:
return "%s is not a possible %s: %s. So I won't compute it." % (_fmt(x), f["name"], f["why"])
return None
def answer(self, text, session_id="default"):
t = re.sub(r"\s+", " ", str(text or "")).strip()
if not self.rx_out.search(t) or narrative(t) or not ASKING.search(t):
return None
vals, missing, spans = self._read(t)
stray = [m for m in ANYNUM.finditer(t) if not any(a <= m.start() < b for a, b in spans)]
if stray: # numbers no input claims: another calculation
return None
if missing:
named = any(re.search(label_rx(lab), t, re.I) for lab, _ in self.ins)
if named and short_direct(t):
return {"kind": "missing_input", "status": "declined",
"response": "To work out the %s I need the %s, and the question doesn't give %s."
% (self.out_label, " and the ".join(missing), "it" if len(missing) == 1 else "them")}
return None
for (lab, _), v, sign in zip(self.ins, vals, self.in_sign):
if not _in_sign(v, sign):
return {"kind": "out_of_domain", "status": "declined",
"response": "Every worked example this program was written from has a %s %s; %s is outside that, so I "
"won't extrapolate." % (sign.replace("nonnegative", "non-negative"), lab, _fmt(v))}
refused = self._domain_v3(vals)
if refused:
return {"kind": "out_of_domain", "status": "declined", "response": refused}
try:
y = self.compute(*vals)
except Exception:
return None
if y is None or (isinstance(y, float) and y != y):
return None
if not _in_sign(y, self.out_sign):
return {"kind": "out_of_domain", "status": "declined",
"response": "That would make the %s %s, and every worked example this program was written from gave a %s "
"one, so I won't give it." % (self.out_label, _fmt(y), self.out_sign.replace("nonnegative", "non-negative"))}
unit =(" " + self.out_unit) if self.out_unit and not isinstance(y, str) else ""
return {"kind": "compute", "status": "answered",
"response": "The %s is %s%s. (A composed program: %s; %s.)" % (self.out_label, _fmt(y), unit,
self.spec["expression"], self.spec["said"])}123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366{ "dev": [ { "q": "What is the cross-sectional area for specific rotation 107.961, angle of optical rotation 59.4105 and mass 5.77717?", "a": "10.498254293702432", "valid": true, "kind": "compute", "expect": 10.498254293702432, "dtype": "quantity", "unit": "m^2", "why": "cross-sectional area for [107.960666, 59.4105, 5.777165] (the system specific rotation (Wikidata Q2191631))" }, { "q": "Tell me the cross-sectional area with specific rotation of 107.961, angle of optical rotation of 59.4105 and mass of 5.77717.", "a": "10.498254293702432", "valid": true, "kind": "compute", "expect": 10.498254293702432, "dtype": "quantity", "unit": "m^2", "why": "cross-sectional area for [107.960666, 59.4105, 5.777165] (the system specific rotation (Wikidata Q2191631))" }, { "q": "What is the cross-sectional area for specific rotation 85.2416, angle of optical rotation 160.878 and mass 2.69428?", "a": "1.4275672119863798", "valid": true, "kind": "compute", "expect": 1.4275672119863798, "dtype": "quantity", "unit": "m^2", "why": "cross-sectional area for [85.241623, 160.878442, 2.69428] (the system specific rotation (Wikidata Q2191631))" }, { "q": "Tell me the cross-sectional area with specific rotation of 85.2416, angle of optical rotation of 160.878 and mass of 2.69428.", "a": "1.4275672119863798", "valid": true, "kind": "compute", "expect": 1.4275672119863798, "dtype": "quantity", "unit": "m^2", "why": "cross-sectional area for [85.241623, 160.878442, 2.69428] (the system specific rotation (Wikidata Q2191631))" }, { "q": "What is the cross-sectional area for specific rotation 45.6157, angle of optical rotation 4.97131 and mass 94.305?", "a": "865.3232325447225", "valid": true, "kind": "compute", "expect": 865.3232325447225, "dtype": "quantity", "unit": "m^2", "why": "cross-sectional area for [45.61567, 4.971307, 94.305046] (the system specific rotation (Wikidata Q2191631))" }, { "q": "Tell me the cross-sectional area with specific rotation of 45.6157, angle of optical rotation of 4.97131 and mass of 94.305.", "a": "865.3232325447225", "valid": true, "kind": "compute", "expect": 865.3232325447225, "dtype": "quantity", "unit": "m^2", "why": "cross-sectional area for [45.61567, 4.971307, 94.305046] (the system specific rotation (Wikidata Q2191631))" }, { "q": "What is the cross-sectional area for specific rotation 10.5638, angle of optical rotation 198.839 and mass 0.671697?", "a": "0.03568568130708054", "valid": true, "kind": "compute", "expect": 0.03568568130708054, "dtype": "quantity", "unit": "m^2", "why": "cross-sectional area for [10.563843, 198.838955, 0.671697] (the system specific rotation (Wikidata Q2191631))" }, { "q": "Tell me the cross-sectional area with specific rotation of 10.5638, angle of optical rotation of 198.839 and mass of 0.671697.", "a": "0.03568568130708054", "valid": true, "kind": "compute", "expect": 0.03568568130708054, "dtype": "quantity", "unit": "m^2", "why": "cross-sectional area for [10.563843, 198.838955, 0.671697] (the system specific rotation (Wikidata Q2191631))" }, { "q": "What is the cross-sectional area for specific rotation 21.7931, angle of optical rotation 29.5106 and mass 8.50341?", "a": "6.279634237980215", "valid": true, "kind": "compute", "expect": 6.279634237980215, "dtype": "quantity", "unit": "m^2", "why": "cross-sectional area for [21.793126, 29.510609, 8.503407] (the system specific rotation (Wikidata Q2191631))" }, { "q": "Tell me the cross-sectional area with specific rotation of 21.7931, angle of optical rotation of 29.5106 and mass of 8.50341.", "a": "6.279634237980215", "valid": true, "kind": "compute", "expect": 6.279634237980215, "dtype": "quantity", "unit": "m^2", "why": "cross-sectional area for [21.793126, 29.510609, 8.503407] (the system specific rotation (Wikidata Q2191631))" }, { "q": "What is the cross-sectional area for specific rotation 223.509, angle of optical rotation 17.3414 and mass 7.10705?", "a": "91.60072422473009", "valid": true, "kind": "compute", "expect": 91.60072422473009, "dtype": "quantity", "unit": "m^2", "why": "cross-sectional area for [223.508796, 17.341435, 7.107049] (the system specific rotation (Wikidata Q2191631))" }, { "q": "Tell me the cross-sectional area with specific rotation of 223.509, angle of optical rotation of 17.3414 and mass of 7.10705.", "a": "91.60072422473009", "valid": true, "kind": "compute", "expect": 91.60072422473009, "dtype": "quantity", "unit": "m^2", "why": "cross-sectional area for [223.508796, 17.341435, 7.107049] (the system specific rotation (Wikidata Q2191631))" }, { "q": "What is the cross-sectional area for specific rotation 107.961 and angle of optical rotation 59.4105?", "a": "", "valid": false, "kind": "missing_input", "expect": null, "dtype": "quantity", "unit": "", "why": "the mass is not given" }, { "q": "Tell me the cross-sectional area with specific rotation of 85.2416 and angle of optical rotation of 160.878.", "a": "", "valid": false, "kind": "missing_input", "expect": null, "dtype": "quantity", "unit": "", "why": "the mass is not given" }, { "q": "What is the cross-sectional area of the Eiffel Tower?", "a": "", "valid": false, "kind": "not_held", "expect": null, "dtype": "quantity", "unit": "", "why": "a named thing, not inputs: a lookup the program cannot do" }, { "q": "What is the cross-sectional area of Mount Everest?", "a": "", "valid": false, "kind": "not_held", "expect": null, "dtype": "quantity", "unit": "", "why": "a named thing, not inputs: a lookup the program cannot do" }, { "q": "Tell me the cross-sectional area with specific rotation of -45.6157, angle of optical rotation of 4.97131 and mass of 94.305.", "a": "", "valid": false, "kind": "out_of_domain", "expect": null, "dtype": "quantity", "unit": "", "why": "a negative specific rotation: no example had one" }, { "q": "Which cross-sectional area is the most common?", "a": "", "valid": false, "kind": "output_only", "expect": null, "dtype": "quantity", "unit": "", "why": "names the output and no input: not this program's" } ], "heldout": [ { "q": "If the specific rotation is 17.7888, angle of optical rotation is 167.625 and the mass is 10.3291, what is the cross-sectional area?", "a": "1.0961450581531387", "valid": true, "kind": "compute", "expect": 1.0961450581531387, "dtype": "quantity", "unit": "m^2", "why": "cross-sectional area for [17.788778, 167.624948, 10.329054] (the system specific rotation (Wikidata Q2191631))" }, { "q": "Could you work out the cross-sectional area given specific rotation = 17.7888, angle of optical rotation = 167.625, mass = 10.3291?", "a": "1.0961450581531387", "valid": true, "kind": "compute", "expect": 1.0961450581531387, "dtype": "quantity", "unit": "m^2", "why": "cross-sectional area for [17.788778, 167.624948, 10.329054] (the system specific rotation (Wikidata Q2191631))" }, { "q": "I need the cross-sectional area for a specific rotation of 21.511, an angle of optical rotation of 173.394 and a mass of 251.084, please.", "a": "31.149197612202414", "valid": true, "kind": "compute", "expect": 31.149197612202414, "dtype": "quantity", "unit": "m^2", "why": "cross-sectional area for [21.511016, 173.393638, 251.084037] (the system specific rotation (Wikidata Q2191631))" }, { "q": "If the specific rotation is 21.511, angle of optical rotation is 173.394 and the mass is 251.084, what is the cross-sectional area?", "a": "31.149197612202414", "valid": true, "kind": "compute", "expect": 31.149197612202414, "dtype": "quantity", "unit": "m^2", "why": "cross-sectional area for [21.511016, 173.393638, 251.084037] (the system specific rotation (Wikidata Q2191631))" }, { "q": "Could you work out the cross-sectional area given specific rotation = 129.245, angle of optical rotation = 1.18359, mass = 15.9416?", "a": "1740.7830274187056", "valid": true, "kind": "compute", "expect": 1740.7830274187056, "dtype": "quantity", "unit": "m^2", "why": "cross-sectional area for [129.244984, 1.18359, 15.941612] (the system specific rotation (Wikidata Q2191631))" }, { "q": "I need the cross-sectional area for a specific rotation of 129.245, an angle of optical rotation of 1.18359 and a mass of 15.9416, please.", "a": "1740.7830274187056", "valid": true, "kind": "compute", "expect": 1740.7830274187056, "dtype": "quantity", "unit": "m^2", "why": "cross-sectional area for [129.244984, 1.18359, 15.941612] (the system specific rotation (Wikidata Q2191631))" }, { "q": "If the specific rotation is 20.3966, angle of optical rotation is 18.3169 and the mass is 6.8386, what is the cross-sectional area?", "a": "7.615050191987504", "valid": true, "kind": "compute", "expect": 7.615050191987504, "dtype": "quantity", "unit": "m^2", "why": "cross-sectional area for [20.396558, 18.316867, 6.838598] (the system specific rotation (Wikidata Q2191631))" }, { "q": "Could you work out the cross-sectional area given specific rotation = 20.3966, angle of optical rotation = 18.3169, mass = 6.8386?", "a": "7.615050191987504", "valid": true, "kind": "compute", "expect": 7.615050191987504, "dtype": "quantity", "unit": "m^2", "why": "cross-sectional area for [20.396558, 18.316867, 6.838598] (the system specific rotation (Wikidata Q2191631))" }, { "q": "I need the cross-sectional area for a specific rotation of 185.886, an angle of optical rotation of 13.2373 and a mass of 4.71941, please.", "a": "66.27285731134774", "valid": true, "kind": "compute", "expect": 66.27285731134774, "dtype": "quantity", "unit": "m^2", "why": "cross-sectional area for [185.886273, 13.237311, 4.719415] (the system specific rotation (Wikidata Q2191631))" }, { "q": "If the specific rotation is 185.886, angle of optical rotation is 13.2373 and the mass is 4.71941, what is the cross-sectional area?", "a": "66.27285731134774", "valid": true, "kind": "compute", "expect": 66.27285731134774, "dtype": "quantity", "unit": "m^2", "why": "cross-sectional area for [185.886273, 13.237311, 4.719415] (the system specific rotation (Wikidata Q2191631))" }, { "q": "Could you work out the cross-sectional area given specific rotation = 9.1061, angle of optical rotation = 24.5721, mass = 108.451?", "a": "40.19049097830896", "valid": true, "kind": "compute", "expect": 40.19049097830896, "dtype": "quantity", "unit": "m^2", "why": "cross-sectional area for [9.106104, 24.572086, 108.450792] (the system specific rotation (Wikidata Q2191631))" }, { "q": "I need the cross-sectional area for a specific rotation of 9.1061, an angle of optical rotation of 24.5721 and a mass of 108.451, please.", "a": "40.19049097830896", "valid": true, "kind": "compute", "expect": 40.19049097830896, "dtype": "quantity", "unit": "m^2", "why": "cross-sectional area for [9.106104, 24.572086, 108.450792] (the system specific rotation (Wikidata Q2191631))" }, { "q": "If the specific rotation is 17.7888 and the angle of optical rotation is 167.625, what is the cross-sectional area?", "a": "", "valid": false, "kind": "missing_input", "expect": null, "dtype": "quantity", "unit": "", "why": "the mass is not given" }, { "q": "Could you work out the cross-sectional area given specific rotation = 21.511, angle of optical rotation = 173.394?", "a": "", "valid": false, "kind": "missing_input", "expect": null, "dtype": "quantity", "unit": "", "why": "the mass is not given" }, { "q": "Do you know the cross-sectional area of a violin?", "a": "", "valid": false, "kind": "not_held", "expect": null, "dtype": "quantity", "unit": "", "why": "a named thing, not inputs: a lookup the program cannot do" }, { "q": "Do you know the cross-sectional area of the French Revolution?", "a": "", "valid": false, "kind": "not_held", "expect": null, "dtype": "quantity", "unit": "", "why": "a named thing, not inputs: a lookup the program cannot do" }, { "q": "Could you work out the cross-sectional area given specific rotation = -129.245, angle of optical rotation = 1.18359, mass = 15.9416?", "a": "", "valid": false, "kind": "out_of_domain", "expect": null, "dtype": "quantity", "unit": "", "why": "a negative specific rotation: no example had one" }, { "q": "What is a typical cross-sectional area?", "a": "", "valid": false, "kind": "output_only", "expect": null, "dtype": "quantity", "unit": "", "why": "names the output and no input: not this program's" } ]}1234567"""cross-sectional area from specific rotation, angle of optical rotation, mass (specific rotation (Wikidata Q2191631))The maths organ (systems.py): solved from the system q0 = q1*((q2)/(q3)); checked by substitution into every equation and by a numeric solution at 12 points"""import math
def compute(specific_rotation, angle_of_optical_rotation, mass): return 1.0*mass*specific_rotation/angle_of_optical_rotation12345678910111213141516171819202122232425262728293031"""scorer_formula_v1 - scorer for composed formula specialists: (good, asserted).A must-decline item answered is a false yes. A valid quantity item is right when the FIRST number in the reply (theanswer, before any working) is within 0.5% of the sealed answer; a valid text item is right when the answer appears in thereply as a whole word, exactly as written."""import re
def _first_num(text): m = re.search(r"-?\d[\d,]*(?:\.\d+)?(?:[eE][+-]?\d+)?", text) if not m: return None try: return float(m.group(0).replace(",", "")) except ValueError: return None
def ok(p, r): r = r or {} text = str(r.get("response", "")) answered = str(r.get("status", "")) == "answered" if not p["valid"]: return (not answered), answered if not answered: return False, False if p.get("dtype") == "quantity": want, got = float(p["expect"]), _first_num(text) if got is None: return False, True return abs(got - want) <= (0.005 * abs(want) if want else 0.005), True return re.search(r"(?<![\w])%s(?![\w])" % re.escape(str(p["expect"])), text) is not None, True123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145{ "title": "cross-sectional area from specific rotation, angle of optical rotation, mass (specific rotation (Wikidata Q2191631))", "inputs": [ "specific rotation (m^2/kg)", "angle of optical rotation (1)", "mass (kg)" ], "output": "cross-sectional area (m^2)", "input_kinds": [ "number", "number", "number" ], "expression": "1.0*q0*q3/q1", "expression_x": null, "said": "solved from the system q0 = q1*((q2)/(q3)); checked by substitution into every equation and by a numeric solution at 12 points", "composer": "systems (the maths organ)", "library": [], "system": { "equations": [ "q0 = q1*((q2)/(q3))" ], "constants": {}, "quantities": { "q0": "specific rotation (m^2/kg)", "q1": "angle of optical rotation (1)", "q2": "cross-sectional area (m^2)", "q3": "mass (kg)" }, "symbols": [ "q0", "q1", "q3" ], "out_symbol": "q2" }, "points": [ { "in": [ 107.960666, 59.4105, 5.777165 ], "out": 10.498254293702432 }, { "in": [ 17.788778, 167.624948, 10.329054 ], "out": 1.0961450581531387 }, { "in": [ 85.241623, 160.878442, 2.69428 ], "out": 1.4275672119863798 }, { "in": [ 21.511016, 173.393638, 251.084037 ], "out": 31.149197612202414 }, { "in": [ 45.61567, 4.971307, 94.305046 ], "out": 865.3232325447225 }, { "in": [ 129.244984, 1.18359, 15.941612 ], "out": 1740.7830274187056 }, { "in": [ 10.563843, 198.838955, 0.671697 ], "out": 0.03568568130708054 }, { "in": [ 20.396558, 18.316867, 6.838598 ], "out": 7.615050191987504 }, { "in": [ 21.793126, 29.510609, 8.503407 ], "out": 6.279634237980215 }, { "in": [ 185.886273, 13.237311, 4.719415 ], "out": 66.27285731134774 }, { "in": [ 223.508796, 17.341435, 7.107049 ], "out": 91.60072422473009 }, { "in": [ 9.106104, 24.572086, 108.450792 ], "out": 40.19049097830896 } ], "domain": { "inputs": [ "positive", "positive", "positive" ], "output": "positive", "order": [], "facts": [] }}1234567891011121314151617181920212223242526272829303132333435363738{ "id": "solved-cross-sectional-area-2", "split": "dev", "decision": "WOULD PASS", "reasons": [], "n": 18, "head": { "ok": 6, "fy": 0, "wrong": 0 }, "with_specialist": { "ok": 18, "fy": 0, "wrong": 0 }, "gain_needed": 3, "core": { "n": 924, "taken": 0, "cap": 9, "examples": [] }, "self_ok": true, "p50_ms": 0.0, "budget_ms": 200.0, "fails": [], "files_sha": "5ace398b1dd5f55e79c3138fe235ed675d7c6eed331c7d528a669e4a3f7d9f6d", "panel_sha": "cce6187bcde81dbf1ee1238e7f31c7716004e106ff5e5fc5248b330c4854fc88", "time": "2026-10-25T01:01:18Z", "core_head": "oracle_release_runtime_w571", "head_probe": { "asked": 2, "core_right": 0, "fillable_declines": 2, "mode": "declines" }}123456789101112131415161718192021222324252627282930313233343536373839{ "id": "solved-cross-sectional-area-2", "split": "heldout", "decision": "ADMIT", "reasons": [], "n": 18, "head": { "ok": 6, "fy": 0, "wrong": 0 }, "with_specialist": { "ok": 18, "fy": 0, "wrong": 0 }, "gain_needed": 3, "core": { "n": 924, "taken": 0, "cap": 9, "examples": [] }, "self_ok": true, "p50_ms": 0.0, "budget_ms": 200.0, "fails": [], "files_sha": "5ace398b1dd5f55e79c3138fe235ed675d7c6eed331c7d528a669e4a3f7d9f6d", "panel_sha": "4770d010b8625694a82fa15aa20fbfee388bc89dd4f84d65905b44b44a884cb2", "time": "2026-10-25T01:01:18Z", "core_head": "oracle_release_runtime_w571", "head_probe": { "asked": 2, "core_right": 0, "fillable_declines": 2, "mode": "declines" }, "memory": "written to your group's memory"}1{"t": "2026-10-25T00:56:51Z", "heldout_sha": "6217f3e208a1b7fae99ca0be05856198f68b64a4fa419614045cec6b81f52527", "files_sha": "a269cee765790b16b93b1821f89f4a7c3b86e12dd3c693d81e3e120b6d6e7fbe"}1234567891011121314151617181920212223242526272829303132333435363738394041{ "id": "solved-cross-sectional-area", "name": "Solved: cross-sectional area from molar optical rotatory power, angle of optical rotation, amount of substance (molar optical rotatory power (Wikidata Q96346994))", "sources": [ { "name": "the maths organ: solved from the system q0 = q1*((q2)/(q3)); checked by substitution into every equation and by a numeric solution at 12 points", "licence": "yours" } ], "organ": { "module": "organ_formula_v3", "class": "FormulaOrgan", "init": {} }, "accept": { "kinds": [ "compute" ], "declines_in_domain": [ "missing_input", "out_of_domain" ], "context_regex": "\\bcross\\-sectional\\ area\\b" }, "panel": { "path": "panel.json", "scorer_module": "scorer_formula_v1", "scorer_fn": "ok" }, "budgets": { "latency_p50_ms": 200 }, "notes": "Solved by the maths organ from the system molar optical rotatory power (Wikidata Q96346994): 6 checked points used to write the panel's dev half, 6 its held-out half.", "built_from": { "questions": [ "What is the cross-sectional area for molar optical rotatory power and angle of optical rotation and amount of substance?" ], "gap": "", "node": "hod" }}1234567891011121314151617181920212223242526272829303132333435363738394041424344454647#!/usr/bin/env python3"""narrow_v1 - the shared NARROWING rule for specialist organs (2026-09-29, from the full-core sweep):
WORD PROBLEMS AND NARRATIVE TURNS BELONG TO THE HEAD. An organ answers a direct domain question. A turn that tells a story ("Justine wants to put a deck ...", "A new energy drink advertises 106 calories for 8 ounces ...") or relates quantities to each other ("the length is 9 inches more than the width") is a word problem, which the core's word- problem organ owns; organs firing on its nouns declined it or answered a different question. An organ may DECLINE only a short direct question (it is then refusing the domain question that was asked); on anything longer it says nothing and the head answers.
Narrowing only ever removes turns an organ takes, so on any input where it does not fire, the organ's reply isbyte-identical to the frozen version it wraps (checked per specialist by an invariance count before re-gating)."""import re
RELATION = re.compile(r"\b(?:\d+(?:\.\d+)?|one|two|three|four|five|six|seven|eight|nine|ten)\s+(?:\w+\s+){0,2}(?:more|less|fewer|longer|shorter)\s+than\b|" r"\b(?:twice|three times|half)\s+(?:as\s+\w+\s+as\s+)?the\s+\w+\b", re.I)
# a RATE ("106 calories for 8 ounces", "3 apples per 2 dollars") makes the turn a proportion problemRATE = re.compile(r"\b\d+(?:\.\d+)?\s+[a-z]+\s+(?:for|per|every)\s+(?:\d+(?:\.\d+)?|a|an|one|each)\s+[a-z]+", re.I)NUM = re.compile(r"(?<![\w.])\d+(?:\.\d+)?(?!\w|\.\d)") # "leg is 5." counts: a sentence-final period is not a decimal
def numbers(t): return len(NUM.findall(str(t or "")))
def last_sentence(t): parts = [s for s in re.split(r"(?<=[.!?;])\s+", str(t or "").strip()) if s.strip()] return parts[-1] if parts else ""
def sentences(t): return len([s for s in re.split(r"(?<=[.!?])\s+", str(t or "").strip()) if s.strip()])
def narrative(t): """a story-shaped or relational turn: 3+ sentences, 40+ words, or quantities defined relative to each other""" t = str(t or "") return sentences(t) >= 3 or len(t.split()) > 40 or RELATION.search(t) is not None or RATE.search(t) is not None
def short_direct(t): """a direct question an organ may decline: at most 2 sentences, at most 25 words, not narrative""" t = str(t or "") return sentences(t) <= 2 and len(t.split()) <= 25 and not narrative(t)123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163"""organ_formula_v2 - v1 + a question is declined as missing an input only when it names one of the inputs (v1 declined
"What is the largest living animal species that only eats plants?" for the zodiac program, whose output is "animal":
the gate found the core item made worse, 2026-10-20). A question that names the output and no input is not this
program's, and gets no reply.
v2 also keeps to the DOMAIN of its examples (spec.json "domain", written from the worked examples the composer saw): an
input every example gave as positive (or non-negative) must be so in the question, and an answer whose sign no example's
answer had is not given ("ABV for original gravity 1.010 and final gravity 1.050" would be -5.25): out_of_domain, an
in-domain refusal that says why. A program is evidence for the range its examples span in sign, not beyond.
organ_formula_v1 - the GENERIC FORMULA SPECIALIST: one program the code composer wrote (program.py beside this file) and
the typed signature it was written for (spec.json: the inputs and the output, each a label with an optional unit in
parentheses). Built, not trained; no phrasing templates.
Reading, by role: the output is named in the question (its label; when an input has the same label, the output's unit too,
"in F"); each input is its label with a value right after it ("original gravity 1.055", "age of 25", "f-number = 8") or
right before it ("1.055 original gravity"). A value is a number ("1,000", "0.5", "1/125") or, for an input whose examples
were codes, a token mixing digits and letters ("205/55R16").
compute every input found: "The <output> is <value> <unit>." and the program it came from
missing_input a short direct question names the output but not every input's value: an in-domain refusal naming what
is missing
Narrowing (narrow_v1, the factory's shared rule): story-shaped and relational turns belong to the core; a turn carrying
numbers that no input claims is a different calculation and belongs to the core. Everything else: no reply."""
from __future__ import annotations
import importlib.util
import json
import os
import re
from narrow_v1 import narrative, short_direct
HERE = os.path.dirname(os.path.abspath(__file__))
NUM = r"-?\d[\d,]*(?:\.\d+)?(?:\s*/\s*\d[\d,]*(?:\.\d+)?)?"
CODE = r"[A-Za-z0-9]*\d[A-Za-z0-9]*[/\-][A-Za-z0-9/\-]*\d[A-Za-z0-9]*"
ANYNUM = re.compile(r"(?<![\w/.])-?\d[\d,]*(?:\.\d+)?(?![\w/])")
ASKING = re.compile(r"\?\s*$|^\s*(?:what|which|how|tell me|give me|i need|do you know|could you|can you|if |compute|calculate|"
r"work out|find )", re.I)
LINK = r"\s*(?:of|is|=|:|at|equal to|equals)?\s*(?:a|an|the)?\s*"
def split_label(s):
m = re.match(r"\s*(.*?)\s*(?:\(([^)]*)\))?\s*$", s)
return m.group(1).strip(), (m.group(2) or "").strip()
def label_rx(label):
words = [re.escape(w) for w in re.split(r"[\s]+", label) if w]
return r"(?<![\w-])" + r"[\s-]+".join(words) + r"s?(?![\w-])"
def _val(tok):
tok = tok.replace(",", "").replace(" ", "")
if "/" in tok:
a, b = tok.split("/", 1)
return float(a) / float(b)
return float(tok)
def _in_sign(v, sign):
if isinstance(v, str) or sign == "any":
return True
return v > 0 if sign == "positive" else v >= 0
def sign_of(values):
"""the sign every example gave: "positive", "nonnegative" or "any" (text values: "any")"""
if not values or any(isinstance(v, str) for v in values):
return "any"
if all(v > 0 for v in values):
return "positive"
return "nonnegative" if all(v >= 0 for v in values) else "any"
def _fmt(v):
if isinstance(v, str):
return v
v = float(v)
if v == 0:
return "0"
return ("%.6g" % v) if 1e-3 <= abs(v) < 1e7 else ("%.4g" % v)
class FormulaOrgan:
def __init__(self, spec="spec.json"):
self.spec = json.load(open(os.path.join(HERE, spec), encoding="utf-8"))
loader = importlib.util.spec_from_file_location("composed_program", os.path.join(HERE, "program.py"))
mod = importlib.util.module_from_spec(loader)
loader.loader.exec_module(mod)
self.compute = mod.compute
self.out_label, self.out_unit = split_label(self.spec["output"])
self.ins = [split_label(x) for x in self.spec["inputs"]]
self.kinds = self.spec["input_kinds"] # "number" or "code", from the examples
dom = self.spec.get("domain") or {}
self.in_sign = dom.get("inputs") or ["any"] * len(self.kinds) # "positive", "nonnegative" or "any", per input
self.out_sign = dom.get("output", "any")
collide = any(lab.lower() == self.out_label.lower() for lab, _ in self.ins)
out = label_rx(self.out_label)
if collide and self.out_unit: # "the temperature in F"
out += r"\s+(?:in|to)\s+(?:degrees\s+)?" + re.escape(self.out_unit) + r"(?![\w])"
self.rx_out = re.compile(out, re.I)
self.rx_in = []
for (lab, unit), kind in zip(self.ins, self.kinds):
v = CODE if kind == "code" else NUM
after = re.compile(label_rx(lab) + LINK + r"(" + v + r")(?![\w/])", re.I)
before = re.compile(r"(?<![\w/.])(" + v + r")\s+(?:\w+\s+)?" + label_rx(lab), re.I)
self.rx_in.append((after, before))
def _read(self, t):
spans, vals, missing = [], [], []
out_m = self.rx_out.search(t)
for (lab, _), kind, (after, before) in zip(self.ins, self.kinds, self.rx_in):
got = None
for rx in (after, before):
for m in rx.finditer(t):
if out_m and out_m.start() <= m.start() < out_m.end():
continue # the output's own mention is not an input
if any(a <= m.start(1) < b for a, b in spans):
continue
got = m
break
if got:
break
if not got:
missing.append(lab)
continue
spans.append((got.start(1), got.end(1)))
vals.append(got.group(1) if kind == "code" else _val(got.group(1)))
return vals, missing, spans
def answer(self, text, session_id="default"):
t = re.sub(r"\s+", " ", str(text or "")).strip()
if not self.rx_out.search(t) or narrative(t) or not ASKING.search(t):
return None
vals, missing, spans = self._read(t)
stray = [m for m in ANYNUM.finditer(t) if not any(a <= m.start() < b for a, b in spans)]
if stray: # numbers no input claims: another calculation
return None
if missing:
named = any(re.search(label_rx(lab), t, re.I) for lab, _ in self.ins)
if named and short_direct(t):
return {"kind": "missing_input", "status": "declined",
"response": "To work out the %s I need the %s, and the question doesn't give %s."
% (self.out_label, " and the ".join(missing), "it" if len(missing) == 1 else "them")}
return None
for (lab, _), v, sign in zip(self.ins, vals, self.in_sign):
if not _in_sign(v, sign):
return {"kind": "out_of_domain", "status": "declined",
"response": "Every worked example this program was written from has a %s %s; %s is outside that, so I "
"won't extrapolate." % (sign.replace("nonnegative", "non-negative"), lab, _fmt(v))}
try:
y = self.compute(*vals)
except Exception:
return None
if y is None or (isinstance(y, float) and y != y):
return None
if not _in_sign(y, self.out_sign):
return {"kind": "out_of_domain", "status": "declined",
"response": "That would make the %s %s, and every worked example this program was written from gave a %s "
"one, so I won't give it." % (self.out_label, _fmt(y), self.out_sign.replace("nonnegative", "non-negative"))}
unit =(" " + self.out_unit) if self.out_unit and not isinstance(y, str) else ""
return {"kind": "compute", "status": "answered",
"response": "The %s is %s%s. (A composed program: %s; %s.)" % (self.out_label, _fmt(y), unit,
self.spec["expression"], self.spec["said"])}123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205"""organ_formula_v3 - v2 + the DOMAIN beyond signs (pre-registration v11 part C, 2026-10-21). 4.1 and 4.2 published the limit
"a blood pressure of 70/110 or day 400 of a year is answered". spec.json "domain" now also holds:
order an ordering that holds in EVERY worked example between the numbers of one code input ("120/80": systolic above
diastolic) or between two inputs with the same named unit ("original gravity (SG)" above "final gravity (SG)").
Inputs without a named unit are not ordered: four examples cannot show that a chainring always outnumbers a cog.
facts what the quantity can be, cited: a day of 2025 is a whole number from 1 to 365 (Gregorian calendar, a common year);
a temperature is at or above absolute zero (SI Brochure, 9th edition, 2019: 0 K = -273.15 degC = -459.67 degF);
teeth, integers and years are whole numbers.
An input outside either is out_of_domain, an in-domain refusal that says which rule and why.
organ_formula_v2 (the parent) - v1 + a question is declined as missing an input only when it names one of the inputs (v1 declined
"What is the largest living animal species that only eats plants?" for the zodiac program, whose output is "animal":
the gate found the core item made worse, 2026-10-20). A question that names the output and no input is not this
program's, and gets no reply.
v2 also keeps to the DOMAIN of its examples (spec.json "domain", written from the worked examples the composer saw): an
input every example gave as positive (or non-negative) must be so in the question, and an answer whose sign no example's
answer had is not given ("ABV for original gravity 1.010 and final gravity 1.050" would be -5.25): out_of_domain, an
in-domain refusal that says why. A program is evidence for the range its examples span in sign, not beyond.
organ_formula_v1 - the GENERIC FORMULA SPECIALIST: one program the code composer wrote (program.py beside this file) and
the typed signature it was written for (spec.json: the inputs and the output, each a label with an optional unit in
parentheses). Built, not trained; no phrasing templates.
Reading, by role: the output is named in the question (its label; when an input has the same label, the output's unit too,
"in F"); each input is its label with a value right after it ("original gravity 1.055", "age of 25", "f-number = 8") or
right before it ("1.055 original gravity"). A value is a number ("1,000", "0.5", "1/125") or, for an input whose examples
were codes, a token mixing digits and letters ("205/55R16").
compute every input found: "The <output> is <value> <unit>." and the program it came from
missing_input a short direct question names the output but not every input's value: an in-domain refusal naming what
is missing
Narrowing (narrow_v1, the factory's shared rule): story-shaped and relational turns belong to the core; a turn carrying
numbers that no input claims is a different calculation and belongs to the core. Everything else: no reply."""
from __future__ import annotations
import importlib.util
import json
import os
import re
from narrow_v1 import narrative, short_direct
HERE = os.path.dirname(os.path.abspath(__file__))
NUM = r"-?\d[\d,]*(?:\.\d+)?(?:\s*/\s*\d[\d,]*(?:\.\d+)?)?"
CODE = r"[A-Za-z0-9]*\d[A-Za-z0-9]*[/\-][A-Za-z0-9/\-]*\d[A-Za-z0-9]*"
ANYNUM = re.compile(r"(?<![\w/.])-?\d[\d,]*(?:\.\d+)?(?![\w/])")
ASKING = re.compile(r"\?\s*$|^\s*(?:what|which|how|tell me|give me|i need|do you know|could you|can you|if |compute|calculate|"
r"work out|find )", re.I)
LINK = r"\s*(?:of|is|=|:|at|equal to|equals)?\s*(?:a|an|the)?\s*"
def split_label(s):
m = re.match(r"\s*(.*?)\s*(?:\(([^)]*)\))?\s*$", s)
return m.group(1).strip(), (m.group(2) or "").strip()
def label_rx(label):
words = [re.escape(w) for w in re.split(r"[\s]+", label) if w]
return r"(?<![\w-])" + r"[\s-]+".join(words) + r"s?(?![\w-])"
def _val(tok):
tok = tok.replace(",", "").replace(" ", "")
if "/" in tok:
a, b = tok.split("/", 1)
return float(a) / float(b)
return float(tok)
def _in_sign(v, sign):
if isinstance(v, str) or sign == "any":
return True
return v > 0 if sign == "positive" else v >= 0
def sign_of(values):
"""the sign every example gave: "positive", "nonnegative" or "any" (text values: "any")"""
if not values or any(isinstance(v, str) for v in values):
return "any"
if all(v > 0 for v in values):
return "positive"
return "nonnegative" if all(v >= 0 for v in values) else "any"
def _fmt(v):
if isinstance(v, str):
return v
v = float(v)
if v == 0:
return "0"
return ("%.6g" % v) if 1e-3 <= abs(v) < 1e7 else ("%.4g" % v)
class FormulaOrgan:
def __init__(self, spec="spec.json"):
self.spec = json.load(open(os.path.join(HERE, spec), encoding="utf-8"))
loader = importlib.util.spec_from_file_location("composed_program", os.path.join(HERE, "program.py"))
mod = importlib.util.module_from_spec(loader)
loader.loader.exec_module(mod)
self.compute = mod.compute
self.out_label, self.out_unit = split_label(self.spec["output"])
self.ins = [split_label(x) for x in self.spec["inputs"]]
self.kinds = self.spec["input_kinds"] # "number" or "code", from the examples
dom = self.spec.get("domain") or {}
self.in_sign = dom.get("inputs") or ["any"] * len(self.kinds) # "positive", "nonnegative" or "any", per input
self.out_sign = dom.get("output", "any")
collide = any(lab.lower() == self.out_label.lower() for lab, _ in self.ins)
out = label_rx(self.out_label)
if collide and self.out_unit: # "the temperature in F"
out += r"\s+(?:in|to)\s+(?:degrees\s+)?" + re.escape(self.out_unit) + r"(?![\w])"
self.rx_out = re.compile(out, re.I)
self.rx_in = []
for (lab, unit), kind in zip(self.ins, self.kinds):
v = CODE if kind == "code" else NUM
after = re.compile(label_rx(lab) + LINK + r"(" + v + r")(?![\w/])", re.I)
before = re.compile(r"(?<![\w/.])(" + v + r")\s+(?:\w+\s+)?" + label_rx(lab), re.I)
self.rx_in.append((after, before))
def _read(self, t):
spans, vals, missing = [], [], []
out_m = self.rx_out.search(t)
for (lab, _), kind, (after, before) in zip(self.ins, self.kinds, self.rx_in):
got = None
for rx in (after, before):
for m in rx.finditer(t):
if out_m and out_m.start() <= m.start() < out_m.end():
continue # the output's own mention is not an input
if any(a <= m.start(1) < b for a, b in spans):
continue
got = m
break
if got:
break
if not got:
missing.append(lab)
continue
spans.append((got.start(1), got.end(1)))
vals.append(got.group(1) if kind == "code" else _val(got.group(1)))
return vals, missing, spans
def _components(self, vals):
"""every number the inputs give, keyed (input, k): a code input gives its numbers in order ("120/80" -> 120, 80)"""
out = {}
for i, (v, kind) in enumerate(zip(vals, self.kinds)):
if kind == "code":
for k, x in enumerate(re.findall(r"\d+(?:\.\d+)?", str(v))):
out[(i, k)] = float(x)
elif not isinstance(v, str):
out[(i, 0)] = float(v)
return out
def _domain_v3(self, vals):
dom = self.spec.get("domain") or {}
comp = self._components(vals)
for o in dom.get("order") or []:
a, b = tuple(o["greater"]), tuple(o["lesser"])
if a in comp and b in comp and not comp[a] > comp[b]:
return ("In every worked example this program was written from, the %s is greater than the %s; here it is not "
"(%s and %s), so it is not a reading I can work from." % (o["greater_name"], o["lesser_name"],
_fmt(comp[a]), _fmt(comp[b])))
for f in dom.get("facts") or []:
x = comp.get((f["input"], 0))
if x is None:
continue
bad = (f.get("integer") and x != int(x)) or ("min" in f and x < f["min"]) or ("max" in f and x > f["max"])
if bad:
return "%s is not a possible %s: %s. So I won't compute it." % (_fmt(x), f["name"], f["why"])
return None
def answer(self, text, session_id="default"):
t = re.sub(r"\s+", " ", str(text or "")).strip()
if not self.rx_out.search(t) or narrative(t) or not ASKING.search(t):
return None
vals, missing, spans = self._read(t)
stray = [m for m in ANYNUM.finditer(t) if not any(a <= m.start() < b for a, b in spans)]
if stray: # numbers no input claims: another calculation
return None
if missing:
named = any(re.search(label_rx(lab), t, re.I) for lab, _ in self.ins)
if named and short_direct(t):
return {"kind": "missing_input", "status": "declined",
"response": "To work out the %s I need the %s, and the question doesn't give %s."
% (self.out_label, " and the ".join(missing), "it" if len(missing) == 1 else "them")}
return None
for (lab, _), v, sign in zip(self.ins, vals, self.in_sign):
if not _in_sign(v, sign):
return {"kind": "out_of_domain", "status": "declined",
"response": "Every worked example this program was written from has a %s %s; %s is outside that, so I "
"won't extrapolate." % (sign.replace("nonnegative", "non-negative"), lab, _fmt(v))}
refused = self._domain_v3(vals)
if refused:
return {"kind": "out_of_domain", "status": "declined", "response": refused}
try:
y = self.compute(*vals)
except Exception:
return None
if y is None or (isinstance(y, float) and y != y):
return None
if not _in_sign(y, self.out_sign):
return {"kind": "out_of_domain", "status": "declined",
"response": "That would make the %s %s, and every worked example this program was written from gave a %s "
"one, so I won't give it." % (self.out_label, _fmt(y), self.out_sign.replace("nonnegative", "non-negative"))}
unit =(" " + self.out_unit) if self.out_unit and not isinstance(y, str) else ""
return {"kind": "compute", "status": "answered",
"response": "The %s is %s%s. (A composed program: %s; %s.)" % (self.out_label, _fmt(y), unit,
self.spec["expression"], self.spec["said"])}123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366{ "dev": [ { "q": "What is the cross-sectional area for molar optical rotatory power 107.961, angle of optical rotation 59.4105 and amount of substance 5.77717?", "a": "10.498254293702432", "valid": true, "kind": "compute", "expect": 10.498254293702432, "dtype": "quantity", "unit": "m^2", "why": "cross-sectional area for [107.960666, 59.4105, 5.777165] (the system molar optical rotatory power (Wikidata Q96346994))" }, { "q": "Tell me the cross-sectional area with molar optical rotatory power of 107.961, angle of optical rotation of 59.4105 and amount of substance of 5.77717.", "a": "10.498254293702432", "valid": true, "kind": "compute", "expect": 10.498254293702432, "dtype": "quantity", "unit": "m^2", "why": "cross-sectional area for [107.960666, 59.4105, 5.777165] (the system molar optical rotatory power (Wikidata Q96346994))" }, { "q": "What is the cross-sectional area for molar optical rotatory power 85.2416, angle of optical rotation 160.878 and amount of substance 2.69428?", "a": "1.4275672119863798", "valid": true, "kind": "compute", "expect": 1.4275672119863798, "dtype": "quantity", "unit": "m^2", "why": "cross-sectional area for [85.241623, 160.878442, 2.69428] (the system molar optical rotatory power (Wikidata Q96346994))" }, { "q": "Tell me the cross-sectional area with molar optical rotatory power of 85.2416, angle of optical rotation of 160.878 and amount of substance of 2.69428.", "a": "1.4275672119863798", "valid": true, "kind": "compute", "expect": 1.4275672119863798, "dtype": "quantity", "unit": "m^2", "why": "cross-sectional area for [85.241623, 160.878442, 2.69428] (the system molar optical rotatory power (Wikidata Q96346994))" }, { "q": "What is the cross-sectional area for molar optical rotatory power 45.6157, angle of optical rotation 4.97131 and amount of substance 94.305?", "a": "865.3232325447225", "valid": true, "kind": "compute", "expect": 865.3232325447225, "dtype": "quantity", "unit": "m^2", "why": "cross-sectional area for [45.61567, 4.971307, 94.305046] (the system molar optical rotatory power (Wikidata Q96346994))" }, { "q": "Tell me the cross-sectional area with molar optical rotatory power of 45.6157, angle of optical rotation of 4.97131 and amount of substance of 94.305.", "a": "865.3232325447225", "valid": true, "kind": "compute", "expect": 865.3232325447225, "dtype": "quantity", "unit": "m^2", "why": "cross-sectional area for [45.61567, 4.971307, 94.305046] (the system molar optical rotatory power (Wikidata Q96346994))" }, { "q": "What is the cross-sectional area for molar optical rotatory power 10.5638, angle of optical rotation 198.839 and amount of substance 0.671697?", "a": "0.03568568130708054", "valid": true, "kind": "compute", "expect": 0.03568568130708054, "dtype": "quantity", "unit": "m^2", "why": "cross-sectional area for [10.563843, 198.838955, 0.671697] (the system molar optical rotatory power (Wikidata Q96346994))" }, { "q": "Tell me the cross-sectional area with molar optical rotatory power of 10.5638, angle of optical rotation of 198.839 and amount of substance of 0.671697.", "a": "0.03568568130708054", "valid": true, "kind": "compute", "expect": 0.03568568130708054, "dtype": "quantity", "unit": "m^2", "why": "cross-sectional area for [10.563843, 198.838955, 0.671697] (the system molar optical rotatory power (Wikidata Q96346994))" }, { "q": "What is the cross-sectional area for molar optical rotatory power 21.7931, angle of optical rotation 29.5106 and amount of substance 8.50341?", "a": "6.279634237980215", "valid": true, "kind": "compute", "expect": 6.279634237980215, "dtype": "quantity", "unit": "m^2", "why": "cross-sectional area for [21.793126, 29.510609, 8.503407] (the system molar optical rotatory power (Wikidata Q96346994))" }, { "q": "Tell me the cross-sectional area with molar optical rotatory power of 21.7931, angle of optical rotation of 29.5106 and amount of substance of 8.50341.", "a": "6.279634237980215", "valid": true, "kind": "compute", "expect": 6.279634237980215, "dtype": "quantity", "unit": "m^2", "why": "cross-sectional area for [21.793126, 29.510609, 8.503407] (the system molar optical rotatory power (Wikidata Q96346994))" }, { "q": "What is the cross-sectional area for molar optical rotatory power 223.509, angle of optical rotation 17.3414 and amount of substance 7.10705?", "a": "91.60072422473009", "valid": true, "kind": "compute", "expect": 91.60072422473009, "dtype": "quantity", "unit": "m^2", "why": "cross-sectional area for [223.508796, 17.341435, 7.107049] (the system molar optical rotatory power (Wikidata Q96346994))" }, { "q": "Tell me the cross-sectional area with molar optical rotatory power of 223.509, angle of optical rotation of 17.3414 and amount of substance of 7.10705.", "a": "91.60072422473009", "valid": true, "kind": "compute", "expect": 91.60072422473009, "dtype": "quantity", "unit": "m^2", "why": "cross-sectional area for [223.508796, 17.341435, 7.107049] (the system molar optical rotatory power (Wikidata Q96346994))" }, { "q": "What is the cross-sectional area for molar optical rotatory power 107.961 and angle of optical rotation 59.4105?", "a": "", "valid": false, "kind": "missing_input", "expect": null, "dtype": "quantity", "unit": "", "why": "the amount of substance is not given" }, { "q": "Tell me the cross-sectional area with molar optical rotatory power of 85.2416 and angle of optical rotation of 160.878.", "a": "", "valid": false, "kind": "missing_input", "expect": null, "dtype": "quantity", "unit": "", "why": "the amount of substance is not given" }, { "q": "What is the cross-sectional area of the Eiffel Tower?", "a": "", "valid": false, "kind": "not_held", "expect": null, "dtype": "quantity", "unit": "", "why": "a named thing, not inputs: a lookup the program cannot do" }, { "q": "What is the cross-sectional area of Mount Everest?", "a": "", "valid": false, "kind": "not_held", "expect": null, "dtype": "quantity", "unit": "", "why": "a named thing, not inputs: a lookup the program cannot do" }, { "q": "Tell me the cross-sectional area with molar optical rotatory power of -45.6157, angle of optical rotation of 4.97131 and amount of substance of 94.305.", "a": "", "valid": false, "kind": "out_of_domain", "expect": null, "dtype": "quantity", "unit": "", "why": "a negative molar optical rotatory power: no example had one" }, { "q": "Which cross-sectional area is the most common?", "a": "", "valid": false, "kind": "output_only", "expect": null, "dtype": "quantity", "unit": "", "why": "names the output and no input: not this program's" } ], "heldout": [ { "q": "If the molar optical rotatory power is 17.7888, angle of optical rotation is 167.625 and the amount of substance is 10.3291, what is the cross-sectional area?", "a": "1.0961450581531387", "valid": true, "kind": "compute", "expect": 1.0961450581531387, "dtype": "quantity", "unit": "m^2", "why": "cross-sectional area for [17.788778, 167.624948, 10.329054] (the system molar optical rotatory power (Wikidata Q96346994))" }, { "q": "Could you work out the cross-sectional area given molar optical rotatory power = 17.7888, angle of optical rotation = 167.625, amount of substance = 10.3291?", "a": "1.0961450581531387", "valid": true, "kind": "compute", "expect": 1.0961450581531387, "dtype": "quantity", "unit": "m^2", "why": "cross-sectional area for [17.788778, 167.624948, 10.329054] (the system molar optical rotatory power (Wikidata Q96346994))" }, { "q": "I need the cross-sectional area for a molar optical rotatory power of 21.511, an angle of optical rotation of 173.394 and an amount of substance of 251.084, please.", "a": "31.149197612202414", "valid": true, "kind": "compute", "expect": 31.149197612202414, "dtype": "quantity", "unit": "m^2", "why": "cross-sectional area for [21.511016, 173.393638, 251.084037] (the system molar optical rotatory power (Wikidata Q96346994))" }, { "q": "If the molar optical rotatory power is 21.511, angle of optical rotation is 173.394 and the amount of substance is 251.084, what is the cross-sectional area?", "a": "31.149197612202414", "valid": true, "kind": "compute", "expect": 31.149197612202414, "dtype": "quantity", "unit": "m^2", "why": "cross-sectional area for [21.511016, 173.393638, 251.084037] (the system molar optical rotatory power (Wikidata Q96346994))" }, { "q": "Could you work out the cross-sectional area given molar optical rotatory power = 129.245, angle of optical rotation = 1.18359, amount of substance = 15.9416?", "a": "1740.7830274187056", "valid": true, "kind": "compute", "expect": 1740.7830274187056, "dtype": "quantity", "unit": "m^2", "why": "cross-sectional area for [129.244984, 1.18359, 15.941612] (the system molar optical rotatory power (Wikidata Q96346994))" }, { "q": "I need the cross-sectional area for a molar optical rotatory power of 129.245, an angle of optical rotation of 1.18359 and an amount of substance of 15.9416, please.", "a": "1740.7830274187056", "valid": true, "kind": "compute", "expect": 1740.7830274187056, "dtype": "quantity", "unit": "m^2", "why": "cross-sectional area for [129.244984, 1.18359, 15.941612] (the system molar optical rotatory power (Wikidata Q96346994))" }, { "q": "If the molar optical rotatory power is 20.3966, angle of optical rotation is 18.3169 and the amount of substance is 6.8386, what is the cross-sectional area?", "a": "7.615050191987504", "valid": true, "kind": "compute", "expect": 7.615050191987504, "dtype": "quantity", "unit": "m^2", "why": "cross-sectional area for [20.396558, 18.316867, 6.838598] (the system molar optical rotatory power (Wikidata Q96346994))" }, { "q": "Could you work out the cross-sectional area given molar optical rotatory power = 20.3966, angle of optical rotation = 18.3169, amount of substance = 6.8386?", "a": "7.615050191987504", "valid": true, "kind": "compute", "expect": 7.615050191987504, "dtype": "quantity", "unit": "m^2", "why": "cross-sectional area for [20.396558, 18.316867, 6.838598] (the system molar optical rotatory power (Wikidata Q96346994))" }, { "q": "I need the cross-sectional area for a molar optical rotatory power of 185.886, an angle of optical rotation of 13.2373 and an amount of substance of 4.71941, please.", "a": "66.27285731134774", "valid": true, "kind": "compute", "expect": 66.27285731134774, "dtype": "quantity", "unit": "m^2", "why": "cross-sectional area for [185.886273, 13.237311, 4.719415] (the system molar optical rotatory power (Wikidata Q96346994))" }, { "q": "If the molar optical rotatory power is 185.886, angle of optical rotation is 13.2373 and the amount of substance is 4.71941, what is the cross-sectional area?", "a": "66.27285731134774", "valid": true, "kind": "compute", "expect": 66.27285731134774, "dtype": "quantity", "unit": "m^2", "why": "cross-sectional area for [185.886273, 13.237311, 4.719415] (the system molar optical rotatory power (Wikidata Q96346994))" }, { "q": "Could you work out the cross-sectional area given molar optical rotatory power = 9.1061, angle of optical rotation = 24.5721, amount of substance = 108.451?", "a": "40.19049097830896", "valid": true, "kind": "compute", "expect": 40.19049097830896, "dtype": "quantity", "unit": "m^2", "why": "cross-sectional area for [9.106104, 24.572086, 108.450792] (the system molar optical rotatory power (Wikidata Q96346994))" }, { "q": "I need the cross-sectional area for a molar optical rotatory power of 9.1061, an angle of optical rotation of 24.5721 and an amount of substance of 108.451, please.", "a": "40.19049097830896", "valid": true, "kind": "compute", "expect": 40.19049097830896, "dtype": "quantity", "unit": "m^2", "why": "cross-sectional area for [9.106104, 24.572086, 108.450792] (the system molar optical rotatory power (Wikidata Q96346994))" }, { "q": "If the molar optical rotatory power is 17.7888 and the angle of optical rotation is 167.625, what is the cross-sectional area?", "a": "", "valid": false, "kind": "missing_input", "expect": null, "dtype": "quantity", "unit": "", "why": "the amount of substance is not given" }, { "q": "Could you work out the cross-sectional area given molar optical rotatory power = 21.511, angle of optical rotation = 173.394?", "a": "", "valid": false, "kind": "missing_input", "expect": null, "dtype": "quantity", "unit": "", "why": "the amount of substance is not given" }, { "q": "Do you know the cross-sectional area of a violin?", "a": "", "valid": false, "kind": "not_held", "expect": null, "dtype": "quantity", "unit": "", "why": "a named thing, not inputs: a lookup the program cannot do" }, { "q": "Do you know the cross-sectional area of the French Revolution?", "a": "", "valid": false, "kind": "not_held", "expect": null, "dtype": "quantity", "unit": "", "why": "a named thing, not inputs: a lookup the program cannot do" }, { "q": "Could you work out the cross-sectional area given molar optical rotatory power = -129.245, angle of optical rotation = 1.18359, amount of substance = 15.9416?", "a": "", "valid": false, "kind": "out_of_domain", "expect": null, "dtype": "quantity", "unit": "", "why": "a negative molar optical rotatory power: no example had one" }, { "q": "What is a typical cross-sectional area?", "a": "", "valid": false, "kind": "output_only", "expect": null, "dtype": "quantity", "unit": "", "why": "names the output and no input: not this program's" } ]}1234567"""cross-sectional area from molar optical rotatory power, angle of optical rotation, amount of substance (molar optical rotatory power (Wikidata Q96346994))The maths organ (systems.py): solved from the system q0 = q1*((q2)/(q3)); checked by substitution into every equation and by a numeric solution at 12 points"""import math
def compute(molar_optical_rotatory_power, angle_of_optical_rotation, amount_of_substance): return 1.0*amount_of_substance*molar_optical_rotatory_power/angle_of_optical_rotation12345678910111213141516171819202122232425262728293031"""scorer_formula_v1 - scorer for composed formula specialists: (good, asserted).A must-decline item answered is a false yes. A valid quantity item is right when the FIRST number in the reply (theanswer, before any working) is within 0.5% of the sealed answer; a valid text item is right when the answer appears in thereply as a whole word, exactly as written."""import re
def _first_num(text): m = re.search(r"-?\d[\d,]*(?:\.\d+)?(?:[eE][+-]?\d+)?", text) if not m: return None try: return float(m.group(0).replace(",", "")) except ValueError: return None
def ok(p, r): r = r or {} text = str(r.get("response", "")) answered = str(r.get("status", "")) == "answered" if not p["valid"]: return (not answered), answered if not answered: return False, False if p.get("dtype") == "quantity": want, got = float(p["expect"]), _first_num(text) if got is None: return False, True return abs(got - want) <= (0.005 * abs(want) if want else 0.005), True return re.search(r"(?<![\w])%s(?![\w])" % re.escape(str(p["expect"])), text) is not None, True123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145{ "title": "cross-sectional area from molar optical rotatory power, angle of optical rotation, amount of substance (molar optical rotatory power (Wikidata Q96346994))", "inputs": [ "molar optical rotatory power (m^2/mol)", "angle of optical rotation (1)", "amount of substance (mol)" ], "output": "cross-sectional area (m^2)", "input_kinds": [ "number", "number", "number" ], "expression": "1.0*q0*q3/q1", "expression_x": null, "said": "solved from the system q0 = q1*((q2)/(q3)); checked by substitution into every equation and by a numeric solution at 12 points", "composer": "systems (the maths organ)", "library": [], "system": { "equations": [ "q0 = q1*((q2)/(q3))" ], "constants": {}, "quantities": { "q0": "molar optical rotatory power (m^2/mol)", "q1": "angle of optical rotation (1)", "q2": "cross-sectional area (m^2)", "q3": "amount of substance (mol)" }, "symbols": [ "q0", "q1", "q3" ], "out_symbol": "q2" }, "points": [ { "in": [ 107.960666, 59.4105, 5.777165 ], "out": 10.498254293702432 }, { "in": [ 17.788778, 167.624948, 10.329054 ], "out": 1.0961450581531387 }, { "in": [ 85.241623, 160.878442, 2.69428 ], "out": 1.4275672119863798 }, { "in": [ 21.511016, 173.393638, 251.084037 ], "out": 31.149197612202414 }, { "in": [ 45.61567, 4.971307, 94.305046 ], "out": 865.3232325447225 }, { "in": [ 129.244984, 1.18359, 15.941612 ], "out": 1740.7830274187056 }, { "in": [ 10.563843, 198.838955, 0.671697 ], "out": 0.03568568130708054 }, { "in": [ 20.396558, 18.316867, 6.838598 ], "out": 7.615050191987504 }, { "in": [ 21.793126, 29.510609, 8.503407 ], "out": 6.279634237980215 }, { "in": [ 185.886273, 13.237311, 4.719415 ], "out": 66.27285731134774 }, { "in": [ 223.508796, 17.341435, 7.107049 ], "out": 91.60072422473009 }, { "in": [ 9.106104, 24.572086, 108.450792 ], "out": 40.19049097830896 } ], "domain": { "inputs": [ "positive", "positive", "positive" ], "output": "positive", "order": [], "facts": [] }}1234567891011121314151617181920212223242526272829303132333435363738{ "id": "solved-cross-sectional-area", "split": "dev", "decision": "WOULD PASS", "reasons": [], "n": 18, "head": { "ok": 6, "fy": 0, "wrong": 0 }, "with_specialist": { "ok": 18, "fy": 0, "wrong": 0 }, "gain_needed": 3, "core": { "n": 924, "taken": 0, "cap": 9, "examples": [] }, "self_ok": true, "p50_ms": 0.01, "budget_ms": 200.0, "fails": [], "files_sha": "a269cee765790b16b93b1821f89f4a7c3b86e12dd3c693d81e3e120b6d6e7fbe", "panel_sha": "b298ac85d541d80fad1478c7983f252e64464e679267a3afa5a33de1077fe1eb", "time": "2026-10-25T00:56:51Z", "core_head": "oracle_release_runtime_w571", "head_probe": { "asked": 2, "core_right": 0, "fillable_declines": 2, "mode": "declines" }}123456789101112131415161718192021222324252627282930313233343536373839{ "id": "solved-cross-sectional-area", "split": "heldout", "decision": "ADMIT", "reasons": [], "n": 18, "head": { "ok": 6, "fy": 0, "wrong": 0 }, "with_specialist": { "ok": 18, "fy": 0, "wrong": 0 }, "gain_needed": 3, "core": { "n": 924, "taken": 0, "cap": 9, "examples": [] }, "self_ok": true, "p50_ms": 0.01, "budget_ms": 200.0, "fails": [], "files_sha": "a269cee765790b16b93b1821f89f4a7c3b86e12dd3c693d81e3e120b6d6e7fbe", "panel_sha": "6217f3e208a1b7fae99ca0be05856198f68b64a4fa419614045cec6b81f52527", "time": "2026-10-25T00:56:51Z", "core_head": "oracle_release_runtime_w571", "head_probe": { "asked": 2, "core_right": 0, "fillable_declines": 2, "mode": "declines" }, "memory": "written to your group's memory"}1{"t": "2026-10-24T00:17:58Z", "heldout_sha": "345658eb273c71a3412ecd4c911baf41a37aa971cab00c6621300d1b0f35aa6f", "files_sha": "a5f8a9920a5cec538005300ba3efbed4c4616a4e4db80b690b35d86e43aaab84"}1234567891011121314151617181920212223242526272829303132333435363738394041{ "id": "solved-current-2", "name": "Solved: current from power, voltage (Electric power)", "sources": [ { "name": "the maths organ: solved from the system P = U*I; checked by substitution into every equation and by a numeric solution at 12 points", "licence": "yours" } ], "organ": { "module": "organ_formula_v3", "class": "FormulaOrgan", "init": {} }, "accept": { "kinds": [ "compute" ], "declines_in_domain": [ "missing_input", "out_of_domain" ], "context_regex": "\\bcurrent\\b" }, "panel": { "path": "panel.json", "scorer_module": "scorer_formula_v1", "scorer_fn": "ok" }, "budgets": { "latency_p50_ms": 200 }, "notes": "Solved by the maths organ from the system Electric power: 6 checked points used to write the panel's dev half, 6 its held-out half.", "built_from": { "questions": [ "What is the current for power and voltage?" ], "gap": "", "node": "hod" }}1234567891011121314151617181920212223242526272829303132333435363738394041424344454647#!/usr/bin/env python3"""narrow_v1 - the shared NARROWING rule for specialist organs (2026-09-29, from the full-core sweep):
WORD PROBLEMS AND NARRATIVE TURNS BELONG TO THE HEAD. An organ answers a direct domain question. A turn that tells a story ("Justine wants to put a deck ...", "A new energy drink advertises 106 calories for 8 ounces ...") or relates quantities to each other ("the length is 9 inches more than the width") is a word problem, which the core's word- problem organ owns; organs firing on its nouns declined it or answered a different question. An organ may DECLINE only a short direct question (it is then refusing the domain question that was asked); on anything longer it says nothing and the head answers.
Narrowing only ever removes turns an organ takes, so on any input where it does not fire, the organ's reply isbyte-identical to the frozen version it wraps (checked per specialist by an invariance count before re-gating)."""import re
RELATION = re.compile(r"\b(?:\d+(?:\.\d+)?|one|two|three|four|five|six|seven|eight|nine|ten)\s+(?:\w+\s+){0,2}(?:more|less|fewer|longer|shorter)\s+than\b|" r"\b(?:twice|three times|half)\s+(?:as\s+\w+\s+as\s+)?the\s+\w+\b", re.I)
# a RATE ("106 calories for 8 ounces", "3 apples per 2 dollars") makes the turn a proportion problemRATE = re.compile(r"\b\d+(?:\.\d+)?\s+[a-z]+\s+(?:for|per|every)\s+(?:\d+(?:\.\d+)?|a|an|one|each)\s+[a-z]+", re.I)NUM = re.compile(r"(?<![\w.])\d+(?:\.\d+)?(?!\w|\.\d)") # "leg is 5." counts: a sentence-final period is not a decimal
def numbers(t): return len(NUM.findall(str(t or "")))
def last_sentence(t): parts = [s for s in re.split(r"(?<=[.!?;])\s+", str(t or "").strip()) if s.strip()] return parts[-1] if parts else ""
def sentences(t): return len([s for s in re.split(r"(?<=[.!?])\s+", str(t or "").strip()) if s.strip()])
def narrative(t): """a story-shaped or relational turn: 3+ sentences, 40+ words, or quantities defined relative to each other""" t = str(t or "") return sentences(t) >= 3 or len(t.split()) > 40 or RELATION.search(t) is not None or RATE.search(t) is not None
def short_direct(t): """a direct question an organ may decline: at most 2 sentences, at most 25 words, not narrative""" t = str(t or "") return sentences(t) <= 2 and len(t.split()) <= 25 and not narrative(t)123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163"""organ_formula_v2 - v1 + a question is declined as missing an input only when it names one of the inputs (v1 declined
"What is the largest living animal species that only eats plants?" for the zodiac program, whose output is "animal":
the gate found the core item made worse, 2026-10-20). A question that names the output and no input is not this
program's, and gets no reply.
v2 also keeps to the DOMAIN of its examples (spec.json "domain", written from the worked examples the composer saw): an
input every example gave as positive (or non-negative) must be so in the question, and an answer whose sign no example's
answer had is not given ("ABV for original gravity 1.010 and final gravity 1.050" would be -5.25): out_of_domain, an
in-domain refusal that says why. A program is evidence for the range its examples span in sign, not beyond.
organ_formula_v1 - the GENERIC FORMULA SPECIALIST: one program the code composer wrote (program.py beside this file) and
the typed signature it was written for (spec.json: the inputs and the output, each a label with an optional unit in
parentheses). Built, not trained; no phrasing templates.
Reading, by role: the output is named in the question (its label; when an input has the same label, the output's unit too,
"in F"); each input is its label with a value right after it ("original gravity 1.055", "age of 25", "f-number = 8") or
right before it ("1.055 original gravity"). A value is a number ("1,000", "0.5", "1/125") or, for an input whose examples
were codes, a token mixing digits and letters ("205/55R16").
compute every input found: "The <output> is <value> <unit>." and the program it came from
missing_input a short direct question names the output but not every input's value: an in-domain refusal naming what
is missing
Narrowing (narrow_v1, the factory's shared rule): story-shaped and relational turns belong to the core; a turn carrying
numbers that no input claims is a different calculation and belongs to the core. Everything else: no reply."""
from __future__ import annotations
import importlib.util
import json
import os
import re
from narrow_v1 import narrative, short_direct
HERE = os.path.dirname(os.path.abspath(__file__))
NUM = r"-?\d[\d,]*(?:\.\d+)?(?:\s*/\s*\d[\d,]*(?:\.\d+)?)?"
CODE = r"[A-Za-z0-9]*\d[A-Za-z0-9]*[/\-][A-Za-z0-9/\-]*\d[A-Za-z0-9]*"
ANYNUM = re.compile(r"(?<![\w/.])-?\d[\d,]*(?:\.\d+)?(?![\w/])")
ASKING = re.compile(r"\?\s*$|^\s*(?:what|which|how|tell me|give me|i need|do you know|could you|can you|if |compute|calculate|"
r"work out|find )", re.I)
LINK = r"\s*(?:of|is|=|:|at|equal to|equals)?\s*(?:a|an|the)?\s*"
def split_label(s):
m = re.match(r"\s*(.*?)\s*(?:\(([^)]*)\))?\s*$", s)
return m.group(1).strip(), (m.group(2) or "").strip()
def label_rx(label):
words = [re.escape(w) for w in re.split(r"[\s]+", label) if w]
return r"(?<![\w-])" + r"[\s-]+".join(words) + r"s?(?![\w-])"
def _val(tok):
tok = tok.replace(",", "").replace(" ", "")
if "/" in tok:
a, b = tok.split("/", 1)
return float(a) / float(b)
return float(tok)
def _in_sign(v, sign):
if isinstance(v, str) or sign == "any":
return True
return v > 0 if sign == "positive" else v >= 0
def sign_of(values):
"""the sign every example gave: "positive", "nonnegative" or "any" (text values: "any")"""
if not values or any(isinstance(v, str) for v in values):
return "any"
if all(v > 0 for v in values):
return "positive"
return "nonnegative" if all(v >= 0 for v in values) else "any"
def _fmt(v):
if isinstance(v, str):
return v
v = float(v)
if v == 0:
return "0"
return ("%.6g" % v) if 1e-3 <= abs(v) < 1e7 else ("%.4g" % v)
class FormulaOrgan:
def __init__(self, spec="spec.json"):
self.spec = json.load(open(os.path.join(HERE, spec), encoding="utf-8"))
loader = importlib.util.spec_from_file_location("composed_program", os.path.join(HERE, "program.py"))
mod = importlib.util.module_from_spec(loader)
loader.loader.exec_module(mod)
self.compute = mod.compute
self.out_label, self.out_unit = split_label(self.spec["output"])
self.ins = [split_label(x) for x in self.spec["inputs"]]
self.kinds = self.spec["input_kinds"] # "number" or "code", from the examples
dom = self.spec.get("domain") or {}
self.in_sign = dom.get("inputs") or ["any"] * len(self.kinds) # "positive", "nonnegative" or "any", per input
self.out_sign = dom.get("output", "any")
collide = any(lab.lower() == self.out_label.lower() for lab, _ in self.ins)
out = label_rx(self.out_label)
if collide and self.out_unit: # "the temperature in F"
out += r"\s+(?:in|to)\s+(?:degrees\s+)?" + re.escape(self.out_unit) + r"(?![\w])"
self.rx_out = re.compile(out, re.I)
self.rx_in = []
for (lab, unit), kind in zip(self.ins, self.kinds):
v = CODE if kind == "code" else NUM
after = re.compile(label_rx(lab) + LINK + r"(" + v + r")(?![\w/])", re.I)
before = re.compile(r"(?<![\w/.])(" + v + r")\s+(?:\w+\s+)?" + label_rx(lab), re.I)
self.rx_in.append((after, before))
def _read(self, t):
spans, vals, missing = [], [], []
out_m = self.rx_out.search(t)
for (lab, _), kind, (after, before) in zip(self.ins, self.kinds, self.rx_in):
got = None
for rx in (after, before):
for m in rx.finditer(t):
if out_m and out_m.start() <= m.start() < out_m.end():
continue # the output's own mention is not an input
if any(a <= m.start(1) < b for a, b in spans):
continue
got = m
break
if got:
break
if not got:
missing.append(lab)
continue
spans.append((got.start(1), got.end(1)))
vals.append(got.group(1) if kind == "code" else _val(got.group(1)))
return vals, missing, spans
def answer(self, text, session_id="default"):
t = re.sub(r"\s+", " ", str(text or "")).strip()
if not self.rx_out.search(t) or narrative(t) or not ASKING.search(t):
return None
vals, missing, spans = self._read(t)
stray = [m for m in ANYNUM.finditer(t) if not any(a <= m.start() < b for a, b in spans)]
if stray: # numbers no input claims: another calculation
return None
if missing:
named = any(re.search(label_rx(lab), t, re.I) for lab, _ in self.ins)
if named and short_direct(t):
return {"kind": "missing_input", "status": "declined",
"response": "To work out the %s I need the %s, and the question doesn't give %s."
% (self.out_label, " and the ".join(missing), "it" if len(missing) == 1 else "them")}
return None
for (lab, _), v, sign in zip(self.ins, vals, self.in_sign):
if not _in_sign(v, sign):
return {"kind": "out_of_domain", "status": "declined",
"response": "Every worked example this program was written from has a %s %s; %s is outside that, so I "
"won't extrapolate." % (sign.replace("nonnegative", "non-negative"), lab, _fmt(v))}
try:
y = self.compute(*vals)
except Exception:
return None
if y is None or (isinstance(y, float) and y != y):
return None
if not _in_sign(y, self.out_sign):
return {"kind": "out_of_domain", "status": "declined",
"response": "That would make the %s %s, and every worked example this program was written from gave a %s "
"one, so I won't give it." % (self.out_label, _fmt(y), self.out_sign.replace("nonnegative", "non-negative"))}
unit =(" " + self.out_unit) if self.out_unit and not isinstance(y, str) else ""
return {"kind": "compute", "status": "answered",
"response": "The %s is %s%s. (A composed program: %s; %s.)" % (self.out_label, _fmt(y), unit,
self.spec["expression"], self.spec["said"])}123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205"""organ_formula_v3 - v2 + the DOMAIN beyond signs (pre-registration v11 part C, 2026-10-21). 4.1 and 4.2 published the limit
"a blood pressure of 70/110 or day 400 of a year is answered". spec.json "domain" now also holds:
order an ordering that holds in EVERY worked example between the numbers of one code input ("120/80": systolic above
diastolic) or between two inputs with the same named unit ("original gravity (SG)" above "final gravity (SG)").
Inputs without a named unit are not ordered: four examples cannot show that a chainring always outnumbers a cog.
facts what the quantity can be, cited: a day of 2025 is a whole number from 1 to 365 (Gregorian calendar, a common year);
a temperature is at or above absolute zero (SI Brochure, 9th edition, 2019: 0 K = -273.15 degC = -459.67 degF);
teeth, integers and years are whole numbers.
An input outside either is out_of_domain, an in-domain refusal that says which rule and why.
organ_formula_v2 (the parent) - v1 + a question is declined as missing an input only when it names one of the inputs (v1 declined
"What is the largest living animal species that only eats plants?" for the zodiac program, whose output is "animal":
the gate found the core item made worse, 2026-10-20). A question that names the output and no input is not this
program's, and gets no reply.
v2 also keeps to the DOMAIN of its examples (spec.json "domain", written from the worked examples the composer saw): an
input every example gave as positive (or non-negative) must be so in the question, and an answer whose sign no example's
answer had is not given ("ABV for original gravity 1.010 and final gravity 1.050" would be -5.25): out_of_domain, an
in-domain refusal that says why. A program is evidence for the range its examples span in sign, not beyond.
organ_formula_v1 - the GENERIC FORMULA SPECIALIST: one program the code composer wrote (program.py beside this file) and
the typed signature it was written for (spec.json: the inputs and the output, each a label with an optional unit in
parentheses). Built, not trained; no phrasing templates.
Reading, by role: the output is named in the question (its label; when an input has the same label, the output's unit too,
"in F"); each input is its label with a value right after it ("original gravity 1.055", "age of 25", "f-number = 8") or
right before it ("1.055 original gravity"). A value is a number ("1,000", "0.5", "1/125") or, for an input whose examples
were codes, a token mixing digits and letters ("205/55R16").
compute every input found: "The <output> is <value> <unit>." and the program it came from
missing_input a short direct question names the output but not every input's value: an in-domain refusal naming what
is missing
Narrowing (narrow_v1, the factory's shared rule): story-shaped and relational turns belong to the core; a turn carrying
numbers that no input claims is a different calculation and belongs to the core. Everything else: no reply."""
from __future__ import annotations
import importlib.util
import json
import os
import re
from narrow_v1 import narrative, short_direct
HERE = os.path.dirname(os.path.abspath(__file__))
NUM = r"-?\d[\d,]*(?:\.\d+)?(?:\s*/\s*\d[\d,]*(?:\.\d+)?)?"
CODE = r"[A-Za-z0-9]*\d[A-Za-z0-9]*[/\-][A-Za-z0-9/\-]*\d[A-Za-z0-9]*"
ANYNUM = re.compile(r"(?<![\w/.])-?\d[\d,]*(?:\.\d+)?(?![\w/])")
ASKING = re.compile(r"\?\s*$|^\s*(?:what|which|how|tell me|give me|i need|do you know|could you|can you|if |compute|calculate|"
r"work out|find )", re.I)
LINK = r"\s*(?:of|is|=|:|at|equal to|equals)?\s*(?:a|an|the)?\s*"
def split_label(s):
m = re.match(r"\s*(.*?)\s*(?:\(([^)]*)\))?\s*$", s)
return m.group(1).strip(), (m.group(2) or "").strip()
def label_rx(label):
words = [re.escape(w) for w in re.split(r"[\s]+", label) if w]
return r"(?<![\w-])" + r"[\s-]+".join(words) + r"s?(?![\w-])"
def _val(tok):
tok = tok.replace(",", "").replace(" ", "")
if "/" in tok:
a, b = tok.split("/", 1)
return float(a) / float(b)
return float(tok)
def _in_sign(v, sign):
if isinstance(v, str) or sign == "any":
return True
return v > 0 if sign == "positive" else v >= 0
def sign_of(values):
"""the sign every example gave: "positive", "nonnegative" or "any" (text values: "any")"""
if not values or any(isinstance(v, str) for v in values):
return "any"
if all(v > 0 for v in values):
return "positive"
return "nonnegative" if all(v >= 0 for v in values) else "any"
def _fmt(v):
if isinstance(v, str):
return v
v = float(v)
if v == 0:
return "0"
return ("%.6g" % v) if 1e-3 <= abs(v) < 1e7 else ("%.4g" % v)
class FormulaOrgan:
def __init__(self, spec="spec.json"):
self.spec = json.load(open(os.path.join(HERE, spec), encoding="utf-8"))
loader = importlib.util.spec_from_file_location("composed_program", os.path.join(HERE, "program.py"))
mod = importlib.util.module_from_spec(loader)
loader.loader.exec_module(mod)
self.compute = mod.compute
self.out_label, self.out_unit = split_label(self.spec["output"])
self.ins = [split_label(x) for x in self.spec["inputs"]]
self.kinds = self.spec["input_kinds"] # "number" or "code", from the examples
dom = self.spec.get("domain") or {}
self.in_sign = dom.get("inputs") or ["any"] * len(self.kinds) # "positive", "nonnegative" or "any", per input
self.out_sign = dom.get("output", "any")
collide = any(lab.lower() == self.out_label.lower() for lab, _ in self.ins)
out = label_rx(self.out_label)
if collide and self.out_unit: # "the temperature in F"
out += r"\s+(?:in|to)\s+(?:degrees\s+)?" + re.escape(self.out_unit) + r"(?![\w])"
self.rx_out = re.compile(out, re.I)
self.rx_in = []
for (lab, unit), kind in zip(self.ins, self.kinds):
v = CODE if kind == "code" else NUM
after = re.compile(label_rx(lab) + LINK + r"(" + v + r")(?![\w/])", re.I)
before = re.compile(r"(?<![\w/.])(" + v + r")\s+(?:\w+\s+)?" + label_rx(lab), re.I)
self.rx_in.append((after, before))
def _read(self, t):
spans, vals, missing = [], [], []
out_m = self.rx_out.search(t)
for (lab, _), kind, (after, before) in zip(self.ins, self.kinds, self.rx_in):
got = None
for rx in (after, before):
for m in rx.finditer(t):
if out_m and out_m.start() <= m.start() < out_m.end():
continue # the output's own mention is not an input
if any(a <= m.start(1) < b for a, b in spans):
continue
got = m
break
if got:
break
if not got:
missing.append(lab)
continue
spans.append((got.start(1), got.end(1)))
vals.append(got.group(1) if kind == "code" else _val(got.group(1)))
return vals, missing, spans
def _components(self, vals):
"""every number the inputs give, keyed (input, k): a code input gives its numbers in order ("120/80" -> 120, 80)"""
out = {}
for i, (v, kind) in enumerate(zip(vals, self.kinds)):
if kind == "code":
for k, x in enumerate(re.findall(r"\d+(?:\.\d+)?", str(v))):
out[(i, k)] = float(x)
elif not isinstance(v, str):
out[(i, 0)] = float(v)
return out
def _domain_v3(self, vals):
dom = self.spec.get("domain") or {}
comp = self._components(vals)
for o in dom.get("order") or []:
a, b = tuple(o["greater"]), tuple(o["lesser"])
if a in comp and b in comp and not comp[a] > comp[b]:
return ("In every worked example this program was written from, the %s is greater than the %s; here it is not "
"(%s and %s), so it is not a reading I can work from." % (o["greater_name"], o["lesser_name"],
_fmt(comp[a]), _fmt(comp[b])))
for f in dom.get("facts") or []:
x = comp.get((f["input"], 0))
if x is None:
continue
bad = (f.get("integer") and x != int(x)) or ("min" in f and x < f["min"]) or ("max" in f and x > f["max"])
if bad:
return "%s is not a possible %s: %s. So I won't compute it." % (_fmt(x), f["name"], f["why"])
return None
def answer(self, text, session_id="default"):
t = re.sub(r"\s+", " ", str(text or "")).strip()
if not self.rx_out.search(t) or narrative(t) or not ASKING.search(t):
return None
vals, missing, spans = self._read(t)
stray = [m for m in ANYNUM.finditer(t) if not any(a <= m.start() < b for a, b in spans)]
if stray: # numbers no input claims: another calculation
return None
if missing:
named = any(re.search(label_rx(lab), t, re.I) for lab, _ in self.ins)
if named and short_direct(t):
return {"kind": "missing_input", "status": "declined",
"response": "To work out the %s I need the %s, and the question doesn't give %s."
% (self.out_label, " and the ".join(missing), "it" if len(missing) == 1 else "them")}
return None
for (lab, _), v, sign in zip(self.ins, vals, self.in_sign):
if not _in_sign(v, sign):
return {"kind": "out_of_domain", "status": "declined",
"response": "Every worked example this program was written from has a %s %s; %s is outside that, so I "
"won't extrapolate." % (sign.replace("nonnegative", "non-negative"), lab, _fmt(v))}
refused = self._domain_v3(vals)
if refused:
return {"kind": "out_of_domain", "status": "declined", "response": refused}
try:
y = self.compute(*vals)
except Exception:
return None
if y is None or (isinstance(y, float) and y != y):
return None
if not _in_sign(y, self.out_sign):
return {"kind": "out_of_domain", "status": "declined",
"response": "That would make the %s %s, and every worked example this program was written from gave a %s "
"one, so I won't give it." % (self.out_label, _fmt(y), self.out_sign.replace("nonnegative", "non-negative"))}
unit =(" " + self.out_unit) if self.out_unit and not isinstance(y, str) else ""
return {"kind": "compute", "status": "answered",
"response": "The %s is %s%s. (A composed program: %s; %s.)" % (self.out_label, _fmt(y), unit,
self.spec["expression"], self.spec["said"])}123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366{ "dev": [ { "q": "What is the current for power 107.961 and voltage 59.4105?", "a": "1.8171983999893246", "valid": true, "kind": "compute", "expect": 1.8171983999893246, "dtype": "quantity", "unit": "A", "why": "current for [107.960666, 59.4105] (the system Electric power)" }, { "q": "Tell me the current with power of 107.961 and voltage of 59.4105.", "a": "1.8171983999893246", "valid": true, "kind": "compute", "expect": 1.8171983999893246, "dtype": "quantity", "unit": "A", "why": "current for [107.960666, 59.4105] (the system Electric power)" }, { "q": "What is the current for power 169.527 and voltage 280.774?", "a": "0.6037850281809957", "valid": true, "kind": "compute", "expect": 0.6037850281809957, "dtype": "quantity", "unit": "A", "why": "current for [169.526958, 280.773702] (the system Electric power)" }, { "q": "Tell me the current with power of 169.527 and voltage of 280.774.", "a": "0.6037850281809957", "valid": true, "kind": "compute", "expect": 0.6037850281809957, "dtype": "quantity", "unit": "A", "why": "current for [169.526958, 280.773702] (the system Electric power)" }, { "q": "What is the current for power 1.91195 and voltage 82.2401?", "a": "0.023248420388592404", "valid": true, "kind": "compute", "expect": 0.023248420388592404, "dtype": "quantity", "unit": "A", "why": "current for [1.911952, 82.240072] (the system Electric power)" }, { "q": "Tell me the current with power of 1.91195 and voltage of 82.2401.", "a": "0.023248420388592404", "valid": true, "kind": "compute", "expect": 0.023248420388592404, "dtype": "quantity", "unit": "A", "why": "current for [1.911952, 82.240072] (the system Electric power)" }, { "q": "What is the current for power 1.64379 and voltage 252.709?", "a": "0.006504696457692342", "valid": true, "kind": "compute", "expect": 0.006504696457692342, "dtype": "quantity", "unit": "A", "why": "current for [1.643795, 252.709024] (the system Electric power)" }, { "q": "Tell me the current with power of 1.64379 and voltage of 252.709.", "a": "0.006504696457692342", "valid": true, "kind": "compute", "expect": 0.006504696457692342, "dtype": "quantity", "unit": "A", "why": "current for [1.643795, 252.709024] (the system Electric power)" }, { "q": "What is the current for power 18.3169 and voltage 6.8386?", "a": "2.6784535160942915", "valid": true, "kind": "compute", "expect": 2.6784535160942915, "dtype": "quantity", "unit": "A", "why": "current for [18.316867, 6.838598] (the system Electric power)" }, { "q": "Tell me the current with power of 18.3169 and voltage of 6.8386.", "a": "2.6784535160942915", "valid": true, "kind": "compute", "expect": 2.6784535160942915, "dtype": "quantity", "unit": "A", "why": "current for [18.316867, 6.838598] (the system Electric power)" }, { "q": "What is the current for power 156.502 and voltage 185.886?", "a": "0.8419223616111585", "valid": true, "kind": "compute", "expect": 0.8419223616111585, "dtype": "quantity", "unit": "A", "why": "current for [156.50181, 185.886273] (the system Electric power)" }, { "q": "Tell me the current with power of 156.502 and voltage of 185.886.", "a": "0.8419223616111585", "valid": true, "kind": "compute", "expect": 0.8419223616111585, "dtype": "quantity", "unit": "A", "why": "current for [156.50181, 185.886273] (the system Electric power)" }, { "q": "What is the current for power 107.961?", "a": "", "valid": false, "kind": "missing_input", "expect": null, "dtype": "quantity", "unit": "", "why": "the voltage is not given" }, { "q": "Tell me the current with power of 169.527.", "a": "", "valid": false, "kind": "missing_input", "expect": null, "dtype": "quantity", "unit": "", "why": "the voltage is not given" }, { "q": "What is the current of the Eiffel Tower?", "a": "", "valid": false, "kind": "not_held", "expect": null, "dtype": "quantity", "unit": "", "why": "a named thing, not inputs: a lookup the program cannot do" }, { "q": "What is the current of Mount Everest?", "a": "", "valid": false, "kind": "not_held", "expect": null, "dtype": "quantity", "unit": "", "why": "a named thing, not inputs: a lookup the program cannot do" }, { "q": "Tell me the current with power of -1.91195 and voltage of 82.2401.", "a": "", "valid": false, "kind": "out_of_domain", "expect": null, "dtype": "quantity", "unit": "", "why": "a negative power: no example had one" }, { "q": "Which current is the most common?", "a": "", "valid": false, "kind": "output_only", "expect": null, "dtype": "quantity", "unit": "", "why": "names the output and no input: not this program's" } ], "heldout": [ { "q": "If the power is 8.50728 and the voltage is 17.7888, what is the current?", "a": "0.4782387296673114", "valid": true, "kind": "compute", "expect": 0.4782387296673114, "dtype": "quantity", "unit": "A", "why": "current for [8.507283, 17.788778] (the system Electric power)" }, { "q": "Could you work out the current given power = 8.50728, voltage = 17.7888?", "a": "0.4782387296673114", "valid": true, "kind": "compute", "expect": 0.4782387296673114, "dtype": "quantity", "unit": "A", "why": "current for [8.507283, 17.788778] (the system Electric power)" }, { "q": "I need the current for a power of 8.24951 and a voltage of 0.634021, please.", "a": "13.011414796588832", "valid": true, "kind": "compute", "expect": 13.011414796588832, "dtype": "quantity", "unit": "A", "why": "current for [8.24951, 0.634021] (the system Electric power)" }, { "q": "If the power is 8.24951 and the voltage is 0.634021, what is the current?", "a": "13.011414796588832", "valid": true, "kind": "compute", "expect": 13.011414796588832, "dtype": "quantity", "unit": "A", "why": "current for [8.24951, 0.634021] (the system Electric power)" }, { "q": "Could you work out the current given power = 0.318734, voltage = 9.56607?", "a": "0.03331922249257168", "valid": true, "kind": "compute", "expect": 0.03331922249257168, "dtype": "quantity", "unit": "A", "why": "current for [0.318734, 9.566071] (the system Electric power)" }, { "q": "I need the current for a power of 0.318734 and a voltage of 9.56607, please.", "a": "0.03331922249257168", "valid": true, "kind": "compute", "expect": 0.03331922249257168, "dtype": "quantity", "unit": "A", "why": "current for [0.318734, 9.566071] (the system Electric power)" }, { "q": "If the power is 0.671697 and the voltage is 14.2496, what is the current?", "a": "0.04713807027437235", "valid": true, "kind": "compute", "expect": 0.04713807027437235, "dtype": "quantity", "unit": "A", "why": "current for [0.671697, 14.249569] (the system Electric power)" }, { "q": "Could you work out the current given power = 0.671697, voltage = 14.2496?", "a": "0.04713807027437235", "valid": true, "kind": "compute", "expect": 0.04713807027437235, "dtype": "quantity", "unit": "A", "why": "current for [0.671697, 14.249569] (the system Electric power)" }, { "q": "I need the current for a power of 21.7931 and a voltage of 29.5106, please.", "a": "0.7384844800541926", "valid": true, "kind": "compute", "expect": 0.7384844800541926, "dtype": "quantity", "unit": "A", "why": "current for [21.793126, 29.510609] (the system Electric power)" }, { "q": "If the power is 21.7931 and the voltage is 29.5106, what is the current?", "a": "0.7384844800541926", "valid": true, "kind": "compute", "expect": 0.7384844800541926, "dtype": "quantity", "unit": "A", "why": "current for [21.793126, 29.510609] (the system Electric power)" }, { "q": "Could you work out the current given power = 153.15, voltage = 18.5953?", "a": "8.235943368499306", "valid": true, "kind": "compute", "expect": 8.235943368499306, "dtype": "quantity", "unit": "A", "why": "current for [153.149965, 18.595315] (the system Electric power)" }, { "q": "I need the current for a power of 153.15 and a voltage of 18.5953, please.", "a": "8.235943368499306", "valid": true, "kind": "compute", "expect": 8.235943368499306, "dtype": "quantity", "unit": "A", "why": "current for [153.149965, 18.595315] (the system Electric power)" }, { "q": "If the power is 8.50728, what is the current?", "a": "", "valid": false, "kind": "missing_input", "expect": null, "dtype": "quantity", "unit": "", "why": "the voltage is not given" }, { "q": "Could you work out the current given power = 8.24951?", "a": "", "valid": false, "kind": "missing_input", "expect": null, "dtype": "quantity", "unit": "", "why": "the voltage is not given" }, { "q": "Do you know the current of a violin?", "a": "", "valid": false, "kind": "not_held", "expect": null, "dtype": "quantity", "unit": "", "why": "a named thing, not inputs: a lookup the program cannot do" }, { "q": "Do you know the current of the French Revolution?", "a": "", "valid": false, "kind": "not_held", "expect": null, "dtype": "quantity", "unit": "", "why": "a named thing, not inputs: a lookup the program cannot do" }, { "q": "Could you work out the current given power = -0.318734, voltage = 9.56607?", "a": "", "valid": false, "kind": "out_of_domain", "expect": null, "dtype": "quantity", "unit": "", "why": "a negative power: no example had one" }, { "q": "What is a typical current?", "a": "", "valid": false, "kind": "output_only", "expect": null, "dtype": "quantity", "unit": "", "why": "names the output and no input: not this program's" } ]}1234567"""current from power, voltage (Electric power)The maths organ (systems.py): solved from the system P = U*I; checked by substitution into every equation and by a numeric solution at 12 points"""import math
def compute(power, voltage): return 1.0*power/voltage12345678910111213141516171819202122232425262728293031"""scorer_formula_v1 - scorer for composed formula specialists: (good, asserted).A must-decline item answered is a false yes. A valid quantity item is right when the FIRST number in the reply (theanswer, before any working) is within 0.5% of the sealed answer; a valid text item is right when the answer appears in thereply as a whole word, exactly as written."""import re
def _first_num(text): m = re.search(r"-?\d[\d,]*(?:\.\d+)?(?:[eE][+-]?\d+)?", text) if not m: return None try: return float(m.group(0).replace(",", "")) except ValueError: return None
def ok(p, r): r = r or {} text = str(r.get("response", "")) answered = str(r.get("status", "")) == "answered" if not p["valid"]: return (not answered), answered if not answered: return False, False if p.get("dtype") == "quantity": want, got = float(p["expect"]), _first_num(text) if got is None: return False, True return abs(got - want) <= (0.005 * abs(want) if want else 0.005), True return re.search(r"(?<![\w])%s(?![\w])" % re.escape(str(p["expect"])), text) is not None, True123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128{ "title": "current from power, voltage (Electric power)", "inputs": [ "power (W)", "voltage (V)" ], "output": "current (A)", "input_kinds": [ "number", "number" ], "expression": "1.0*P/U", "expression_x": null, "said": "solved from the system P = U*I; checked by substitution into every equation and by a numeric solution at 12 points", "composer": "systems (the maths organ)", "library": [], "system": { "equations": [ "P = U*I" ], "constants": {}, "quantities": { "P": "power (W)", "U": "voltage (V)", "I": "current (A)" }, "symbols": [ "P", "U" ], "out_symbol": "I" }, "points": [ { "in": [ 107.960666, 59.4105 ], "out": 1.8171983999893246 }, { "in": [ 8.507283, 17.788778 ], "out": 0.4782387296673114 }, { "in": [ 169.526958, 280.773702 ], "out": 0.6037850281809957 }, { "in": [ 8.24951, 0.634021 ], "out": 13.011414796588832 }, { "in": [ 1.911952, 82.240072 ], "out": 0.023248420388592404 }, { "in": [ 0.318734, 9.566071 ], "out": 0.03331922249257168 }, { "in": [ 1.643795, 252.709024 ], "out": 0.006504696457692342 }, { "in": [ 0.671697, 14.249569 ], "out": 0.04713807027437235 }, { "in": [ 18.316867, 6.838598 ], "out": 2.6784535160942915 }, { "in": [ 21.793126, 29.510609 ], "out": 0.7384844800541926 }, { "in": [ 156.50181, 185.886273 ], "out": 0.8419223616111585 }, { "in": [ 153.149965, 18.595315 ], "out": 8.235943368499306 } ], "domain": { "inputs": [ "positive", "positive" ], "output": "positive", "order": [], "facts": [] }}1234567891011121314151617181920212223242526272829303132{ "id": "solved-current-2", "split": "dev", "decision": "WOULD PASS", "reasons": [], "n": 18, "head": { "ok": 6, "fy": 0, "wrong": 0 }, "with_specialist": { "ok": 18, "fy": 0, "wrong": 0 }, "gain_needed": 3, "core": { "n": 924, "taken": 0, "cap": 9, "examples": [] }, "self_ok": true, "p50_ms": 0.01, "budget_ms": 200.0, "fails": [], "files_sha": "a5f8a9920a5cec538005300ba3efbed4c4616a4e4db80b690b35d86e43aaab84", "panel_sha": "51620f5ebe12e04ec5a45de19d748f18bc39dc20a3c3bdaf83a7ecfc19a97b7c", "time": "2026-10-24T00:17:58Z", "core_head": "oracle_release_runtime_w571"}123456789101112131415161718192021222324252627282930313233{ "id": "solved-current-2", "split": "heldout", "decision": "ADMIT", "reasons": [], "n": 18, "head": { "ok": 6, "fy": 0, "wrong": 0 }, "with_specialist": { "ok": 18, "fy": 0, "wrong": 0 }, "gain_needed": 3, "core": { "n": 924, "taken": 0, "cap": 9, "examples": [] }, "self_ok": true, "p50_ms": 0.01, "budget_ms": 200.0, "fails": [], "files_sha": "a5f8a9920a5cec538005300ba3efbed4c4616a4e4db80b690b35d86e43aaab84", "panel_sha": "345658eb273c71a3412ecd4c911baf41a37aa971cab00c6621300d1b0f35aa6f", "time": "2026-10-24T00:18:01Z", "core_head": "oracle_release_runtime_w571", "memory": "written to your group's memory"}1{"t": "2026-10-24T00:35:04Z", "heldout_sha": "264169435a97762a2ef583d3a0f9bb2c2765cd9968782900b1029aea1e464562", "files_sha": "a7c5e357277f70512509dfc572869388a6a996f1a10020b0b463482ae126e4a9"}root/organs10/physics/specialists/solved-cost-3/program.pyAdded+7
root/organs10/physics/specialists/solved-cost-3/scorer_formula_v1.pyAdded+31
root/organs10/physics/specialists/solved-cost-3/spec.jsonAdded+128
root/organs10/physics/specialists/solved-cost-3/verdict_dev.jsonAdded+32
root/organs10/physics/specialists/solved-cost-3/verdict_heldout.jsonAdded+41
root/organs10/physics/specialists/solved-cowling-number/exam_log.jsonlAdded+1
root/organs10/physics/specialists/solved-cowling-number/manifest.jsonAdded+41
root/organs10/physics/specialists/solved-cowling-number/narrow_v1.pyAdded+47
root/organs10/physics/specialists/solved-cowling-number/organ_formula_v2.pyAdded+163
root/organs10/physics/specialists/solved-cowling-number/organ_formula_v3.pyAdded+205
root/organs10/physics/specialists/solved-cowling-number/panel.jsonAdded+366
root/organs10/physics/specialists/solved-cowling-number/program.pyAdded+7
root/organs10/physics/specialists/solved-cowling-number/scorer_formula_v1.pyAdded+31
root/organs10/physics/specialists/solved-cowling-number/spec.jsonAdded+128
root/organs10/physics/specialists/solved-cowling-number/verdict_dev.jsonAdded+38
root/organs10/physics/specialists/solved-cowling-number/verdict_heldout.jsonAdded+39
root/organs10/physics/specialists/solved-cross-sectional-area-2/exam_log.jsonlAdded+1
root/organs10/physics/specialists/solved-cross-sectional-area-2/manifest.jsonAdded+41
root/organs10/physics/specialists/solved-cross-sectional-area-2/narrow_v1.pyAdded+47
root/organs10/physics/specialists/solved-cross-sectional-area-2/organ_formula_v2.pyAdded+163
root/organs10/physics/specialists/solved-cross-sectional-area-2/organ_formula_v3.pyAdded+205
root/organs10/physics/specialists/solved-cross-sectional-area-2/panel.jsonAdded+366
root/organs10/physics/specialists/solved-cross-sectional-area-2/program.pyAdded+7
root/organs10/physics/specialists/solved-cross-sectional-area-2/scorer_formula_v1.pyAdded+31
root/organs10/physics/specialists/solved-cross-sectional-area-2/spec.jsonAdded+145
root/organs10/physics/specialists/solved-cross-sectional-area-2/verdict_dev.jsonAdded+38
root/organs10/physics/specialists/solved-cross-sectional-area-2/verdict_heldout.jsonAdded+39
root/organs10/physics/specialists/solved-cross-sectional-area/exam_log.jsonlAdded+1
root/organs10/physics/specialists/solved-cross-sectional-area/manifest.jsonAdded+41
root/organs10/physics/specialists/solved-cross-sectional-area/narrow_v1.pyAdded+47
root/organs10/physics/specialists/solved-cross-sectional-area/organ_formula_v2.pyAdded+163
root/organs10/physics/specialists/solved-cross-sectional-area/organ_formula_v3.pyAdded+205
root/organs10/physics/specialists/solved-cross-sectional-area/panel.jsonAdded+366
root/organs10/physics/specialists/solved-cross-sectional-area/program.pyAdded+7
root/organs10/physics/specialists/solved-cross-sectional-area/scorer_formula_v1.pyAdded+31
root/organs10/physics/specialists/solved-cross-sectional-area/spec.jsonAdded+145
root/organs10/physics/specialists/solved-cross-sectional-area/verdict_dev.jsonAdded+38
root/organs10/physics/specialists/solved-cross-sectional-area/verdict_heldout.jsonAdded+39
root/organs10/physics/specialists/solved-current-2/exam_log.jsonlAdded+1
root/organs10/physics/specialists/solved-current-2/manifest.jsonAdded+41
root/organs10/physics/specialists/solved-current-2/narrow_v1.pyAdded+47
root/organs10/physics/specialists/solved-current-2/organ_formula_v2.pyAdded+163
root/organs10/physics/specialists/solved-current-2/organ_formula_v3.pyAdded+205
root/organs10/physics/specialists/solved-current-2/panel.jsonAdded+366
root/organs10/physics/specialists/solved-current-2/program.pyAdded+7
root/organs10/physics/specialists/solved-current-2/scorer_formula_v1.pyAdded+31
root/organs10/physics/specialists/solved-current-2/spec.jsonAdded+128
root/organs10/physics/specialists/solved-current-2/verdict_dev.jsonAdded+32
root/organs10/physics/specialists/solved-current-2/verdict_heldout.jsonAdded+33
root/organs10/physics/specialists/solved-current-3/exam_log.jsonlAdded+1