fix(web): read conclusion level from the field Honcho actually sends - #92
Open
osyduck wants to merge 1 commit into
Open
fix(web): read conclusion level from the field Honcho actually sends#92osyduck wants to merge 1 commit into
osyduck wants to merge 1 commit into
Conversation
Dream cards always showed 0 deductive and 0 inductive. The type inference read `conclusion_type`, which no Honcho version returns; live 3.0.11 sends `level`. Every conclusion therefore hit the "explicit" fallback. Verified against a live instance: 87 explicit, 8 inductive, 5 deductive in the first page of conclusions. `premises` and `reasoning_tree` are still unserved, so the premise tree stays empty until Honcho ships them. Co-Authored-By: Claude Opus 5 (1M context) <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.
Problem
Every dream card reports
0 deductiveand0 inductive, no matter what the backend actually produced.inferConclusionTypereadsconclusion_type:https://github.com/offendingcommit/openconcho/blob/main/packages/web/src/lib/dreams.ts#L55
No Honcho version returns that field.
git grep conclusion_typefinds it only indreams.tsand its own tests — nothing produces it, so the?? "explicit"fallback fires for every conclusion and the deductive/inductive chips are structurally pinned to zero.The real field is
level. From Honcho's own SDKs:Verified against a live Honcho 3.0.11 instance —
POST /v3/workspaces/{id}/conclusions/listreturns:{ "id": "dTecvFzuSm3838v7aadlG", "content": "...", "observer_id": "claude", "observed_id": "claude", "session_id": "dudul-openconcho", "level": "deductive", "created_at": "2026-08-03T21:56:40.252268Z" }Across 800 conclusions on that instance: 740
explicit, 31deductive, 29inductive— all of which the dashboard was rendering as explicit.Fix
Read
level. Two details beyond the rename:contradictionis a fourth level. A naivec.level ?? "explicit"would pass it straight through and crash two call sites that assume a closed 3-value set:DreamDetail.tsx—buckets[inferConclusionType(c)].push(c)on a bucket record with only three keys →TypeErroronundefined.pushPremiseTree.tsx—TYPE_BADGE[type]→TypeErrorreadingcfg.bgSo
contradictionis added as a first-class type: detail column, badge, and a list chip that stays hidden at zero (the three existing chips keep rendering dimmed at zero as before).Unknown levels no longer reach the UI.
levelis typedstring, not the union, and narrowed throughCONCLUSION_TYPES. If Honcho adds a fifth level, the conclusion is counted as explicit instead of crashing the page or vanishing from the totals.Notes for review
e2e/dreams.spec.tshas ~70 lines of re-indent noise.pnpm lintisbiome check src/, soe2e/was never formatted; the.husky/pre-commithook (biome check --write --staged) reformatted the whole file when the mock rename was staged. No logic changed there beyondconclusion_type:→level:. Happy to strip it if you'd rather keep the diff to the five renamed lines.openapi.jsonis Honcho 3.0.5, which exposes neither field, soExtendedConclusionis still needed. Regenerating against a newer spec would letlevelbecome a first-class typed field and drop the augmentation — left alone here since that's a bigger call.premisesandreasoning_treeare genuinely unserved. A full conclusion object from live 3.0.11 has exactly seven keys; neither field appears on the list or detail response.expandPremiseTreeandPremiseTreetherefore never render children today. Left untouched — separate concern from this fix.mainhas since renamedobserver_id→observerinsrc/schemas/api.py, so a future API bump will need a wider sweep than this.Verification
pnpm check(lint + typecheck + test) passespackages/web/src/test/dreams.test.ts— 15 tests pass, including a new case asserting an unrecognized level counts as explicit rather than being dropped5 deductive,6 deductive / 9 inductive,6 inductivefor three consecutive runs whose raw API timestamps and levels match exactly