Skip to content

feat: extend Tok coach with reasoning metric, lever-focused chips, and refinements - #47

Open
bhavsarpratik wants to merge 5 commits into
mainfrom
codex/goals-coach
Open

bhavsarpratik wants to merge 5 commits into
mainfrom
codex/goals-coach

Conversation

@bhavsarpratik

Copy link
Copy Markdown
Member

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_tokens MCP stats metric — a bounded, read-only, execution-sourced sum metric 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 into total_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.)
  • Coach seed chips → controllable levers — the two generic chips are replaced with five that steer Tok toward model mix, context, reasoning/retries, a broad "what should I change" prompt, and the unchanged 30-day goal. This removes a generic prompt that kept resolving to non-actionable built-in tool volume. (Standard route: 1 tester + 1 reviewer, both PASS; live browser check at 1440px and 1024px.)

In-progress feature work (not independently gated this session)

  • navigationaction coach rename across the coach service, Codex turn, and dashboard.
  • Refinements to token_meter/app.py, coach/codex.py, coach/service.py, docs, and builder-recap git-delivery evidence.

⚠️ Reviewer note — known failing tests

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_evidence
  • BuilderRecapEndpointTests.test_builder_recap_state_reduces_git_evidence_before_public_build

The 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.
  • Embedded dashboard JS parses (js ok).
  • git diff --check clean.
  • MCP metric installed and verified live (/health, /menubar, source↔runtime parity).

🤖 Generated with Claude Code

bhavsarpratik and others added 5 commits September 15, 2026 18:56
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>
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