feat(web): render conclusion provenance from Honcho 3.2.0 source_ids - #108
Open
twistedgrim wants to merge 1 commit into
Open
twistedgrim wants to merge 1 commit into
twistedgrim wants to merge 1 commit into
Conversation
Honcho v3.2.0 serves conclusion attribution natively (source_ids,
times_derived); the legacy premises/reasoning_tree fields were never
shipped upstream, so the dream premise tree has always been empty.
- regenerate api schema against live Honcho 3.2.0 (level, source_ids,
times_derived, GET /conclusions/{id}); hoist the chat $defs blocks
the 3.2.0 schema inlines so openapi-typescript can resolve them
- dreams.ts: conclusionSourceIds() prefers native source_ids with the
legacy premises alias as fallback; hasPremiseTree() pre-check;
ExtendedConclusion re-declares level as widened string (Omit) because
Honcho may add unknown levels
- walk() sources children from source_ids, keeping reasoning_tree
precedence for older forks that served it
- DreamList builds a workspace-wide premise index and passes it to
DreamDetail so a deductive conclusion can resolve sources grouped
into a different dream
- dialectic chat calls send include_evidence: false (new required field)
- schedule_dream sends rebuild (new required field)
Test environment fixes (needed to run the suite on node 26):
- node 26's experimental localStorage is undefined without
--localstorage-file and clobbers jsdom's Storage through the compat
layer; setup.ts installs an in-memory Storage shim
- vitest environmentOptions pins jsdom url (opaque-origin guard)
Tests: 123 pass (22 in dreams.test.ts, +7 new for source_ids semantics)
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.
Summary
Honcho v3.2.0 serves conclusion attribution natively (
source_ids,times_derived). Thepremises/reasoning_treefields this UI has been waiting on were never shipped upstream, so the dream premise tree has always rendered empty. This change makes the tree real against Honcho >= 3.2.0 while preserving graceful behavior on older deployments.Changes
API schema
src/api/schema.d.tsfrom live Honcho 3.2.0openapi.json— addslevel,source_ids,times_derivedtoConclusion, and the typedGET /v3/workspaces/{workspace_id}/conclusions/{conclusion_id}route$defsblocks in the two/chatresponses which openapi-typescript cannot resolve; they are hoisted intocomponents/schemasduring regenerationPremise tree (
src/lib/dreams.ts)conclusionSourceIds(): nativesource_idsfirst, legacypremisesalias as fallbackhasPremiseTree(): cheap pre-check the detail view uses to decide whether to offer expansionexpandPremiseTree(): children now source fromsource_ids;reasoning_treeretains precedence (harmless, nothing serves it, but avoids regressing any deployment that piped it in)ExtendedConclusionre-declareslevelviaOmit+ widenedstring | null— Honcho may add levels at any time and unknown levels must classify asexplicit, not drop rowsData flow
DreamListbuilds a workspace-wide premise index and passes it toDreamDetail: a deductive conclusion'ssource_idsfrequently point at explicit conclusions clustered into a different dream, which the old dream-local index could never resolveNew required request fields (schema fallout)
include_evidence: falseschedule_dreamsendsrebuild: falseTest environment
localStoragethat isundefinedwithout--localstorage-file; that undefined bleeds through the environment compat layer and clobbers jsdom's Storage, breaking the entire suite (115 failures on main before any of my changes).setup.tsnow installs an in-memory Storage shim when real storage is absent, andvitest.config.tspins the jsdom URL as an opaque-origin guardVerification
pnpm typecheckcleanpnpm test: 123 passed (19 files), including 7 new tests covering source_ids-native walking,source_ids-over-premisesprecedence, legacy fallback, and thehasPremiseTree/conclusionSourceIdscontractspnpm lintcleanpnpm buildsucceedssource_ids/times_derived(direct observations havesource_ids: null,times_derived: 1)