feat: extend Tok coach with reasoning metric, lever-focused chips, and refinements - #47
Open
bhavsarpratik wants to merge 5 commits into
Open
bhavsarpratik wants to merge 5 commits into
bhavsarpratik wants to merge 5 commits into
Conversation
Tok is one shared right-side conversation across every dashboard route. It answers with Token Meter evidence through bounded read-only MCP, turns a natural-language intention into a structured local goal contract, and produces opt-in weekly reviews through the user's signed-in Codex CLI. The live turn reports only observed boundaries: an indeterminate orbit, the in-progress read-only MCP tool, a completed-reading count, and a visual timer. Failures surface visibly with a recovery action instead of being announced only to assistive technology, so a missing local prerequisite is actionable rather than silent. Co-Authored-By: Claude Code <noreply@anthropic.com>
…d refinements This advances the Tok goals-coach feature on top of the initial coach commit. MCP: - Add a bounded, read-only `reasoning_tokens` stats metric (execution-sourced, sum reduction) so Tok can measure reasoning volume directly instead of only pointing at the Efficiency page. Reasoning is a component of output and is not folded into total_tokens; absent source data resolves to unavailable, never a measured zero. Advertised enum stays in parity with the resolver schema. - Tighten the coach SKILL "Reasoning effort" guidance to cite the measured share. Dashboard: - Replace the two seed coach chips with five that steer Tok toward controllable levers (model mix, context, reasoning/retries, and a broad "what should I change" prompt) plus the unchanged 30-day goal, instead of a generic prompt that resolved to non-actionable built-in tool volume. Coach service and supporting work: - Rename the coach `navigation` concept to `action`, and refine the coach service, Codex turn, app wiring, docs, and builder-recap delivery evidence. Known state: two builder-recap tests (BuilderRecapDomainTests.test_spotlight_eligibility_uses_safe_period_evidence and BuilderRecapEndpointTests.test_builder_recap_state_reduces_git_evidence_before_public_build) currently fail; that builder-recap work is still in progress. The reasoning-metric and coach-chip changes each passed independent tester and reviewer gates. Co-Authored-By: Claude <noreply@anthropic.com>
Reword the broad coach chip and add a SKILL guardrail so a cost question compares levers in dollars, never presents a token count, dollar figure, and retry ratio side by side, and does not conflate total input tokens with per-execution context. Co-Authored-By: Claude <noreply@anthropic.com>
Tok's first answer to an actionable question was a bare recommendation, so the user had to ask a follow-up to learn what to actually do. Expand the "Answer for someone who has to act" guidance to require a concrete worked example — name the kinds of work to move and the MCP-read numbers behind it, never the user's raw trace content — while keeping narrow single-number questions short. Add a model-routing worked-example exemplar to the Worked contrast so the strongest steering signal models the fuller shape. Raise the answer cap 700->1200 through a single MAX_ANSWER_CHARS constant used at both enforcement points (CHAT_SCHEMA maxLength and the _sanitize_chat re-validation) so the two cannot drift. Co-Authored-By: Claude <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What & why
Advances the Tok goals-coach feature (branch
codex/goals-coach) on top of the initial coach commit. Two increments in here went through independent tester + reviewer gates this session; the rest is in-progress feature work bundled at the author's request.Gated & green
reasoning_tokensMCP stats metric — a bounded, read-only, execution-sourcedsummetric so Tok can measure reasoning volume directly instead of only linking to the Efficiency page. Reasoning is treated as a component of output and is not folded intototal_tokens; absent source data resolves to unavailable, never a measured zero. The stdio-advertised metric enum stays in parity with the resolver schema. SKILL guidance updated to cite the measured share. (High-risk route: 1 tester + 2 distinct-lens reviewers, all PASS; installed and verified —/health,/menubar, source↔runtime parity.)In-progress feature work (not independently gated this session)
navigation→actioncoach rename across the coach service, Codex turn, and dashboard.token_meter/app.py,coach/codex.py,coach/service.py, docs, and builder-recap git-delivery evidence.Two builder-recap tests currently fail on this head; that builder-recap work is still in progress and was bundled deliberately rather than split out:
BuilderRecapDomainTests.test_spotlight_eligibility_uses_safe_period_evidenceBuilderRecapEndpointTests.test_builder_recap_state_reduces_git_evidence_before_public_buildThe rest of the suite passes (full suite: 1095 tests, 2 failures, 16 skipped). The reasoning-metric and coach-chip changes are unaffected by these failures.
Validation
python3 -m unittest discover -s tests→ 1095 run, 2 failures (the builder-recap tests above), 16 skipped.js ok).git diff --checkclean./health,/menubar, source↔runtime parity).🤖 Generated with Claude Code