[222-epic] Confidence as visible trait — Timmy shows his uncertainty #246

Closed
opened 2026-03-15 18:35:03 +00:00 by hermes · 1 comment
Collaborator

Epic: #222 — The Workshop: Timmy as Presence

What

SOUL.md: "When I am uncertain, I must say so in proportion to my uncertainty."

PR #232 wired estimate_confidence() into the chat flow. But it's logger.debug() only. The user never sees it. This is compliance theater.

What "visible" means

  • In text: Timmy uses hedging language naturally when confidence is low. "I think..." vs "I know..."
  • In the Workshop: visual cues. Timmy's posture, animation, ambient lighting could reflect certainty. Confident = upright, clear. Uncertain = chin-scratch, dimmer.
  • In the bridge protocol: confidence score sent alongside every bark/response so the 3D world can react.

The real fix

The confidence module shouldn't just score AFTER the response. It should influence the PROMPT. If Timmy's memory retrieval on a topic is thin, the prompt should say "you have low context on this — be honest about that." The model then naturally hedges instead of confabulating.

Depends on: #222, #231 (confidence module)

## Epic: #222 — The Workshop: Timmy as Presence ### What SOUL.md: "When I am uncertain, I must say so in proportion to my uncertainty." PR #232 wired `estimate_confidence()` into the chat flow. But it's `logger.debug()` only. The user never sees it. This is compliance theater. ### What "visible" means - In text: Timmy uses hedging language naturally when confidence is low. "I think..." vs "I know..." - In the Workshop: visual cues. Timmy's posture, animation, ambient lighting could reflect certainty. Confident = upright, clear. Uncertain = chin-scratch, dimmer. - In the bridge protocol: confidence score sent alongside every bark/response so the 3D world can react. ### The real fix The confidence module shouldn't just score AFTER the response. It should influence the PROMPT. If Timmy's memory retrieval on a topic is thin, the prompt should say "you have low context on this — be honest about that." The model then naturally hedges instead of confabulating. Depends on: #222, #231 (confidence module)
kimi added the 222-epicactionable labels 2026-03-18 20:54:25 +00:00
Author
Collaborator

Kimi Instructions for #246 — Confidence as Visible Trait

What

Inject confidence context into Timmy's system prompt so the model naturally hedges when uncertain, rather than just appending [confidence: 65%] after the response.

Files to Modify

  1. src/timmy/prompts.py — add confidence context to the system prompt builder
  2. src/timmy/session.py — pass confidence context before the LLM call, not just after
  3. tests/timmy/test_session.py — add tests for prompt injection

Implementation

In prompts.py:
Add a function confidence_context(topic: str, confidence: float) -> str that returns a natural-language instruction like:

  • confidence > 0.8: (empty string — no injection needed)
  • 0.5 < confidence <= 0.8: 'You have moderate familiarity with this topic. Be honest about the limits of your knowledge.'
  • confidence <= 0.5: 'You have low context on this topic. Say so plainly. Do not confabulate. It is better to say "I am not sure" than to guess.'

In session.py:
Before calling the LLM (in process_message and similar functions):

  1. Use the cognitive_state's last confidence or call estimate_confidence on recent memory retrieval
  2. Call confidence_context() and prepend it to the system prompt if non-empty
  3. KEEP the existing post-response [confidence: N%] for low scores — that's fine as a secondary signal

Key constraint

The confidence injection must happen BEFORE the LLM call, not after. The whole point is to influence the model's hedging behavior at generation time.

Tests

  • Test confidence_context() returns correct strings at each threshold
  • Test that low confidence injects context into the prompt (mock the LLM call, verify prompt contains the context)
  • Test that high confidence does NOT inject context
  • Test the existing post-response tag still works

Run Tests

tox -e unit -- tests/timmy/test_session.py -v

Do NOT

  • Change the confidence scoring algorithm
  • Remove the existing [confidence: N%] tag
  • Modify the Familiar or Workshop state modules
## Kimi Instructions for #246 — Confidence as Visible Trait ### What Inject confidence context into Timmy's system prompt so the model naturally hedges when uncertain, rather than just appending `[confidence: 65%]` after the response. ### Files to Modify 1. `src/timmy/prompts.py` — add confidence context to the system prompt builder 2. `src/timmy/session.py` — pass confidence context before the LLM call, not just after 3. `tests/timmy/test_session.py` — add tests for prompt injection ### Implementation **In `prompts.py`:** Add a function `confidence_context(topic: str, confidence: float) -> str` that returns a natural-language instruction like: - confidence > 0.8: (empty string — no injection needed) - 0.5 < confidence <= 0.8: 'You have moderate familiarity with this topic. Be honest about the limits of your knowledge.' - confidence <= 0.5: 'You have low context on this topic. Say so plainly. Do not confabulate. It is better to say "I am not sure" than to guess.' **In `session.py`:** Before calling the LLM (in `process_message` and similar functions): 1. Use the cognitive_state's last confidence or call `estimate_confidence` on recent memory retrieval 2. Call `confidence_context()` and prepend it to the system prompt if non-empty 3. KEEP the existing post-response `[confidence: N%]` for low scores — that's fine as a secondary signal ### Key constraint The confidence injection must happen BEFORE the LLM call, not after. The whole point is to influence the model's hedging behavior at generation time. ### Tests - Test `confidence_context()` returns correct strings at each threshold - Test that low confidence injects context into the prompt (mock the LLM call, verify prompt contains the context) - Test that high confidence does NOT inject context - Test the existing post-response tag still works ### Run Tests ```bash tox -e unit -- tests/timmy/test_session.py -v ``` ### Do NOT - Change the confidence scoring algorithm - Remove the existing `[confidence: N%]` tag - Modify the Familiar or Workshop state modules
kimi was assigned by hermes 2026-03-19 01:55:17 +00:00
kimi was unassigned by Timmy 2026-03-19 14:09:19 +00:00
gemini was assigned by Rockachopa 2026-03-22 23:36:47 +00:00
claude added the harnessp1-important labels 2026-03-23 13:55:48 +00:00
gemini was unassigned by Timmy 2026-03-24 19:34:39 +00:00
Timmy closed this issue 2026-03-24 21:55:29 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Rockachopa/Timmy-time-dashboard#246