Commit graph

53 commits

Author SHA1 Message Date
Eric Garcia
6e8f0db6c0 chore: add dialogues, RFCs, docs and minor improvements
- Add dialogue prompt file writing for audit/debugging
- Update README install instructions
- Add new RFCs (0053, 0055-0059, 0062)
- Add recorded dialogues and expert pools
- Add ADR 0018 dynamodb-portable-schema
- Update TODO with hook configuration notes

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-26 08:51:56 -05:00
Eric Garcia
69ba55e5a9 feat: RFC 0061 Phase 1 - implement blue init
- blue init now creates .blue/ directory and SQLite database
- Added --force flag to reinitialize existing projects
- Prints helpful output showing created paths
- Idempotent: running twice shows "already initialized" message

Phase 1 of RFC 0061 (CLI Database Parity).

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-11 00:53:40 -05:00
Eric Garcia
093abcf4a1 feat: RFC 0054 Calibrated Alignment with Charter system
Major additions to RFC 0054:
- Rename Ethos → Charter (CH prefix) for clarity
- Charter rules get referenceable IDs (CH0001-R01, CH0001-R05)
- Multi-domain support via charter_domains junction table
- Lenses for per-domain tenet filtering with priority overrides
- 3-character domain codes (FID, INV, REG) to avoid collisions
- Human-readable artifacts for all DB entities
- Cross-domain deliberation example (AI + Medical + Fiduciary)

ID scheme:
- PR{seq:04d} — Principles (global)
- {code}-TN{seq:02d} — Tenets (domain-scoped)
- {code}-LN{seq:02d} — Lenses (domain-scoped)
- CH{seq:04d} — Charters (global)
- {charter}-R{seq:02d} — Charter Rules
- CN{seq:02d} — Constraints (dialogue-scoped)

Expert usage: [TENSION T0003: challenges CH0001-R05]

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-09 17:05:17 -05:00
Eric Garcia
c745d11870 feat: RFC 0060 reliable binary installation
- install.sh: Add xattr/codesign fix after cp on macOS
- install.sh: Add portable timeout verification using perl
- INSTALL.md: Recommend cargo install --path as primary method
- INSTALL.md: Document macOS signature issue and fix
- blue doctor: Detect com.apple.provenance xattr with fix hint
- blue doctor: Verify code signature with codesign --verify
- blue doctor: 3-second liveness timeout for hanging binaries

Fixes dyld hang at _dyld_start when copied binaries have stale
signatures after Homebrew library updates.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-05 21:01:19 -05:00
Eric Garcia
b0e533849c feat: RFC 0057 Phase 8-9 CLI parity implementation
Add CLI subcommands that call the same MCP handlers:
- `blue dialogue` - create, get, list, export dialogues
- `blue adr` - create, get, list, status ADRs
- `blue spike` - create, get, list, complete spikes
- `blue audit` - create, get, list audit docs
- `blue prd` - create, get, list PRDs
- `blue reminder` - create, list, snooze, dismiss reminders

Make blue-mcp handlers module public for CLI access.
Phases 8-9 complete; Phase 10 (staging, llm, etc.) deferred.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-03 10:16:19 -05:00
Eric Garcia
b8337c43a2 feat: RFC 0057 Judge Convergence Discipline (Phases 1-7)
Fixes convergence discipline with four core changes:

1. Velocity redefined: velocity = open_tensions + new_perspectives
   (work remaining, not score delta)

2. Unanimous convergence: 100% of experts must signal [MOVE:CONVERGE]

3. Both conditions required: velocity=0 AND converge=100%

4. Dialogues persist: stored in .blue/dialogues/<ISO>-<name>/

Database schema updates:
- Added score component columns (W/C/T/R breakdown)
- Added convergence tracking columns
- Created alignment_convergence_signals table
- Created alignment_scoreboard view

MCP tool updates:
- round_register accepts new metrics
- round_context returns convergence status
- verdict_register gates on convergence criteria
- dialogue_create outputs to .blue/dialogues/
- dialogue_export includes full scoreboard

