patlas/ docs

Quick add: a note or a photo into issues

Status: Phase 1 implemented and verified, text and image. Phase 2 implemented,
with a browser pass still pending.

One input, either a text note or an image, becomes one or more issues. A model
frames it into a title, a description and labels. A human then reviews the drafts
before anything is written to git.

Flow

sequenceDiagram
  participant U as User
  participant C as Client
  participant S as Server
  participant M as Qwen3 on Workers AI
  U->>C: note or photo
  C->>S: POST quick/preview
  S->>M: frame, no lock and no write
  M-->>S: JSON issues
  S-->>C: drafts + knownLabels
  C->>U: review each draft
  U->>C: Create reviewed (N)
  C->>S: POST quick/commit
  S->>S: one mutate, one commit
  S-->>C: IssueDto list
  S-->>C: issue.created per issue
  C->>U: open first issue popup

Decisions locked

The model was chosen by sweeping all 24 free-tier text models. Only a handful
both split correctly and keep the note language. Qwen3 was fastest and cheapest
of those, at about 0.84 s and 4.8 neurons for a three-task note. The prompt was
chosen by an eight-variant bake-off. Both are summarized under Measured basis.

Phase 1: server

No frontend work, testable with curl.

1.1 Framing client

crates/patlas-server/src/text.rs, new module. An OpenAI-compatible chat client,
mirroring the shape of vision.rs.

You turn a raw note into project tasks.

Reply with JSON only, in exactly this shape:
{"issues":[{"title":"...","body":"...","labels":["..."]}]}

Rules:
- Split only for clearly distinct tasks. Default to one issue. Two symptoms of
  the same page or feature are one task.
- title: at most 80 characters, imperative, capitalised, no trailing period.
- body: one short sentence, or "" when the title is enough.
- labels: 1 to 3 lowercase kebab-case tags. Reuse an existing tag when it fits.
  Invent a new one when none fit. Never leave labels empty.
- Never translate. Write title and body in the note's language.

Existing labels: <injected>

Example
Note: "checkout crashes on ios and the receipt email never arrives"
{"issues":[{"title":"Fix checkout crash on iOS","body":"Checkout crashes on iOS.","labels":["bug","ios"]},{"title":"Fix missing receipt email","body":"The receipt email never arrives.","labels":["bug","email"]}]}

Example
Note: "срочно: на странице оплаты сумма дублируется при повторном нажатии. и ещё кнопка логина глючит на сафари"
{"issues":[{"title":"Исправить дублирование суммы при оплате","body":"Сумма дублируется при повторном нажатии.","labels":["bug","payment"]},{"title":"Исправить кнопку логина в Safari","body":"Кнопка логина не работает в Safari.","labels":["bug","ui"]}]}

Example
Note: "the dashboard takes 8 seconds to load after login and the charts block everything"
{"issues":[{"title":"Fix slow dashboard load","body":"The dashboard takes 8 seconds to load after login and the charts block rendering.","labels":["performance"]}]}

1.2 Configuration

Environment, in the style of MOONDREAM_*:

VariableMeaning
FRAME_MODEL_URLBase ending in /v1, account-scoped
FRAME_MODEL_API_KEYBearer token
FRAME_MODELModel id, defaults to the Qwen3 one
FRAME_MODEL_TIMEOUT_SECSRequest timeout, default 20

Deployment adds /opt/patlas-rust/frame-model-env to the unit with the optional
- prefix, the same way moondream-env is wired. When the URL or key is unset,
quick add still works and degrades to the deterministic split.

1.3 Label injection

The runtime already holds the snapshot, so the server aggregates the project
labels itself. No new endpoint and no trust in the client.

existing = snapshot.issues.flat_map(labels).map(trim).filter(non-empty).unique.sorted

The list goes into the prompt. The same list is returned as knownLabels so the
review page can mark a proposed tag that is not yet in the project.

1.4 Bulk create

runtime.create_issues_bulk(inputs, column, board, by) -> Vec<IssueDto>.

1.5 Routes

Both sit under /api/board/:slug, after the membership check, so they inherit
the existing auth.

RouteBodyEffect
POST .../quick/preview{ text } or { imageDataUrl }none, returns { drafts, knownLabels }
POST .../quick/commit{ issues: [{ title, body, labels }] }bulk create, returns { issues }

preview is a pure transform. commit is the only writer, and it takes exactly
what the user reviewed.

1.6 Image arm

1.7 Tests

1.8 Verification

Phase 2: client

Touches web/app, which stays out of scope except by coordination. This is that
coordination.

2.1 Composer

Extend web/app/add-issue.tsx, the composer shared by the Issues page and the
bottom panel, to accept a text note or a pasted or dropped image. Submit calls
quick/preview and hands the drafts to the review page.

2.2 Review page

2.3 Label confirmation

2.4 Commit and popup

Measured basis

Model

All 24 free-tier text models were tried on one Russian three-task note. The two
requirements, correct splitting and keeping the note language, eliminate nearly
everything.

ModelWallNeuronsNotes
qwen3-30b-a3b-fp80.84 s4.8splits, keeps Russian, sparse labels
mistral-small-3.1-24b4.4 s15.8splits, keeps Russian
gemma-sea-lion-v4-27b2.5 s14.6splits, keeps Russian
llama-4-scout-17b1.8 s12.7splits, loose labels
llama-3.3-70b3.7 s28.4splits, terse titles
qwen3.8-27b18.2 s197ignores /no_think
llama-3.2-3b, llama-3.1-8b-fp8-fast0.4 s2 to 3never split
llama-3.1-8b-fp8, granite-micro, gpt-oss-20btranslate the note
llama-3.2-1b, qwq-32bdo not return JSON

Free-tier budget at 4.8 neurons is roughly 2000 calls a day for three-task
notes, and about twice that for single-task notes.

Prompt

Eight variants were scored across seven notes on empty labels, language
violations and over-splitting.

VariantEmpty labelsLanguageOver-splitNew tags
V1 baseline1oknoperformance
V2 +labels +capital01 violationnoperformance
V3 / V4 / V5 with examples0okyesmixed
V6 with examples and one single-issue example0oknoperformance
V7 explicit do-not-split rule0okyesperformance
V8 no examples02 violationsnonone

Two findings drive V6. Examples are required, because without them the model
transliterates Russian and stops inventing tags. Examples also teach
over-splitting, and the fix is one example whose note stays a single issue. An
explicit "if unsure, do not split" rule did not work.

Known residual: labels are sometimes mapped to the wrong existing tag, such as
ui for a VAT change. This is left to the review page rather than tuned with
another rule, which would overfit the test notes.

Open