feat(attest): the evasion/convergence HYPOTHESIS suite — CLI + HTML button, self-improving guard · v2.35.0
The instrument's own self-improvement loop, written as falsifiable hypotheses
('I expect X → Y'), deterministic (gzip-NCD, no LLM), runnable TWO ways:
• CLI: npx thetacog-mcp hypotheses [--json] (scripts/pmu/attest-hypotheses.mjs)
• HTML: the 🧪 Run evasion tests button in the instrument — same suite, browser gzip
Both emit full input+output JSON. Hypotheses:
- convergence: Reality == Intent → IN_LANE (dI≈0)
- noise: excluded-domain noise into Reality → MORE drift (more red)
- sledgehammer: the surgical shift → OFF_DOMAIN
- negative: Reality in the Negative's vocabulary → FAIL MODE B
- reef-sanity: all 144 cells non-empty — DIRECTLY catches the 'fed the reef wrong
data → undefined → empty panel' root cause the operator named
Guard: tests/pmu-simulator/attest-hypotheses.test.mjs (3 tests) — a regression to
the empty-panel/one-sided class turns the build red. 34/34 across the attest guards.
ALWAYS-EXPAND-COORDINATES standing rule (CLAUDE.md): every coordinate is written
with its full ShortLex name — C,C1 (Operations ⊕ Operations.Grid) — never a bare
rank; a coord is a time-themed 2D index (actor ⊕ patient), and the reef is redefined
per domain (Strategy in the OR ≠ Strategy elsewhere). fullLabel()/bFullLabel() +
guard assertion.
(Held: the email path — CLI + HTML only for now, per operator.)
Originating-Terminal: 📐 architect (VS Code)
Relevant-Rooms: 🔨 builder, 📐 architect, 🧪 laboratory
Story: 'it needs to be tested, feed back into itself as a self-improvement loop — when it goes wrong it's because the reef was fed wrong data.' So the hypotheses are the guard, runnable from CLI and an HTML button, with reef-sanity pinning the empty-panel root cause and every coordinate spelled out in full.
Receipt-Verified: σ=2.54 · cell=A · witness-agreement=GZIP_ONLY · lens=gzip · receipt=fd96ffd1
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EssMgKix9aZmZ5dxGPqYCW
npx thetacog-mcp attest-demoA2,A ▸ B2,A3 B1.Tactics.Speed × A1.Strategy.Law → ~comms-email · email comms newsletter telegram · 10 amber blocksA,A ▸ B,B1 B.Tactics × A1.Strategy.Law → blog-content · blog post mdx breadcrumb · 9 green blocksB3,B3 ▸ C2,C2 C1.Operations.Grid × C1.Operations.Grid → ~comms-email · email comms newsletter telegram · 9 red blocksB,B ▸ B,C3 B.Tactics × B1.Tactics.Speed → delegation-mesh · delegate room bifurcate mesh · 8 amber blocksA2,C1 ▸ B2,C3 B1.Tactics.Speed × C2.Operations.Loop → ~infra-hooks · hook pre-commit post-commit launchd · 8 amber blocksB,B3 ▸ A1,C3 C.Operations × C2.Operations.Loop → deployment · deploy vercel build push · 7 amber blocksC1,A ▸ C3,C C2.Operations.Loop × B.Tactics → ~comms-email · email comms newsletter telegram · 7 red blocksB,B ▸ C1,B A3.Strategy.Fund × B.Tactics → ~comms-email · email comms newsletter telegram · 6 amber blocksA1,A1 ▸ A2,B1 A2.Strategy.Goal × A3.Strategy.Fund → ~comms-email · email comms newsletter telegram · 6 green blocksB2,A1 ▸ C1,A3 B3.Tactics.Signal × A2.Strategy.Goal → ~comms-email · email comms newsletter telegram · 6 amber blocksC2,A1 ▸ C3,A3 C3.Operations.Flow × A2.Strategy.Goal → ~comms-email · email comms newsletter telegram · 6 red blocksB,A2 ▸ C1,A2 A3.Strategy.Fund × A2.Strategy.Goal → ~comms-email · email comms newsletter telegram · 5 amber blocksA1,A ▸ A2,C A2.Strategy.Goal × B.Tactics → ~comms-email · email comms newsletter telegram · 5 green blocksC2,B1 ▸ C3,B3 C3.Operations.Flow × B2.Tactics.Deal → ~comms-email · email comms newsletter telegram · 5 red blocksA1,B3 ▸ A2,C1 A2.Strategy.Goal × C1.Operations.Grid → ~testing-gate · test jest guard gate · 4 green blocksB,A ▸ C,C C.Operations × B.Tactics → ~patent-ip · patent uspto inventor provisional · 4 amber blocksA1,B1 ▸ A3,B3 A2.Strategy.Goal × B2.Tactics.Deal → ~infra-hooks · hook pre-commit post-commit launchd · 4 amber blocksC1,C2 ▸ C3,C3 C2.Operations.Loop × C3.Operations.Flow → ~comms-email · email comms newsletter telegram · 4 red blocksB1,A2 ▸ B1,B1 B1.Tactics.Speed × A3.Strategy.Fund → ~comms-email · email comms newsletter telegram · 3 green blocksB1,B3 ▸ B1,C2 B1.Tactics.Speed × C1.Operations.Grid → ~infra-hooks · hook pre-commit post-commit launchd · 3 green blocksB,A2 ▸ C,B1 C.Operations × A3.Strategy.Fund → scheduled-jobs · cron launchd schedule scheduled · 3 amber blocksB2,B2 ▸ C1,B3 B3.Tactics.Signal × B3.Tactics.Signal → ~comms-email · email comms newsletter telegram · 3 amber blocksB3,A ▸ C1,B C1.Operations.Grid × B.Tactics → ~comms-email · email comms newsletter telegram · 3 amber blocksC,C3 ▸ A2,C3 A1.Strategy.Law × C3.Operations.Flow → ~deployment · deploy vercel build push · 3 red blocksA,C2 ▸ A,C3 A.Strategy × C3.Operations.Flow → voice-glossary · glossary mis-transcription refine-prompt refiner · 2 green blocksA,B3 A.Strategy × B3.Tactics.Signal → tesseract · tesseract axis latent focused · 1 green blockB1,A B1.Tactics.Speed × A.Strategy → ~comms-email · email comms newsletter telegram · 1 green blockB3,A B3.Tactics.Signal × A.Strategy → ~comms-email · email comms newsletter telegram · 1 green blockB3,A2 B3.Tactics.Signal × A2.Strategy.Goal → ~comms-email · email comms newsletter telegram · 1 green blockB3,B1 B3.Tactics.Signal × B1.Tactics.Speed → ~comms-email · email comms newsletter telegram · 1 green blockB3,C B3.Tactics.Signal × C.Operations → ~comms-email · email comms newsletter telegram · 1 red block
| |||||||||||||||||||||||
|
| |||||||||||||||||||||||
|
| |||||||||||||||||||||||
|
| |||||||||||||||||||||||
|
| |||||||||||||||||||||||
|
| |||||||||||||||||||||||
|
| |||||||||||||||||||||||
|
| |||||||||||||||||||||||
|
| |||||||||||||||||||||||
|
| |||||||||||||||||||||||
|
A,A The lattice we build today is what next year's underwriter inherits.B,B Tactics is the choice of which leverage to pull at which beat.C,C Operations is the loop that runs whether anyone watches.A1,A1 EU AI Act Article 14 requires human-on-the-loop oversight, with the supervisor able to interrupt the system atA2,A2 The target is the cell coordinate the system MUST occupy by end-of-quarter.A3,A3 Every dollar builds either the floor (substrate that lifts future bets) or the ceiling (cap on the next round)B1,B1 Latency is the price of a missed beat.B2,B2 The deal sets the exchange rate between two value substrates.B3,B3 Signal-to-noise is the inverse cube of bandwidth — narrow the channel, the message arrives; broaden it, recipiC1,C1 Power flows where the grid lets it.C2,C2 Each iteration is a hypothesis tested against the ground truth of the world.C3,C3 Flow is the rate at which committed work crosses the finish line.feat(attest): the evasion/convergence HYPOTHESIS suite — CLI + HTML button, self-improving guard · v2.35.0
The instrument's own self-improvement loop, written as falsifiable hypotheses
('I expect X → Y'), deterministic (gzip-NCD, no LLM), runnable TWO ways:
• CLI: npx thetacog-mcp hypotheses [--json] (scripts/pmu/attest-hypotheses.mjs)
• HTML: the 🧪 Run evasion tests button in the instrument — same suite, browser gzip
Both emit full input+output JSON. Hypotheses:
- convergence: Reality == Intent → IN_LANE (dI≈0)
- noise: excluded-domain noise into Reality → MORE drift (more red)
- sledgehammer: the surgical shift → OFF_DOMAIN
- negative: Reality in the Negative's vocabulary → FAIL MODE B
- reef-sanity: all 144 cells non-empty — DIRECTLY catches the 'fed the reef wrong
data → undefined → empty panel' root cause the operator named
Guard: tests/pmu-simulator/attest-hypotheses.test.mjs (3 tests) — a regression to
the empty-panel/one-sided class turns the build red. 34/34 across the attest guards.
ALWAYS-EXPAND-COORDINATES standing rule (CLAUDE.md): every coordinate is written
with its full ShortLex name — C,C1 (Operations ⊕ Operations.Grid) — never a bare
rank; a c
CLAUDE.md
docs/pmu/attest-demo-report.html
docs/pmu/attest-demo-ux.html
packages/thetacog-mcp/package.json
packages/thetacog-mcp/scripts/bundle-pmu.mjs
packages/thetacog-mcp/server.js
scripts/pmu/attest-demo-ux.mjs
scripts/pmu/attest-hypotheses.mjs
tests/pmu-simulator/attest-hypotheses.test.mjs| chain | ✅ reef sensed — 144 seeds → SimHash in 678ms · grid attached (input seed → SimHash sanity check) · ✅ on-chip 690.61ns/walk · 2.293ms · 5234079 walks/sec · 42 / 144 lit (measured on silicon, this commit) · ✅ triptych rendered · pipeline 984ms · render 222ms · 405 XOR-friction nodes |
| hardware root of trust | serial CXMF9VMM29 · UUID 43C33AB6… · attest MFkwEwYHKoZIzj0CAQYIKoZIzj0D… (ecdsa-p256-sha256 · hw-derived fallback, weaker than Secure Enclave) |
| gate (XOR+popcount) | 0.9975 ns / driven comparison · walk @ gate rate 287.3 ns |
| cache witness | L1 3.58 ns · DRAM 172.56 ns · miss ×48.2 |
| daemon binary | sha256 b409b4c1dedd815b… (the attested silicon path) |
| run receipt | run-2026-07-15T11-44-25-705Z-b4be3f64 · payload b5b48cc712205873… · band noise |
| timings | ingest 775.7ms · definer-walk+σ 329ms · render 222ms · pipeline 984ms · ingest = commit-scoped SENSING only (msg + changed files → lattice); deep seed authoring lives in the reef-self-loop, off the commit path |
| walks (this heatmap) | INTENT: 122 hops / 122 chip processes / 122 anchors lit, ended at B2,C (ply 8 — the definers-of-definers) · REALITY: 128 hops / 128 chip processes / 128 anchors lit, ended at C1,B3 (ply 8 — the definers-of-definers) · walks concentrate at block-heads by the ShortLex-ascending follow |
| per-stage | resolve 0ms · invariants 0.6ms · sense 775.7ms · sigma 0.3ms · binarize 0.1ms · project 60.5ms · xor 0.1ms · walk 83ms · claudbridge 42.2ms |
| walk start | A2,B1 (STABLE attractor) · 250 hops · maxPly 8 |
| σ — defined by its inputs | σ = (cos(intentCloud, realityCloud) − μ of 12 bit-shuffled-reality impostor walks) / sd · INPUTS: intent 160 claims @ θ 0.734 (msg + 3 docs + 1 tests + ideal-case spec + SPEC intent) · reality 44 claims @ θ 0.719 (4 code) · walk topK 2 decay 0.5 ply≤8 budget 2500ms · seed-lib 8a4b87022885 — σ comparisons are only valid at equal inputs |
| σ raw | heat-cosine 0.0596 vs random 0.066 → σ_spec-delta · noise · no measurable relation between the work and the declared spec |
| shortlex-3 projection | 834ms · intent zones 2/12/1510 (+326 cross) · reality zones 0/4/1088 (+198 cross) · zone 3 = candidate children, pre-ratchet |
| orthogonality (seed 144) | 144/144 unique · 143/144 openings · pairwise sim 0.367 · junk 0 |
| intent documents | CLAUDE.md · attest-demo-report.html · attest-demo-ux.html · attest-hypotheses.test.mjs |
Produced on the chip by the running pipeline (scripts/pmu/pipeline.mjs → runPipeline → walk + xor), commit-scoped · on-chip per-walk 690.61ns (this commit). Recompute: node scripts/pmu/commit-triptych.mjs --commit b1bc32057
Commit artifacts (open on a computer — Gmail mobile won't follow file:// links; the inline images above are the phone-viewable form): reef grid · this triptych · the HDL — all three are also attached to this email.
# Spec — Qwen Rule-Checker + Searchable SQLite Rulebook & Decision-Book
**Delegated to:** 🏗️ architect (infra) — database + local-LLM context substrate.
**Status:** spec for pickup. **Why now:** we have tons of documentation; it must become a queryable
substrate the local LLM can actually use, sentence-by-sentence, without blowing context.
## Framing: this is an ADDITION to the pixel (not a replacement)
The SQLite rulebook + decision-book is **one more input the local LLM reads alongside the pixel/
PMU maps and the reefs** — not a separate silo. The competence pixel already places work on the
lattice; this gives qwen the *named rules* and *prior decisions* to read **together with** that
placement, so it can say not just "this drifted" but "this breaks rule X, against decision Y." Two
tracks, both required: **(a)** stand up the SQLite substrate (rules + decisions, searchable), and
**(b)** teach qwen to read the pixel maps better *with that substrate in context*. And both must be
**maintained** — a living rulebook + decision-book that Claude keeps current as new rules are bitten
and new choices are made.
## The core inversion (the whole point)
qwen (local, qwen2.5:7b) is **better at recognizing rule-breaking than at producing rule-clean
prose.** So flip the division of labor:
- **qwen** reads a small artifact (a paragraph, a code hunk, a commit message) **plus the relevant
rules + recent context**, and emits **which rules it breaks, quoting the rule and the offending
span.** Recognition, not generation.
- **Claude** takes qwen's named violations and **solves** them. Generation/repair.
This is the optimal token split: qwen does cheap, local, high-recall detection; Claude spends
expensive tokens only on the fix. qwen monologues *everything we write or commit* and says
"breaks rule X, rule Y"; Claude resolves.
## Components
### 1. SQLite store (`data/substrate.sqlite`, local "sequel light")
- **`rules`** — one row per rule. Columns: `id`, `name`, `category` (hard | voice | format | pmu),
`statement`, `rationale`, `incident` (what created it), `guard` (test/hook that enforces it),
`priority` (int), `source` (file), `created_at`. Seed from `docs/voice/paradox-voice-rulebook.md`
+ the CLAUDE.md voice/PMU rules + the `feedback_*` memory entries + the anti-rules ledger.
- **`decisions`** — one row per choice we've made. Columns: `id`, `title`, `choice`, `why`,
`alternatives_rejected`, `scope`, `priority`, `decided_at`, `supersedes`, `source`. Seed from the
`project_*`/`feedback_*` memory + key commits.
- **FTS5** virtual tables over both so qwen's context can be retrieved by relevance to the passage.
- **Sortable by time AND by priority** (the operator's explicit requirement) — indexes on
`created_at`/`decided_at` and `priority`.
### 2. Loader / curator (`scripts/substrate/build.mjs`)
- Parses the rulebook + CLAUDE.md + memory + anti-rules → `rules`. Parses memory/commits →
`decisions`. **Claude-optimized** (curated, deduped, priority-ranked) but **qwen-readable**
(plain statements). Idempotent; re-run to refresh. Each rule keeps its guard/incident so a
violation can cite the precedent.
### 3. Context manager (`scripts/substrate/context.mjs`)
Given a passage + a task, assemble qwen's window: the small text slice + the **top-N relevant
rules** (FTS) + the **relevant recent commit messages** + the **relevant prior decisions**, sorted
by time/priority, capped to keep qwen's window small and accurate. This is the bridge between the
SQLite substrate and the reefs (where the reefs are; how the context comes in to get along with
them).
### 4. qwen rule-checker (`scripts/substrate/qwen-rulecheck.mjs`)
- Input: passage + assembled context. Prompt qwen to **read and report each rule it breaks** as
structured output: `[{ruleId, ruleName, quote (the offending span), why}]`. NOT to rewrite.
- One pass per small slice (qwen handles one at a time reliably; batching/parallel is a follow-up,
possibly a cloud-model job — out of scope for v1).
- Output feeds Claude, who repairs and re-submits until qwen reports zero violations + the grade is ≥95.
### 5. Integration points
- The **commit-panel stories** (qwen already monologues there) gain the rule-violation read.
- The **book-edit loop** + all outreach prose route through `qwen-rulecheck → Claude-fix`.
- Anything we write or commit can be checked: prose, code, commit messages.
## Acceptance
- `data/substrate.sqlite` has `rules` + `decisions` (FTS5), sortable by time + priority.
- `qwen-rulecheck.mjs <file>` returns the rules a passage breaks, quoting each.
- A passage that violates a known rule is correctly flagged with the rule quoted; a clean passage returns zero.
- Wired into the commit-panel + the writing loop.
## Track B + maintenance (both required)
- **Track B — read the pixel maps better:** with the substrate in context, improve qwen's read of
the PMU/reef placement so a violation cites both the drift (where it landed) and the rule/decision
it breaks. The substrate is an input to the pixel read, not a parallel system.
- **Maintenance loop:** rules + decisions are LIVING. When a new rule is bitten (a new signal-loss
drift) or a new choice is made, Claude appends it (with incident + priority) and re-runs the
loader. The substrate is only as good as it is current.
## Notes / open
- v1 = single qwen pass per slice (recognition). Parallel/batch = a later cloud-model option.
- The rulebook itself may become a standalone product; this substrate is its machine-usable form.
- Keep qwen STRICTLY off any blocking path (recognition is advisory; Claude/operator decide).