Piper · Cognition
Log in

Summary / Component 6 of 38

6 Logic

Applying formal or rule-based relationships.

Latest95.8v2
Baseline78.2Oct 9
Live use—last 7 days

Shared copy: the operator's name is replaced with "the operator", machines other than Firefly are named by their role, and one security detail is held back. Nothing else is changed.

Piper — what it is

Formal constraint work is delegated to a real solver rather than reasoned at: puzzles, scheduling and Latin-square problems go to Z3 through the logic lab, and every probability or odds question goes through one tested implementation instead of inline arithmetic. That last rule exists because I have been confidently wrong about arithmetic before, and a wrong number I then act on is worse than no number.

Piper — the parts that do it

logiclab v1.0 and z3-solver v4.x; probkit v0.2.0 (the only sanctioned home for probability and statistics); code-check v1.0.1 for deterministic syntax and lint.

Reviewer Claude, 2026-09-30

What needs improving: Solves held-out logic (97/100); routing gate fixed to read notation (held-out F1 78.2 → 95.8), still watch-only

Handing formal logic to a real solver instead of reasoning it out in prose is the correct engineering answer for a language model. That part of the concept is exactly right. But the Z3 half isn't happening. No rule in AGENTS.md, the Day prompt or the bridge routes anything to it. No worker has ever solved anything with logiclab. The only Z3 commands in any session are her checking today whether it exists. Z3 is 5.1.0 and installed only in the puzzle-lab venv. The probability half is real: probkit is used about 85 times by workers, and code_check 325 times. "Puzzles, scheduling and Latin squares go to Z3" describes a plan, not a behaviour.

Update 2026-10-09 — routing gate 1.6.0: reads formal notation, stops sending chat to the solver — held-out F1 78.2 → 95.8 (+17.6 [+11.2, +25.5]); live, still watch-only

Correction first. This morning's held-out figure (F1 38.7) was mis-scored. It counted CC06-C items 291–300 as non-logic, but they are Band G "semantic compiler" logic items: formalise the wording, then solve. So all 100 items are logic problems. Corrected: the live gate 1.4.0 sent 34 of 100 to a logic route. Precision can't be measured on CC06-C, because the set contains no non-problems. The 38.7 row is now an anchor at 50.7 (recall-only F1).

What was wrong (two faults). - It missed notation. The gate fired on English connectives (if, must, unless). E1: X1 XOR X2 … = 1, X6 := NAND(X3, X4), K_A(X4=0) and edge lists carried no trigger word, so 66 of the 100 CC06-C items were kept from the solver. - It sent chat to the solver. Her seat passes the operator message to the gate with its [situated-frame] header attached (trust=1.0 when=2026-10-09 12:26). The gate read those as quantities and relations. Separately, any message with one quantifier, one number and a question mark counted as "representable". In the live shadow log, 30 of 119 ordinary turns went to a logic route, among them "What is the velvet glove", "All good?" and "Did you finish all 100 logic puzzles yet?".

The fix (gate 1.6.0, Claude). 1. The situated-frame header is stripped before classifying. 2. Notation route. Dense formal notation goes to the declarative front: operator words and calls, logic, modal and set symbols, ASCII ~ & |, forall/exists, indexed variables, var = value, and edge lists. Arrows count only between non-numeric operands, so 47.5 → 74.0 in a progress report does not count. 3. Problem-kernel guard on every word-triggered route. The message must name two or more quantities or entities, or a declared domain, or state two or more premises before an ask. Long first- and second-person prose is not a problem. 4. Logic-domain terms (satisfiable, knights/knaves, chromatic, cryptarithm, power set …) route when a kernel is present. 5. Code, SQL and log shapes are kept off the formal routes unless notation is dense.

How it was tested. - First attempt failed. 1.5.0 was preregistered (PREREG-G15) and judged on a fresh set of 154 messages written by an independent model that never saw the gate. It came in at F1 +4.3 [−1.5, +10.2] with recall 77.0, against bars of +10 and 80. Not installed. Its misses (ASCII connectives, modal logic, edge lists, no domain vocabulary) went into 1.6.0, and that set became development data. - 1.6.0 was preregistered (PREREG-G16) and judged once on a second fresh draw of 143 messages: 70 problems in 12 formats and 73 look-alike non-problems. The non-problems were status chat, reports with arrows, code, SQL, logs, stats questions, forum posts and task requests.

