Commit Graph

714 Commits

Author SHA1 Message Date
William Valentin c68fd2498e fix(audit): enforce phase0 summary max-limit semantics
Validate maxSessions/maxChannels/maxSkipReasons as non-negative finite values, make 0 produce zero rows, and add regression coverage. No architecture/protocol flow changes; diagram files reviewed and no updates were needed.
2026-02-27 13:08:37 -08:00
William Valentin fd0ab6e6df fix(audit): validate non-negative drift thresholds
Reject negative phase0 drift gate thresholds with explicit parameter names and add regression tests. No architecture/protocol flow changes; diagram files reviewed and no updates were needed.
2026-02-27 13:06:52 -08:00
William Valentin ad395bbdd6 fix(audit): reject malformed rolling artifact tags
Harden phase0 rolling retention timestamp parsing with explicit bounds and UTC round-trip validation; add regression coverage for invalid date/time tags. No architecture/protocol flow changes; diagram files reviewed and no updates were needed.
2026-02-27 13:04:27 -08:00
William Valentin 49a5a44c8a feat(auth): add Anthropic OAuth support and deferred credential loading
- Read Claude Code's OAuth token from ~/.claude/.credentials.json as
  a fallback source for auth_mode: oauth (with expiry checking)
- Fix OAuth callback server to bind to localhost (not 127.0.0.1) and
  use JSON content type for token exchange
- Null out apiKey when authToken is set to prevent SDK from falling
  back to ANTHROPIC_API_KEY env var (routes to wrong billing)
- Add DeferredErrorClient so daemon starts even when credentials are
  missing, surfacing the error on first chat() call instead of crash
- Prompt to complete OAuth flow immediately when setting auth_mode to
  oauth with no token stored

Note: Anthropic currently rejects OAuth for API access (Feb 2026
policy change), but the plumbing is in place for if/when re-enabled.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-27 13:03:01 -08:00
William Valentin 487e5c2930 test(audit): lock phase0 rolling script TAG wiring
Add regression tests that verify rolling and rolling:prune scripts keep shared overridable TAG semantics and tagged prune reports. No architecture/protocol flow changes; diagram files reviewed and no updates were needed.
2026-02-27 12:21:18 -08:00
William Valentin c2c9b2af66 fix(auth): make OAuth device flow polling cancellable via Ctrl+C
Add AbortSignal support to pollForToken (GitHub) and pollDeviceToken
(OpenAI) using an abortable sleep that clears its timer immediately on
abort. Wire an AbortController into the TUI login handlers, triggered
by the readline SIGINT event, so Ctrl+C exits the wait loop cleanly
instead of hanging until the device code expires.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-27 11:30:50 -08:00
William Valentin 7988d662e8 feat(audit): retain rolling phase0 prune reports 2026-02-27 10:57:00 -08:00
William Valentin 134fa60af1 feat(audit): add rolling phase0 artifact retention tooling 2026-02-27 10:20:14 -08:00
William Valentin 20224f1601 feat(audit): add phase0 backend drift and freshness gates 2026-02-27 09:01:43 -08:00
William Valentin 68cdc2cf8b feat(audit): add backend-scoped phase0 live baseline capture 2026-02-27 08:47:31 -08:00
William Valentin 826df1d35b feat(audit): automate gateway phase0 live-window capture 2026-02-26 23:56:30 -08:00
William Valentin 4b07a1f166 feat(audit): replace probe baseline workflow with live anonymized capture 2026-02-26 23:41:13 -08:00
William Valentin 820af97859 fix(companion): make reference-app exports reproducible by default
No diagram change needed: this change only makes generated reference-app timestamps deterministic and adds an override flag.
2026-02-26 20:58:31 -08:00
William Valentin 078c3799ce feat(companion): add mobile runtime skeleton shell templates 2026-02-26 20:56:43 -08:00
William Valentin d303869866 feat(companion): add runnable macOS menu-bar reference app scaffold 2026-02-26 20:51:00 -08:00
William Valentin 90b6d94a81 feat(companion): emit release manifest metadata in bundles 2026-02-26 19:39:11 -08:00
William Valentin be8b1f29a4 feat(companion): add generated macos ios android reference app surfaces 2026-02-26 19:37:28 -08:00
William Valentin 3839c04a7d feat(companion): add build-and-verify bundle automation pipeline 2026-02-26 19:35:02 -08:00
William Valentin ad2f7b7d04 feat(companion): enforce checksum verification in generated launcher 2026-02-26 19:32:42 -08:00
William Valentin 995166fbbc feat(companion): add release bundle verification mode 2026-02-26 19:31:24 -08:00
William Valentin 5618ca1fc5 feat(companion): add optional signing for release bundle artifacts 2026-02-26 19:05:41 -08:00
William Valentin 5df8ece040 feat(companion): export platform shell templates for app starters 2026-02-26 19:03:22 -08:00
William Valentin bbec292434 feat(companion): include checksums in release bundle artifacts 2026-02-26 18:59:44 -08:00
William Valentin 484247e1c1 feat(companion): export release bundle artifacts for shell packaging 2026-02-26 18:58:21 -08:00
William Valentin ee93061496 feat(companion): add shell bootstrap status location push controls 2026-02-26 18:55:29 -08:00
William Valentin 6620afcf1f feat(companion): add bootstrap manifest export for app packaging 2026-02-26 18:40:55 -08:00
William Valentin 62c427da4a feat(setup): add onboarding live checks and first-success guidance 2026-02-26 18:18:12 -08:00
William Valentin 163b1a0139 feat: harden voice reliability with tts fallback and talk controls 2026-02-26 17:29:23 -08:00
William Valentin 184dc2c688 Add companion reconnect state recovery and handoff helper 2026-02-26 17:01:16 -08:00
William Valentin 7c904ef0fd Add browser workflow reliability primitives and guardrails 2026-02-26 14:06:46 -08:00
William Valentin 3cc9e16ef5 feat(subagents): complete queue, budgets, audit, and inspection controls 2026-02-26 13:28:10 -08:00
William Valentin b679261683 feat(subagents): add idle ttl cleanup and summary tool 2026-02-26 13:12:53 -08:00
William Valentin 2171346116 feat(subagents): add multi-turn subagent session runtime 2026-02-26 13:07:34 -08:00
William Valentin d07e05d4cc fix(config): change no_tools_mode default to false for pi_embedded
The previous default of true was overly restrictive. false is the correct
default — tool-like prompts fall through to native handling only when
explicitly enabled.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-26 11:52:43 -08:00
William Valentin a00451a690 fix(auth): cancel OAuth callback server when flow is aborted
Add AbortSignal support to startCallbackServer and loginAnthropicOAuth
so that pressing Ctrl+C during the browser OAuth flow immediately closes
the HTTP server and 5-minute timer instead of leaving the process hung.

