Skip to main content

Compare writing in Cortex

Status: Ready

Truth label: Current

Audience: Fleet operator

Reader outcome: Use compare writing in Cortex in Cortex, with every control, its verification, and its limits stated.

Last verified: 2026-09-13

Open Manage Cortex > Compare writing. See Cortex management for search and keyboard access.

Implemented 2026-09-08 as the first S0/VB08 comparison workflow in the feature plan. This complements Voice and drafts.

Make a useful comparison​

  1. Create a case with a writing request and your reference writing. Put all facts and output constraints in the request. The reference, review notes, required-term checks, citations, and review word limit are reserved for evaluation; they are not appended to generation prompts.
  2. Label the audience, format, authorship, and split. Use Held out for evaluation for writing you will reserve for checking results. Use Development case while refining a profile. These labels are operator declarations, not evidence that a model has never seen similar writing.
  3. Choose local-only processing or allow local and cloud processing. Local-only cases require both a local generation endpoint and local example-search embeddings. Declare an operator-owned LAN Ollama host in Local models. Removing its declaration stops later candidates from receiving local-only material. Reference text itself is never sent to the generation or embedding provider by this workflow.
  4. Save the case. A saved revision is required before generation. Cortex warns about lexical overlap with other cases. Cases and their reference text are not automatically ingested into knowledge, conversation history, or the learning bank.
  5. Choose an operator voice, provider, and model. Optional temperature, top P, seed, and reasoning effort are checked against the existing provider controls. Set temperature or top P, not both. Blank controls use provider defaults; this form does not inherit hidden sampling values from chat.
  6. Select Generate three candidates. The comparison makes three generation requests. Results and progress are saved on Brain, so closing the dialog or reloading Cortex does not discard the run.
  7. Review candidates A, B, and C against the frozen request and reference. Rate resemblance to your voice, factual meaning, and instruction compliance. Choose a preferred candidate, a tie, or none acceptable. Optional edited wording and self-reported editing seconds record the effort needed to make the result usable.
  8. Save the review to reveal the writing setups, example evidence, mechanical checks, and timing. Earlier ratings remain available when you save a revised review. Only the first review is recorded as blind.

The three setups are:

SetupDelivery guidanceExamples
BaselineBrain default registerNone
Profile onlySelected operator registerNone
Approved examplesSelected operator registerEligible static pack examples and retrieved approved examples

All three use the same Brain system-prompt builder, configured user profile, request, model, sampling controls, and captured style rules. Baseline means the Brain's default writing behavior, including its shared communication instructions. It does not mean a bare model prompt. Comparison generation does not bind tools, search knowledge, retrieve conversations, execute tasks, or run the optional polish pass. This isolates delivery guidance from those other sources of variation. It does not benchmark the complete chat/research pipeline.

The server randomizes candidate labels and generation order separately. It withholds setup identities, prompt snapshots, per-candidate timing, and mechanical checks until the first saved review. The writing itself can still suggest how a candidate was produced; this is an aid to review, not proof of perfect blinding. Partial runs keep successful outputs but should not be treated as complete three-way evidence. Cortex names runs with no eligible examples because they cannot measure the effect of learning examples.

What the evidence means​

After review, each candidate shows word count, missing required terms/citations, banned terms, output-lint changes, latency, and reported token usage. A term appearing in an answer does not prove the claim is correct. For example, both "ship Friday" and "do not ship Friday" contain Friday. Human factual and instruction judgments remain separate from these mechanical checks.

edit_fraction is one minus Python's character-sequence similarity between the generated and edited wording. It is a bounded comparison aid, not a measured percentage of keystrokes or time saved. Editing seconds are entered by the reviewer; absence means unmeasured, not zero. Monetary cost is unmeasured. Model identifiers/fingerprints are retained when the provider reports them; the requested model name alone does not prove a fixed model version.

The exported, reviewed comparison includes the frozen case revision, prompt texts and hashes, profile definition, pack content hashes, exact eligible example records, style rules and hash, requested/effective controls, and provider response metadata. It contains private writing and should be handled like a voice-pack export. Credentials are not part of the export. Export before review preserves blinding and omits the setup manifest and prompts.

One run produces one sample per setup. Repeat cases with representative formats and authentic reference writing before inferring a trend. This release supplies the comparison workflow; it does not establish improved personal voice, factual fidelity, or detector outcomes. Saved suites and aggregate reviews are now available below. Detector adapters, automatic promotion thresholds, and model recommendations remain planned.

Manage cases and runs​

Cases: create, import a single JSON case into the editor, edit, save a successor version, restore a previous version into the editor, archive/unarchive, export the saved case and its versions, or delete the case and its versions. Import accepts a case object or the case object from an export. It creates a new identity; it does not replace another case or import its old history. Review imported availability settings before saving. Conflicting saves return 409 and retain the editor's unsaved text. Export case exports saved values; save edits first to include them.

Comparisons: reopen a run, cancel remaining generation, load its recorded settings to repeat against the latest case/profile/example state, export it, or delete the run and reviews. Repeating uses a new run ID and manifest. It does not replace earlier evidence or promise identical model output. A deleted case's frozen copies remain in existing runs. Delete those runs separately to remove those copies.

Reviews: the first save reveals setup identities. Later corrections append a new review version, retain prior judgments, and are labeled non-blind. Review conflicts preserve unsaved browser input. Ratings are required for every completed candidate; a failed candidate cannot be selected as the winner.

