Commit graph

112 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
aec859b22e feat: RFC 0061 Phase 3 - CLI parity for RFC and worktree commands
Add handle_rfc_command() and handle_local_worktree_command() functions
that call shared MCP handlers directly, avoiding code duplication.

RFC commands: create, list, get, status, plan, complete
Worktree commands: create, list, remove

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-26 08:48:01 -05:00
Eric Garcia
016c05e1ed Merge branch 'develop' 2026-02-20 16:13:10 -05:00
Eric Garcia
3fb6fe3271 feat: RFC 0061 Phase 2 - extract handler functions
- handlers/rfc.rs: Add handle_create, handle_get, handle_list,
  handle_update_status, handle_plan as standalone functions
- handlers/status.rs: New module with handle_status, handle_next
- handlers/worktree.rs: Already had standalone functions
- handlers/mod.rs: Export status module

These standalone functions can be called by both MCP server and CLI,
avoiding code duplication (RFC 0061 architecture).

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-11 00:59:03 -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
4b043c12d0 test: add alignment_db unit tests (RFC 0051)
12 tests covering:
- Dialogue ID generation with collision handling
- Display ID format (P0001, T0105, R0215)
- Display ID parsing
- Dialogue creation and retrieval
- Expert registration and scoring
- Perspective, tension, recommendation registration
- Tension lifecycle (open → addressed → resolved)
- Cross-reference registration
- Verdict registration with dialogue status update
- Full workflow integration test

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-02 16:50:54 -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
29ccd4082f fix: guard-write hook uses portable bash timeout
The hook was blocking because `timeout` is a GNU coreutil only
available via homebrew on macOS. Replaced with bash's built-in
`read -t 2` which is portable and doesn't require PATH setup.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-01 22:38:49 -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
21dc822d4c fix: guard hook uses shell script with full binary path
The original hook syntax `blue guard --path="$TOOL_INPUT:file_path"`
didn't work - Claude Code doesn't support that variable interpolation.

Created guard-write.sh that:
- Reads JSON from stdin using jq (Claude Code's recommended pattern)
- Extracts file_path from tool_input
- Calls blue guard with full path to target/release binary
- Closes stdin with </dev/null to prevent hanging

The full binary path is a workaround for an issue where PATH-based
command lookup hangs in Claude Code's hook subprocess environment.
A proper fix (making guard synchronous before tokio::main) is tracked
in RFC 0049.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-01 17:32:40 -05:00
Eric Garcia
ddce9e8b03 fix: derive worktree name from path, not branch name
Git worktree names are stored in .git/worktrees/<name> and cannot
contain slashes. The code was using branch names like "feature/slug"
or "rfc/name" as worktree names, which git2 rejects silently.

Now the worktree name is derived from the path's directory name (the
slug), which is always a simple identifier without slashes.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-30 19:09:13 -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
e288678572 feat: implement RFC 0043 Mermaid diagram linting
Extends lint.rs with Mermaid block validation:
- Neutral theme declaration check (Error, auto-fixable)
- Custom fill color detection (Error, requires manual fix)
- LR flow >3 leaf nodes warning (Advisory)
- Leaf node counting algorithm (excludes subgraphs/style/comments)

Adds 15 test cases covering all lint scenarios.

Also fixes dialogue.rs test assertions to match template text.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-30 12:03:21 -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
607b5ce07c fix: add session-heartbeat and session-end CLI commands for hooks
- Add top-level `session-heartbeat` command (silent, touches session file)
- Add top-level `session-end` command (silent, removes session file)
- Add `Heartbeat` variant to SessionCommands enum
- Required by global Claude Code hooks in ~/.claude/settings.json

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-30 10:03:31 -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
6ff8ba706c feat: RFC 0038 SDLC workflow discipline implementation
- Add `blue guard` CLI command for PreToolUse hook integration
  - Allowlist patterns for .blue/docs/, .claude/, /tmp/, root *.md
  - Worktree detection and RFC branch validation
  - Audit logging for bypass tracking
- Add PreToolUse hook in .claude/settings.json
- Add produces_rfcs field to Spike struct for multi-RFC tracking
- Implement spike auto-close when RFC transitions to implemented
- Add ADR suggestions when RFC transitions to in-progress
- Add LocalRealmDependencies for .blue/realm.toml parsing
- Add blue_rfc_validate_realm tool for cross-repo RFC validation
- Add toml dependency for realm.toml parsing

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-30 08:59:20 -05:00
Eric Garcia
0246ef6a22 fix: add plan_cache to base schema + feature/{slug} branch naming
- Add plan_cache table to base SCHEMA so fresh databases have it
  (was only created via migration, causing "no such table" errors)
- Change worktree branch naming from `{title}` to `feature/{slug}`
- Add slugify() to handle titles with spaces like "Minimal Job Submission"
- Update cleanup handler to use same naming convention

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-27 17:21:25 -05:00
Eric Garcia
e3de9a17ed Merge branch 'develop' 2026-01-26 21:57:04 -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
37de7759b5 feat: RFC 0029 file-based subagent output for alignment dialogues
Replace JSONL extraction pipeline with direct file writes: alignment-expert
agents write perspectives to /tmp/blue-dialogue/{slug}/round-{n}/{name}.md,
and the Judge reads those files directly after Task completion.

Changes:
- alignment-expert.md: add Write tool
- dialogue.rs: create output_dir, pass to build_judge_protocol
- Add name_lowercase field to agent JSON for filename generation
- Add WRITE YOUR OUTPUT section to agent prompt template
- Update Judge instructions with mkdir + Read tool workflow
- Add output_dir to returned protocol JSON
- New test: test_build_judge_protocol_output_paths

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-26 12:37:39 -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
af07fe487a Merge branch 'develop' 2026-01-26 07:47:54 -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
992ba45034 Merge develop into main for v0.2.0 release
Features:
- Alignment dialogue subagents, MCP instructions, and document batch
- RFC 0020 MCP project detection
- Filesystem authority with slug matching and FS-aware numbering (RFC 0022)
- Document sync and Claude Code task integration (RFC 0018, 0019)
- Plan file authority (RFC 0017)
- Dynamic context activation (RFC 0016 + 0017)
- Context injection architecture via 12-expert alignment dialogue
- Workflow enforcement parity (RFC 0014)
- Git forge integration for GitHub and Forgejo (RFC 0013)
- MCP workflow guidance for worktree creation (RFC 0011)

Fixes:
- Correct dialogue round numbering and kebab-case spike filenames
- Remove wrong alignment orchestration architecture (RFC 0015)
- Clippy fixes and invalid YAML test fix
2026-01-26 07:40:39 -05:00
Eric Garcia
015c21d381 fix: correct dialogue round numbering and kebab-case spike filenames
- Fix "Round 0" → "Round 1" for opening arguments in alignment dialogues
- Convert spike titles to kebab-case for consistent filenames

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-26 07:40:24 -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
ff83a2e26b feat: implement filesystem authority - slug matching, FS-aware numbering (RFC 0022)
Add slug-based document lookup so kebab-case queries ("filesystem-authority")
match titles ("Filesystem Authority") via deslugification. Implement
next_number_with_fs() that scans both DB and filesystem directory, taking
max(db, fs) + 1 to prevent numbering collisions when files exist outside
the index. Update all 7 callers across MCP handlers. Add blue.db to
.gitignore since it is a derived index. Includes 9 new tests covering
slug matching, filesystem-aware numbering, and collision regression.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-25 21:46:08 -05:00