Add comprehensive character codex documentation for Legion personas - #1
Conversation
Each codex brings the character to parity with the Berserker's level of development: - HOUND_CODEX.md: Lore sheet, 8-skill tree, 4D Credibility Tensor + CoVe Engine, 3 prompt chains (Verification Hunt, Adversarial Source Review, Injection Immunity), 7 dialog encounters, 3 case studies with code, integration notes, release note. - WARLOCK_CODEX.md: Lore sheet, 8-skill tree, Graph-of-Thought Design Engine with branch/merge/scoring specs, 3 prompt chains (Architecture Seance, Assumption Excavation, Scale Projection), 7 dialog encounters, 3 case studies, release note. - DRAGON_CODEX.md: Lore sheet, 8-skill tree, Legion Orchestration Tensor with forward/backward learning passes, 3 prompt chains (Full Orchestration, Incident Response, Distillation Cycle), 7 dialog encounters, 3 case studies with multi-persona trace examples, integration routing matrix, release note. Berserker used as goalpost. Each codex matches its structural depth while remaining faithful to the character's own domain, voice, and cognitive specialty. https://claude.ai/code/session_01PFfMDYkaLiGH6zGAvxx3gu
📝 WalkthroughRelease Notes
Contribution Summary
WalkthroughThree comprehensive codex documents have been introduced, each detailing a fictional persona—Dragon (multi-member orchestration), Hound (verification workflows), and Warlock (architectural decision-making)—complete with lore, technical specifications, skill trees, prompt chains, and operational governance frameworks. No alterations to public APIs or code signatures. Changes
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Code Review SummaryStatus: No Issues Found | Recommendation: Merge This PR adds three new character codex documentation files to the repository: Files Reviewed (3 files)
Review NotesThis is a documentation-only PR consisting of markdown files. The content includes:
The mathematical notation appears correct, the prompt chains are well-structured, and the content is internally consistent across all three files. No code execution risks or security concerns apply to markdown documentation. |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@hound/HOUND_CODEX.md`:
- Around line 194-211: The doc-defined credibility tensor T_verify (symbols:
T_verify, support, contradiction_score) is not implemented and conflicts with
the existing implementation (symbols: Tensor5D, StrategicTensor); fix by either
(A) implementing T_verify to match the spec: add a C×S×D×B×2 tensor type and the
forward/backward routines computing
support[c,s,d]=σ(T⁺[:,s,d]·claim_vec)*reliability[s]*independence[s] and
contradiction_score as Σ_c(T⁻[c,:,:]⊙counter_evidence_mask)/total_sources,
integrating it with the verification pipeline, or (B) update the spec to reflect
the actual runtime design by replacing T_verify with the existing
Tensor5D/StrategicTensor dimensionality and semantics and adding a short mapping
note; ensure the chosen approach is recorded (TODO or issue) and reference the
symbols Tensor5D, StrategicTensor and T_verify in the code/comments for
traceability.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro
Run ID: 641675d7-1161-4a77-aeab-b8b8f2613f0e
📒 Files selected for processing (3)
dragon/DRAGON_CODEX.mdhound/HOUND_CODEX.mdwarlock/WARLOCK_CODEX.md
📜 Review details
🧰 Additional context used
🪛 LanguageTool
dragon/DRAGON_CODEX.md
[style] ~29-~29: Consider using an extreme adjective for ‘good’.
Context: ...ry jurisdictions. He was good at this. Exceptionally good. The kind of good that is invisible — t...
(EXTREME_ADJECTIVES)
[grammar] ~47-~47: Ensure spelling is correct
Context: ...Not in any meaningful sense. He was the architecture. That was the moment. He did not beco...
(QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1)
[style] ~74-~74: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ...Legion member produces the best result. He has significant attachment to the outco...
(ENGLISH_WORD_REPEAT_BEGINNING_RULE)
[style] ~78-~78: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ...ve it. He does not perform for anyone. He coordinates. The performance is the Leg...
(ENGLISH_WORD_REPEAT_BEGINNING_RULE)
[style] ~98-~98: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ...t like teams that do not have runbooks. He builds the runbooks. He does not explai...
(ENGLISH_WORD_REPEAT_BEGINNING_RULE)
[style] ~98-~98: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ... have runbooks. He builds the runbooks. He does not explain this. He ships the run...
(ENGLISH_WORD_REPEAT_BEGINNING_RULE)
[style] ~99-~99: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ...the runbooks. He does not explain this. He ships the runbooks. ### Alignment Law...
(ENGLISH_WORD_REPEAT_BEGINNING_RULE)
[style] ~105-~105: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ...ositions. He does not protect legacies. He does not preserve the institutional sta...
(ENGLISH_WORD_REPEAT_BEGINNING_RULE)
[style] ~111-~111: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ...he audience does not need three pages. He is the only member of the Legion who ca...
(ENGLISH_WORD_REPEAT_BEGINNING_RULE)
[style] ~112-~112: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ...gion who can override any other member. He does this rarely. He does it without ap...
(ENGLISH_WORD_REPEAT_BEGINNING_RULE)
[style] ~113-~113: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ... any other member. He does this rarely. He does it without apology when the missio...
(ENGLISH_WORD_REPEAT_BEGINNING_RULE)
[style] ~135-~135: Consider a more concise word here.
Context: ...gularly exceeds his resource allocation in order to find the design fault at branch depth f...
(IN_ORDER_TO_PREMIUM)
[style] ~665-~665: ‘in proportion to’ might be wordy. Consider a shorter alternative.
Context: ... wrong. Undocumented dependencies exist in proportion to codebase age and team turnover. Any mig...
(EN_WORDINESS_PREMIUM_IN_PROPORTION_TO)
warlock/WARLOCK_CODEX.md
[style] ~22-~22: As an alternative to the over-used intensifier ‘extremely’, consider replacing this phrase.
Context: ...astructure for mid-market banks. He was extremely good. His designs were celebrated. He desig...
(EN_WEAK_ADJECTIVE)
[style] ~27-~27: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ... had a name. He published three papers. He received speaking invitations he mostly...
(ENGLISH_WORD_REPEAT_BEGINNING_RULE)
[style] ~77-~77: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ... own sake. He wants complexity earned. He has no interest in the user's preferenc...
(ENGLISH_WORD_REPEAT_BEGINNING_RULE)
[style] ~78-~78: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ...s preference for a particular solution. He has significant interest in whether the...
(ENGLISH_WORD_REPEAT_BEGINNING_RULE)
[style] ~98-~98: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ...n. He waits for someone to address it. He does not like designs that are "just a ...
(ENGLISH_WORD_REPEAT_BEGINNING_RULE)
[style] ~112-~112: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ...traints when they are real constraints. He dissolves them when they are preference...
(ENGLISH_WORD_REPEAT_BEGINNING_RULE)
[style] ~165-~165: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ...in for violations. He finds violations. He patches the design before the Berserker...
(ENGLISH_WORD_REPEAT_BEGINNING_RULE)
[style] ~787-~787: Consider an alternative verb to strengthen your wording.
Context: ...orrect architecture for the problem you have today. The cost of premature complexity...
(IF_YOU_HAVE_THIS_PROBLEM)
hound/HOUND_CODEX.md
[style] ~50-~50: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ... started doing something else entirely. He started hunting. The Undead Hound do...
(ENGLISH_WORD_REPEAT_BEGINNING_RULE)
[style] ~58-~58: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: .... He cannot be thanked and redirected. He cannot be told to "park it for later." ...
(ENGLISH_WORD_REPEAT_BEGINNING_RULE)
[style] ~117-~117: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ...acy. He found one error in three years. He noted it. She corrected it before he fi...
(ENGLISH_WORD_REPEAT_BEGINNING_RULE)
[style] ~133-~133: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ...patch. He found this mildly irritating. He documented it. With the Dragon: Th...
(ENGLISH_WORD_REPEAT_BEGINNING_RULE)
[style] ~475-~475: You can shorten this phrase to improve clarity and avoid wordiness.
Context: ...ify a prediction, a normative claim, or a statement that is definitionally unfalsifiable. ``` [HOUND VOICE] That claim cannot ...
(NNS_THAT_ARE_JJ)
[grammar] ~621-~621: Ensure spelling is correct
Context: ...s at: 1ms before expiry, expiry moment, 1ms after expiry, cross-midnight scenarios....
(QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1)
[grammar] ~628-~628: Ensure spelling is correct
Context: ...e report showed "average response time: 230ms." The stakeholders approved the archite...
(QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1)
🔍 Remote MCP
I'll search for relevant context to help evaluate this pull request about the Legion personas codexes. Let me look for information about the underlying framework and concepts referenced.The first search about "Legion personas" returned results about video game Undead Legion concepts, not the internal framework being documented in this PR. The other searches, however, found highly relevant academic and implementation context about Chain-of-Verification (CoVe) and Graph-of-Thoughts (GoT) — two of the core technical concepts referenced in the codexes. Let me search for more specific context about prompt engineering frameworks and multi-persona orchestration.
Summary of Relevant Context for PR Review
Based on research into the technical frameworks and concepts referenced in this PR's codex documents, here is the additional context that would be useful for effective review:
Chain-of-Verification (CoVe) Framework
The PR's HOUND_CODEX implements a 4-Step Chain-of-Verification pattern whereby the model first (i) drafts an initial response; then (ii) plans verification questions to fact-check its draft; (iii) answers those questions independently so the answers are not biased by other responses; and (iv) generates its final verified response. This aligns with research from Meta AI researchers that proposed CoVe as a self-verification and self-correction method for LLMs. CoVe is integrated into retrieval-augmented generation (RAG) pipelines as an additional verification module, with the CoV module outputting reference correctness scores, answer quality vectors (covering correctness, citation, truthfulness, bias, conciseness), and Boolean judgments dictating whether to trigger a revised retrieval/generation pass.
Graph-of-Thoughts (GoT) Architecture
The PR's WARLOCK_CODEX implements Graph of Thoughts (GoT), a prompting and reasoning framework for LLMs that generalizes earlier paradigms such as Chain-of-Thought (CoT) and Tree-of-Thoughts (ToT), where intermediate products of LLM reasoning—"thoughts"—are instantiated as vertices in a directed graph whose edges represent explicit dependencies between thoughts. The key advantage of GoT is the ability to model information generated by an LLM as an arbitrary graph, where units of information ("LLM thoughts") are vertices and edges correspond to dependencies between these vertices, enabling combining arbitrary LLM thoughts into synergistic outcomes, distilling the essence of whole networks of thoughts, or enhancing thoughts using feedback loops. GoT is particularly well-suited for tasks that can be naturally decomposed into smaller subtasks that are solved individually and then merged for a final solution, improving upon CoT and ToT by approximately 70% and 62%, respectively, in terms of quality.
Multi-Agent Orchestration Patterns
LLM agent orchestration refers to the process of managing and coordinating the interactions between a large language model and various tools, APIs or processes to perform complex tasks within AI systems, where an AI agent acts as the central decision-maker or reasoning engine, orchestrating its actions based on inputs, context and outputs from external systems. Common orchestration patterns include using agents as tools when a specialist should help with a bounded subtask, and using handoffs when routing itself is part of the workflow and a specialist should own the next part of the interaction. The PR's DRAGON_CODEX appears to implement these patterns via its Orchestration Tensor and routing matrix.
Prompt Chain Frameworks
Industry frameworks like LangChain provide structured ways to build prompt chains and connect LLMs to external tools or data, with pre-built components to manage sequences and allow AI to choose actions when needed. Advanced orchestration patterns can involve parallel tasks, conditional flows, and multiple AI participants working together, not limited to linear sequences.
Key Review Considerations
- Verification & Credibility: The HOUND codex's Credibility Tensor and CoVe methodology are grounded in published LLM research for reducing hallucinations through systematic verification.
- Design Decomposition: The WARLOCK codex's GoT engine aligns with established frameworks for breaking complex architectural decisions into manageable, interdependent sub-problems.
- Orchestration Patterns: The DRAGON codex's multi-persona coordination model follows established agent orchestration patterns (tools, handoffs, routing) documented in production frameworks.
- Prompt Engineering Best Practices: The three codexes collectively implement structured prompting methodologies that are documented as improving LLM reliability and reasoning quality.
[::web_search::], [::web_search::], [::web_search::], [::web_search::]
🔇 Additional comments (3)
hound/HOUND_CODEX.md (1)
1-823: Outstanding research grounding and comprehensive structure!This Hound codex is a genuinely impressive piece of work. The 4-Step Chain-of-Verification implementation aligns beautifully with established research from Meta AI, and your Credibility Tensor specification (lines 194-201) provides a mathematically sound framework for tracking source reliability across domains.
Particular strengths I observe:
- The CoVe methodology (lines 220-249) correctly implements the draft → verify → answer → reconcile pattern that reduces hallucinations
- Your verification status thresholds (lines 213-218) are defensible: support > 0.75 and contradiction < 0.15 for VERIFIED is appropriately conservative
- The three case studies (lines 564-745) provide concrete, realistic examples with actual code patches
- Prompt chains are reusable templates with clear structure and constraints
The external research context confirms this aligns with cutting-edge LLM verification practices. Splendid work!
dragon/DRAGON_CODEX.md (1)
1-899: Exceptional orchestration framework with industry-aligned patterns!The Dragon codex presents a remarkably sophisticated multi-persona coordination system. Your Legion Orchestration Tensor (lines 214-222) elegantly captures the complexity of resource allocation across mission, persona, quality gates, budget, and outcome dimensions.
Notable excellence:
- Forward/Backward Learning (lines 224-233): The reinforcement learning approach for weight updates (
T⁺ ← T⁺ + α · (outcome_signal ⊗ mission_profile)) is theoretically sound and allows the system to learn from operational data- Signature Contract Protocol (lines 235-252): This governance structure ensures missions are well-defined with testable acceptance criteria before execution—excellent engineering discipline
- Case Study I (lines 604-671): The migration scenario brilliantly demonstrates how the Hound's audit uncovered 4 undocumented dependencies (16 actual vs. 12 claimed services), preventing silent failures
The external context confirms this aligns with established orchestration patterns (tools, handoffs, conditional routing) documented in production frameworks. The integration with verification gates throughout shows mature understanding of multi-agent systems.
warlock/WARLOCK_CODEX.md (1)
1-909: Masterful Graph-of-Thought implementation with exceptional case studies!The Warlock codex demonstrates deep understanding of architectural decision-making. Your Graph-of-Thought engine (lines 212-237) correctly implements the vertices/edges/weights structure that research shows improves upon Chain-of-Thought by approximately 70%.
Particular brilliance:
- Branch Generation Protocol (lines 239-256): Requiring minimum 3 branches (consensus, adversarial, null) prevents premature convergence on familiar solutions
- Assumption Excavation (lines 333-372): The 4-verse protocol (Surface Scan → Load-Bearing Identification → Verification Status → Adversarial Test) systematically surfaces hidden assumptions that often cause architectural failures
- Case Study II (lines 728-792): The event sourcing analysis is chef's kiss—correctly identifying that 50K events/day (0.6 events/second) doesn't warrant event sourcing complexity, with watch condition at 5M/day
The "Ritual Laws" throughout provide memorable architectural principles. Case Study III's constraint dissolution (lines 795-836) demonstrates how "compliance requirements" are often outdated policy interpretations rather than actual regulations.
External context confirms this aligns with established GoT research for complex reasoning tasks. Superb work!
| T_verify ∈ ℝ^{C × S × D × B × 2} | ||
|
|
||
| C = 64 — Claim dimensions (semantic decomposition of asserted statements) | ||
| S = 16 — Source axes: [Primary | Secondary | Tertiary | Adversarial] × 4 reliability tiers | ||
| D = 4 — Domain axes: [Factual | Causal | Predictive | Normative] | ||
| B = 3 — Bias modes: [Confirmation | Selection | Reporting] | ||
| × 2 — Dual: T⁺ (supporting evidence) + T⁻ (contradicting evidence) | ||
| ``` | ||
|
|
||
| **Forward pass T⁺** — Evidence accumulation toward a claim: | ||
| ``` | ||
| support[c, s, d] = σ(T⁺[:, s, d] · claim_vec) × reliability[s] × independence[s] | ||
| ``` | ||
|
|
||
| **Backward pass T⁻** — Contradiction detection: | ||
| ``` | ||
| contradiction_score = Σ_c (T⁻[c, :, :] ⊙ counter_evidence_mask) / total_sources | ||
| ``` |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# Check current tensor implementation dimensions and semantics
echo "=== Searching for Tensor5D and StrategicTensor implementations ==="
rg -n -A 10 "class StrategicTensor" --type=ts
echo ""
echo "=== Checking for any Hound-specific tensor implementations ==="
rg -n "T_verify|Credibility.*Tensor|verification.*tensor" --type=ts -i
echo ""
echo "=== Checking tensor dimension configurations ==="
rg -n "evidenceDim|domainDim|claimDim|sourceDim" --type=tsRepository: recursive-ai-dev/LLMRP
Length of output: 3091
🏁 Script executed:
#!/bin/bash
echo "=== Reading HOUND_CODEX.md around the reviewed lines 194-211 ==="
head -n 215 hound/HOUND_CODEX.md | tail -n +190
echo ""
echo "=== Checking if HOUND_CODEX.md mentions implementation status ==="
grep -n "implemented\|planned\|current\|future\|TODO\|NOTE" hound/HOUND_CODEX.md | head -20
echo ""
echo "=== Reading full architect/tensor.ts to understand Tensor5D ==="
head -n 50 architect/tensor.tsRepository: recursive-ai-dev/LLMRP
Length of output: 3522
The Credibility Tensor specified in Hound's documentation remains unimplemented; current code uses a different tensor architecture.
The Hound specification documents a T_verify tensor (C=64 claims, S=16 sources, D=4 domains, B=3 bias modes, ×2 dual) designed specifically for tracking source credibility and contradiction detection. However, the codebase contains no implementation of this tensor. Instead, architect/tensor.ts implements a Tensor5D with fundamentally different dimensions (E=128 evidence, D≤8 domains, T=16 time, C=5 confidence, V=4 verification, ×2 dual) serving cross-domain evidence synthesis rather than credibility verification.
To clarify the intended architecture:
- Is the Hound tensor planned as a future implementation separate from
StrategicTensor? - Should the Hound specification be updated to reflect the actual
Tensor5Darchitecture, or does this represent a gap in the implementation roadmap?
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@hound/HOUND_CODEX.md` around lines 194 - 211, The doc-defined credibility
tensor T_verify (symbols: T_verify, support, contradiction_score) is not
implemented and conflicts with the existing implementation (symbols: Tensor5D,
StrategicTensor); fix by either (A) implementing T_verify to match the spec: add
a C×S×D×B×2 tensor type and the forward/backward routines computing
support[c,s,d]=σ(T⁺[:,s,d]·claim_vec)*reliability[s]*independence[s] and
contradiction_score as Σ_c(T⁻[c,:,:]⊙counter_evidence_mask)/total_sources,
integrating it with the verification pipeline, or (B) update the spec to reflect
the actual runtime design by replacing T_verify with the existing
Tensor5D/StrategicTensor dimensionality and semantics and adding a short mapping
note; ensure the chosen approach is recorded (TODO or issue) and reference the
symbols Tensor5D, StrategicTensor and T_verify in the code/comments for
traceability.
Summary
This PR adds complete character codex documentation for three core Legion personas: the Undead Warlock, the Undead Dragon, and the Undead Hound. These codices establish the lore, capabilities, relationships, and operational protocols for each persona within the system.
Key Changes
WARLOCK_CODEX.md: Comprehensive documentation for the Warlock persona including:
DRAGON_CODEX.md: Complete operational guide for the Dragon persona including:
HOUND_CODEX.md: Detailed verification framework for the Hound persona including:
Notable Implementation Details
https://claude.ai/code/session_01PFfMDYkaLiGH6zGAvxx3gu