Judge protocol updated with new scoreboard format and max_rounds=10.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-03 10:08:00 -05:00
Eric Garcia
1447a2a6d2 test: RFC 0051 performance & isolation tests
Added:
- Performance indices on all entity tables for fast dialogue lookups
- test_output_directory_isolation: Unique IDs ensure separate output dirs
- test_performance_many_perspectives: 100 perspectives queried under 100ms
- test_indices_exist: Verify all performance indices created
- test_no_orphaned_entities: Refs connect valid entities

All pending tests complete. RFC 0051 fully implemented.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-02 18:53:13 -05:00
Eric Garcia
4fad08945a feat: RFC 0051 Phase 6 tooling & integration tests
Phase 6 Tooling:
- expand_citation/expand_citations: Display ID → full entity context
- get_cross_dialogue_stats: Aggregate stats across all dialogues
- find_similar_dialogues: Text search across titles and tensions
- get_dialogue_progress: Real-time velocity, convergence, leaderboard

Integration Tests:
- test_integration_multi_round_dialogue: Full 3-round workflow
- test_integration_minority_verdict: Dissent verdicts
- test_integration_tension_reopening: Tension state machine
- test_integration_cross_reference_graph: Reference relationships

All 133 tests passing.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-02 18:06:54 -05:00
Eric Garcia
49ac8f7a78 feat: RFC 0051 Phase 2-5 implementation
Phase 2 (MCP Tools):
- blue_dialogue_round_context - bulk fetch context for prompt building
- blue_dialogue_expert_create - create experts mid-dialogue
- blue_dialogue_round_register - bulk register perspectives, tensions, refs
- blue_dialogue_verdict_register - register interim/final/minority verdicts
- blue_dialogue_export - export dialogue to JSON with provenance

Phase 2c (Validation Layer):
- ValidationError struct with code, message, field, suggestion, context
- ValidationCollector for batch error collection
- Semantic constraints: resolve/address/reopen → Tension, refine → same-type
- validate_round_register_inputs() returns all errors before DB operations
- 8 new validation tests (20 total alignment_db tests)

Phase 5 (Skills):
- Updated alignment-play skill with DB-backed workflow
- Two-phase ID system documentation
- Cross-references alignment-expert skill for marker syntax

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-02 17:15:52 -05:00
Eric Garcia
401a6b1a45 feat: RFC 0051 Phase 1 - global perspective & tension tracking schema
RFC 0051 accepted and initial implementation:

- Added alignment_dialogues, alignment_experts, alignment_rounds tables
- Added alignment_perspectives, alignment_tensions with event tracking
- Added alignment_recommendations, alignment_evidence, alignment_claims
- Added alignment_refs table for cross-entity references
- Added alignment_verdicts table for final/interim/minority verdicts
- Created alignment_db.rs module with database operations
- Created alignment-expert skill with marker syntax reference

Schema version bumped from 8 to 9.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-02 15:13:41 -05:00
Eric Garcia
e7f257a181 docs: RFC 0051 clarify Judge vs MCP responsibilities
- Remove context_brief from MCP return (Judge constructs from data)
- Add three expert sources: retained, pool, created
- Consolidate duplicate blue_dialogue_round_context sections
- Add step 0 (EVOLVE PANEL) to round workflow
- Fix step numbering and loop target in workflow
- Clarify Judge registers rounds even on convergence
- Fix "experts register" → Judge registers on their behalf
- Change "collide" to "overlap" for local IDs
- Add defaults section (panel size, 100% convergence)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-02 15:03:46 -05:00
Eric Garcia
47edb7509f feat: RFC 0050 graduated panel rotation implementation
Judge-driven panel evolution for alignment dialogues:

- Add `Graduated` as default rotation mode
- New `blue_dialogue_evolve_panel` tool for panel specification
- Panel sampling is now a suggestion (`suggested_panel`) not mandate
- Judge can override Round 0 panel before spawning agents
- Fresh experts (pool/created) get automatic context briefs
- Support for on-demand expert creation with focus areas
- Track panel history with source counts (retained/pool/created)

Key workflow changes:
- Phase 1: Review suggested panel, override if needed
- Phase 2+: Evolve panel based on dialogue dynamics
- `expert_source` param in round_prompt for context brief generation

