Skip to content

A derivation explains itself down to the sentence - #227

Merged
WaylandYang merged 1 commit into
devfrom
feat/proof-tree
Sep 3, 2026
Merged

A derivation explains itself down to the sentence#227
WaylandYang merged 1 commit into
devfrom
feat/proof-tree

Conversation

@WaylandYang

Copy link
Copy Markdown
Contributor

B1 of 0016 (R2 in 0002). A derived fact could show its direct premises as text; now it explains itself down to the sentence. reasoning::proof returns the derivation plus its premises in derivation order, each carrying its evidence rows; GET /kbs/{id}/derived/{id}/proof serves it; in the entity panel a derived row expands into the chain, each step a triple with its quotes linking into the document.

It is a chain, not a tree: fact_derivations records only asserted premises (derivation input excludes derived facts), so "recursive expansion" flattens to the ordered premises and their evidence. A premise that was since retracted is listed and marked, not hidden — the derivation falls with it, but "what it rested on at the time" stays readable, which is what the record axis is for. A derivation that no longer exists yields proof: null, and the panel falls back to the text premises it already had.

Decision records: 0002 R2 marked done with a revision on the chain-vs-tree shape; 0016 B1 marked done; index updated.

Checks: clippy clean, pnpm typecheck clean, new store test a_proof_reaches_the_sentence (order, leaf quotes, retracted marking) green alongside derived_facts_are_second_class; verified in the browser on a scratch base (transitive part_of chain and a sub-property derivation whose step links to the source sentence).

🤖 Generated with Claude Code

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@WaylandYang
WaylandYang merged commit e2c00df into dev Sep 3, 2026
3 checks passed
@WaylandYang
WaylandYang deleted the feat/proof-tree branch September 3, 2026 02:04
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