on held-out H2 (143) precision recall F1
gate 1.4.0 (live until 14:51) 82.5% 74.3% 78.2
gate 1.6.0 94.4% 97.1% 95.8

Change +17.6, bootstrap 95% CI [+11.2, +25.5]. All four preregistered criteria were met.

Checked as well. - Dev: CC06-C 100/100 (1.4.0: 32), suite A 96/100, canary pool 20/20 + 20/20. - Live shadow log: false positives 30 → 0 of 119. Logic turns 2 of 5 (1.4.0: 3 of 5). The miss is a long pasted list of web puzzles. - Her own gate checks give identical results to 1.4.0. - Speed: the readings post-pass takes at most 0.18 s per item.

Caveat. The second fresh set came from the same generator and prompts as the first, which 1.6.0 was tuned on. The pass shows the fix generalises within that distribution. The real test is her live traffic: in 48 h the new shadow rows will be read by hand.

Status. Installed 14:51 as a whole-file replace, after confirming the live file was unchanged (backup gate.py.bak-claude-g16-20261009). It is still watch-only: it logs, it does not route. Enforcement stays off.

Parts that do it - ~/cognition-bench/06-logic/gatefix/: PREREG-G15.txt (+ heldout/RESULT-G15.txt), PREREG-G16.txt, heldout2/ (items, sha256, label log, duplicate log), score_g16.py, evalgate.py, dev sets - Firefly learning/puzzle-lab/logiclab/gate.py 1.6.0

Update 2026-10-09 — held-out set CC06-C graded: she solves it (97/100 right, 3 partial, 0 wrong), but her routing gate fails it (F1 38.7; corrected later: 34/100 routed) — it reads English connectives, not constraint notation; it stays watch-only

The test. CC06-C is the operator's third logic set: 100 items written after her gate's last edit (the set arrived 10-07 14:41, the gate was last changed at 10:47). Her answers, emailed 10-07 15:32, were graded on 10-09 against the operator's key. The key was sealed on the bench machine and never placed on Firefly.

Solving: 97 of 100 fully right, 3 partial, 0 wrong.