Updates skill documentation with graduated rotation guidelines and
7 key rules including "REVIEW THE SUGGESTED PANEL".

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-02 08:08:31 -05:00
Eric Garcia
d7db9c667d feat: RFC 0048 expert pool implementation and documentation batch
## RFC 0048 Expert Pool Implementation
- Added tiered expert pools (Core/Adjacent/Wildcard) to dialogue handlers
- Implemented weighted random sampling for panel selection
- Added blue_dialogue_sample_panel MCP tool for manual round control
- Updated alignment-play skill with pool design instructions

## New RFCs
- 0044: RFC matching and auto-status (draft)
- 0045: MCP tool enforcement (draft)
- 0046: Judge-defined expert panels (superseded)
- 0047: Expert pool sampling architecture (superseded)
- 0048: Alignment expert pools (implemented)
- 0050: Graduated panel rotation (draft)

## Dialogues Recorded
- 2026-02-01T2026Z: Test expert pool feature
- 2026-02-01T2105Z: SQLite vs flat files
- 2026-02-01T2214Z: Guard command architecture

## Other Changes
- Added TODO.md for tracking work
- Updated expert-pools.md knowledge doc
- Removed deprecated alignment-expert agent
- Added spikes for SQLite assets and SDLC workflow gaps

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-01 19:26:41 -05:00
Eric Garcia
f5d3621495 feat: RFC 0052 blue install command - implemented
Adds unified installation management for Claude Code integration:

  blue install      - Install hooks, skills, MCP server
  blue uninstall    - Remove Blue from Claude Code
  blue doctor       - Check installation health

Components managed:
- Hooks: session-start.sh (PATH), guard-write.sh (guard)
- Skills: Symlinks to ~/.claude/skills/
- MCP Server: Configuration in ~/.claude.json

Features:
- --hooks-only, --skills-only, --mcp-only flags
- --force to overwrite existing files
- Managed files tagged with "# Managed by: blue install"
- Idempotent - safe to run repeatedly

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-01 19:02:37 -05:00
Eric Garcia
2216fc41d9 docs: RFC 0052 expanded to full install command
Now covers unified `blue install` that manages:
- Hooks (SessionStart + PreToolUse)
- Skills (symlinks to ~/.claude/skills/)
- MCP Server (configuration in ~/.claude.json)

Also adds `blue uninstall` and `blue doctor` for health checks.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-01 18:58:25 -05:00
Eric Garcia
a4040cc41b docs: RFC 0052 CLI hook management
Proposes `blue hooks` subcommand for managing Claude Code hooks:
  blue hooks install    - Install all Blue hooks
  blue hooks uninstall  - Remove Blue hooks
  blue hooks status     - Show current hook status
  blue hooks check      - Verify hooks work correctly

Benefits: one-command setup, portable, idempotent, reversible.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-01 18:55:02 -05:00
Eric Garcia
50318ab802 feat: RFC 0051 SessionStart hook for PATH injection
Added SessionStart hook that adds $CLAUDE_PROJECT_DIR/target/release
to PATH via CLAUDE_ENV_FILE. This makes `blue` available by name in
all subsequent hooks.

- .claude/hooks/session-start.sh: Sets PATH on session start
- .claude/hooks/guard-write.sh: Now uses `blue` instead of full path
- .claude/settings.json: Added SessionStart hook

Requires Claude Code restart to take effect.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-01 18:44:13 -05:00
Eric Garcia
fb869cf12d docs: RFC 0051 portable hook binary resolution
Problem: Claude Code hooks run in minimal environment without PATH.
Commands by name hang; only full paths work.

Solution: Use $CLAUDE_PROJECT_DIR for portable binary resolution:
  "$CLAUDE_PROJECT_DIR/target/release/blue" guard --path="$FILE_PATH"

This is documented Claude Code behavior - hooks don't inherit shell
initialization for security reasons.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-01 18:41:42 -05:00
Eric Garcia
174eb40da9 feat: RFC 0049 synchronous guard command - implemented
Guard now runs synchronously before tokio runtime initialization:
- Added maybe_handle_guard_sync() pre-main check
- Added run_guard_sync() with full guard logic
- Added is_in_allowlist_sync() and is_source_code_path_sync()
- main() now checks for guard before calling tokio_main()

