Skip to content

Release 1.6.6: Ally template, deferral UI fix, setup display name fix#520

Merged
emooreatx merged 19 commits intomainfrom
release/1.6.6
Nov 25, 2025
Merged

Release 1.6.6: Ally template, deferral UI fix, setup display name fix#520
emooreatx merged 19 commits intomainfrom
release/1.6.6

Conversation

@emooreatx
Copy link
Copy Markdown
Contributor

Release 1.6.6

This release includes three improvements:

Changes

PR #517 - Fix Deferral UI Fields (Issue #514)

  • Added question, context, and timeout_at fields to PendingDeferral schema
  • Updated WiseAuthorityService.get_pending_deferrals to populate UI fields with rich context
  • Deferral dashboard now shows question details, task description, and timeout information

PR #518 - Fix Setup Display Name (Issue #515)

  • Modified /auth/me endpoint to fetch actual username from auth service
  • Setup wizard now shows real username instead of wa-date format ID

PR #519 - Add Ally Template + Consolidate Templates

  • New "Ally" personal assistant template for user thriving support
    • Evidence-based ethics (Google DeepMind 2024 autonomy principles)
    • California SB 243 compliant crisis response protocols
    • TaskSchedulerService integration for reminders and goal tracking
  • Consolidated templates to single folder (ciris_engine/ciris_templates/)
  • Updated both manifest generators for reproducibility

Files Changed

  • ciris_engine/schemas/services/authority/wise_authority.py - PendingDeferral schema
  • ciris_engine/logic/services/governance/wise_authority/service.py - UI field population
  • ciris_engine/logic/adapters/api/routes/auth.py - Username lookup
  • ciris_engine/logic/adapters/api/routes/wa.py - Simplified deferral endpoint
  • ciris_engine/ciris_templates/ally.yaml - New template
  • tools/generate_template_manifest.py - Updated for consolidation
  • tools/templates/generate_manifest.py - Updated for consolidation
  • pre-approved-templates.json - Updated manifest with ally
  • Removed: ciris_templates/ folder (consolidated)

Test Plan

  • Deferral UI fields populated with context
  • Setup wizard shows correct username
  • Ally template validates and loads
  • Template signing reproducible
  • CI passes

🤖 Generated with Claude Code

emooreatx and others added 14 commits November 24, 2025 16:53
…reSQL support

This patch release fixes critical database path resolution issues in the
setup wizard that prevented users from persisting correctly in both SQLite
and PostgreSQL deployments.

### Changes

- **Fixed setup wizard database path bug** - Users created during setup now persist correctly
  - Modified `_create_setup_users()` to accept `auth_db_path` parameter from running application
  - Previously created new `EssentialConfig()` which defaulted to CWD-relative paths
  - Now uses runtime's resolved database path ensuring consistency

- **Fixed central path resolution in EssentialConfig** - All database paths now use centralized path_resolution.py
  - Added `default_factory` functions that call `get_data_dir()`
  - Ensures correct paths across all three deployment modes:
    - Managed/Docker mode: `/app/data/`
    - Development mode: `<git_repo>/data/`
    - Installed mode: `~/ciris/data/`

- **Fixed PostgreSQL backend support in setup wizard** - Uses `get_audit_db_full_path()`
  - Setup wizard now correctly creates users in PostgreSQL when configured
  - Previously only worked with SQLite deployments
  - Matches the database resolution logic used by AuthenticationService

- **Fixed test suite** - Updated test signatures and fixtures
  - Added `client_with_runtime` fixture for proper runtime mocking
  - Updated 4 tests to match new `_create_setup_users()` signature
  - All tests passing (6,675 passed, 38 skipped)

### Version
- Bumped to 1.6.5.3-stable

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Add three UI compatibility fields directly to the PendingDeferral schema:
- question: Optional display text for UI (defaults to None)
- context: Additional context as JSONDict (defaults to empty dict)
- timeout_at: ISO format timeout string (defaults to None)

Simplify API route by removing transformation code - the schema now
includes these fields natively, eliminating the need for runtime
transformation.

This fixes deferral details not being visible in the UI by ensuring
the TypeScript SDK receives the expected fields from the API.

Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
The /auth/me endpoint was returning the wa-date format user_id
(e.g., "wa-2025-11-24-03-40-04-427473") as the username, which was
displayed in the setup wizard's welcome message. This fix fetches
the actual username from the auth service.

Changes:
- Modified get_current_user() to inject auth_service dependency
- Fetch user object via auth_service.get_user(auth.user_id)
- Use user.name if available, fallback to auth.user_id if not found
- Maintains type safety (mypy passes)

Fixes #515

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
…folder

This commit introduces the Ally agent template and consolidates all templates
to a single authoritative location for improved maintainability.

