Commit Graph
581 Commits
Author SHA1 Message Date
g-butandClaude Sonnet 4.6 1804adb9b3 refactor(dry): extract computeStreak helper in habits.ts
The 7-line streak loop appeared twice — once using HABIT_HISTORY_DAYS
as the bound (listHabitsForToday) and once using a dynamic days param
(getHabitHeatmapData). Extracted to a private computeStreak(dates, maxDays)
function eliminating the duplication.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-11 15:32:30 +02:00
g-butandClaude Sonnet 4.6 4a49716f79 fix(ssot): replace inline panel/kicker patterns with ui-* classes
DevLogList, ProjectProfile, project-overview-helpers: replace inline
rounded-xl border border-border-subtle bg-surface-base with ui-panel.

EventsDueCard event.type label: replace text-xs text-text-tertiary
uppercase tracking-caps with ui-kicker — semantically correct and
eliminates the inline duplication of the kicker token set.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-11 15:28:26 +02:00
g-butandClaude Sonnet 4.6 9e7a78f372 feat(ssot): add ui-input-inline class and apply across 14 callsites
The repeating inline-edit input pattern (bg-surface-raised border rounded
outline-none transition-colors with focus:border-border-strong) appeared
14 times across 9 components with no shared class. Adds ui-input-inline
to globals.css as the single source of truth for click-to-edit inputs on
raised surfaces. Callers supply their own padding, text-size, width, and
border-strength overrides as needed.

Files updated: HabitCard, CommitmentItem, GoalCard, goal-card-helpers,
HabitRow, LogConversationButton, ProjectInlineEditors, ProjectPromptsTab,
project-overview-helpers.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-11 15:19:24 +02:00
g-butandClaude Sonnet 4.6 df8e2b2a40 fix(ssot): import Agent type from agent-registry instead of redefining
Eliminates the duplicate type Agent = "codex" | "claude" that violated
the single-source-of-truth principle.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-11 15:06:17 +02:00
g-butandClaude Sonnet 4.6 91374b42cf fix(dead-code): remove unused LaunchAgentOption from use-control-data
Zero external callers; the type was never imported by any component.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-11 15:03:11 +02:00
g-butandClaude Sonnet 4.6 e559e539df fix(dead-code): unexport private types in db/queries/
CreateEventInput, PatchEventInput, MilestoneSchema, SubscriptionRow,
PatchSubscriptionInput, LatestLifecycleEvents, PatchProjectInput,
PatchCommitmentInput — all referenced only within their own query file,
never imported by route handlers or components.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-11 15:01:32 +02:00
g-butandClaude Sonnet 4.6 4bfc7864dc fix(dead-code): unexport private symbols in config/
WhisperModel (beacon), CHANNEL_ATTR_PREFIX + ChannelConfig (channels),
PromptScope (prompt-library), SubscriptionMeta (subscriptions) — all
had zero external callers and are only referenced within their own file.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-11 14:55:50 +02:00
g-butandClaude Sonnet 4.6 b57c17f2a8 fix(dead-code): unexport/remove dead symbols across lib/
agent-registry: remove sanitizeAgentOption, getDefaultAgentId,
getAgentRegistryEntry, getDefaultAgentConfig, sanitizeAgentConfig,
listSwitchableAgentRegistry — all had zero external callers.

agent-config: make CLAUDE_HOME, PROJECTS_CONF, CLAUDE_PROJECTS_CONF,
CLAUDE_PROMPTS_FILE, PromptConfig, readPromptConfig private — only
used within the file.

