Model Profile Base Prompts & Flavors

Status: Intent preserved; separate bundle architecture superseded. The implementation contract now lives in Document Mode Editor — Model-selected base prompts and flavor overlays. This page keeps the product idea and its boundaries discoverable without maintaining a competing schema/runtime plan.

The product problem

Different models often need different prompt engineering, while the creative choices layered over that engineering are reusable:

Model Profiles are already the reusable “model pattern → mode + recommended parameters” layer. They should compose these concerns rather than introduce another Bundle entity.

Canonical terminology

Base prompt

A Base prompt is the ordinary Mode selected by an automatic winning Model Profile Entry or a deliberately selected compatible Entry.

This is a relational role, not a new Mode kind.

Flavor overlay

A Flavor is one optional, profile-owned, keyless System prompt fragment.

Flavor meaning is contextual link/group state, not an intrinsic sub_prompt flag. Its V1 content row is exclusive to the Profile aggregate. Importing authorized keyless System v0/v1 text creates a private clone; imported v0 shows a Legacy notice/palette gate and keeps literal text plus final {{char}}/{{user}} substitution until an explicit staged inline-token upgrade. New Flavors use expansion v1, so old text behavior and new inline variables coexist without a cross-parent prompt leak.

Fallback

Fallback is separate from Base. The package layer obeys the package’s explicit resolver policy: policy 0 preserves shipped exact → SQL-pattern substring behavior with no wildcard, while policy 1 uses exact → longest literal substring → *. Initial resolution can then use the read-only legacy package fallback → selected-character default Mode → built-in DefaultSections. On later policy-0 re-resolution, the shipped null behavior retains a prior valid automatic Base as Base-only policy0_retained_base; policy 1’s discriminated valid-null instead clears through the outer fallback chain.

If no Entry from a profile wins, that profile contributes no Flavors. Under policy 1, a creator adds a * Entry when they want catch-all Base + Flavor behavior; policy-0 packages must explicitly opt into that corrected resolver first. There is no profile base_mode_id fallback.

Canonical composition

Only the exact automatic winner or a deliberate compatible manual_profile_entry contributes its Profile Flavors. Two profiles may point to the same Base Mode while producing different effective plans. Policy-0 retained Base, manual Mode, fallback, legacy-unprovenanced, Direct/Discord, and Hybrid plans are Base-only in V1.

The assembly order is fixed:

  1. Resolve the Base first: a zero-row Base still expands to all existing DefaultSections.
  2. Base Mature/NSFW prelude and contiguous leading System rows.
  3. Enabled Flavor rows in effective order (profile order for a new plan, snapshotted order for an existing conversation).
  4. Remaining Base rows in unchanged local order.
  5. One journal fallback if neither the resolved Base nor enabled Flavors declares journal.
  6. Existing name substitution and Base Mode merge behavior.

Flavors are structurally layered rows—not recursively expanded {{flavor}} text. Insertion before the first non-System Base row prevents a late System Flavor in Advanced multi-role plans. Composite ordinals preserve Base/Flavor local order without a second global raw-sort pass. The Document Base remains exactly one mode-linked row because Flavor links live outside prompt_mode_sub_prompt_links.

Existing profiles have zero Flavor links and therefore assemble exactly as before.

Canonical storage direction

The canonical plan extends Model Profiles with contextual relations:

Do not add the old proposal’s:

Modes retain N:M sub-prompt reuse. V1 Flavor rows are deliberately exclusive because sub-prompts have no independent entity-permission surface; copying authorized source text is explicit and safe, while defaults and meaning still belong on the Profile link/group.

Creator and user experience

Model Profile editor

Package Workbench

Chat

Flavor toggles do not spend Echoes. Generated Test-drive/chat turns still use ordinary eligibility and billing rules.

Safety, rights, and publication

Parameter recommendations are separate

Model Profile Entry parameters remain recommendations. One atomic selection transaction can follow the automatic winner, choose a bound Entry with a concrete matching preset, or detach to an allowed ordinary Mode. For the chosen Entry it offers:

Automatic parameter precedence at package/resolver launch is not part of this feature. Package settings use a separate exact non-Generation allowlist and reject every Generation.*/*Llm.* key, so that JSON cannot silently recreate automatic Entry recommendations.

Explicit Entry selection uses the package’s actual policy-specific match predicate. Policy 0 preserves its case-sensitive exact plus case-insensitive PostgreSQL-pattern substring behavior (including %, _, and \; * is not special). Policy 1 uses case-sensitive exact, case-insensitive literal containment, then a whole-identifier *. A matching shadowed Entry may be chosen deliberately even though automatic resolution still chooses its deterministic winner.

The exact winning Profile governs enforcement, or the package’s single normalized default Profile when none wins; no bound Profile means no Profile enforcement. Mandatory requires a matching Entry and blocks no-match generation/arbitrary Mode detachment. Package Mode lock additionally blocks manual Entry/Mode overrides but not creator-defined automatic re-resolution, optional Flavor toggles, or applying settings to the unchanged Entry. The only compatibility carve-out is the narrow migrated-conversation grandfather above; it cannot authorize a new selection.

Hybrid and door boundary

V1 Flavors target classic_primary on Web only. Hybrid, Direct, and Discord remain Base-only, so a prose-style choice is never applied without the promised effect/control surface. Future role-tagged Beat/Prose Model Profile composition and door-specific controls can extend the same link model with explicit stages; Flavor content never silently crosses a stage or door.

Acceptance Criteria

The Base/Flavor feature is not done until every box below is verified against the running product. The detailed canonical gate is maintained in Document Mode Editor.

User use cases:

Behavior:

Invariants:

Edges: