Skip to content

docs(compression): match caveman output mode notes to code - #15297

Open
woodsonl wants to merge 4 commits into
diegosouzapw:release/v3.8.52from
woodsonl:docs/compression-guide-output-mode
Open

woodsonl wants to merge 4 commits into
diegosouzapw:release/v3.8.52from
woodsonl:docs/compression-guide-output-mode

Conversation

@woodsonl

@woodsonl woodsonl commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Corrects the caveman output mode and output-styles passages in docs/compression/COMPRESSION_GUIDE.md against open-sse/services/compression/outputMode.ts, open-sse/services/compression/outputStyles/{apply,backCompat,catalog}.ts and open-sse/handlers/chatCore.ts.

  • When to use: the guide showed a routing-combo config.auto.outputMode: "caveman" setting. The only .outputMode reads in src/ and open-sse/ are the compression combo's boolean (applyCompressionComboConfig() in open-sse/handlers/chatCore.ts, src/lib/db/compressionCombos.ts:16) and the omniroute_set_compression_engine MCP tool's boolean argument (open-sse/mcp-server/tools/compressionTools.ts:464). The section now shows cavemanOutputMode.enabled together with the master enabled switch it depends on (off by default per types.ts:421-422, checked in chatCore.ts before resolveOutputStyleSelection()), names those two switches, and notes that a non-empty outputStyles selection takes precedence (backCompat.ts:21-23).

  • Back-compat: the guide said the mapping to terse-prose is byte-identical to the old injection in every legacy language. Running the legacy applyCavemanOutputMode() side by side with the live resolveOutputStyleSelection() → applyOutputStyles() path for all 12 legacy languages at all 3 levels shows:

    • the marker line differs in every language ([OmniRoute Caveman Output Mode] vs [OmniRoute Output Styles]);
    • the text below it matches in en, pt-BR, es, de, fr, it, ru, id and vi;
    • ja and zh gain one space before the boundaries clause (apply.ts:167 joins the instruction and the boundary block with a space; those two legacy texts have none);
    • hu gets the English text, because CAVEMAN_INSTRUCTION_BY_LANGUAGE has hu (outputMode.ts:42-46) and the terse-prose i18n map (catalog.ts:52-63) leaves it out. A Hungarian user message resolves to hu through resolveOutputStyleLanguage(), so this is reachable.

    The sentence now states that, and that the mapping applies while outputStyles is empty (backCompat.ts:21-27).

  • Boundaries: SHARED_BOUNDARIES (outputMode.ts:28-29) lists code blocks, file paths, commands, errors and URLs; identifiers come from the terse-prose and terse-cjk level texts. The "appends the boundaries clause once" sentence also gains the SAFETY_BOUNDARIES clause that less-code and ponytail add (apply.ts:129-139, from fix(compression): honor per-style boundaries and add the ponytail safety carve-out #13938).

  • Auto-Clarity: the guide said the content bypass runs whatever the Auto-Clarity Bypass toggle is set to. The bypass runs while the toggle is on (apply.ts:206; on by default per types.ts:466), and turning it off skips the keyword check (from fix(compression): honor the Auto-Clarity toggle on the output-styles path #14551). "How to enable" now points to the toggle's home, the Caveman page's Output Mode card (/dashboard/context/caveman, CavemanContextPageClient.tsx:249-263), and uses the sidebar labels for the Compression Settings page (sections.ts:91-120).

Related Issues

Validation

  • Change type: other (docs only)
  • Focused checks: npm run check:docs-all passes, and so does each of its gates run on its own (check:docs-sync, check:docs-frontmatter, check:docs-counts, check:env-doc-sync, check:deprecated-versions, check:doc-links, check:fabricated-docs) plus check:docs-symbols. All of them also pass on the base tip before the edit.
  • npm run lint (docs-only change)
  • Reconciled with the current active release base (release/v3.8.52 at 5282351, merged into this branch); check:docs-all rerun afterward and passes
  • Production-code changes include a new or updated automated test in this PR (docs-only change)
  • Behavior claims were checked by running code, not only by reading it: the legacy injector against the live output-styles path (every legacy language at every level), the bypass with Auto-Clarity on, off and unset, and a Hungarian message through resolveOutputStyleLanguage(). A second claim-by-claim pass against the sources tightened four sentences (second commit).

Tests Added Or Updated

  • No production code changed.

Coverage Notes

  • This PR touches only docs/compression/COMPRESSION_GUIDE.md and its changelog fragment.

Reviewer Notes

  • i18n: this PR changes the English guide only; its 66 mirrors wait for the next mirror refresh. The blocking i18n docs drift step (scripts/i18n/check-translation-drift.mjs) lists this guide until that refresh. On the base tip (5282351) it already lists six other core docs: docs/architecture/QUALITY_GATES.md, docs/frameworks/ACP.md, docs/frameworks/AGENT_PROTOCOLS_GUIDE.md, docs/guides/CLI-INTEGRATIONS.md, docs/reference/API_REFERENCE.md and docs/reference/ENVIRONMENT.md.

⚠️ base-red inherited: #15306

The Compression Guide's caveman output mode and output-styles passages
described behavior the code does not have. Correct them against the
current sources:

- When to use: the legacy mode is switched by cavemanOutputMode.enabled,
  which replaces the routing-combo config.auto.outputMode example. A
  compression combo's Output Mode toggle and the
  omniroute_set_compression_engine MCP tool's outputMode argument set the
  same switch.
- Back-compat: the mapping to terse-prose applies while outputStyles is
  empty. The block starts with the [OmniRoute Output Styles] marker; the
  text matches the legacy injector in en, pt-BR, es, de, fr, it, ru, id
  and vi, carries one extra space before the boundaries clause in ja and
  zh, and is English for hu, which terse-prose does not translate.
- Boundaries: SHARED_BOUNDARIES keeps code blocks, file paths, commands,
  errors and URLs exact; terse-prose and terse-cjk add identifiers, and
  less-code and ponytail add the SAFETY_BOUNDARIES clause.
- Auto-Clarity: the content bypass runs while the Auto-Clarity Bypass
  toggle is on (the default) and is skipped when it is off. The toggle
  is on the Caveman page's Output Mode card.
- How to enable: the dashboard path uses the sidebar labels (Compression
  Context, Compression Settings).
@woodsonl
woodsonl requested a review from diegosouzapw as a code owner October 1, 2026 18:53
An accuracy review of the previous commit against the sources found four
sentences that were imprecise:

- The legacy switch takes effect only while compression itself is on
  (the master `enabled` flag, off by default), and a non-empty
  outputStyles selection overrides it. The example now sets both flags,
  and How to enable states the master-switch requirement for all styles.
- "The Terse prose output style injects the same text" read as a
  comparison with the legacy injector; it now says the same block.
- The safety clause less-code and ponytail add can be its translation.
- Turning the Auto-Clarity Bypass toggle off skips the keyword check; it
  does not force injection, which other conditions can still prevent.
@woodsonl

woodsonl commented Oct 5, 2026

Copy link
Copy Markdown
Contributor Author

PR #15591 fixes the hu/ja/zh drift that the new guide paragraph here documents: Hungarian gets its own terse-prose text (no more English fallback), and the extra space before the boundary sentence is gone for ja/zh, including terse-cjk and multi-style selections. The paragraph and changelog line added in this PR describe the pre-fix behavior, so whichever of the two PRs lands second needs to update that wording. Cross-noted in #15591's body.

This branch has not been deployed

No deployments
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