Skip to content

feat(overlay): add the Lore capture overlay MVP (verified core + Tauri shell scaffold)#202

Open
tcballard wants to merge 6 commits into
mainfrom
claude/lore-overlay-mvp
Open

feat(overlay): add the Lore capture overlay MVP (verified core + Tauri shell scaffold)#202
tcballard wants to merge 6 commits into
mainfrom
claude/lore-overlay-mvp

Conversation

@tcballard

@tcballard tcballard commented Jun 24, 2026

Copy link
Copy Markdown
Collaborator

Summary

A first MVP of the capture overlay (Host B of lore-capture-surfaces,
architecture in lore-capture-overlay). It is a lore-* product (ADR-068)
developed here as a staging directory (lore-overlay/) to extract to its own
itsthelore/lore-overlay repo later — the develop-in-repo-then-extract pattern
used for the VS Code extension.

Two surfaces:

  • lore-overlay/core/ — the platform-agnostic capture "brain" (Rust lib).
    Fully tested here.
  • lore-overlay/app/ — the macOS-first Tauri v2 desktop shell. Authored
    scaffold; not built/run
    (it targets macOS; this was developed in a Linux
    container).

The product name is provisional ("overlay" is a working title), per the
maintainer's note.

Scope

Included

  • The capture core: the two-gate flow (ADR-077) over three trait seams (rac
    engine / model gateway / GitHub). propose (Gate-1 fidelity) → publish
    (writes, validates with rac, opens a draft PR only). The Publisher
    trait has no approve/merge method, and publish refuses any non-draft PR —
    a host on this core cannot self-approve.
  • A bring-your-own OpenAI-compatible gateway (ADR-035); the engine seam shells to
    rac (ADR-063); no AI in the engine (ADR-002/067).
  • The Tauri shell scaffold (tray + global hotkey → modal → the two commands) and
    a minimal two-gate frontend.
  • A README.md that states exactly what is verified vs not.

Excluded

  • The desktop app is not built, run, signed, or notarized — that needs macOS.
  • Real settings persistence + OS-keychain secret storage (scaffolded via env vars).
  • Desktop GitHub-App device-flow auth (the core takes a bearer token; acquiring it
    is the shell's job — an open question in the design).
  • No engine, corpus (rac/), or Python change.

Product / Architecture Decisions

  • Core in Rust so it is the Tauri backend, yet cargo test runs on Linux
    without the macOS webview. Network clients (reqwest) sit behind a net feature
    so the test suite is fast and offline.
  • The two gates are encoded in the type system: separate propose/publish
    steps, and a Publisher trait with no approve path.

Verification

Ran

  • cd lore-overlay/core && cargo test4 hermetic tests pass (propose→publish
    keeps frontmatter + opens a draft PR; non-draft PR is refused; minted-id parse;
    schema/draft/fill/validate over fakes).
  • LORE_TEST_RAC="…" cargo test real_rac_client_reads_schema_when_configured
    the real RacClient shells to rac schema decision --json and parses it.
  • cargo check --features net — the gateway + GitHub clients compile.
  • cargo fmt --check — clean.

Not run (cannot, in a Linux container)

  • cargo tauri build / dev, code signing, notarization — require macOS.

CI

  • No rac/, src/, or tests/ change, so the Python/rac CI tier is unaffected;
    the Rust under lore-overlay/ is verified locally as above (CI does not build it).

Review Path

  1. lore-overlay/README.md — what this is, verified vs not, how to build on a Mac.
  2. lore-overlay/core/src/flow.rs — the two-gate orchestration.
  3. lore-overlay/core/src/{rac,gateway,github}.rs — the three seams (traits + real impls).
  4. lore-overlay/core/tests/flow_test.rs — the suite.
  5. lore-overlay/app/src-tauri/src/lib.rs — the shell wiring (scaffold).

Notes For Reviewer

  • This is a staging location; extraction to itsthelore/lore-overlay and the
    product rename are follow-ups.
  • The shell's exact Tauri-plugin API calls are an authored scaffold (uncompiled
    here); treat them as a starting point to verify on macOS.

Implementation Process

Implemented with AI assistance; final scope, review, and acceptance decisions were
made by the maintainer.

The platform-agnostic 'brain' of the Lore capture overlay (Host B of
lore-capture-surfaces), as a staging dir in rac-core to extract to its own
lore-* repo later. Implements the two-gate flow (ADR-077) over three trait seams
(rac / gateway / GitHub): propose (fidelity) then publish, which writes,
validates with rac, and opens a DRAFT pull request only. The Publisher trait has
no approve/merge method, so a host cannot self-approve. Model calls go through a
bring-your-own OpenAI-compatible gateway (ADR-035). Verified by a hermetic cargo
test suite plus a real rac-shell test; net clients compile.
The macOS-first Tauri v2 shell that wraps the verified core: a global hotkey
summons a modal that runs propose/publish as Tauri commands. Authored as a
scaffold and NOT built/run here (it targets macOS and was developed in a Linux
container); the README states clearly what is verified (the core) vs not (the
desktop build/sign). Provisional product name.
Adds a Preview/Edit segmented control to the Gate-1 review step so the
drafted artifact body reads as normal text by default, with a raw editable
view a click away. The textarea remains the source of truth for publish.

The renderer is a small dependency-free markdown subset (headings, bold,
italic, inline code, lists, paragraphs) and escapes HTML before rendering,
keeping artifact content treated as untrusted input (ADR-065).
Replaces the hand-rolled markdown subset with markdown-it for full CommonMark
fidelity in the Gate-1 body preview. Output is sanitized with DOMPurify before
it touches innerHTML and markdown-it runs with html:false, keeping artifact
content treated as untrusted input (ADR-065). Extends the rendered-view styles
to cover blockquotes, fenced code, tables, links, images, and rules.
Decouples PR granularity from capture cadence. The PR is the trust boundary
(ADR-077 Gate 2), not the save action, so its granularity is configurable
without weakening the model:

- per-capture: a branch and draft PR per capture (current behaviour)
- rolling (default): append to a shared capture branch with one batch draft
  PR, so a maintainer reviews on their cadence, not per artifact
- direct: commit to a branch, no PR (a solo repo with no independent reviewer)

Splits the Publisher seam into commit_file + ensure_draft_pr — still no
approve/merge method by construction, so the two-gate property holds in every
mode. Adds a read-only footer showing where a capture lands (repo, branch,
mode). Hermetic tests cover all three modes (6 passing).
…verlay]

The PR is the trust boundary (ADR-077 Gate 2), not the save action, so its
granularity is a configuration choice. Records the three write modes
(per-capture, rolling batch default, direct), the constraint that granularity
is configurable while the trust boundary is not, and the rolling-batch
lifecycle open question.

Implements rac/designs/lore-capture-overlay.md.
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