You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Generalize readonly stores for zero-footprint query commands
Add readonly=True pattern to MemoryCatalog, SkillCandidateStore, and
AutomationStore to prevent query commands from creating .teaagent
directories in fresh workspaces.
Store layer:
- Add readonly parameter to MemoryCatalog, SkillCandidateStore, AutomationStore
- Skip directory creation when readonly=True
- Add RuntimeError guards in mutating methods when readonly=True
CLI handlers:
- memory list/search/show use MemoryCatalog(readonly=True)
- skill candidate list/show use SkillCandidateStore(readonly=True)
- automation list/show use AutomationStore(readonly=True)
- Add JSON error boundary for memory show missing
Preflight chain (critical for status):
- build_daily_brief: Add readonly parameter, propagate to RunStore and preflight
- build_automation_status: Use AutomationStore(readonly=True) and BackgroundRunStore(readonly=True)
- preflight: Add readonly parameter, propagate to MemoryCatalog and build_context_pack
- build_context_pack: Use MemoryCatalog(readonly=True)
- check_env_health: Skip write health checks in readonly mode
- status_short: Pass readonly=True to build_daily_brief
Ergonomics:
- run_history: Use RunStore(readonly=True) for yesterday/recall
- automation_observability: Use AutomationStore(readonly=True) for blocked_reason
Tests:
- Add table-driven test distinguishing zero-footprint queries from mutating initializers
- Add status short and automation status to zero-footprint test table
- Add assertions for mutating initializer half
- Fix ruff issues (contextlib.suppress, import ordering)
This ensures high-frequency commands like status and yesterday/recall are
truly zero-footprint for fresh workspaces, suitable for shell prompts,
HUDs, and automated watchers.
Constraint: Must maintain backward compatibility; readonly defaults to False for all stores. Query commands must not create .teaagent in fresh workspaces. Mutating commands must continue to initialize state normally.
Tested: 22 tests in test_cli_ergonomics_handlers.py pass including new table-driven test. Fresh-root CLI black-box verification confirms status, agent automation status, yesterday/recall, memory/skill/automation list/show are zero-footprint. Ruff check passes.
Confidence: high
0 commit comments