docs(OGAR): SurrealQL-AST trap pre-flight spellbook + activation triggers#99
Merged
Merged
Conversation
…gers The trap (per SURREAL-AST-AS-ADAPTER.md §0): treating SurrealQL AST as the primary IR for producers with lifecycle vocabulary, then hijacking DEFINE EVENT / sentinels to smuggle behavior the DDL can't carry. The trap is pre-cognitive — sessions reflex their way in. A mirror that fires BEFORE the reflex is cheaper than a refactor after. This is the operational extract of the existing design doc: - docs/SURREAL-AST-TRAP-PREFLIGHT.md (new) — five introspection questions (90-second read), diagnostic signatures for review, three-move remediation, activation triggers + READ-BY scope. - docs/SURREAL-AST-AS-ADAPTER.md — added top pointer to the pre-flight (the design vs. the operational mirror). - CLAUDE.md — new non-negotiable: "SurrealQL is an adapter, not a spine." Added pre-flight to the doc family at position 7. Pattern follows existing workspace precedent (lance-graph's encoding-ecosystem.md / lab-vs-canonical-surface.md / core-first- transcode-doctrine.md MANDATORY-before rules). Fires for: core-first-architect / adapter-shaper / core-gap-auditor / Plan subagent on trigger phrases (SurrealQL AST, DEFINE EVENT, .surql, surreal_ast.rs, distill from SurrealQL, lower onto ogar_vocab::Class, from_triples, recompute_dag, behavioral roundtrip). Worked remediation case stays APP-CODEBOOK-MIGRATION-PLAN.md W3 (odoo-rs od-ontology fork → lower onto ogar_vocab::Class, emit via adapter, delete fork). Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EYvNjD8M8LMNYbRy3gq2FP
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
The "SurrealQL-AST trap" spellbook — a pre-flight introspection mirror that fires before a session reflexes into treating SurrealQL AST as the primary IR for producers with lifecycle vocabulary.
The trap is pre-cognitive (sessions don't argue their way in — they reflex their way in), so the mirror has to fire before the keyboard does. The fix is the established workspace pattern:
.claude/knowledge/*.md+MANDATORY-before-Xnon-negotiable + activation triggers. Five questions, 90 seconds, one mirror.Three artifacts
docs/SURREAL-AST-TRAP-PREFLIGHT.md(new) — the spellbook itself. Five introspection questions (Q1–Q5), diagnostic signatures for post-hoc review, three-move remediation script, activation triggers + READ-BY scope. ~220 lines, designed to be readable in 90 seconds.docs/SURREAL-AST-AS-ADAPTER.md— added a top-of-doc pointer distinguishing the design (the why) from the operational mirror (the pre-flight). Existing content unchanged.CLAUDE.md— added one non-negotiable line ("SurrealQL is an adapter, not a spine") and added the pre-flight to the doc family at position 7.The five questions (TL;DR of the spellbook)
Any "stop" answer catches the trap pre-materialization.
Diagnostic signatures (for reviewers)
.surqlfiles withDEFINE EVENT … WHEN … THEN …doing more than row triggers-- @action:/-- @state:/-- @lifecycle:surreal_ast.rsas a project's spine (not adapter)From<DdlAst> for ActionDef/to_action_def()conversionsparse(emit(parse(x))) == parse(x)through DDLtriple.rs/recompute_dag.rscluster colocated withsurreal_ast.rs(the od-ontology fork pattern)Pattern precedent
Same shape as the workspace's existing knowledge-doc + MANDATORY-rule pattern: lance-graph's
encoding-ecosystem.md,lab-vs-canonical-surface.md,core-first-transcode-doctrine.md. The mechanism is well-trodden; the "spellbook" framing is the user's playful term for it. Activates forcore-first-architect/adapter-shaper/core-gap-auditor/Plansubagents on trigger phrases (SurrealQL AST,DEFINE EVENT,.surql,surreal_ast.rs,distill from SurrealQL,lower onto ogar_vocab::Class,from_triples,recompute_dag,behavioral roundtrip).Worked remediation case stays the same
APP-CODEBOOK-MIGRATION-PLAN.mdW3 — odoo-rsod-ontology::{surreal_ast,triple,emit}fork → lower ontoogar_vocab::Class, emit via canonical adapter, delete the fork. The spellbook is now the entry-point doc that explains why W3 exists, before someone authors another fork.Status
[H]— landing-shape only; doc-only PR, no code touched. Falsifier would be a probe that loads the doc in a fresh session before a transcode task and measures whether the reflex actually catches (PROBE-SPELLBOOK-MIRROR). Not currently authored.🤖 Generated with Claude Code
https://claude.ai/code/session_01EYvNjD8M8LMNYbRy3gq2FP
Generated by Claude Code