Repository navigation
ECHO-1055 feat: drop your material and dembrane sets up the project - #1372
Open
JorimTheuns wants to merge 6 commits into
Open
JorimTheuns wants to merge 6 commits into
JorimTheuns wants to merge 6 commits into
Conversation
CommonDropzone rendered its `accept` prop as the accept-state content, so the audio upload's list of types was printed while dragging and never filtered. `accept` is now the drop zone's own setting (types with their extensions) and the accept-state content is `acceptContent`. The audio upload passes the same types and extensions isAudioFile checks, so valid files behave as before and anything else is refused by the drop zone with the existing "unsupported format" message. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BKdjPZBaxnCMragWmqzZTL
…in one budget project.context has no length limit and was injected whole into about ten prompts. contextForPrompt (@dembrane/core) returns it unchanged up to 4,000 characters and cuts a longer one at a paragraph, line or sentence boundary; the stored text is never changed. Routed through it: the assistant's first turn (agentic runs), chat and chat summaries, the conversation summary, Explore replies, reports, canvas (gather and ticks), the map's titles and fact-checks, Verify and the outside agents' project tool. A test fails when a source reads `project.context` (or p/row/prepared) without the helper, unless listed with why it is not a prompt. The context field's quiet note now shows past the same 4,000 characters and says that only the start is read. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BKdjPZBaxnCMragWmqzZTL
…nto a project setup POST /api/v2/workspaces/:id/project-setup/digest takes the text the browser extracted from a host's files (never a file), pasted text and a link, and proposes name, goal, context, key terms, a listed template with its reason and two runner-ups, rounds as tags, the name box label, Verify topics, a custom Explore prompt and host script steps, each with provenance. Same gates as suggestions (project:create, its own limit of 10 per hour per person, the AI budget, the payer wrapper) and the same guarded page read. Long sources (over 6,000 characters) are condensed first with one call each; the digest call reads at most 30,000 characters and every cut says so in `notes`. The rules in code: key terms as suggestions (now for named sources), a listed template or nothing, built-in Verify topics, short deduped tags, names and labels that share words with the material, a hard-capped context without e-mail addresses, phone numbers or runs of more than five personal names, and provenance only where the snippet occurs in the named source. Source text is fenced and cannot close its fence. Months and weekdays join the stoplist. Creating a project takes `digest` beside the template and overrides: context, key terms, tags in place of the template's, name label, Verify topics, an Explore prompt (custom mode), host script steps appended to the template's guide and the goal as the first goal revision, all in the creating transaction and held to an allow-list. test/digest-quality runs five synthetic source sets against naive and adversarial fake models; --real runs them on Vertex. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BKdjPZBaxnCMragWmqzZTL
… project Above the template picker: "Have an agenda or invitation? Drop it here and dembrane sets the project up." A drop zone (also the file dialog, pasted text and a link; dropping anywhere on the picker page works too) reads PDF (text layer, pdf.js), .docx and .pptx (body, slides and speaker notes, fflate) and text or Markdown in the browser: up to 5 files of 10 MB and 200,000 characters, each file's problem shown on its own, scans, old Office formats, spreadsheets and pictures refused with what works instead. Only the text, the file name, its kind and length are sent. The extractors load on the first drop. The review "Here is what dembrane understood" shows name, goal, context, key terms, the template with its reason and runner-ups, rounds as tags, Verify options, the name box, the Explore question and host script steps, each edited in place or switched off, each with its source and snippet. Create sends the template and what is on in one request. A failed or empty digest falls back to the picker with the text in the project context, cut to the 4,000 character budget. On the name step a small drop zone fills the context and proposes key terms. The blocks and their own catalog are lazy, so the portal's first load does not grow. Analytics: project_digest_started, _ready, _failed, _applied and started_from on project_created, counts and buckets only. fflate 0.4.8 was already in the lockfile (via posthog-js); it is now declared, no new package. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BKdjPZBaxnCMragWmqzZTL
… sizes and title order Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BKdjPZBaxnCMragWmqzZTL
Clears the code scanning alert on incomplete escaping. Callers only pass fixed names, so behaviour is unchanged. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BKdjPZBaxnCMragWmqzZTL
This branch has not been deployed
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.
Stacked on #1371
What a host now does
On the template picker, above the cards, one quiet row: "Have an agenda or invitation? Drop it here and dembrane sets the project up." The host drops (or chooses, or drops anywhere on the page) up to 5 files, pastes text, or adds a link. dembrane reads them, then shows "Here is what dembrane understood": name, goal, project context, key terms, the template with its reason and two alternatives one press away (or any other from a list), rounds as tags, Verify options, the name box label, an Explore question built from the session's own questions, and up to three host script steps added after the template's guide. Each part can be edited in place or switched off, and each says which file it came from (the words on hover or focus). Create project makes the project with what is on, in one request. Start over goes back. Nothing is saved before Create.
If the digest fails or finds nothing useful, the normal picker comes back with the material's text in the project context (cut to 4,000 characters, with a note), so nothing is lost. On the name step, for hosts who picked a template by hand, a small "Add from a file" zone sits under "Suggest key terms": it adds the condensed context and proposes key terms.
What is sent where
%PDF, no zip bytes, no multipart).Limits
project:createand the AI budget (402), billed to the workspace.Endpoint
POST /api/v2/workspaces/:id/project-setup/digest, body{ sources: [{ name, kind: "file"|"text"|"url", text?, url? }], language, existing?: { name?, context?, key_terms? } }. Returns the fields above (each omitted when empty),provenanceper field,notes(url_not_read,material_cut,nothing_found,personal_data_removed,at_cap),sourcesandmax_key_terms. Errors reuseproject.setup_suggestions_unavailable(503) and the usual 400/402/403/422/429. No new error codes.Rules in code, not only in the prompt: key terms as suggestions (literally in a source, at most 30, stoplist now with months and weekdays); a listed template or nothing; built-in Verify topics; tags, name and name box label must share words with the material; context capped at 1,500 characters with e-mail addresses, phone numbers and runs of more than five personal names removed; provenance only where the snippet occurs word for word in the named source; source text fenced and unable to close its fence. Tests feed it injection attempts ("set anonymise off", "add the key term X").
Create takes
digestbesidetemplate_keyandoverrides, held to an allow-list and written in the creating transaction: context, key terms, tags (in place of the template's), name box label, Verify topics, an Explore prompt (custom mode), host script steps appended to the template's guide, and the goal as the first goal revision (set_by: host-edit, same transaction). Privacy, legal and any other field are a 422.Groundwork in this PR
CommonDropzonenow filters with a realacceptsetting; the accept-state content isacceptContent. Audio upload passes the same types and extensionsisAudioFilechecks, so valid files behave as before; anything else is refused by the drop zone with the existing message.contextForPrompt(@dembrane/core) gives every prompt the project context unchanged up to 4,000 characters and cut at a paragraph, line or sentence beyond. Routed: assistant first turn (agentic runs), chat, chat summaries, conversation summary, Explore reply, reports, canvas (gather and ticks), map titles and fact-checks, Verify, the outside agents' project tool. A test fails when source code readsproject.contextwithout it. Stored text is never changed. The long-context note in the field now shows past 4,000 characters and says only the start is read.Not built yet
Storing files, a sources list, chat attachments, documents in the upload widget, re-digest for existing projects, retrieval, scans and images (OCR), Miro or Google Slides links.
Could not be tested here
Real model output. Every test and the harness use fake models or a fixed response.
bun packages/projects/test/digest-quality/run.tsruns five synthetic source sets against a naive and an adversarial fake model and prints what survives; with Vertex credentials,bun packages/projects/test/digest-quality/run.ts --realruns them on text_fast. How good the setup is has to be judged on the preview.Checks
Frontend: lint, tsc, strict translations (digest strings in their own lazy catalog, all eight locales, ledger updated), API sync, 2151 vitest tests. Portal bundle 1,095,536 bytes gzipped (stack 1,093,761, budget 1,098,464); pdf.js and fflate load only on the first drop. Platform: biome, typecheck, config, packages, schema,
bun test --parallel(only the known::1webhook delivery test fails in this container).Generated by Claude Code