Repository navigation
feat: V0-12 provisional Synthesis with Prompt B - #32
Merged
Merged
Conversation
Implement the Synthesis engine: once a Thinking Workspace has enough organized material, the Enrichment Workflow sends a bounded, diverse Note sample and recent Synthesis history to the approved Prompt B, and a valid result waits as a pending Synthesis until the thinker accepts it as a fresh thesis Note or dismisses it. - synthesis.rs holds the pure seam: byte-for-byte Prompt B, the response schema, eligibility evaluation against a caller-supplied clock, five-to-ten candidate selection, the three-block user message, response validation, and the semantic-repeat invariant. - Migration 0009 stores pending Syntheses with their source identities and captured revisions, AI provenance, the bounded novelty history, and the per-Workspace attempt checkpoint. No Relationship row is ever written for a provisional result. - A `found: false` attempt is a success: it moves the cooldown and the checkpoint and adds no pending content. Accept creates a thesis Note and removes the pending item in one transaction; dismiss removes the pending content and keeps only the text for novelty. A changed, deleted, or moved source Note makes a pending Synthesis stale and unacceptable. - The UI shows pending Syntheses beside their sources with Accept and Dismiss, reports ineligible and no-insight outcomes quietly, and draws a provisional mark in the graph without persisting a fake Relationship. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Spec review:
- A failed attempt (malformed body, provider failure, stale sources) now
records a cooldown-only checkpoint. Previously only `found: false` and
semantic repeats touched `synthesis_attempts`, so a provider answering with
nonsense was re-asked after every debounce forever. The cooldown moves; the
five-new-Notes checkpoint deliberately does not, so a transient failure
never costs the thinker their next five organized Notes.
- The diversity gate counted Note Types and Labels into one set, so five Notes
sharing one default Note Type and one Label passed on a total of two. The
two axes are now counted separately: "at least two represented Note Types
**or** Labels" means either axis on its own, never a sum.
- The novelty history is now bounded in storage, not only on read.
Standards review:
- `extract_json_candidate` is shared with the Note Organization parser rather
than copied; the attempt upsert and the organized-material counts each have
one home; `store_pending_synthesis` takes `ParsedSynthesis` and
`SourceRevision` instead of loose tuples and strings; the Assistance Policy
travels as its own enum on both sides of the seam.
- Dropped the glossary drift the new prose introduced ("edge", "canvas").
- Removed the unused `attemptNow` / `clear` controller surface, and the
optional-with-default `pendingSyntheses` prop.
- `useWorkspaceSnapshot` exposes `adoptSnapshot` instead of the App wrapping a
snapshot in a resolved promise to reuse `submit`.
Fallow (introduced findings only):
- Extracted the shared request-generation guard both AI controllers use.
- The Synthesis controller now owns which Syntheses are pending here, and the
accept and dismiss commands, so the App composes rather than coordinates.
- One `assistanceEnabled` predicate replaces three copies of the policy test.
- Simplified `statusMessage` from a seven-arm switch to a lookup.
Introduced complexity findings are back to zero. The remaining eight-line
clone between the two controllers is the call-and-guard shape around two
different commands with two different status unions; collapsing it further
would be an abstraction neither controller needs.
Co-Authored-By: Claude Opus 4.8 <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.
Closes #13.
Implements the Synthesis engine. Once a Thinking Workspace holds enough organized material, the Enrichment Workflow sends a bounded, diverse Note sample and recent Synthesis history to the approved Prompt B. A valid result waits as a pending Synthesis until the thinker accepts it as a fresh thesis Note or dismisses it. Nothing is ever accepted automatically, and no source Note is mutated on any path.
What is here
src-tauri/src/synthesis.rs— the pure seam, independent of storage: Prompt B byte-for-byte (asserted by a contract test), the response schema,evaluate_eligibilityagainst a caller-supplied clock, five-to-ten candidate selection biased by diversity then recency, the three-block user message, response validation, and the semantic-repeat invariant.Migration 0009 — pending Syntheses with their source identities and the enrichment revision each source carried, AI provenance, the bounded novelty history, and the per-Workspace attempt checkpoint. No Relationship row is ever written for a provisional result.
workspace.rs— pending Syntheses in the snapshot with staleness derived on every read (a source edited, deleted, or moved to another Workspace); atomic accept (thesis Note + Labels + pending removal + undo entry); dismiss; and a store that refuses a result whose sources moved during inference.lib.rs—propose_synthesis,accept_synthesis,dismiss_synthesis. Manual Workspaces and unconsented Cloud land onineligible, never on a provider call.Frontend — a controller that schedules attempts (durable rules stay in Rust), a panel showing each pending Synthesis beside its sources with Accept and Dismiss, and a dashed provisional mark in the graph that persists nothing.
Decisions worth review
no_insight, on the same path asfound: false.Verification
npm run checkpasses end to end: typecheck, lint, 139 frontend tests, 133 Rust tests, and the Tauri smoke build.Reviewed on both axes with
code-review(standards + spec) and audited withfallow; every actionable finding is addressed in the second commit, and introduced complexity findings are back to zero. The one remaining introduced clone is the eight-line call-and-guard shape shared by the two AI controllers, over two different commands and two different status unions.🤖 Generated with Claude Code