Compound-hallucination failure mode: spec bytes treated as authoritative instead of hypothesis #1
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What surfaced
During AILang's
raw-buf.2iteration (the first real polymorphickernel-tier module after the kernel-extension-mechanics milestone),
the spec at
docs/specs/0054-raw-buf.mdshipped through brainstormimplement with a chain of three surface-parse defects + one
structural defect that none of the upstream skills had caught. Full
diagnosis in the AILang
BLOCKED.mdfrom the iteration (commit647121c..working tree).Root cause is not "the spec was wrong" in isolation — it is that
every defensive line in the skill pipeline treated the spec's
Form-A code blocks as authoritative truth instead of as hypothesis
to verify.
The spec inherited aspirational Form-A from
design/models/0007-kernel-extensions.md(amodels/whitepaper,per the AILang
design/INDEX.mdconvention "evolves / onboarding"not "test-pinned / stable"). No skill in the pipeline questioned
whether the Form-A snippets in the model actually parsed against
the current surface. Brainstorm copied them into the spec. Grounding-
check PASSed. Planner inlined them verbatim into a plan task body.
Plan-recon validated paths but not surface-parseability. Only the
implementer hit them at execution and surfaced the panic.
This is the compound-hallucination pattern: an earlier model
writes an aspirational construct into a checked-in document, a
later model reads that document and treats the construct as
canonical because of its
design/location, and no validation stepbetween the two enforces the model/contract distinction.
The irony: AILang exists to harden LLM authoring against
hallucination. The first real spec extension after the kernel-
extension-mechanics milestone demonstrated that the hardening
mechanisms (content-addressing, local-reasoning, test-pinned
contracts) only work if the skill pipeline consults them. None of
the four defense lines did.
The four defense lines and where each failed
brainstormStep 4 (feature-acceptance + concrete code).Already requires concrete code as the criterion's empirical
evidence. Does NOT require that code to have been parsed
against the live tool. A trivial
ail parse <code>(or whateverthe project's surface tool is) on each block before PASS would
have caught
(storage-tag), the implicitforall, and the(RawBuf a)/(con RawBuf a)shorthand confusion.grounding-check. Searches for green tests ratifying thespec's assumptions about codebase behaviour. Does NOT extract
the spec's own code blocks and validate them against the
corresponding parser. Complementary defense missing.
plannerStep 2 (plan-recon). Found one workspace-pinsite (
workspace_pin.rs) but missed the second pin ine2e.rs::workspace_lists_imported_modules— same invariant,different test file. The "enumerate hash-pin blast radius
across ALL
crates/*/tests/" discipline is a project-memoryitem but is not enforced in plan-recon's mandatory checks.
plannerStep 5 self-review. Procedural checks(placeholder scan, type consistency, compile-gate vs deferred-
caller, filter-string resolution). Does NOT include: "verbatim
bytes the plan inlines for the implementer — have they been
parsed against the live tool?"
The implementer behaved correctly (respected the spec, surfaced
BLOCKED instead of patching). That is the only line that worked —
and only because
feedback_dont_adapt_tests_to_bugsdiscipline issharp.
Proposed fixes
All five for the next time a substantive spec extension is on the
roadmap. None of these is AILang-specific; the pattern recurs
anywhere a
models/(orRFCs/orproposals/) directory carriesaspirational code that a later spec is expected to lift.
Fix 1 — brainstorm Step 4: parse-every-block gate
Tighten the feature-acceptance step to:
Verifiable: if a Run block appears in the brainstorm chat showing
the parse output, the gate fired. If not, the gate was skipped.
Fix 2 — grounding-check: extract-and-validate code blocks
Add a third pass to the agent: extract every fenced code block
from the spec, infer its language (the fence label or convention),
dispatch to the appropriate parser, report any parse failures as
BLOCK. Complementary to the existing test-ratification search; no
overlap.
This needs a per-project mapping of "fence label → parser command"
to be configurable (AILang has
.ail,.ail.json,.ll; anotherproject has
.toml,.yaml,.proto; etc.). The mapping livesin the project profile.
Fix 3 — plan-recon: hash-pin blast radius enumeration
Promote the existing project-memory item
("
feedback_hash_pin_blast_radius_audit" in AILang's case) to aplan-recon mandatory check. The agent enumerates EVERY
*.rs(orlanguage-appropriate equivalent) file under
crates/*/tests/that grep-matches the spec's load-bearing constant, fixture name,
or assertion shape. The dispatch prompt template should embed the
memory directly so the discipline does not depend on the
orchestrator remembering to reinforce it.
Fix 4 — planner Step 5: parse-the-bytes-i-inline gate
Add a ninth self-review check:
This is the last defensive line before implementer dispatch. If
it fails, the plan is wrong, regardless of what brainstorm or
grounding-check said.
Fix 5 —
design/models/aspirational markerAdopt a convention (recommendation to projects, not enforced by
the plugin) where files under a "models" / "RFCs" / "proposals"
directory carry an explicit frontmatter marker:
When a brainstorm session lifts content from such a file, the
markers feed forward as a flag: "this paragraph was lifted from
an aspirational source; have you validated it against current
code at lift-time?"
design/INDEX.md(or the equivalent design ledger) shoulddistinguish "model" rows from "contract" rows in a way the
skill agents can mechanically read.
Scope
The five fixes are independent; each can ship in its own
iteration. The skill plugin is shared across projects, so a fix
here benefits every consumer.
Priority order (substantive impact, not effort):
mechanism-level.
Out of scope
Mechanically auto-running every code block in every skill is not
the goal. The goal is that the orchestrator and the dispatched
agents both fail closed when they have not validated a load-
bearing assumption against the live tool. The validation can be a
shell-out, a static lookup, or an explicit "no parser exists for
this fence label, skip"-and-document. What is unacceptable is the
current state: silent assumption-as-truth.
Why this is a
featurenot anideaThe diagnosis is concrete. The five fixes are named with specific
skill files and step numbers. The patterns are recurring (the same
shape will reappear on the next substantive spec extension of any
project that uses the plugin). This earns its place above the
ideathreshold.References
BLOCKED.mdfrom iteration raw-buf.2 (uncommitted; seethe conversation transcript at file rotation if needed).
feedback_specs_need_concrete_code.md— the existingmemory that points at the same pattern from a different angle.
feedback_hash_pin_blast_radius_audit.md— the existingmemory that captures Fix 3's content from a recent recurrence.
feedback_grounding_check_misses_insource_tests.md— aprior known-gap in grounding-check, same family of "agent does
not consult the full surface".
Triage (2026-05-29)
Diagnosis re-verified against the current plugin tree. Verdict per
fix:
brainstorm/SKILL.mdStep 4 (:112-147) requires concrete code but never a parse; Step 7 self-review check 5 (:224) checks code presence, not parseability.brainstorm/agents/grounding-check.mdratifies assumptions about codebase behaviour via green tests; no pass extracts/parses the spec's own fenced blocks. Genuinely complementary.planner/agents/plan-recon.md:120-127already grew a "Non-compile-checked sites" sweep covering drift-pins/fixtures — but:211-215gate it behind signature/variant/removal scopes. Theraw-buf.2failure was a module addition that shifted a workspace-listing hash (no signature change), so the sweep was legitimately omittable. Fix 3 narrows to: make the hash-pin enumeration mandatory for content-pin-perturbing scopes too.planner/SKILL.mdStep 5 (:162-225) has 8 checks today (the issue's "ninth" is consistent); all are textual/structural, none runs inlined bytes through a parser.design_modelsslot exists (templates/project-profile.yml:11, schema:16) but nostatus/validated-againstfrontmatter convention, and brainstorm does not flag lifts from it.Cross-cutting prerequisite. Fix 1 and Fix 2 both need the same
new profile slot — a
fence-label → parser-commandmapping — whichdoes not exist in
docs/profile-schema.mdtoday. Landing it once asa prerequisite avoids Fix 1 and Fix 2 each defining the slot.
Per ~/dev/CLAUDE.md ("each fix is independent; each can ship in its
own iteration"), kept as a single tracking issue with a checklist
rather than split into a milestone. Labelled
feature.Checklist (author's priority order)
fence-label → parser-commandmapping to
docs/profile-schema.md+templates/project-profile.yml(prerequisite for Fix 1 and Fix 2). Done on branch
feat/spec-validation-slot(4a2c70b).parser behind it must parse clean before PASS; parse-trace into
the brainstorm chat. Landed as Step-7 self-review check #6 (not
Step 4 — the spec file exists only after Step 6). Branch
feat/spec-validation-slot(e1d3336).every verbatim surface-language body the plan inlines is parsed
against the live tool before hand-off; trace into the planner
session. Branch
feat/spec-validation-slot(305d797).extracts fenced blocks, runs the mapped parser, reports parse
failures as BLOCK. Complementary to test-ratification and
independent of Fix 1 (fresh-context second line). Branch
feat/spec-validation-slot(fc36647).sweep now mandatory for content-pin-perturbing scopes (not only
signature/variant/removal); enumerate EVERY matching test file.
Embedded in plan-recon.md itself (no new slot; leans on CLAUDE.md
lockstep pairs). Branch
feat/spec-validation-slot(e019d04).status: aspirational/validated-against:frontmatterconvention, consumed by brainstorm Step 1 + Step 4 as a
lift-time flag (upstream signal to the Fix-1 gate). Branch
feat/spec-validation-slot(56ef25c).