Wire up an AbortController in the TUI browser OAuth path so the cancel
callback aborts the signal on Ctrl+C.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-26 11:51:27 -08:00
William Valentin dfc7fbe3b9 fix(cli): add curly braces to single-line if statements in resolveAuthMode 2026-02-26 11:34:47 -08:00
William Valentin ed66dc98d3 feat(cli): add --browser flag to anthropic-auth command 2026-02-26 11:33:23 -08:00
William Valentin 0c500855c5 feat(tui): replace Anthropic token paste with browser OAuth flow 2026-02-26 11:31:19 -08:00
William Valentin 7b9e1e6cba fix(auth): correct ternary indentation in openBrowser 2026-02-26 11:28:29 -08:00
William Valentin 57f08e7005 feat(auth): implement Anthropic OAuth PKCE browser flow
Add openBrowser, exchangeCodeForToken, and loginAnthropicOAuth to
src/auth/anthropic.ts, completing the full PKCE OAuth flow. Includes
5 new tests covering happy path, state mismatch, 403 subscription
error, 500 error, and missing access_token cases.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-26 10:52:28 -08:00
William Valentin 82f09422d6 feat(auth): add PKCE helpers and OAuth callback server for Anthropic
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-26 10:32:13 -08:00
William Valentin c34b387ffe feat(tui): add tab completions for /login mode subcommand
Implement tab completion for /login <provider> mode <value> syntax,
allowing users to easily switch auth modes (api_key, oauth, auto) with
keyboard navigation.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-26 09:44:59 -08:00
William Valentin 7004a1a805 fix(tui): only offer auth_mode prompt after successful credential storage
Introduce a `credentialStored` flag in all 4 credential paths (OpenAI
API key, OpenAI OAuth, Anthropic auth token, Anthropic API key). The
auth_mode prompt is now gated on `credentialStored`, so a failed store
call no longer falls through to prompt the user for an auth mode that
was never set.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-26 09:40:58 -08:00
William Valentin 7d0c59b16f feat(tui): implement /login <provider> mode <value> auth mode switching
Export AUTH_MODE_PROVIDERS and applyAuthModeToConfig from minimal.ts.
Wire mode fast-path into handleLoginCommand so /login anthropic mode oauth
persists auth_mode to config without entering the credential flow.
After successful credential entry for anthropic/openai, prompt to set
auth_mode immediately.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-26 09:35:50 -08:00
William Valentin c456d34bf1 feat(tui): thread configPath and currentConfig into MinimalTuiConfig 2026-02-26 09:31:48 -08:00
William Valentin 7726b6d42a feat(tui): extend /login parser to accept mode subcommand
Add support for `/login <provider> mode <api_key|oauth|auto>` syntax to allow
switching authentication mode per provider in the TUI. The Command union type
now includes an optional mode field, and parseCommand handles regex matching
for the "mode" subcommand pattern while maintaining backward compatibility.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-26 09:28:47 -08:00
William Valentin c226a340b5 test(memory): cover getSystemPrompt session context 2026-02-25 18:06:33 -08:00
William Valentin 17f53e57d0 feat(memory): build session context for getSystemPrompt 2026-02-25 16:58:52 -08:00
William Valentin a76bc94b4d feat(memory): wire user_namespace and working memory config to orchestrator 2026-02-25 12:59:06 -08:00
William Valentin c658660a91 feat(memory): inject session context and write working memory after compaction 2026-02-25 12:58:01 -08:00