Context Profiles and rules
A Context Profile is the desired composition for a consumer + objective (+ environment): a budget and one rule per layer. It is the product term for the SEIF perspective/profile the engine compiles it into — a ContextKernelPolicy for selection and a projection ContextProfile for DagContextRuntime. It never mutates sources or authority.
Rule
| Field | Values | Effect |
|---|---|---|
participation (desired) | auto (include when applicable), include (always), exclude (never) | Your intent. |
mode | inline, retrieve, on-demand | Inline: items in order; retrieve: items ranked by deterministic lexical relevance to input.message (zero-relevance items are not retrieved); on-demand: nothing inline, items offered as expansion references. |
required | bool | If the layer is not selected (unavailable, unknown, stale…) the resolution is BLOCKED (MISSING_REQUIRED_CONTEXT); if it is trimmed by the budget, RENDERING_INCOMPLETE. |
priority | number | Order of layers and of admission under the budget. |
maxItems, maxTokens | numbers | Bounded acquisition per layer; the rest becomes expandable references (BEYOND_MAX_ITEMS, NOT_RETRIEVED, LAYER_TOKEN_LIMIT). |
order | relevance, recency, path | Recency reads the currentness field (or date). |
currentness | maxAgeDays, field (default updated), onStale, onUnknown (exclude/warn) | Items older than the limit are STALE; items without the date are UNKNOWN. Excluded items are listed in currentnessExcluded with their reason and leave nothing unknown: they are not in the context. Undated items kept by warn make the resolution's currentness UNKNOWN. An item warn delivers out of date or undated carries Not current (…): do not present it as current. in the rendered text (an attribute not-current in XML), so the model reads it too. A consumer with render.includeCurrentness also reads each item's date. |
Layer-level conditions (on the layer, shared by all profiles): appliesTo.objectives, appliesTo.consumers, requiresInput (missing keys make applicability UNKNOWN, never "no"), and itemFilter (only items whose metadata field equals the request input value participate — e.g. a customer's own profile and tickets).
Decision order (per layer)
- Available — material exists (
MATERIAL_PRESENT) /EMPTY/UNAVAILABLE/UNKNOWN. - Applicable —
IN_SCOPE,MATCHED:<field>,NOT_APPLICABLE(OBJECTIVE_OUT_OF_SCOPE,NO_MATCHING_MATERIAL…) orUNKNOWN(INPUT_NOT_PROVIDED:<key>). - Currentness filters candidates.
- Desired + mode → Context Kernel decision: inline, on-demand or omitted, with reason (
INCLUDED_BY_PROFILE,INCLUDED_APPLICABLE,EXCLUDED_BY_PROFILE,APPLICABILITY_UNKNOWN,STALE_EXCLUDED…). - Materialized — bounded acquisition; Projected — facets resolved by
DagContextRuntime; Rendered — admitted by the consumer renderer within the budget (BUDGET_TRIMMEDotherwise).
Budget
Estimated tokens (ceil(characters / 4)) of the exact rendered output, never presented as tokenizer counts. Items are admitted by priority (required layers first) while the rendered estimate stays within the limit. Required content that cannot fit blocks the resolution.