This eliminates tokio overhead for guard invocations and provides
correct architecture (pre-init gates don't depend on post-init infra).

Note: PATH-based command lookup still hangs in Claude Code's hook
environment - this is a Claude Code issue, not Blue. The hook still
requires full binary path as workaround.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-01 18:27:45 -05:00
Eric Garcia
fa98368588 docs: RFC 0049 synchronous guard command
Emerged from alignment dialogue with 5 experts (unanimous convergence).

Problem: guard command runs async within tokio::main, causing hangs
when invoked from Claude Code hooks.

Solution: Run guard synchronously before tokio runtime initialization.
Pre-init gates should not depend on post-init infrastructure.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-01 17:33:32 -05:00
Eric Garcia
71c3d3caa9 chore: dialogue handler improvements and config updates
- blue-mcp: dialogue handler enhancements (280+ lines)
- blue-mcp: server updates
- config.yaml updates
- alignment-play skill tweak
- spike: expert context and archival simplification

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-30 19:05:53 -05:00
Eric Garcia
02901dfec7 chore: batch commit - ADRs, RFCs, dialogues, spikes, and code updates
ADRs:
- Update 0008-honor, 0009-courage, 0013-overflow, 0015-plausibility
- Add 0017-hosted-coding-assistant-architecture

RFCs:
- 0032: per-repo AWS profile configuration (draft)
- 0033: round-scoped dialogue files (impl + plan)
- 0034: comprehensive config architecture (accepted)
- 0036: expert output discipline (impl)
- 0037: single source protocol authority (draft)
- 0038: SDLC workflow discipline (draft)
- 0039: ADR architecture greenfield clarifications (impl)
- 0040: divorce financial analysis (draft)
- 0042: alignment dialogue defensive publication (draft)

Spikes:
- Read tool token limit on assembled dialogues
- RFC ID collision root cause
- Expert agent output too long
- Judge writes expert outputs
- Blue MCP server on superviber infrastructure
- Playwright MCP multiple window isolation

Dialogues: 16 alignment dialogue records

Code:
- blue-core: forge module enhancements
- blue-mcp: env handlers and server updates
- alignment-expert agent improvements
- alignment-play skill refinements
- install.sh script

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-30 16:28:31 -05:00
Eric Garcia
b88bdbe650 docs: add defensive publication and update client financial doc
- N+1 Alignment Dialogue Architecture defensive publication (DOI: 10.5281/zenodo.18434186)
- Financial portfolio management document updated to client-only (v2.1)
  - Removed DOI, marked as client document
  - References defensive publication for prior art
- Dialogue record: deliberation on publication vs client-only decision
  - Unanimous expert consensus: keep financial doc client-only
  - Core architecture already protected by defensive publication

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-30 14:22:20 -05:00
Eric Garcia
97d68ec796 feat: add AWS profile configuration for superviber
Configure repo to use 'superviber' AWS profile per RFC 0032.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-30 14:20:46 -05:00
Eric Garcia
006546b2fd feat: RFC 0043 Mermaid diagram standards
Establishes mandatory standards for Mermaid diagrams in Blue documents:
- Neutral theme required for dark/light mode compatibility
- Leaf node counting for LR flow warnings (>3 nodes)
- Plain text for architecture labels (no emoji color injection)
- Shape semantics advisory for new diagrams
- Auto-fix for theme declaration only (colors require manual review)

Includes alignment dialogue with 10/10 tensions resolved across 3 rounds.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-30 11:58:32 -05:00
Eric Garcia
88da94af8d chore: mark RFC 0041 as implemented
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-30 10:18:41 -05:00
Eric Garcia
9170c20c15 feat: RFC 0041 compaction-resilient context injection
- Add hooks/pre-compact: injects survival context before compaction
- Add hooks/context-restore: targeted restoration after compaction
- Update install.sh to write hooks to settings.json (not hooks.json)
- Add migration logic for existing hooks.json
- Use symlinks for skills installation (fixes re-install errors)

Three-layer injection model:
- SessionStart: full knowledge (~800 tokens)
- PreCompact: survival context (~200 tokens, enters summary)
- SessionStart:compact: targeted restore (~150 tokens)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-30 10:01:40 -05:00
Eric Garcia
8eefd33085 feat: RFC 0035 spike resolved lifecycle suffix
Add 'resolved' outcome for spikes where a fix is applied during investigation.
Requires fix_summary parameter describing what was fixed. File renames to .resolved.md.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-26 21:56:55 -05:00
Eric Garcia
e03499effc fix: remove run_in_background from Judge Protocol to prevent dialogue halts
The Judge spawned expert agents with run_in_background: true, which caused
the Judge's turn to end immediately after spawning. Users had to manually
type "proceed" to resume scoring and convergence. Removing the flag keeps
parallel execution (multiple Task calls in one message) while blocking
until all agents return summaries, so the Judge auto-proceeds through
rounds without intervention.

Also includes RFC 0033 round-scoped file architecture updates: coerce_bool
for MCP string booleans, mandatory agent return summaries, token budget
documentation, and write-artifacts workflow step.

Spike: alignment-dialogue-halts-after-expert-completion

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-26 16:30:59 -05:00
Eric Garcia
0fea499957 feat: lifecycle suffixes for all document states + resolve all clippy warnings
Every document filename now mirrors its lifecycle state with a status
suffix (e.g., .draft.md, .wip.md, .accepted.md). No more bare .md for
tracked document types. Also renamed all from_str methods to parse to
avoid FromStr trait confusion, introduced StagingDeploymentParams struct,
and fixed all 19 clippy warnings across the codebase.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-26 12:19:46 -05:00
Eric Garcia
4a7aaa569a fix: stop tracking blue.db and update .gitignore
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-26 07:47:44 -05:00
Eric Garcia
16d45d9a11 feat: alignment dialogue subagents, MCP instructions, and document batch
Alignment dialogues now use custom `alignment-expert` subagents with
max_turns: 10, tool restrictions (Read/Grep/Glob), and hard 400-word
output limits. Judge protocol injects as prose via RFC 0023. Moved
Blue voice patterns from CLAUDE.md to MCP server instructions field
for cross-repo portability.

Includes RFCs 0017-0026, spikes, and alignment dialogues from
2026-01-25/26 sessions.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-26 07:09:39 -05:00
Eric Garcia
c9acd1a4ad feat: implement RFC 0020 MCP project detection (all phases)
Separate mcp_root from cwd so tool-arg overrides don't clobber the
session-level root from initialize. Fallback chain matches RFC spec:
cwd → mcp_root → walk tree → fail with guidance. Error messages now
include attempted paths and actionable fix suggestions. Added --debug
flag to MCP server for file-based DEBUG logging.

Phase 2 finding: Claude Code v2.1.19 declares roots capability but
sends no roots array. Walk-up is the primary detection path.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-25 21:47:24 -05:00
Eric Garcia
1ed6f15fa9 feat: implement document sync and Claude Code task integration (RFC 0018, 0019)
RFC 0018 - Document Import/Sync:
- Add content_hash and indexed_at fields to Document
- Implement find_document_with_fallback for filesystem recovery
- Add reconcile() for database/filesystem sync
- Create blue_sync MCP tool
- Update blue_status to show index drift

RFC 0019 - Claude Code Task Integration:
- Expose .plan.md as MCP resource (blue://docs/rfcs/{n}/plan)
- Enhance blue_rfc_get with claude_code_tasks array
- Add 💙 prefix for Blue-synced tasks
- Add knowledge/task-sync.md for session injection
- Automatic sync via injected instructions

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-25 20:58:46 -05:00
Eric Garcia
9759f0e3db feat: implement plan file authority (RFC 0017)
Plan files (.plan.md) are now the authoritative source for RFC task
tracking, with SQLite as a derived cache rebuilt on read.

Changes:
- Add plan.rs with PlanFile parsing/generation
- Add schema v7 migration for plan_cache table
- Modify handle_rfc_plan to write .plan.md files
- Modify handle_rfc_task_complete to update .plan.md
- Implement rebuild-on-read for stale cache detection
- Add RFC header validation (table vs inline format)
- Extend blue_lint with headers check and --fix support

Also includes spike investigating Claude Code task integration.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-25 20:10:05 -05:00
Eric Garcia
1847700c09 docs: add infrastructure RFCs (0014, 0015-cert-manager)
- RFC 0014: Workflow Enforcement Parity - conversational hints over JSON
- RFC 0015: Cert-Manager with Let's Encrypt for TLS on K3s cluster

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-25 18:12:36 -05:00
Eric Garcia
29f139e1cd fix: remove wrong alignment orchestration architecture (RFC 0015)
RFC 0012 was implemented with Option B (MCP orchestrates via Ollama)
instead of Option A (Claude orchestrates via Task tool). This caused:
- No parallel agents spawned
- Fake Ollama responses instead of real deliberation
- Inline JSON instead of .dialogue.md files

Fix by removing blue_alignment_play tool entirely. Claude now
orchestrates alignment dialogues directly using Task tool per ADR 0014.

Also:
- Add pub mod resources for RFC 0016/0017 (was missing)
- Update lib.rs threading for spawn_blocking
- Add .blue/worktrees/ to gitignore
- Update database schema

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-25 17:36:16 -05:00
Eric Garcia
83fb0202a6 feat: implement dynamic context activation (RFC 0016 + 0017)
RFC 0016: Context Injection Architecture
- Add blue:// URI scheme for document addressing
- Add manifest.rs for three-tier context configuration
- Implement MCP resources/list and resources/read handlers
- Add `blue context` CLI command for visibility
- Add context_injections audit table (schema v5)

RFC 0017: Dynamic Context Activation (Phase 1)
- Add relevance_edges table for explicit links (schema v6)
- Implement composite session ID: {repo}-{realm}-{random12}
- Add content-hash based staleness detection
- Add tiered refresh policies (SessionStart/OnChange/OnRequest/Never)
- Add rate limiting with 30s cooldown
- Add blue_context_status MCP tool

Drafted from 12-expert alignment dialogue achieving 95% convergence.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-25 17:21:05 -05:00
Eric Garcia
a5b142299d feat: context injection architecture via 12-expert alignment dialogue
RFC 0016 drafted from alignment dialogue achieving 95% convergence:
- Three-tier model: Identity (fixed) / Workflow (session) / Reference (on-demand)
- Manifest-driven injection via .blue/context.manifest.yaml
- URI addressing: blue://docs/, blue://context/, blue://state/
- Hooks push URIs, MCP resolves content
- Progressive visibility: blue context show

New ADRs ported from coherence-mcp:
- 0014: Alignment Dialogue Agents (renamed from 0006)
- 0015: Plausibility
- 0016: You Know Who You Are

Knowledge injection system:
- hooks/session-start for SessionStart injection
- knowledge/*.md files for global context
- Expert pools with domain-specific relevance tiers
- Updated /alignment-play skill with full scoring

Spikes completed:
- Context injection mechanisms (7 mechanisms designed)
- ADR porting inventory (17 Blue ADRs mapped)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-25 16:16:11 -05:00
Eric Garcia
19602c632b chore: sync state.rs and add RFC/spike documents
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-24 20:32:32 -05:00
Eric Garcia
fae8e96108 feat: implement RFC 0012 alignment dialogue orchestration
Add blue_alignment_play MCP tool for multi-expert deliberation:
- Core alignment module with Expert, Round, ExpertResponse types
- Panel templates: Infrastructure, Product, ML, Governance, General
- Ollama integration for running expert rounds until convergence
- Dialogue markdown generation with SQLite tracking
- RFC linking support

Also removes dead code (ADR 0010: No Dead Code).

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-24 20:14:13 -05:00
Eric Garcia
bfd2a01ede fix: remove stop sequence that truncated indexer LLM output
The stop_sequences contained "```" which caused the model to stop
immediately after outputting "```yaml", truncating the entire response.
Also wrap blocking indexer operations in spawn_blocking to avoid
runtime conflicts with reqwest::blocking::Client.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-24 19:25:51 -05:00
Eric Garcia
d77ea4ba3f feat: add Ollama integration for semantic file indexing
Implements the AI-powered indexing component of RFC 0010:
- Add indexer module with LlmProvider abstraction
- Integrate qwen2.5:3b via Ollama for local file analysis
- Extract summaries, relationships, and symbols from source files
- Support partial indexing for files >1000 lines
- Wire indexer to all CLI index commands (--all, --diff, --file, --refresh)

The indexer generates structured YAML output with:
- One-sentence file summaries
- Relationship descriptions for semantic search
- Symbol-level indexing with line numbers

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-24 18:51:48 -05:00
Eric Garcia
cf0baa0ea0 feat: implement RFC 0010 semantic index core infrastructure
Adds the foundation for AI-maintained semantic file indexing:

Schema (v4 migration):
- file_index table with summary, relationships, prompt_version
- symbol_index table with name, kind, line numbers, description
- FTS5 virtual tables for full-text search

CLI commands (blue index):
- --all: Bootstrap full index
- --diff: Index staged files (for pre-commit hook)
- --file: Single file indexing
- --refresh: Re-index stale entries
- --install-hook: Install git pre-commit hook
- status: Show index freshness

MCP tools:
- blue_index_status: Get index stats
- blue_index_search: FTS5 search across files/symbols
- blue_index_impact: Analyze change blast radius
- blue_index_file: Store AI-generated index data
- blue_index_realm: List all indexed files

Remaining work: Ollama integration for actual AI indexing.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-24 18:44:44 -05:00
Eric Garcia
8f31288b55 docs: add RFC 0010 for realm semantic index
Spike investigation into AI-maintained semantic indexing for realms.
12-expert dialogue refined through 6 rounds to 96% alignment.

Key decisions:
- Storage: SQLite + FTS5, relationships stored at index time
- Triggers: Git pre-commit hook on diff, --all for bootstrap
- Model: Qwen2.5:3b via Ollama (speed/quality sweet spot)
- Granularity: Symbol-level with line numbers

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-24 18:33:02 -05:00
Eric Garcia
1be95dd4a1 feat: implement RFC 0008 (status file sync) and RFC 0009 (audit documents)
RFC 0008: Status updates now sync to markdown files, not just DB
RFC 0009: Add Audit as first-class document type, rename blue_audit to
blue_health_check to avoid naming collision

Also includes:
- Update RFC 0005 with Ollama auto-detection and bundled Goose support
- Mark RFCs 0001-0006 as Implemented
- Add spikes documenting investigations

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-24 17:56:20 -05:00
Eric Garcia
8f0063683f chore: track .blue/blue.db database
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-24 16:44:22 -05:00
Eric Garcia
489942cd35 feat: implement RFC 0006 (soft-delete) and RFC 0007 (branch naming)
RFC 0006 - Document Deletion Tools:
- Add soft-delete with 7-day retention before permanent deletion
- Add blue_delete, blue_restore, blue_deleted_list, blue_purge_deleted tools
- Add deleted_at column to documents table (schema v3)
- Block deletion of documents with ADR dependents
- Support dry_run, force, and permanent options

RFC 0007 - Consistent Branch Naming:
- Strip RFC number prefix from branch/worktree names
- Branch format: feature-description (not rfc/NNNN-feature-description)
- PR title format: RFC NNNN: Feature Description
- Add strip_rfc_number_prefix helper with tests

Also:
- Remove orphan .blue/repos/ and .blue/data/ directories
- Fix docs path resolution bug (spike documented)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-24 16:42:31 -05:00
Eric Garcia
0150a5d1ed chore: move adrs, rfcs, spikes to .blue/docs
Per RFC 0003, Blue-tracked documents live in per-repo .blue/ directories.
ADRs needed for semantic adherence checking.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-24 16:16:34 -05:00
Eric Garcia
eedae91178 chore: move dialogues to .blue/docs/dialogues
Per RFC 0003, docs should live in per-repo .blue/ directories.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-24 16:12:06 -05:00