Skip to content

feat(research,cli): documents — the template port, the default ability, media's optional peers - #27

Merged
lloyal-research merged 1 commit into
feat/research-identityfrom
feat/documents-template
Sep 7, 2026
Merged

feat(research,cli): documents — the template port, the default ability, media's optional peers#27
lloyal-research merged 1 commit into
feat/research-identityfrom
feat/documents-template

Conversation

@lloyal-research

Copy link
Copy Markdown
Contributor

What

The research template attaches PDFs: the port of the documents arc from the casework where it was built and proved end to end. Runtime side: lloyal-ai/hdk#120.

  • harness — documents in the abilities and factories; a run staged with the thread's roots into agentPool({ attachments }); admissions booked from the agent:prefilled bus event (meta line, later runs, reopen) and folded live into the ask; researchable() keeps an ability with an empty catalog off the spine.
  • targetscontentOrigin() on the bridge and content-urls.ts for every door; Composer accepts images and PDFs and shows the admitted thing; Figures shows the document card with page facts and opens the PDF through /source; Prose resolves attachment:// citations; web serve installs createContentIngress with media's upload allowance.
  • package.jsonsharp and @embedpdf/pdfium, media's optional peers. Without them a fresh scaffold fails at the first image or PDF attach.
  • cliDEFAULT_ABILITIES.research += lloyal/documents@0.1.0; link-local knows the documents package; the template ship-count pin moves 131 → 134.

Merge order

Do not merge before lloyal/documents@0.1.0 is approved in the catalog. lloyal new research vendors the default abilities from the catalog, and the harness imports the package; a scaffold made before approval would warn at vendoring and fail to boot.

Checks

npm run typecheck clean · vitest run 22 files / 211 green (three expectations updated for the third default ability; the post-rename rule now applies to the abilities that were renamed). The scaffold proof against the published alpha.4 set follows the cut.

…y, media's optional peers

The research template attaches PDFs. Ported from the casework where it was
built and proved (lloyal-ai/hdk#120 carries the runtime):

harness
- documents joins the abilities and factories; config-less abilities enable
  in one loop; a run is staged with the thread's roots (`stagedRoots`) into
  `agentPool({ attachments })`; the trunk prefill records only PROJECTED
  roots; `RunDirSink` books the roots a tool result admitted from the
  `agent:prefilled` bus event, so the meta line, later runs and reopen carry
  them; the reducer grows the live ask (or the cold brief) as they land.
- pipeline: `attachments` flow to the spine block, the planner context and
  the probe; `researchable()` leaves an ability with an empty catalog off the
  spine; the citation nudge names `attachment://…/page/N`.

targets
- one transport fact on the bridge, `contentOrigin()`; `content-urls.ts`
  derives every door (ingress, manifest, config, source, representation).
- Composer accepts `image/*,application/pdf` and shows the ADMITTED thing;
  Figures shows the document card (first-page render, page facts, the PDF in
  the lightbox through `/source`); Prose resolves `attachment://` citations.
- web: `createContentIngress`, the signal forwarded, the upload allowance
  from media's constants; Vite pre-bundles `@lloyal-labs/media`.
- package.json: `sharp` and `@embedpdf/pdfium` — media's optional peers — so
  a fresh scaffold can admit an image and a PDF.

tests: `content-urls.test.ts`, `documents.scenario.test.ts`, the reducer's
admission fold, the run dir's admission via the bus.

cli
- `DEFAULT_ABILITIES.research` += `lloyal/documents@0.1.0` (merge after the
  catalog approves it: `lloyal new` vendors it, the harness imports it).
- `link-local` knows the documents workspace package.
- ci: the template ship-count pin follows the three new files (131 → 134).
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