backward-chaining goal-driven reactive ui
Forward push graphs re-run entire pipelines whenever an upstream variable changes, while static multi-page forms ask visitors for details they already supplied in an initial prompt. A backward-chaining constraint solver starts from the desired output schema, diffs against already-extracted facts, renders HTML inputs strictly for the minimal missing frontier, and invalidates only transitive dependents when one requirement changes.
Hypothesis
Backward-chaining from a target goal schema (
solveGoalFrontier) renders smaller missing-input forms and invalidates fewer downstream computations on partial edits than forward-push prompt chains.
What confirms it: Supplying upfront natural-language facts eliminates already-known questions from the DOM, and changing destination preserves cached dates and budget artifacts while selectively invalidating flightEstimate and itinerary.
What falsifies or bounds it: Fact extraction errors create oscillating forms where newly extracted fields keep invalidating user-filled controls.
What this lab tests
Reactive Goal UI (GitHub) extracts structured facts via /api/extract-facts (or local LanguageModel), computes missingLeaves, readyToPull, and conditional sub-goals dynamically across three constraint schemas (Book a Trip, SEV-1 Incident Postmortem, Web Feature Launch Readiness), applies canonical-fact early cutoff on rephrased inputs, and progressively unlocks ready sections on /api/pull-goal-node.
const frontier = solveGoalFrontier("book-trip", extractedFacts, nodeCache, "destination");
// -> missingLeaves: ["pace", "international"] (renders only missing inputs)
// -> invalidated: ["flightEstimate", "itinerary"] (leaves dates, budget, pace cached)
Open questions
- How can canonical fact hashing combine browser built-in
LanguageModelextraction with synchronous rule checks in < 50ms? - Can goal schemas automatically compile both these missing-input forms and WebMCP tool parameters (like
canonical-multimodal-ui)?
Iteration log
- — Built 3-pack constraint solver (
Book a Trip,SEV-1 Postmortem,Launch Readiness), canonical fact extractor, and progressive unlock endpoints. - — Fixed Tab 2 CSS Grid
minmax(0, 1fr)horizontal overflow and promoted code blueprints to top of page. - — Reordered the backward-chaining solver ahead of setup docs for 700px embeds, added CSP-safe DOM syntax highlighting and keyboard tab navigation, and routed static assets through the Worker with
no-cacheheaders.
Primitives tested: Backward-Chaining Solver, Conditional Sub-Goals, Selective Invalidation, Canonical Fact Diffing.
This is an active lab under /labs/ and stays off the main RSS feed until graduated into a full essay.