agent-preferences: make AGENT_PREFERENCES_FILE private.
agent-catalog: make AgentCatalogEntry private.
constants: make OPENCLAW_DIR, WORKSPACE_DIR private.
utils: make UUID_RE private.
session-content: make ParsedSession private.
crons: make CronFileData private.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-11 14:49:01 +02:00
g-butandClaude Sonnet 4.6 8d2ce0a0ff fix(dead-code): remove unused exports from agent-runtime
ProjectTab, SwitchTabResult, getConfiguredProjectTabs, getOpenZellijTabs,
restartTab, and restartOpenProjectTabs had zero external callers. The
internal helpers (getOpenZellijTabs, restartTab) are kept as private
functions since launchAgentInTab still depends on them.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-11 14:35:42 +02:00
g-butandClaude Sonnet 4.6 2afd0a22e9 fix(dead-code): remove stale getAgentCwds from agent-runtime
The export was unused — both control routes import from control-fast-state.ts
which has the correct basename-only matching. The agent-runtime version used
a full cmdline scan that produced false positives on bash shell-snapshot scripts
and was superseded when control-fast-state.ts was introduced.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-11 14:24:55 +02:00
g-butandClaude Sonnet 4.6 b784b42e26 fix(control): surface orchestration-ready projects in active section
isOrchestrationReady was not included in isActive, so projects where an
orchestration run just finished were buried in the collapsed idle grid
instead of appearing in the active section where the user can see the
result. The sort rank was already correct (rank 2, same as isReady) but
the active/idle split was wrong.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-11 14:06:56 +02:00
g-butandClaude Sonnet 4.6 6f7a9d92e6 refactor(ssot): agent-preferences imports Agent/sanitizeAgentId/syncAgentSettings from registry
Removed three duplicates in agent-preferences.ts:
- local `type Agent` (same as registry export)
- local `sanitizeAgentId` (identical implementation)
- local `syncClaudeSettings` (same logic as registry's syncAgentSettings)

Now calls syncAgentSettings("claude", ...) directly instead of re-deriving the
~/.claude/settings.json path inline.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-11 14:01:17 +02:00
g-butandClaude Sonnet 4.6 5c913735e4 fix(ssot): align HEALTH_TAG_STYLE and HEALTH_COLOR vocabulary
Both maps cover the same health labels (good/excellent/needs-attention/degraded/critical)
so an agent writing "degraded" no longer silently falls through to neutral tag style
in DevLogList and the public profile page.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-11 13:50:06 +02:00
g-butandClaude Sonnet 4.6 db0a011843 fix(ssot): prompts/agent route imports PROMPTS_FILE from lib/agent-config
Removed local duplicate of the agent-prompts.json path. agent-config.ts is
already the SSOT and also supports AGENT_PROMPTS_FILE env-var override which
the local copy silently ignored.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-11 13:44:21 +02:00
g-butandClaude Sonnet 4.6 349710a132 fix(ssot): deduplicate BEACON_SETTINGS_PATH — single source in config/beacon.ts
Both beacon-settings and beacon/transcribe routes defined the same
~/.config/agent-dashboard-settings.json path. Extracted to BEACON_SETTINGS_PATH
in config/beacon.ts (already the SSOT for beacon config after WHISPER_MODELS).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-11 13:41:30 +02:00
g-butandClaude Sonnet 4.6 d94b9ec8a3 fix(projects): use getHealthShort+HEALTH_COLOR in ClaudeSession health display
Replaced ad hoc pattern matching (startsWith "green"/"red", includes "fail")
with the existing SSOT from lib/constants/control. Fixes degraded health showing
as muted text-secondary instead of warning color in project detail view.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-11 13:34:11 +02:00
g-butandClaude Sonnet 4.6 dbeca7570f feat(control): prioritize degraded/critical health projects in idle tile sort
Within same display-state rank, surface projects with degraded or critical
health before those with only git activity, so attention-needed projects
float to the top of the idle grid.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-11 13:29:48 +02:00
g-butandClaude Sonnet 4.6 0f6c6188a4 feat(control): surface git dirty, behind-remote, and session.done on idle project tiles
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-11 13:23:10 +02:00
g-butandClaude Sonnet 4.6 08c8fc6859 refactor(ssot): extract WHISPER_MODELS to config/beacon; collapse DIMENSION_ORDER into DIMENSION_META keys
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-11 13:12:57 +02:00
g-butandClaude Sonnet 4.6 35333e9ea6 refactor(ssot): import AGENT_IDS from registry; remove dead AlertSeverity type
agent/route.ts redefined AGENT_IDS locally instead of importing from
lib/agent-registry.ts where it lives. One source of truth for agent IDs.

AlertSeverity derived type had zero external usages — removed.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-11 13:02:53 +02:00
g-butandClaude Sonnet 4.6 f02a951694 refactor(projects): hoist HealthBadge style/icon maps to module level
Avoids recreating Record objects on every render. Renamed to
HEALTH_BADGE_STYLE and HEALTH_BADGE_ICON for UPPER_SNAKE_CASE consistency.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-11 12:50:10 +02:00
g-butandClaude Sonnet 4.6 39150f85dc refactor(people): move SORT_LABELS to constants SSOT
Labels belonged alongside SORT_MODE in lib/constants/statuses.ts.
PeopleGrid now imports from there instead of defining them locally.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-11 12:33:41 +02:00
g-butandClaude Sonnet 4.6 149ee16c0e feat(control): one-click library prompts in intent panel
Adds collapsible "Library prompts" section to IntentButtonPanel showing
featured project-scoped prompts as polished mini-cards (2-col grid with
name, description, category badge). Clicking injects directly when the
agent is ready (bannerActive) or populates the input for review when idle.

Adds FEATURED_PROJECT_PROMPTS and substituteProjectName() to
config/prompt-library.ts as the SSOT for control-panel prompt injection.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-11 12:23:21 +02:00
g-butandClaude Sonnet 4.6 ff88bfad1e refactor(profile): simplify listThoughts call — remove unnecessary Promise.resolve wrapper
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-11 12:00:06 +02:00
g-butandClaude Sonnet 4.6 3e48946d4c feat(goals): add project filter chips to GoalsGrid; remove redundant FREQ_LABELS in HabitCard
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-11 11:53:38 +02:00
g-butandClaude Sonnet 4.6 007d714fe8 feat(goals): make linked project name a deep-link to /projects?open=<id>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-11 11:46:16 +02:00
g-butandClaude Sonnet 4.6 50823eb035 refactor(ssot): move QUICK_PROMPTS from shell helper to config/prompt-library
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-11 11:36:37 +02:00
g-butandClaude Sonnet 4.6 0d04a3f9ea refactor(ssot): move ALL_CATEGORIES from CategoryBar component to config/prompt-library
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-11 11:32:58 +02:00
g-butandClaude Sonnet 4.6 98b3e4c773 refactor(ssot): move HEALTH_TAG_STYLE from component to config/ui
HEALTH_STYLE was defined inside DevLogList.tsx (a UI component) and
imported as a module-level constant by the public profile page. Constants
must not live in component files — moved to config/ui.ts as HEALTH_TAG_STYLE
with both consumers updated to import from the canonical location.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-11 11:27:06 +02:00
g-butandClaude Sonnet 4.6 5e9945bc22 fix(people): sync health filter back to URL for bookmarkable filtered views
When the user toggles health filters (e.g. after landing on /people?health=stale
via SummaryBar), the URL now stays in sync via replaceState so the current
filter is always bookmarkable and shareable without triggering a server re-render.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-11 11:19:15 +02:00
g-butandClaude Sonnet 4.6 ea8db50194 feat(today): surface degraded fleet projects in SummaryBar
getFleetSummary now also reads sessionHealth from DB and counts projects
whose health is degraded or critical. A new amber pill appears in SummaryBar
when any exist, linking to /control — so the user sees unhealthy agents
from Today without opening the Control panel.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-11 11:15:58 +02:00
g-butandClaude Sonnet 4.6 a4549b2d88 feat(habits): add inline habit management — edit title, frequency, active toggle, delete
The habits page was read-only; users had no way to rename habits, change
their cadence, deactivate them, or remove them despite the API supporting
all four. Introduces HabitCard (client component) with click-to-edit title,
frequency chip selector, on/off active toggle, and a delete button.
Also extends PatchHabitBody and updateHabit to accept the active field.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-11 11:08:38 +02:00
g-butandClaude Sonnet 4.6 236b50a9ad fix(today): make overdue/drafts SummaryBar pills clickable with anchor links
Add id="actions" to ActionQueueCard wrapper and id="commitments" around
CommitmentsCard so the SummaryBar pills can link directly to the relevant
card on the Today page, matching the existing #alerts anchor pattern.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-11 11:01:46 +02:00
g-butandClaude Sonnet 4.6 a9c691154b fix(people): align stale contacts count with health system SSOT
staleContacts in getTodaySummary was using HEALTH_ACTIVE_DAYS (14d)
as threshold, but "stale" is defined as > HEALTH_FADING_DAYS (30d).
This made the SummaryBar warn about fading contacts (14-30d) under
the "needs attention" label, which conflates two different health states.

Now the count only surfaces contacts silent for 30+ days, matching
the semantic meaning of "stale" in lib/constants/people. The SummaryBar
link goes to /people?health=stale instead of fading+stale.

Also removes stale comment in people.ts that referenced the wrong path.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-11 10:50:43 +02:00
g-butandClaude Sonnet 4.6 899ff09fe5 refactor(ssot): extract getFleetSummary time windows to control constants
cutoff4h and cutoff10m in getFleetSummary were magic numbers duplicating
intent already expressed in lib/constants/control. The 10-minute waiting
window is identical to READY_WINDOW_S (the UI banner window) — keeping
them separate means they can silently drift. Now both point to the same
constant so a change to READY_WINDOW_S automatically keeps the Today bar
pill in sync with the control panel banner.

The 4-hour running stale window is extracted as PROMPT_RUNNING_WINDOW_S
so it has a name, a comment explaining the invariant, and a single place
to adjust if the threshold ever changes.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-11 10:41:33 +02:00
g-butandClaude Sonnet 4.6 c71bd83fce fix(beacon,control): integrated pause/play UX across beacon and control panel
Three changes for a coherent auto-continue experience:

1. Beacon popup: the Pause/Play button now reflects the *effective* paused
   state — shows Play whenever isComposing (typing, focused, or recording),
   not just when autoContinueEnabled is false. This makes typing/speaking
   visually equivalent to pressing Pause, as intended. The button stays
   visible and enabled during recording (was opacity-30 disabled) so the
   user can always see and control the state. Status bar text updated:
   "Focused — paused" when textarea is focused but empty, "Recording —
   paused" when mic is active.

2. ReadyBanner (control panel): added a Pause/Play button next to the
   countdown timer — the button was previously only in the IntentButtonPanel
   below the banner, requiring the user to look away from where the countdown
   was displayed. Now it's inline with the timer for immediate access.

3. Threaded onToggleAutoContinue through ProjectBanners → ReadyBanner so
   both isReady and isOrchReady banners get the toggle.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-11 10:35:55 +02:00
g-butandClaude Sonnet 4.6 9d5480f675 fix(beacon): pause countdown when textarea is focused, not just when typing
The control panel already paused its countdown on input focus (customFocused).
The beacon popup only paused on non-empty text — so clicking the textarea
before typing didn't pause the countdown, leaving a window where a fast
typist could still get auto-fired before their first character registered.
Now inputFocused is included in isComposing, matching the control panel's
behaviour and closing the remaining race.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-11 10:27:05 +02:00
g-butandClaude Sonnet 4.6 8a6bfe0e23 fix(beacon): prevent auto-fire while user is typing in custom input
The fire effect only guarded against mic states (listening/processing)
but not text input — so typing in the custom box didn't stop the
countdown from firing. Replacing the individual mic checks with
isComposing (which already covers both mic and textarea) means the
auto-inject is suppressed whenever the user is mid-sentence, regardless
of input method.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-11 10:22:57 +02:00
g-butandClaude Sonnet 4.6 ff3be2534f fix(goals): use GOAL_PROGRESS_THRESHOLDS for progress bar tone
GoalCard hardcoded bg-status-positive/60 regardless of actual progress.
Now uses getProgressTone with the same thresholds as GoalsDueCard and
ProjectGoalsTab — amber below 50%, accent below 80%, green at 80%+.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-10 21:37:03 +02:00
g-butandClaude Sonnet 4.6 501b80c353 fix(control): include orchestration-ready projects in waitingCount
"Needs input" metric was only counting isReady (Claude session) but missed
isOrchestrationReady (orchestration run finished). Both states require builder
attention, so both should be reflected in the dashboard metric.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-09 23:48:03 +02:00
g-butandClaude Sonnet 4.6 0139aae7ab feat(control): surface degraded/critical health count in fleet dashboard
Projects with degraded or critical session health now show as "N degraded"
inline in the "Projects in control" metric note, so the builder can see
health issues at a glance without expanding each card.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-09 23:40:37 +02:00
g-butandClaude Sonnet 4.6 e6f7c2fbae refactor(ssot): replace hardcoded radius values with semantic tokens
Introduces --radius-modal (2rem) and --radius-pill (1.75rem) tokens in
globals.css — both expressed relative to --radius so they scale with
the base. Eliminates the last two rounded-[*] arbitrary values.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-09 23:37:56 +02:00
g-butandClaude Sonnet 4.6 618f778d30 feat(control): show +N commits today on idle project tiles
Idle tiles already show branch + health. Adding today's commit count gives
the builder a quick glance at which idle projects shipped work today.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-09 23:34:54 +02:00
g-butandClaude Sonnet 4.6 7207b08468 feat(control): replace verbose inventoryNote with fleet commits-today metric
The inventory note ("Source: Projects database · N directory-backed...") was
developer diagnostics with no judgment value. Replaced with a fleet-level
signal: total commits shipped today across all projects, shown only when > 0.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-09 23:32:37 +02:00
g-butandClaude Sonnet 4.6 2cf70aa8b7 feat(control): show recent commits in ReadyBanner — the main judgment moment
ReadyBanner is the high-frequency state (agent finishes a cycle, 12s countdown
before auto-inject). Showing the last 5 commits there lets the builder verify
real progress before the next dispatch, same collapsible pattern as ClosedBanner.
Adds git prop to ReadyBanner; both ReadyBanner calls in ProjectBanners pass it.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-09 23:27:07 +02:00
g-butandClaude Sonnet 4.6 30d5ad5c45 feat(control): show recent commits in ClosedBanner session review
Surfaces the last 5 git commits (already fetched but unused) in a
collapsible row inside the ClosedBanner — shown at session-close time
when the builder is reviewing what was done before deciding next action.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-09 23:22:33 +02:00
g-butandClaude Sonnet 4.6 736e1609a3 refactor(ssot): extract relationship health domain to lib/constants/people
Moves RelationshipHealth type, HEALTH_ACTIVE_DAYS/FADING_DAYS, deriveRelationshipHealth,
HEALTH_DOT_COLOR, and HEALTH_LABEL out of lib/utils (a pure-utility module) into a
dedicated lib/constants/people.ts. lib/utils re-exports for backward compat.
Updates all 8 callers to import from the canonical location.

Also adds missing title tooltip attributes to line-clamped running-banner text
in project-card-helpers and project-card-sections.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-09 23:16:09 +02:00
g-butandClaude Sonnet 4.6 ecc48b88c6 feat(control): per-project notes/scratchpad in profile panel
Adds a collapsible Notes section to ProjectProfile — a free-form textarea
that debounce-saves on change and persists on blur. Schema: new nullable
`notes TEXT` column on user_projects; PATCH route + query updated.
Dot indicator on the collapsed header when notes are non-empty.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-09 23:05:50 +02:00
g-butandClaude Sonnet 4.6 0dd1e89c52 feat(control): per-project focus mode — isolate one project, hide the rest
Adds a Focus button (lucide Focus icon) to every ProjectCard header and
ProjectTile footer. Clicking it sets focusedTab state in ControlPanel,
hiding all other projects and showing a slim accent banner "X — focus mode
· Exit focus". Idle tiles in focus mode expand automatically. Helps the
builder review a specific agent's output without visual noise from other
projects.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-09 22:58:18 +02:00
g-butandClaude Sonnet 4.6 5f3de284c6 feat(today): add agent fleet status pills to SummaryBar
Show "N running" (accent) and "N waiting" (green) pills in the Today
page summary bar, linking to /control. Uses a fast DB-only query on
project_states (currentPromptStartedAt within 4h = running; readyAt
within 10m = waiting) — no process scanning, safe for server components.
Bridges the personal productivity view with agent fleet awareness.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-09 22:51:24 +02:00