Changes:
- Add new Ally template (personal thriving assistant)
  - Evidence-based ethics (Google DeepMind 2024 autonomy principles)
  - California SB 243 compliant crisis response
  - TaskSchedulerService integration for reminders and goal tracking
  - Comprehensive SOPs for personal assistance, decision support, and crisis handling

- Consolidate templates to single location
  - Remove root /ciris_templates/ folder (9 files)
  - Keep only ciris_engine/ciris_templates/ as authoritative source
  - Update generate_manifest.py to use consolidated path

- Update signed manifest
  - All 7 production templates signed with Ed25519
  - Manifest includes Ally with checksum sha256:381e5e96e5a6612d0f3ff225c20101c431e832c4dbe2dd04c00302a070001f8c
  - Root signature: Sr4Fc4KRLFieAaFy6zkCogl62nG93bzfAtzcYpdQa+K7FmmVPHnSustmM4LQ+5ZFRq+21Ms0SwJSc+Yr6gObCg==

Verification:
- Path resolution works correctly with consolidated folder
- All templates load and validate successfully
- Manifest signing tool updated and tested

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
The PendingDeferral schema was updated with question, context, and
timeout_at fields, but the service method wasn't populating them.
This caused the UI to continue showing empty values.

Changes:
- Populate question field from reason (for UI display)
- Build rich context from deferral data including:
  - task_description: Full task description (up to 500 chars)
  - Any context fields from deferral_info (user_id, etc.)
  - original_message if available
- Calculate timeout_at as created_at + 7 days (ISO format)

This completes the fix for issue #514 - deferral details now visible in UI.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
…lates

Address PR review comment - update the unified manifest generator to:
- Add ally template to TEMPLATES dict
- Point to consolidated ciris_engine/ciris_templates path

This ensures both manifest generators (tools/generate_template_manifest.py
and tools/templates/generate_manifest.py) are in sync with the template
consolidation.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Release 1.6.6 includes:
- PR #517: Fix deferral UI fields (issue #514)
- PR #518: Fix setup display name (issue #515)
- PR #519: Add Ally personal assistant template + consolidate templates folder

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Convert keys() result to list before indexing since dict_keys/odict_keys
view objects don't support subscripting with [0].

Fixes #521

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Reduces log noise in production by moving debug-level messages
from INFO to DEBUG level across multiple files:

- graph.py: add_graph_node debug messages
- memory_service.py: LocalGraphMemoryService init debug
- audit_service/service.py: audit entry creation debug
- action_dispatcher.py: tool audit parameter debug
- wakeup_processor.py: wakeup step processing debug
- setup.py: auth database path debug
- audit.py routes: audit entry conversion debug
- mock_llm responses: message processing debug
- main.py: exit point tracking debug

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Extract helper methods to reduce cognitive complexity from 24 to ~10:

- _parse_deferral_context: Parse context JSON and extract deferral info
- _priority_to_string: Convert integer priority to string representation
- _build_ui_context: Build UI context dictionary from deferral data
- _create_pending_deferral: Create PendingDeferral from parsed data

Added 19 unit tests covering all helper methods with edge cases:
- JSON parsing (valid, invalid, None, missing keys)
- Priority conversion (high, medium, low, edge values)
- UI context building (truncation, None handling, field extraction)
- PendingDeferral creation (defaults, user_id extraction, timeout calc)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
try:
context = json.loads(context_json)
deferral_info = context.get("deferral", {}) # type: ignore[assignment]
except json.JSONDecodeError:
Add custom validation for /v1/setup/templates endpoint to ensure:
- default template (Datum) is present
- ally template is present
- At least 5 templates are returned
- Template names match expected values

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
import os
import sqlite3
from typing import List
from typing import Any, Dict, List, Optional, Tuple
emooreatx and others added 4 commits November 25, 2025 14:25
The custom_validation callback receives requests.Response, not parsed JSON.
Fixed _validate_templates_response to call .json() on the response.

Also added INFO level debug logging to setup routes _get_agent_templates()
to help diagnose template loading issues in production.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Added release notes for:
- PostgreSQL dialect odict_keys fix (#521, #522)
- Deferral UI fields empty fix (#517)
- DEBUG log level fixes (39 statements across 10 files)
- Template consolidation (#519)
- Wise Authority service refactoring
- QA runner setup tests with template validation

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Remove load_env_vars() calls after config is set from dict/object
- CLI args should take precedence over .env file values
- Also fix setup_tests.py to keep default admin password

The adapter was calling load_env_vars() after applying the config dict,
which caused .env values to override CLI args. Now the precedence is:
1. Defaults (lowest)
2. .env file
3. Environment variables
4. CLI arguments (highest)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@sonarqubecloud
Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
70.6% Coverage on New Code (required ≥ 80%)

See analysis details on SonarQube Cloud

@emooreatx emooreatx merged commit b13a760 into main Nov 25, 2025
13 of 14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant