Macro is a unified workspace for teams: email, chat, docs, tasks, agents, calls, and CRM — @-linked together with shared AI memory.
universal_input
Read-only intent classification and editable field extraction for Command K, and the due date read from an email thread for Focus.
src/domain.rsowns admission, draft bounds, verbatim note preservation, and event timestamp validation/defaults.domain/temporalresolves typed, source-backed temporal expressions against the request clock and timezone. Providers interpret natural language; domain validation must not re-parse it with regexes.domain/fallback.rsowns provider failover policy.domain/search.rsselects search type before extracting its supported facets. Extraction schemas and field names derive from the typed search response models; every model field requires guidance, enforced by tests. Providers shareprompts/extract_search_query_prompt.txtso filter-only searches have no query.prompts/holds classification questions and all extraction instructions, including typed field guidance and temporal task/output instructions; seeprompts/README.mdfor the file map.src/outbound.rsimplements the field-extraction port through the shared model router;outbound/clairic.rsimplements Cloudflare typed content extraction, rejects search field claims that reuse source occurrences, andoutbound/temporal.rsextracts temporal facts with Nemotron.src/inbound/axum_router.rsowns authenticated HTTP routes. The harness root composes providers and mounts the router under/universal_input.domain/temporal/thread_due_date.rsandoutbound/thread_due_date.rsread a thread's due date foremail_focus_worker, which has no model credentials: the model states deadline and closure facts per message; Rust resolves each against the day its own message was written and picks the one still standing. Anything uncertain resolves to no date, since a wrong date costs more than a missing one./universal_input/thread-due-dateis internal-only and meters against the acting user asAiFeature::EmailFocus, which no allowance pays for: never open it to user credentials, or it becomes a free model proxy. It has no OpenAPI entry for the same reason. Mail is untrusted data: it stays in the user message, and the fixed system prompt says so.- Suggestions contain display text, never authorized entity identifiers. Submission and permission checks belong to the destination services.
eval/baseline.jsonandeval/compare.pycompare live classification and extraction against fixed expectations; seeeval/README.mdfor the frozen clock, fixture identity resolution, reports and before/after comparisons.- Keep classification prompts within the shared Jev question limit; the intent prompt contract test validates them. Treat an opening destination action as a strong classification signal, above its body topic, across every intent.
- Give each new first-class suggestion field an extraction owner: add it to
InputIntent::extraction_fieldsand typed guidance, or to the domain/temporal path. The response-field ownership test catches omitted fields. Task creation properties use the dynamic catalog and need no per-property schema edit. - When adding a search facet, update the shared web search schema, its typed Rust
search response and field guidance, then regenerate clients. The frontend
queries/extracted-search.tsmapping covers each type-specific shared facet key; keep it exhaustive and add a baseline example. Tags/tagMode remain keyword text. Task-creation properties and task-search options use supplied catalogs. Search type selection receives no task catalog; only Task field extraction receives task options, so unrelated metadata cannot influence another type. - Keep all public API documented; the crate denies missing documentation.
Observability
src/telemetry.rs defines bounded failure categories. Provider spans record model,
token usage, fallback path/reason and build-generated prompt/recipe fingerprints.
Never add draft text, extracted values, provider bodies or caller-supplied labels
to traces. Admission and failover remain domain policy; telemetry does not change
provider selection. The recipe fingerprint covers production Rust source as well
as prompt templates; it is a build identifier, not runtime configuration.
See eval/README.md for read-only local quality and latency evaluation.
Checks
cargo test -p universal_inputfrom the repository root withSQLX_OFFLINEunset.just check.- With model credentials configured, run the opt-in prompt regression with
cargo test -p universal_input search_query_excludes_consumed_filters -- --ignored. python3 -m unittest discover -s crates/universal_input/eval -p 'test_*.py'checks the baseline comparison logic without calling providers.- With model credentials configured, measure the thread due date's quality with
cargo run -p universal_input --example thread_due_date_eval.