Skip to content

Add lifecycle commands, fix bugs, update README - #5

Merged
anilmurty merged 2 commits into
mainfrom
lifecycle-commands
Apr 7, 2026
Merged

anilmurty merged 2 commits into
mainfrom
lifecycle-commands

Conversation

@anilmurty

Copy link
Copy Markdown
Contributor

Summary

  • Bug fix: ocw serve printed wrong metrics port (9464 instead of 7391)
  • Bug fix: ocw onboard launchd daemon install now degrades gracefully on failure
  • Bug fix: CLI commands now fall back to REST API when DuckDB is locked by ocw serve
  • New: ocw stop — graceful shutdown of daemon or background process
  • New: ocw uninstall — clean removal of all OCW data, config, and daemon
  • README: Added toy agent example, new commands in CLI reference, corrected metrics URL, marked daemon roadmap item complete

Test plan

  • All 223 existing tests pass
  • ocw serve prints correct metrics URL (:7391/metrics)
  • ocw stop stops the daemon
  • ocw --help shows stop and uninstall commands
  • Run ocw serve &, then ocw status in another terminal (API fallback)
  • ocw uninstall --yes removes data and config

🤖 Generated with Claude Code

anilmurty and others added 2 commits April 7, 2026 10:26
…aunchd error handling

- Fix ocw serve printing wrong metrics port (9464 -> 7391)
- Gracefully handle launchctl load failures in ocw onboard
- Add API fallback: CLI queries REST API when DuckDB is locked by ocw serve
- Add ocw stop: graceful shutdown of daemon or background process
- Add ocw uninstall: clean removal of all OCW data and config
- Update README with toy agent example, new commands, correct metrics URL

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
@anilmurty
anilmurty merged commit 44e4be0 into main Apr 7, 2026
4 checks passed
@anilmurty
anilmurty deleted the lifecycle-commands branch April 7, 2026 17:35
anshss added a commit that referenced this pull request Apr 11, 2026
- Bootstrap: replace DuckDBBackend(config.storage.path) with
  duckdb.connect(path, read_only=True) — correct constructor signature
  and avoids lock collision with ocw serve
- acknowledge_alert: document short-lived read-write connection pattern
  instead of reusing the read-only handle
- setup_project: document cwd assumption explicitly + optional
  project_path override param
- list_active_sessions/list_agents: note they use db.conn directly
  (not in StorageBackend protocol)
- list_agents: clarify lifetime cost requires spans JOIN

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
anilmurty added a commit that referenced this pull request Jun 19, 2026
HoomanDgtl pushed a commit to HoomanDigital/tokenjam that referenced this pull request Jun 20, 2026
Metabuilder-Labs#5: replace the stale Metabuilder-Labs/openclawwatch#configuration URL (old
project name → 404) in both the generated config header and the onboard 'Next
steps' output with Metabuilder-Labs/tokenjam (Critical Rule 13).

Metabuilder-Labs#15: emit all four [capture] toggles — the writer omitted tool_inputs (CLAUDE.md
documents prompts/completions/tool_inputs/tool_outputs), leaving the generated
config inconsistent with the documented surface.

Tests: generated config carries all four capture toggles; no openclawwatch in
the config or console output. Lint clean.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
anilmurty pushed a commit that referenced this pull request Jul 2, 2026
Add `tj quota-audit` — the accountability companion to opusplan / `/model`.
Those are forward-looking and say nothing about session history; nothing
answered the backward-looking question "which of my PAST Opus sessions were
Sonnet-shaped?". This runs the structural downsize heuristic retroactively,
scoped to Opus sessions, and reports:

- the headline "% of your Opus quota reclaimable from Sonnet-shaped sessions"
  computed as candidate-Opus-tokens / total-Opus-tokens — quota language, not
  dollars (the subscription majority is on a flat fee, so dollar framing
  mis-targets them; implied dollars are a secondary API-only calibration line);
- the specific example sessions to spot-check;
- an optional tuned routing-config export (`--export-config claude-code`,
  reusing the existing snippet generator via a DowngradeFinding shim).

Framed as an audit (quota terms) with the honesty caveat always visible —
"candidates to spot-check, never safe-to-downgrade". Computes purely from
already-backfilled token/model metadata; does not depend on captured content.

`audit_opus_quota()` + `OpusQuotaAudit` / `OpusAuditExample` extend
model_downgrade.py / types.py; framing reuses core/framing (#4 pattern,
window-independent plan mix per #177). Covered by a synthetic-mix test
(Sonnet-shaped Opus candidates vs Opus-shaped Opus vs excluded Sonnet sessions)
asserting the % reclaimable, the spot-check listing, and the caveat render.

Co-Authored-By: Claude <[email protected]>
anilmurty pushed a commit that referenced this pull request Jul 2, 2026
The "tokenmaxxing → tokenminimizing" cultural shift (June 2026) means a
spend-brag card now repels while an efficiency/quota card aligns, and the
subscription majority has no dollar spend to brag about at all. The old card
rendered an (ironic) spend-tier ladder — the wrong polarity.

Reframe the card to a quota/efficiency artifact:
- Lead with the context-COMPOSITION headline from #4's
  compute_context_diagnostic: what share of quota went to overhead (re-reading
  history / CLAUDE.md / tool output) vs real work (uncached input + output).
- Classify into 5 efficiency tiers keyed on the overhead share (lower = leaner
  = a better tier), replacing the 6-tier spend ladder.
- Render quota-native via core/framing, mirroring #5's polarity: headline is a
  token-share / "% of cycle tokens"; dollars are demoted to a secondary
  "Implied API value" line shown only for api plans, suppressed for
  subscription / local / unknown. No dollar spend-brag for subscription users.
- Frame the action line as reclaimable quota (points at tj context).
- Add a --weekly "Quota Wrapped" recap preset (7-day window + recap copy).

The card now needs a direct DuckDB connection (it reads context composition),
matching tj context / tj quota-audit. Tests rewritten to assert the efficiency
framing (composition + reclaimed, not spend-brag) and quota-native suppression
of dollars for a subscription plan, plus weekly mode and the api secondary line.
Updated the two forward-looking release checklists and CLAUDE.md to match.

Co-Authored-By: Claude <[email protected]>
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