1110 Commits
Author SHA1 Message Date
jpmschweitzerandClaude Opus 4.6 abb509eb00 chore(meta): release v0.1.26
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
v0.1.26
2026-03-13 12:38:13 +01:00
jpmschweitzerandClaude Opus 4.6 aa55abb684 docs(docs): remove model provenance policy from D-138
Gemma 2B is picked and embedded — the provenance policy text was
an unnecessary addition. The model choice is final.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-13 12:24:16 +01:00
jpmschweitzerandClaude Opus 4.6 88de04dc4d fix(copy): replace Vael "Arven" to avoid near-collision with Krenn "Harven"
Single-consonant difference undermined cultural distinctiveness.
"Arvenis" extends past the collision point while staying in Vael's
polysyllabic register.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-13 12:24:03 +01:00
jpmschweitzer 1407cbc917 Merge remote-tracking branch 'origin/copy'
# Conflicts:
#	CHANGELOG.md
2026-03-13 12:23:37 +01:00
jpmschweitzerandClaude Opus 4.6 d258fc405e chore(meta): update changelog
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-13 12:11:14 +01:00
jpmschweitzerandClaude Opus 4.6 7c10ff07ce docs(copy): fix stale notes and example in authoring guides
Update content-structure-canonical.md to reflect Krenn NEVER block
and behavior_modifiers now present. Fix base-text-authoring-guide
example to match actual RON primitive format.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-13 12:10:13 +01:00
jpmschweitzerandClaude Opus 4.6 05cae464d4 fix(copy): address PR #91 re-review — content fixes
D-141→D-142 reference in zone-type templates, name pool
cross-contamination resolved (zero overlaps across cultures),
modifier coverage expanded to 2+ per category, authority_response
differentiated Krenn/Osse, gendered pronouns removed from neutral
templates, Osse ungrounded lore terms replaced, dual_lens dead
properties stripped from environmental YAML, overheard.yaml
annotated as legacy (#664).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-13 12:10:04 +01:00
jpmschweitzerandClaude Opus 4.6 de58df05e1 chore(meta): update changelog
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-13 11:47:33 +01:00
jpmschweitzerandClaude Opus 4.6 9fd16fd818 docs(copy): add authoring guides for base text, cultures, and content structure
Three scalability-focused authoring guides for content production
across 300+ systems:
- base-text-authoring-guide.md: elevation checklist, quality test
- culture-authoring-guide.md: 8-step workflow, modifier contract,
  cross-cultural contrast test, one-day-per-culture target
- content-structure-canonical.md: directory template, surviving
  structure audit, culture RON field reference

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-13 11:46:20 +01:00
jpmschweitzerandClaude Opus 4.6 65e033443f docs(decisions): file D-140 dialogue quality rules, D-142 zone-type template architecture (#647)
D-140: Paula's six rules for dialogue re-voicing quality — secret-tier
passthrough, epistemic weight, access tier feel, named entity
passthrough, relationship-specific lines, culture register override.
D-142: Zone-type template architecture — three-layer behavior system,
31 zone types for v1.0, POI three-tier system, scale math for 300+
systems with 300+ cultures. Amend D-123 (baked vs pre-voiced modes),
supersede D-124 (resolved by two-spike strategy).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-13 11:46:03 +01:00
jpmschweitzerandClaude Opus 4.6 f44a105e96 feat(copy): restructure behavior primitives into zone-type templates (#661, D-142)
Move behavior_primitives from per-location zone specs into global
zone-type template files (content/global/zone-types/). Location specs
now declare zone_type and contain only metadata (role weights, social
sites, economic/density levels). Primitives are culture-neutral and
reusable across all 300+ systems. Scrub Krenn-specific language.

New files: rural_agricultural.ron, industrial_freight.ron
Modified: krenn-rural-zone.ron, krenn-industrial-zone.ron (metadata only)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-13 11:45:42 +01:00
jpmschweitzerandClaude Opus 4.6 56b8bbfeb9 feat(copy): add Vael and Osse culture profiles, behavior modifiers for all cultures (#653, #634)
Author two new culture RON files (culture-vael.ron, culture-osse.ron)
with voice_persona, voice_examples, occasional_injections, explicit
NEVER blocks, and behavior_modifiers (7 categories each). Add
behavior_modifiers to culture-krenn.ron and explicit NEVER block.
Modifier categories: work_pace, physical_manner, social_signal,
task_completion, environmental_scan, offduty_posture, authority_response.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-13 11:45:23 +01:00
jpmschweitzer 2a00d78a21 Merge remote-tracking branch 'origin/client' 2026-03-13 11:44:35 +01:00
jpmschweitzerandClaude Opus 4.6 e4f2477323 fix(copy): remove v0.1 hand-authored content and detective mission system (#656, #657)
Delete 64 hand-authored Krenn dialogue/monologue/NPC files superseded
by generated NPCs (D-122) and voice pipeline (D-138). Remove detective
investigation system dropped in v0.2 pivot (D-117): knowledge catalog,
faction, design docs, workshop archives, wireframe detective sections.
Clean investigation.* fact_id references from environmental and triangle
files. Strip investigation cross-references from overheard.yaml.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-13 11:44:26 +01:00
jpmschweitzerandClaude Opus 4.6 a1788dad32 fix(client): guard battery test against CI on-battery false-fail (S7)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-13 11:40:12 +01:00
jpmschweitzerandClaude Sonnet 4.6 f51366b3f5 fix(ui): address PR #90 review — 8 items (W1–W4, S5–S6, A3–A4)
W1/A2: add SimBridge.CONNECTED guard before send_input in toggle handler
W2/A1: assert PlatformInfo != null in HardwareDetector._ready();
       add ordering comment in project.godot [autoload] section
W3: replace FileAccess.open() with get_file_as_string() in
    read_benchmark_cache() — auto-closes, no leak
W4/A3: add _extract_bool_setting() helper in game_state.gd that handles
       both {"Bool": true} and plain bool; push_warning on type mismatch
S5: sync _pre_battery_pref from GameState after load_ai_pref() in
    HardwareDetector._ready() — closes race if system starts on battery
S6: separate "red" TPT status into its own arm with STATUS_RED dot and
    label colour — three-colour mapping: green/yellow/red now distinct
A4: replace DebugConsole.PREFS_PATH compile-time dependency in
    _save_ai_pref() with local SETTINGS_CFG_PATH constant

S7 (battery CI guard) already applied by Hoshe in test file.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-13 11:39:47 +01:00
jpmschweitzerandClaude Opus 4.6 c8773e7ac5 chore(meta): update changelog
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-13 11:30:41 +01:00
jpmschweitzerandClaude Opus 4.6 fa8518cd83 docs(docs): clean stale v0.1 references from decision records
Close Q-015 as obsolete (D-122 eliminates hand-authored FRIEND).
Update Q-033 reframe to reference D-139 composable behaviors.
Replace franchise-specific "Starflyer's agents" with generic
"hostile actors" in D-018 (perception.md).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-13 11:30:25 +01:00
jpmschweitzerandClaude Opus 4.6 ab38631d30 chore(agents): remove stale v0.1 references from agent profiles
Update miri, ozzie, paula, inigo, hoshe profiles to reflect v0.2:
detective/conspiracy framing → emergent narrative, specific
franchise locations → generic zone types, DECISIONS.md → decisions/
domain files.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-13 11:30:17 +01:00
jpmschweitzerandClaude Opus 4.6 f4c72e1480 docs(briefings): update all 18 briefings for v0.2 pivot
Remove stale v0.1 references (detective/smuggler gameplay,
hand-authored content pipeline, named NPCs) and align with
v0.2 reality: generator-first (D-122), LLM voice pipeline
(D-138), composable behaviors (D-139), tycoon bookmark deferred.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-13 11:30:09 +01:00
jpmschweitzerandClaude Opus 4.6 23e6890c4e chore(meta): update changelog
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-13 10:56:08 +01:00
jpmschweitzerandClaude Opus 4.6 d3ed73bcb3 test(client): Sprint 26 AI dialogue + PlatformInfo tests
67 tests covering #646 AI-Enhanced Dialogue toggle, hardware
detection (RAM/TPT/degradation), PlatformInfo power state,
battery suspend/resume, and settings dialog integration.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-13 10:55:44 +01:00
jpmschweitzerandClaude Opus 4.6 623e2e2f16 docs(decisions): D-141 PlatformInfo OS abstraction, resolve Q-059
D-141: client-side PlatformInfo autoload centralizing all OS queries.
Q-059: resolved — full interface scope (23 properties, 7 categories).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-13 10:55:34 +01:00
jpmschweitzerandClaude Sonnet 4.6 9108e5d9ed feat(ui): add get_battery_warning_visible() getter to settings_dialog
Testable API for Hoshe's battery warning visibility assertions (#646).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-13 10:54:54 +01:00
jpmschweitzerandClaude Sonnet 4.6 73b4f37de5 fix(ui): include all 7 path properties in PlatformInfo.get_diagnostics()
config_dir, benchmark_cache_path, executable_path, model_dir were
populated in _init_paths() but missing from the diagnostics dict.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-13 10:50:05 +01:00
jpmschweitzerandClaude Sonnet 4.6 41d16d01ae fix(ui): toggle stays clickable during battery suspend — D-138 player autonomy
Player autonomy wins: AI Dialogue toggle is only greyed out for RAM fail
(< 1.6 GB free). Battery suspend shows a warning label instead of
disabling the toggle — player can override the auto-suspend at any time.

Changes:
- settings_dialog: toggle disabled = hw_status == "fail" only
- settings_dialog: add _ai_battery_warning_label (STATUS_YELLOW) shown
  when _ai_inference_suspended; hidden when plugged back in via
  set_ai_inference_suspended()
- settings_dialog: is_ai_dialogue_toggle_enabled() no longer checks
  _ai_inference_suspended
- settings_dialog: set_ai_inference_suspended() updates warning label
  visibility, not toggle disabled state
- ui-strings: add settings.ai_battery_warning "High battery usage"

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-13 10:49:06 +01:00
jpmschweitzerandClaude Sonnet 4.6 12d25ce17f feat(ui): expand PlatformInfo to full D-141 Tier 1 interface
23 properties, 2 methods, 1 signal:
- Power: raw_power_state + battery_percent added to _poll_power()
- CPU: cpu_name (OS.get_processor_name), cpu_logical_cores
- GPU: gpu_name, gpu_vendor, gpu_api_version, gpu_type (mapped from
  RenderingDevice.DeviceType), gpu_driver_info — all guarded for headless
- Platform: platform_name, os_version, distribution, is_sandboxed
- Display: screen_count, screen_size, screen_dpi, screen_refresh_rate,
  display_scale (macOS screen_get_scale / dpi÷96 fallback)
- Locale: locale, locale_language
- get_diagnostics() -> Dictionary for bug report inclusion
- OS.get_distribution_name() and DisplayServer.screen_get_scale()
  use callv() pattern for headless build safety

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-13 10:46:44 +01:00
jpmschweitzerandClaude Sonnet 4.6 d7a4e3268a feat(ui): PlatformInfo abstraction + battery detection + fixes (#646 D-138)
Platform abstraction:
- New PlatformInfo autoload (extends Node, registered first in project.godot).
  Owns all OS queries: power state monitoring (30s poll), memory (on demand),
  file path resolution (user_data_dir, config_dir, benchmark_cache_path,
  install_dir, executable_path, cache_dir, model_dir).
- PowerProfile enum (FULL/BATTERY/POWER_SAVER), power_profile_changed signal.
  Uses OS.callv("get_power_info") to defer resolution to runtime — avoids
  compile errors on Godot 4.6 headless builds without power API.

HardwareDetector refactor:
- check_ram() now delegates to PlatformInfo.refresh_memory() + free_memory_mb.
  All direct OS.get_memory_info() calls removed.
- classify_power_state(int) and should_suspend_inference(int) delegate to
  PlatformInfo for single source of truth.
- check_power_state() → {power_state, classification, should_suspend}.
- Battery suspend/resume: on PowerProfile.BATTERY, stores pre-battery pref and
  sends ChangeSettings(false) to server. On FULL restore, sends ChangeSettings
  with saved pref if it was enabled. inference_suspended member tracks state.

Settings dialog:
- is_ai_inference_suspended() / set_ai_inference_suspended(bool) — testable API
  per Hoshe's test contract. Reads HardwareDetector.inference_suspended on open.
- Toggle now disabled when battery-suspended OR hardware fails (not only fail).
- get_ai_dialogue_label_text() wired to UIStrings ("settings.ai_dialogue_toggle")
  instead of hardcoded string.

Cleanup:
- Deleted ai_dialogue_detector.gd and .uid (orphaned duplicate, dead code).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-13 10:41:07 +01:00
jpmschweitzerandClaude Sonnet 4.6 01b0583265 feat(ui): AI-Enhanced Dialogue toggle + hardware detection (#646, D-138)
Implements the full AI-Enhanced Dialogue feature for Sprint 26:

- HardwareDetector autoload (extends Node): three-layer detection —
  Layer 1 RAM classification (pass/marginal/fail, thresholds 2GB/1.6GB),
  Layer 2 TPT benchmark cache (green/yellow/red, thresholds 6/3 t/s),
  Layer 3 degradation monitoring (>40% drop → yellow). load_ai_pref()
  restores toggle state from user://settings.cfg on startup.

- Settings dialog AI section: toggle, colored status dot, status message
  label, testable API (get_ai_dialogue_label_text, set_ai_dialogue_
  hardware_status, is_ai_dialogue_toggle_enabled). Only RAM "fail" greys
  out toggle — player always overrides yellow/red recommendations (D-138).

- GameState.ai_enhanced_dialogue_enabled (default true, opt-out model).
  GameState.settings_response (v20 one-shot settings dump from server).
  apply_snapshot() hydrates ai_enhanced_dialogue_enabled from full dump.

- Protocol v19→v20, settings_response decoding in decode_snapshot().
  Protocol converted to extends Node autoload (enables test has_method).
  encode_change_settings() helper for test inspection.

- InputMapper: CHANGE_SETTINGS, REQUEST_ALL_SETTINGS, DELETE_SETTING.
  SimBridge: wire mappings for all three. RequestAllSettings queued after
  handshake to hydrate client state from server SQLite on connect.
  settings_response carry-forward in receive_bytes().

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-13 10:34:48 +01:00
jpmschweitzerandClaude Opus 4.6 ce8c748462 chore(config): add git-lock-guard PreToolUse hook
Clears stale .git/index.lock files before git write commands.
Claude Code's internal git status polling leaves orphan locks
(anthropics/claude-code#11005) that block add/commit/merge/push.

The hook checks lsof/fuser before removing — only stale locks are
cleared, never locks held by live processes. Read-only git commands
are skipped entirely.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-13 09:57:30 +01:00
jpmschweitzerandClaude Opus 4.6 2f8218400d chore(skills): tea-comment @filepath support and docs update
tea-comment now accepts @/path/to/file.md syntax to read comment body
from a file, avoiding $() subshells that break permission matching.
Updated pr-review skill and tea-cli rules with the new pattern.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-13 09:44:11 +01:00
jpmschweitzer 9a1f224a4c Merge remote-tracking branch 'origin/server' 2026-03-13 09:40:38 +01:00
jpmschweitzerandClaude Opus 4.6 51414b0b63 fix(simulation): address PR #89 review — version comment, settings contract, docs, dead process recovery
Must-fix: protocol version comment now references PROTOCOL_VERSION
(no hardcoded number), settings delete is idempotent no-op.

Suggestions addressed: BehaviorModifier dedup claim dropped, hash
collision safety documented, FK pragma in test store, columns_to_value
consolidated, modifier_hint mismatch logging, OffDuty test coverage,
batching tradeoff documented, unknown value_type warning, occluded
text risk documented, dead child respawn in voice worker, INJECT
block ambiguity documented.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-13 09:34:33 +01:00
jpmschweitzerandClaude Sonnet 4.6 b37583ddfc fix(simulation): address PR review items for #655 content removal
- line_pool.rs: add trace! when active_situations is empty (Layer 2
  will silently filter all lines — important for content debugging)
- knowledge_grant.rs: document serde(untagged) ambiguity hazard; add
  KnowledgeGrant::validate() for load-time field validation
- monologue.rs: annotate trigger_monologue as schedule ordering anchor;
  fix stale "periodic trigger cooldown tracking" doc reference in
  trigger_event_monologue (COOLDOWN_TICKS removed in #655)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-13 09:32:48 +01:00
jpmschweitzerandClaude Opus 4.6 dde231cb11 chore(config): move cross-worktree Read permissions to settings.local
These permissions are only needed by the main worktree for PR reviews,
not by team worktrees. Moved from shared settings.json to local.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-13 09:18:34 +01:00
jpmschweitzerandClaude Opus 4.6 5334def411 chore(config): allow cross-worktree Read for PR review agents
Adds Read permissions for all team worktree directories so review
agents spawned from main can read source files directly instead of
falling back to git diff.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-13 09:17:56 +01:00
jpmschweitzerandClaude Opus 4.6 e317a66ac6 chore(meta): update changelog
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-13 09:12:31 +01:00
jpmschweitzerandClaude Opus 4.6 50800cbf81 feat(simulation): composable behavior engine — action+modifier+context primitives (#633)
Replaces flat culture×zone×role behavior strings with three-layer
composition: BehaviorAction (role-generic), BehaviorModifier (culture
coloring), BehaviorContext (situation gating). Assembly at NpcBlueprint
instantiation. Backward compatible — falls back to legacy behaviors
when primitives are empty. D-139 filed, Q-057 resolved.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-13 09:12:07 +01:00
jpmschweitzerandClaude Opus 4.6 accbe579c9 feat(simulation): SQLite settings storage with IPC protocol v20 (#627)
Per-player settings via rusqlite (bundled, zero runtime dep). Server
owns the settings DB; client sends ChangeSettings commands over IPC.
Extensible key-value with typed columns (String/Int/Float/Bool).
Protocol bumped to v20 with settings_response in ObserverSnapshot.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-13 09:11:53 +01:00
jpmschweitzerandClaude Opus 4.6 1a4fd578cc feat(simulation): voice pipeline integration — Factual bypass, observer wiring, tell iteration (#650 #652 #651)
ContentType::Factual bypasses LLM for fact-bearing lines (numbers,
denials). Observer enrichment systems rewrite dialogue/conversation
text with voiced versions before snapshot assembly. Friendly and
RoutineDeviation tells get concrete surface-pattern examples.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-13 09:11:44 +01:00
jpmschweitzerandClaude Sonnet 4.6 ce0df2f320 refactor(simulation): remove v0.1 content loading system (#655)
Delete the hand-authored YAML content pipeline (server/src/content/) superseded
by the v0.2 generator-first approach (D-122, D-128). Runtime ECS types that were
co-located with content loading have been extracted to dedicated simulation modules:

- simulation/triangle.rs: TriangleState, TriangleCrisisEventQueue, tick/resolve systems
- simulation/line_pool.rs: LinePoolIndex, AccessTier, TrustTier, Mood, LinePoolIndexResource
- simulation/knowledge_grant.rs: KnowledgeGrant, Prerequisites

Monologue systems (trigger_monologue, trigger_recognition_monologue,
trigger_event_monologue) now use hardcoded fallback lines only; the
ContentStoreResource branch and select_pool_line function are removed.

Deleted: content/{loader,types,line_pool,hot_reload,spawn,instantiation,entanglement,mod}.rs
Deleted: tests/{content_loading,content_runtime,content_scaling,template_instantiation,template_schema}.rs
Deleted: bin/line_preview.rs (v0.1 tool)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-13 09:07:57 +01:00
jpmschweitzerandClaude Opus 4.6 b979cab41e chore(config): configure autoMemoryDirectory for shared memory storage
Points auto-memory to ~/Projects/settled-reach/.memory so all
worktrees share a single memory root outside the git tree.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-13 08:42:49 +01:00
jpmschweitzerandClaude Opus 4.6 441164fe23 chore(meta): release v0.1.25
Sprint 25: Emerge — generator extrapolation from minimal input,
voice pipeline spikes (D-138), behavior dedup, Want/State layer.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
v0.1.25
2026-03-07 19:53:10 +01:00
jpmschweitzer ecbe905071 Merge remote-tracking branch 'origin/server'
# Conflicts:
#	CHANGELOG.md
2026-03-07 19:52:08 +01:00
jpmschweitzer 78c6aa51c4 Merge remote-tracking branch 'origin/copy'
# Conflicts:
#	decisions/questions.md
2026-03-07 19:51:31 +01:00
jpmschweitzerandClaude Opus 4.6 6c1876f856 chore(meta): add #627 SQLite settings storage to Sprint 26
Prerequisite for #646 (AI-Enhanced Dialogue toggle). Updated server
and client briefings with dependency chain and integration notes.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-07 19:47:00 +01:00
jpmschweitzerandClaude Sonnet 4.6 cbe8b5b5ab chore(meta): plan Sprint 26: Clean House
13 tickets across server (5), copy (6), client (1), planning (1).
Sprint goal: ship voice pipeline to production via observer integration,
remove v0.1 dead weight, stabilize codebase. #648 cancelled as duplicate
of #658.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-07 19:44:02 +01:00
jpmschweitzerandClaude Opus 4.6 a2554118a5 docs(decisions): amend D-138 with Spike 2 findings
Spike 2 amendments: stdio IPC (not HTTP, Gemma 2 T&C compliance),
tell differentiation results (3/5 at 2B capacity), double-prompt
technique, ContentType::Factual for LLM bypass, all negative
injectors moved from universal RULES to per-culture voice_persona.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-07 19:26:07 +01:00
jpmschweitzerandClaude Opus 4.6 9f34d030d7 feat(voice): complete Spike 2 voice pipeline with quality-tested prompt engine
Spike 2 delivers the full voice pipeline: queue → worker pool → sr-voice
child process (stdio JSONL) → cache → disk. Three rounds of quality testing
with Paula, Mellanie, and Gestalt produced iterative prompt improvements.

Prompt engine (prompt_builder.rs):
- Example-based epistemic marker integration (not keyword lists)
- Length-aware Angry tell variant (preserves facts on long content)
- Double-prompt technique: REMEMBER block repeats constraints near OUTPUT:
- Imperative injection framing (composition engine controls frequency)
- Anti-invention constraint ("do not add information not in the input")
- Universal RULES cleaned: worldbuilding moved to culture personas

Worker pool (worker.rs):
- Output post-processor strips after first newline (prevents prompt leakage)
- Watchdog poll loop (1s ticks) replaces blocking sleep for cancel
- Child health check before writing (try_wait)

Test infrastructure:
- voice_pipeline.rs: end-to-end test, auto-detects real sr-voice or mock
- voice_quality_batch.rs: 39 edge-case prompts for quality review
- mock-stdio.sh: Python JSONL mock for CI (no model needed)
- Makefile targets: test-voice-mock, test-voice-real

Quality results (Gemma 2B Q4_K_M, CPU ~13 t/s):
- Epistemic markers: naturally integrated (round 1 comma-lists fixed)
- Tell differentiation: 3/5 working (Nervous, Guarded, Angry)
- Information preservation: ~90% (up from ~70%)
- Prompt leakage: eliminated
- Open: Friendly/RoutineDeviation tells inert (#651), Factual bypass (#650)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-07 19:20:06 +01:00
jpmschweitzerandClaude Opus 4.6 e93a9e8b70 fix(voice): address PR review findings — 3 critical, 5 warning, 4 suggestion
Critical fixes:
- Pause mechanism: workers now hold requests during pause instead of
  dropping them. Queue and worker pool share the same AtomicBool flag
  via VoiceQueue::paused_flag(). Submit() rejects while paused.
- Seed type: sr-voice accepts u64 seeds over IPC (explicit u32 truncation
  for llama.cpp sampler, documented).

Warning fixes:
- HashMap → BTreeMap in cache.rs and worker.rs (D-010 determinism mandate).
  Added Ord derives to CacheKey, ContentType, TellCategory.
- VoicePipe::generate() watchdog kills child after 120s timeout to prevent
  indefinite blocking on read_line.
- VoiceCacheStore Drop impl calls save_all() on shutdown.
- trait-modifiers.ron: fixed 3 wrong trait names (Impulsive→Compassionate,
  Methodical→Incurious, Stubborn→Ruthless) to match PersonalityTrait enum.

Suggestion fixes:
- Worker spawn: log error + reduce pool instead of panic on thread failure.
- on_battery(): added macOS detection via pmset.
- Epistemic markers: lowercased constants, removed redundant to_lowercase().
- cache.rs: documented non-atomic write tradeoff.
- queue.rs: reprioritize() bypasses pause check (it runs during pause).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-07 18:11:46 +01:00