Fuse
Internals & Extending

The Options Model

How a fusion request is composed from scoped option records and the validation rules that gate it.

A fusion is described by a single request object, not a flat bag of settings. That object groups options by the stage they belong to, carries at most one optional scoping mode, and is built from CLI flags or MCP parameters merged with config-file values. Before any stage runs, a validator checks the request against a fixed set of rules. This page documents the request shape, the defaults of each option group, and the validation rules.

This page is for engineers reading or constructing requests and for maintainers who need the authoritative default values and constraints.

Architectural Rationale

A single monolithic options type forces every consumer to depend on every setting and makes it unclear which option affects which stage. The request instead composes one record per stage, so collection, reduction, and emission each own their settings, and scoping is expressed as optional records that are present only when used. Building the request in one place (the request builder) and validating it in one place (the validator) means precedence and constraints are decided once, not scattered across call sites.

The Fusion Request

A fusion request is composed of three required option groups, up to one optional scoping group, and a few run-level flags.

MemberTypeDefaultMeaning
CollectionCollectionOptionsrequiredFile discovery and filtering
ReductionReductionOptionsrequiredContent reduction settings
EmissionEmissionOptionsrequiredOutput format and token budget
FocusFocusOptionsnoneFocus scoping, when present
ChangesChangeOptionsnoneGit-change scoping, when present
QueryQueryOptionsnoneQuery scoping, when present
InMemoryboolfalseReturn content in memory instead of writing to disk
Parallelismint0Degree of parallelism; 0 means processor count
UseReductionCachebooltrueUse the on-disk reduction cache
ClearReductionCacheboolfalseClear the reduction cache before the run

At most one of Focus, Changes, and Query may be present; the validator rejects any combination of two or more.

Building And Merging

The request builder constructs a request from CLI flags or MCP tool parameters and merges them with values from a config file. Precedence is fixed: an explicit CLI flag overrides a config-file value, and a config-file value overrides the built-in default. The defaults below are those built-in values, applied when neither a flag nor config supplies one.

Collection Options

OptionDefaultMeaning
RecursivetrueScan subdirectories
IgnoreBinaryFilestrueSkip binary files
ExcludeEmptyFilestrueSkip zero-byte files
ExcludeAutoGeneratedtrueSkip auto-generated files
RespectGitIgnoretrueHonor gitignore rules
MaxFileSizeKb0Maximum file size in kilobytes; 0 means no limit
ExcludeTestProjectsfalseExclude all test project directories

The source directory, project template, and the resolved include and exclude lists are also part of this group.

Reduction Options

OptionDefaultMeaning
TrimContenttrueTrim leading and trailing whitespace per line
UseCondensingtrueCollapse blank lines
MinifyXmlFilestrueMinify XML-based files
MinifyHtmlAndRazortrueMinify HTML and Razor view files
EnableRedactiontrueRedact secrets before token counting
SkeletonModefalseEmit C# structural skeleton only

The C# structural removals (comments, usings, namespaces, regions, and aggressive compression) all default to false, so a default fusion preserves C# structure and removes only whitespace.

Emission Options

OptionDefaultMeaning
FormatXmlOutput serialization format
TokenizerModelo200k_baseTokenizer used for counting
SplitTokens800000Token threshold that starts a new output part
MaxTokensnoneHard token limit across all parts; emission halts when exceeded
IncludeManifesttruePrepend the manifest header
ShowTokenCounttrueDisplay the token count on completion
IncludeProvenancefalseAnnotate each entry with its inclusion chain

Validation Rules

The validator runs before any stage and reports every violation it finds. The rules are:

  • The source directory must be specified and must exist.
  • Focus, Changes, and Query are mutually exclusive; at most one may be present.
  • When focus scoping is used, focus depth must be between 1 and 10.
  • When query scoping is used, query depth must be between 1 and 10.
  • When query scoping is used, the query text is required and the top-files count must be at least 1.
  • The only-extensions restriction cannot combine with a project template, because only-extensions replaces template defaults entirely.

A request that violates any rule is rejected before collection begins.

What This Does Not Cover

This page documents the request shape, defaults, and validation. It does not map each option to its CLI flag or config key; see the Options Reference. It does not explain what the scoping options do once accepted; see Scoping Internals.

Next

See the Options Reference for the full flag and config mapping, The Fusion Pipeline for how each option group drives its stage, and Scoping Internals for the scoping algorithms.

On this page