Case and run lists load 100 records at a time, with controls to load more. Forms pause editing during asynchronous operations to prevent a delayed response from replacing newly entered text. New cases and unsaved judgments have navigation warnings.

Suites, batches, and review totals​

Open Evaluation suites and batch comparisons in the comparison dialog. Save a named collection of 1 to 20 cases, select the normal voice/model controls, and choose 1 to 3 repeats. Generation is capped at 20 comparisons, or 60 candidate requests, per batch. Each repeat is another sample of the same case, not another independent writing case.

Cortex supports suite creation, editing, cloning, saved version inspection/restoration, archiving, definition export, and deletion. Restoring a version loads its values into the editor; saving creates a new revision. Definition export contains case IDs and suite versions, not a portable copy of every case. Cases remain independently editable and exportable. A batch freezes the selected suite revision, every case revision, and comparison settings before scheduling generation. A preparation conflict or invalid case leaves no partial batch. Editing a suite or case later does not rewrite recorded batches.

Open a saved batch to follow progress, review its individual comparisons, cancel later requests, export it, or delete it and its comparisons/reviews. Completed results survive cancellation. Deleting a suite retains its cases and batch snapshots. Export before review preserves each comparison's blind state. Reloading Cortex retains batch progress. Repeating the identical batch ID and settings does not schedule duplicate generation; a deliberate new batch creates fresh comparisons.

Writing review results defaults to held-out cases and each comparison's first blind judgment. Choose development/all cases, latest judgments, or only the opened batch when useful. The display separates groups by captured profile, pack/style hashes, model and controls, plus provider-reported model versions/fingerprints. It counts complete reviewed runs, distinct case versions, setup wins, ties, unacceptable results, voice ratings, factual/instruction judgments, and reported editing effort. Unknown effort remains unknown. Unreviewed and incomplete runs are counted as skipped; they do not improve the displayed scores. Exports also include edit-fraction means and reporting counts. At most the newest 5,000 comparisons are inspected per report, with a visible truncation flag.

These totals describe the saved judgments. They do not establish causal improvement or a reliable detector outcome. Identical requested model names can still conceal provider changes when a provider supplies no version metadata. Authentic reference writing and repeated operator review remain necessary.

Learning isolation and run recovery​

Comparison example selection excludes lexical matches to the current request/reference and all retained held-out case versions. It checks both static examples and retrieved examples. Retrieved exclusions happen before the final example count and use the existing bounded backfill. The check normalizes word sequences and flags exact equality, containment when both samples have at least eight words, or sequence similarity of at least 0.85. This catches common leakage, not every paraphrase or contamination already present in profile instructions, model training, or configured user context.

Studio draft learning approval also rejects overlap with retained held-out case versions. The wording can still be saved without learning approval. Archived case versions remain protected. Deleting a case and its versions removes that case's protection; it does not remove overlapping protections supplied by another case. Development cases are excluded from their own comparisons but do not create that global Studio approval restriction. Legacy example APIs and normal chat are not retroactively migrated or purged by this workflow. The comparison filters previously approved overlaps out of its own prompts.

Prepared comparisons freeze example text. Before the examples candidate starts, Brain rechecks that the selected examples still exist and remain eligible. Changed or withdrawn examples make that candidate fail visibly; the operator can start a fresh comparison. Withdrawal cannot retract an already submitted model request. Existing completed comparisons remain historical evidence.

Runs claim a single execution owner. Repeated submission of the same run ID and request returns the same record without another generation pass. Cancellation immediately stops accepting results and prevents subsequent requests. A request already in flight may continue at the provider, but its late result is not saved. Deleting a run has the same protection against late writes.

Each candidate has a 180-second timeout. A single queued record expires after 60 seconds without a claim, and a claimed run has an 11-minute recovery window. Reading an expired active run marks it interrupted. Cortex can then repeat it with a new ID. Recovery never silently repeats paid calls after a server restart. It does not resume an interrupted provider request. Batch queues reserve 60 seconds plus 11 minutes per member so later comparisons can wait for earlier ones. Each claimed member retains its own 11-minute limit. Interrupted batch members require a new comparison or batch; a restart does not silently resubmit them.

Storage and verification​

The existing writing.sqlite3 contains writing_cases, writing_case_versions, writing_comparisons, writing_reviews, writing_suites, writing_suite_versions, and writing_batches. Case and review writes use revision checks. Comparison manifests and successful candidate outputs remain frozen after completion; cancellation and review actions do not rewrite them. The existing top-level SQLite backup includes these tables. External voice files keep their existing backup requirements.

Regression checks are in test_writing_evaluation.py. The existing browser acceptance script now covers case capture, generation, blind review, reveal, review history, reload, frozen case revisions, export, and deletion against the isolated fixture API. Tests use deterministic model responses and private data roots. They verify the implementation without making live provider calls or claiming a measured improvement in the operator's writing.

Suite regression checks are in test_writing_suites.py. The suite browser check covers saved suites, repeated generation, blind exports, member review, aggregate results, frozen suite versions, reload, and deletion.

Comparisons now freeze application context budgets, check complete candidate prompts before generation, and separate aggregate groups by recorded budget. A candidate that cannot fit fails visibly; examples are not silently removed from its frozen setup.

Static samples now obey their saved audience/format restrictions using the case audience and genre. Scoped or retired samples are excluded and reported in the frozen manifest. Optional empty fields remain compatible with existing queued snapshots.

All comparison setups use explicit draft perspective. The manifest records writing_mode: draft, and its prompt hashes identify the current shared writing instructions. Compare results within compatible prompt cohorts.