items family result
201–220 48-variable XOR systems: unique witness or minimal contradiction 20/20
221–235 minimum repair (deletions) 15/15, each repair checked against the problem
236–250 feasible-assignment counts and optimum 15/15
251–265 anchored 4-colouring 15/15 (one valid certificate different from the key's)
266–280 public-announcement survivors 15/15
281–290 structural causal models, interventions 10/10
291–300 semantic: scope, defaults, deontics, temporal 7 right, 3 partial

Routing: her gate fails the held-out set.

development set (hers) held-out CC06-C
routing F1 84.8 (1.2.0) → 92.3 (1.3.0) 38.7 (live 1.4.0; corrected: recall 34/100, see below)
formal items sent to the solver 66 of 71 24 of 90
reading-dependent items sent to the solver few all 10

The live gate (1.4.0) was run read-only on a copy of her code. The gate decides from English connectives such as if, then and must, plus a representability heuristic. It does not recognise symbolic constraint notation:

Her own 10-07 report warned that its numbers were "a development reading, not a validation". This is the validation, and it fails. The gate must stay watch-only. It is now (135 logged turns), so her answers were not affected: she chose z3 herself and solved the set.

Summary score. The summary keeps routing F1 as its metric, now measured on the held-out set: 0 (no formal path) → 38.7. The development numbers are kept as reference rows. [Corrected 10-09 PM: 38.7 was mis-scored, because items 291–300 are logic items, not negatives. It is now a reference row (recall 34/100). The summary is now the matched held-out test of gate 1.4.0 vs 1.6.0: 78.2 → 95.8; see the later update.] Solving accuracy (98.5 with partials at half) is a separate reference row.

Readings lane. Piper delivered the readings lane the operator asked for on 10-07; it is part of gate 1.3.0+. Claude re-ran her numbers and they came out identical.

Next. The gate needs to read constraint notation (XOR, =, variable lists, edge lists) as formal, and connective words alone should not be enough. Test it on a fourth set before any enforce.

Parts that do it - Bench: ~/cognition-bench/06-logic/grade_cc06c.py, grade-cc06c-20261009.json, cc06c-routing-gate140*.json; sealed key and answers /var/lib/cognition-bench/06-logic/cc06c/ (root only)

Update 2026-10-07 — CC06-B graded against the operator's key: 85 of 85 keyed items correct, and her encodings are faithful

Graded by Claude, off Piper's machine. The key never went to Firefly. Her answer files were copied off read-only.

Band Items Verdict correct Parse-fidelity check
Boolean / cardinality 101–125 25/25 17/17 planted models satisfy her parsed constraints
Ordering (SMT-LIB) 126–135 10/10 6/6 planted orders pass
Ordering (distance) 136–145 10/10 6/6 planted orders pass
3-colouring 146–160 15/15 7/7 planted colourings pass
Scheduling with capacity 161–175 15/15 11/11 planted schedules pass
Structural causal model, do(·) 176–185 10/10 post-intervention states exact —
Keyed total 101–185 85/85 47/47
Semantic, no single key 186–200 10 robust across readings, 5 flagged "underdetermined by reading" needs a human grade (translation, ambiguity recall)

How it was checked. Getting the verdict right is not the whole test. For every SAT item, the operator's planted solution was evaluated against her encoding of the constraints. If she had misread a single constraint, the planted solution would usually fail it. None failed. For every UNSAT item her unsat core was inspected. The ordering bands' cores are exactly the injected 4-cycle. Some Boolean cores are shorter than the injected 7-clause cycle because they shortcut through a ↔ clause (e.g. 108: B03, B08↔B03, B08→¬B03), which is still a valid contradiction.

What it means. Her exact path is correct on everything a solver should own. The open problem is entirely upstream, in deciding what goes to the solver. On the semantic items she already did the right thing by hand: she enumerated every defensible reading of each ambiguous clause, solved each one, and reported "robust" when all readings agreed (10 items). When they didn't (5 items), she reported the separating assumption. That procedure is what the router should send ambiguous wording to. Today the gate either sends it to the solver as certain or sends it nowhere.

Update 2026-10-07 — her own upgrade, read from her logs: a solver path now exists and answered both suites with Z3; the routing gate is accurate on formal items but over-routes prose, and runs in shadow only

What she did (project cognitive-component-06, 10-06 → 10-07, closed done; everything in foundation/state/cc06/). Working from the operator's logic paper, she: - built a logic gate (logiclab/gate.py 1.2.0). It is a deterministic router that sorts a request into formal / quantitative / code / hybrid / open, with a representability check so a vague request is not forced through a solver; - built a semantic lint that flags constructions with two readings ("only if", "knows", "exactly") and solves both; - keyed the operator's CC06 suite (items 1–100): 71 items by independent brute-force code that shares nothing with the gate, and 29 reading-dependent items by stated convention. She then answered all 100; - answered the harder CC06-B suite (items 101–200, 20–50 variables each) with Z3 5.1.0. Every SAT witness was re-checked against the parsed constraints by a separate evaluator (0 bad models), and each UNSAT verdict carries an unsat core. Both answer sheets went to the operator's laptop (sha256 verified); - wired the gate into the router in shadow: it classifies each operator message and logs it (shadow.jsonl), and the result is discarded.

Baseline (review, 09-30). Formal logic was absent. No rule routed anything to Z3, no worker had ever solved anything with logiclab, and Z3 was installed only in a lab venv. Probability (probkit) was real. The base model (deepseek-flash, no tools) already gets the 21 small keyed CC06 items right (21/21), so on small problems the gap was never the model's reasoning. It was the absence of an exact path for large or trap-laden ones.

Where it stands (her measurements; the routing numbers re-run by Claude 10-07 and identical):

Measure Value Paper's bar (§31)
Gate routing on the operator's CC06 text, formal items sent to the solver (recall) 98.6% (70/71) ≥ 90%: met
Gate routing precision (prose items wrongly sent as certain-formal) 74.5% (24 of 29 reading-dependent items over-routed) ≥ 90%: not met
Gate on her own 200-item bench, first version → 1.1.0 (held-out, single read) recall 62.9% → 100% her own items: optimistic
Live operator turns, hand-labelled (shadow) 13/17 routed right (2 over, 2 under) ≥ 90%: not met
CC06-B: SAT witnesses that fail their own constraints 0 of 100 items verified-wrong < 1%
Final answer correctness, CC06-B (graded 10-07, see next entry) 85/85 keyed items correct; 15 semantic items have no single key —
Semantic lint (development read only) 50 flagged, 22 truly two-reading, 38 false flags not a validation

Reading it. - The exact path now exists and works. Z3 solves the large items and every witness checks out, and she built a key that does not depend on the machinery it grades. That is the paper's core recommendation done, on the bench. - The router is the weak link. It sends nearly every formal item to the solver, but it also sends most reading-dependent prose there as "certain". That is the exact failure the paper warns about, a solver giving a confident answer to one reading of an ambiguous sentence. The lint is meant to catch these, but it is not yet good enough to rely on (38 false flags). - Wired in, but watch-only. The gate runs inside her turn path (foundation_router.py → cc06_shadow.py) on every operator message and logs a decision; the decision is not acted on. Live routing is 13/17 right, below the paper's bar, so keeping it watch-only is the right call for now.

Next. 1. ~~Grade CC06-B against the operator's key~~ done 10-07: 85/85. 2. Fix gate precision on prose: ambiguous wording goes to a readings lane (see next entry), not straight to the solver. 3. Re-score live shadow turns before any switch to enforce.

Test suite Piper's own upgrade (10-06/07) · CC06-B 85/85 keyed · HELD-OUT CC06-C (10-09): solves 97/100 right, 3 partial, 0 wrong · routing: live 1.4.0 sent 34/100 CC06-C items to a logic route (corrected from F1 38.7) and 30/119 chat turns to the solver · gate 1.6.0 (Claude) LIVE 14:51, watch-only: fresh held-out H2 F1 78.2 → 95.8 (+17.6 [+11.2,+25.5], PREREG-G16 KEEP; 1.5.0 failed G15 first) · live shadow re-read due 10-11

A mixed bag of exactly-gradable items: constraint puzzles, small scheduling problems, syllogisms and rule chains, and probability or odds questions with known answers. Scoring: correctness (exact). A secondary score checks routing: did she send solver-shaped items to a solver and probability items to probkit, instead of answering from her head? Because most items are machine-generated, the sealed set is cheap to rotate. The live-use part counts solver and probkit calls in real work.

Scoring rules shared by all 38 suites: How the tests work.

Research & attempts

Score history

Suite v1 retired
0255075100Oct 70
Suite v2 current
0255075100Oct 995.8

Dashed line: the suite's baseline. Shaded band: the ± interval. Hollow dots are anchor items carried over from an earlier suite. Scores from different suite versions are not comparable, so each version gets its own panel.

DateSuiteTypeScore±Live useCostNotes
2026-10-09v2sealed 95.81 —— Gate 1.6.0 (Claude) on the same H2: precision 94.4%, recall 97.1%, F1 95.8. Paired change +17.6, bootstrap 95% CI [+11.2, +25.5] (ci field = CI of the change). PREREG-G16 KEEP: all four criteria met. Installed live 14:51, still watch-only. The previous attempt (1.5.0) failed PREREG-G15 on an earlier fresh set (H1: +4.3 [-1.5, +10.2], recall 77.0) and was not installed; H1 then became dev.
2026-10-09v2sealed 78.2— —— Control: gate 1.4.0 (live until 14:51) on held-out H2, 143 fresh messages written by an independent model that never saw the gate (70 logic/constraint problems in 12 formats, 73 look-alike non-problems: status chat, reports with arrows, code, SQL, logs, stats questions, forum posts, task requests). Logic-route precision 82.5%, recall 74.3%, F1 78.2.
2026-10-09v1anchor 50.7— —— LIVE gate 1.4.0 on the held-out CC06-C (100 items). CORRECTED 10-09 PM: the first version of this row (F1 38.7) counted items 291-300 as non-logic. They are Band G 'semantic compiler' LOGIC items (formalise, then solve), so all 100 items are positives. Corrected: logic-route recall 34/100, precision not measurable on this set (it has no negatives), F1 50.7. The finding is the same: the gate read English connectives and missed problems written in notation (XOR systems, repair sets, K_A(...), X := AND(...), edge lists). Anchor: superseded by the matched held-out test (suite v2).
2026-10-09v1anchor 98.5— —— Different metric (solving accuracy, not routing): her answers to the held-out CC06-C graded against the operator key. 97/100 fully correct, 3 partial (293b, 296, 298), 0 wrong; partial = half. 201-290 machine-checked 90/90 (one valid alternative UNSAT certificate, 259, verified by hand against the problem); 291-300 graded by hand. Answers = the sha256 she sent at 15:32:24; no worker saw the key before the hand-in.
2026-10-07v1anchor 92.3— —— Gate 1.3.0 + readings lane (hers, 10-07) on suite A, her own labels: solver precision 91.7% (66/72), recall 93.0% (66/71), routing F1 92.3; 22 items to the readings lane (18 reading-dependent). Re-run by Claude, identical. Her report: 'a development reading, not a validation'. Anchor: superseded by the held-out CC06-C test of the live gate (1.4.0).
2026-10-07v1anchor 84.8— —— Her gate 1.2.0 on the operator's CC06 text: routing F1 84.8 (recall 98.6% = 70/71 formal items to the solver; precision 74.5%: 24 of 29 reading-dependent prose items over-routed). Re-run by Claude 10-07, identical to her record. SHADOW ONLY, nothing routed live (13/17 live turns right). CC06-B answered with Z3, 0 bad witnesses; correctness awaits the operator's key. [Anchor since 2026-10-09: development measurement of gate 1.2.0 on suite A (her own labels); the live gate is 1.4.0, scored on the held-out CC06-C below.]
2026-10-07v1sealed 0— —— Baseline (review 09-30): no formal path. No rule routed anything to Z3 and no worker had ever solved with logiclab, so 0 of the 71 formal items on the operator's CC06 suite would reach a solver (absent mechanism = 0, as for #3). Base model alone: 21/21 on the small keyed items.

Experimental record

One entry per intervention: hypothesis, prediction, before and after, cost, side effects, and the keep-or-revert decision.

2026-10-09 · v2 ✓ kept 78.2 → 95.8 (+17.6) ± 0

Hypothesis. The gate missed problems written in notation and sent chat to the solver because any quantifier + number + '?' counted as representable. A notation route plus a problem-kernel guard fixes both.

Research sources
Implementation / version
learning/puzzle-lab/logiclab/gate.py 1.4.0 -> 1.6.0 (whole-file replace after confirming the live sha was unchanged; backup gate.py.bak-claude-g16-20261009). (1) [situated-frame] header stripped before classifying; (2) notation route: operator words/calls, logic/modal/set symbols, ASCII ~ & |, forall/exists, indexed variables, var=value, edge lists; arrows count only between non-numeric operands; (3) logic-domain terms (satisfiable, knights/knaves, chromatic, cryptarithm, power set, ...); (4) problem-kernel guard on every lexical route: two or more named quantities/entities or a declared domain, or two or more premises before an ask; long first/second-person prose is not a problem; (5) code/SQL/log shape blocks formal routes unless notation is dense. The readings lane and the solver/readings split are unchanged.
Predicted improvement
Regressions
Her gate checks give identical results to 1.4.0 (canary pool 20/20 + 20/20; readings lane; suite-A solver recall/precision). Dev: suite A 96/100 (1.4.0 94), CC06-C 100/100 (32), live shadow false positives 30 -> 0 of 119, live logic turns 2/5 (3/5 before). Readings post-pass <= 0.18 s per CC06-C item.
Lessons learned