@principles/host-runtime 2.2.2 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/active-principle-prompt.d.ts +88 -3
- package/dist/active-principle-prompt.js +132 -41
- package/dist/adaptive-journal-reconciliation.js +1 -1
- package/dist/adaptive-principle-revalidation.d.ts +1 -1
- package/dist/adaptive-principle-revalidation.js +1 -1
- package/dist/behavior-example-pack-assembler.d.ts +2 -2
- package/dist/behavior-example-pack-assembler.js +6 -6
- package/dist/behavior-history.d.ts +1 -1
- package/dist/behavior-history.js +1 -1
- package/dist/cli-recovery-probe.d.ts +1 -1
- package/dist/codex-artificer-trusted-facts.d.ts +1 -1
- package/dist/codex-rule-context-provider.d.ts +1 -1
- package/dist/codex-rule-context-provider.js +1 -1
- package/dist/codex-worker-status.js +1 -1
- package/dist/design-gate-facts.d.ts +1 -1
- package/dist/design-gate-facts.js +1 -1
- package/dist/evaluator-runtime-context.d.ts +1 -1
- package/dist/evaluator-runtime-context.js +1 -1
- package/dist/governance-observation-store.js +1 -1
- package/dist/governance-signal-admission.d.ts +2 -2
- package/dist/governance-signal-admission.js +3 -3
- package/dist/host-liveness-contract.d.ts +1 -1
- package/dist/host-tool-declaration.d.ts +1 -1
- package/dist/host-tool-declaration.js +1 -1
- package/dist/host-tool-semantic-resolver.d.ts +1 -1
- package/dist/host-tool-semantic-resolver.js +1 -1
- package/dist/index.d.ts +11 -1
- package/dist/index.js +33 -15
- package/dist/internalization-consumer-cycle.d.ts +2 -2
- package/dist/internalization-consumer-cycle.js +2 -2
- package/dist/internalization-consumer-governance.d.ts +1 -1
- package/dist/internalization-consumer-governance.js +1 -1
- package/dist/intervention-evidence-ingress.d.ts +1 -1
- package/dist/intervention-evidence-ingress.js +1 -1
- package/dist/pd-config.d.ts +1 -1
- package/dist/pd-config.js +1 -1
- package/dist/product-telemetry/consent-store.js +1 -1
- package/dist/product-telemetry/exporter.d.ts +1 -1
- package/dist/product-telemetry/milestone-readers.d.ts +1 -1
- package/dist/product-telemetry/service.d.ts +1 -1
- package/dist/product-telemetry/service.js +1 -1
- package/dist/product-telemetry/workspace-scope.js +1 -1
- package/dist/production-pain-evidence.d.ts +1 -1
- package/dist/production-pain-evidence.js +3 -3
- package/dist/production-rulehost-gate.d.ts +1 -1
- package/dist/production-rulehost-gate.js +3 -3
- package/dist/prompt-activation-authority.d.ts +1 -1
- package/dist/prompt-activation-deliverability.d.ts +26 -16
- package/dist/prompt-activation-deliverability.js +60 -30
- package/dist/prompt-injection-budget-observation.d.ts +16 -5
- package/dist/prompt-injection-budget-observation.js +23 -9
- package/dist/prompt-injection-projection.d.ts +106 -49
- package/dist/prompt-injection-projection.js +190 -212
- package/dist/prompt-injection-status.d.ts +1 -1
- package/dist/prompt-injection-status.js +17 -8
- package/dist/signal-classifier.d.ts +2 -2
- package/dist/signal-classifier.js +3 -3
- package/dist/workbuddy-rule-context-provider.d.ts +1 -1
- package/dist/workbuddy-rule-context-provider.js +1 -1
- package/dist/workbuddy-worker-status.js +1 -1
- package/dist/workspace-behavior-evidence.d.ts +1 -1
- package/dist/workspace-behavior-evidence.js +2 -2
- package/dist/workspace-telemetry-emitter.d.ts +1 -1
- package/dist/workspace-telemetry-emitter.js +1 -1
- package/package.json +3 -3
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import fs from 'node:fs';
|
|
2
2
|
import path from 'node:path';
|
|
3
|
-
import { PROMPT_BUDGET_POLICY_VERSION,
|
|
3
|
+
import { PROMPT_BUDGET_POLICY_VERSION, RUNTIME_PRINCIPLE_BUDGET, isValidContextWindowTokens, promptBudgetCharsForContextWindow, resolvePromptBudget, operatorDeclaredContextWindow, } from '@principles/core/runtime';
|
|
4
4
|
import { isPromptInjectionTargetHost, } from './prompt-injection-projection.js';
|
|
5
5
|
/**
|
|
6
6
|
* PRI-1104 Stage 0 (expand): accepted budget policy provenance versions.
|
|
@@ -68,21 +68,32 @@ function isAcceptedBudgetPolicyVersion(value) {
|
|
|
68
68
|
* other event payloads are not cached.
|
|
69
69
|
*/
|
|
70
70
|
/**
|
|
71
|
-
* Candidate directories for the runtime
|
|
71
|
+
* Candidate directories for the runtime event log, in priority order.
|
|
72
72
|
* Shared with the RuleCode telemetry collector (ERR-031: both readers derive
|
|
73
73
|
* from one list — the v1 EventLog writer emits `.state/logs`, no production
|
|
74
74
|
* code ever created `.pd/logs`).
|
|
75
75
|
*/
|
|
76
|
-
export const
|
|
76
|
+
export const RUNTIME_EVENT_LOG_CANDIDATE_DIRS = ['.pd/logs', '.state/logs'];
|
|
77
|
+
/**
|
|
78
|
+
* @deprecated Use `RUNTIME_EVENT_LOG_CANDIDATE_DIRS`.
|
|
79
|
+
*
|
|
80
|
+
* PRI-1136 renamed this exported constant, and `src/index.ts` re-exports it
|
|
81
|
+
* through `export *`, so it is part of the package's public root API. Removing
|
|
82
|
+
* the old name in a patch release would break external consumers that
|
|
83
|
+
* `import { RUNTIME_V2_EVENT_LOG_CANDIDATE_DIRS } from '@principles/host-runtime'`.
|
|
84
|
+
* The alias is the exact same frozen array (not a copy) and will be removed in
|
|
85
|
+
* the next major release.
|
|
86
|
+
*/
|
|
87
|
+
export const RUNTIME_V2_EVENT_LOG_CANDIDATE_DIRS = RUNTIME_EVENT_LOG_CANDIDATE_DIRS;
|
|
77
88
|
/**
|
|
78
89
|
* Bounded I/O: only the most recent daily files are scanned — PER candidate
|
|
79
|
-
* log directory (`
|
|
90
|
+
* log directory (`RUNTIME_EVENT_LOG_CANDIDATE_DIRS`), not globally. The
|
|
80
91
|
* cap is deliberately per directory: both directories describe the same
|
|
81
92
|
* workspace's log convention and either can hold the newest event for a given
|
|
82
93
|
* host (the reader takes latest-wins ACROSS them), so a global cap would let
|
|
83
94
|
* one directory's files starve the other and drop a live host observation.
|
|
84
95
|
* Worst case per read is therefore `RUNTIME_BUDGET_OBSERVATION_MAX_FILES ×
|
|
85
|
-
*
|
|
96
|
+
* RUNTIME_EVENT_LOG_CANDIDATE_DIRS.length` files (14 today) and the same
|
|
86
97
|
* count × `RUNTIME_BUDGET_OBSERVATION_MAX_FILE_BYTES` bytes (56 MiB today).
|
|
87
98
|
*/
|
|
88
99
|
export const RUNTIME_BUDGET_OBSERVATION_MAX_FILES = 7;
|
|
@@ -229,7 +240,7 @@ function narrowObservation(parsed, workspaceDir, nowMs) {
|
|
|
229
240
|
return null;
|
|
230
241
|
if (!isBudgetFallbackReason(rawReason))
|
|
231
242
|
return null;
|
|
232
|
-
if (budget !==
|
|
243
|
+
if (budget !== RUNTIME_PRINCIPLE_BUDGET)
|
|
233
244
|
return null;
|
|
234
245
|
}
|
|
235
246
|
return {
|
|
@@ -253,7 +264,10 @@ function narrowObservation(parsed, workspaceDir, nowMs) {
|
|
|
253
264
|
function readBoundedLogText(filePath) {
|
|
254
265
|
let fd;
|
|
255
266
|
try {
|
|
256
|
-
|
|
267
|
+
// Read-only open. The mode is explicit anyway: this path can be derived
|
|
268
|
+
// from a temp-dir workspace, and an explicit 0600 keeps the file
|
|
269
|
+
// owner-only if this call is ever changed to a creating flag.
|
|
270
|
+
fd = fs.openSync(filePath, 'r', 0o600);
|
|
257
271
|
}
|
|
258
272
|
catch {
|
|
259
273
|
return null;
|
|
@@ -291,7 +305,7 @@ function readBoundedLogText(filePath) {
|
|
|
291
305
|
}
|
|
292
306
|
/**
|
|
293
307
|
* Read the most recent budget observation per host from the workspace's
|
|
294
|
-
* runtime
|
|
308
|
+
* runtime event logs. Never throws: an unreadable log directory degrades
|
|
295
309
|
* to an empty report with an explicit note (absence is UNKNOWN, not zero).
|
|
296
310
|
*/
|
|
297
311
|
export function readRuntimePromptBudgetObservations(input) {
|
|
@@ -304,7 +318,7 @@ export function readRuntimePromptBudgetObservations(input) {
|
|
|
304
318
|
const foreignPolicyEventsSkipped = { count: 0 };
|
|
305
319
|
const truncatedFiles = { count: 0 };
|
|
306
320
|
const latest = new Map();
|
|
307
|
-
for (const candidate of
|
|
321
|
+
for (const candidate of RUNTIME_EVENT_LOG_CANDIDATE_DIRS) {
|
|
308
322
|
const logsRoot = path.resolve(workspaceDir, ...candidate.split('/'));
|
|
309
323
|
if (!fs.existsSync(logsRoot))
|
|
310
324
|
continue;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type PromptBudgetResolution, type PromptSelectionPolicy } from '@principles/core/runtime
|
|
1
|
+
import { type PromptBudgetResolution, type PromptSelectionPolicy } from '@principles/core/runtime';
|
|
2
2
|
/** Hosts with a production prompt-injection path today (shared GovernanceHostKind boundary). */
|
|
3
3
|
export type PromptInjectionTargetHost = 'openclaw' | 'codex' | 'workbuddy';
|
|
4
4
|
/** Single host roster (review P2): every consumer derives from this list, so a
|
|
@@ -10,6 +10,53 @@ export declare const PROMPT_INJECTION_TARGET_HOSTS: readonly PromptInjectionTarg
|
|
|
10
10
|
* (review R1: each re-typed list forked the roster and dropped WorkBuddy). */
|
|
11
11
|
export declare function isPromptInjectionTargetHost(kind: unknown): kind is PromptInjectionTargetHost;
|
|
12
12
|
export type PromptInjectionRouteName = 'legacy_trim' | 'shared_render';
|
|
13
|
+
/**
|
|
14
|
+
* PRI-1137 final review (P1-1): rotation semantics of the production route as
|
|
15
|
+
* a THREE-STATE fact, never a boolean. A boolean conflates two different
|
|
16
|
+
* answers — "the bound host cannot rotate" (a real FIFO statement about a
|
|
17
|
+
* known host) and "no single host is bound, so rotation cannot be attributed"
|
|
18
|
+
* (an unknown). Downstream copy that reads the second as the first tells an
|
|
19
|
+
* OpenClaw Owner their principle is permanently FIFO-queued when it is not.
|
|
20
|
+
*
|
|
21
|
+
* This is the STATIC host capability. Whether a real OpenClaw round actually
|
|
22
|
+
* rotated is a runtime fact the plugin owns: a missing sessionId, a failed
|
|
23
|
+
* `user_turns` write, or an unreadable ordinal degrade that round to
|
|
24
|
+
* `legacy_fifo_prefix_v1` (existing FIFO fallback) — never fabricated here.
|
|
25
|
+
*/
|
|
26
|
+
export type PromptProductionRotationState = {
|
|
27
|
+
readonly state: 'rotates';
|
|
28
|
+
} | {
|
|
29
|
+
readonly state: 'does_not_rotate';
|
|
30
|
+
} | {
|
|
31
|
+
readonly state: 'unknown';
|
|
32
|
+
/** Bounded reason rotation cannot be attributed (rc-3: fail loud, no silent guess). */
|
|
33
|
+
readonly reason: 'no_bound_host' | 'host_facts_unreadable';
|
|
34
|
+
};
|
|
35
|
+
/**
|
|
36
|
+
* A host's STATIC rotation capability (final review P1-1.4/P1-1.5): only
|
|
37
|
+
* OpenClaw supplies a trusted round authority (`nextSessionTurnOrdinal` over
|
|
38
|
+
* trajectory.db `user_turns`); Codex/WorkBuddy inject FIFO by their own
|
|
39
|
+
* policy and never fabricate a round key. One mapping, typed by the roster —
|
|
40
|
+
* consumers must not re-derive host capabilities from route names. A bound
|
|
41
|
+
* host always resolves to a definite state (never `unknown`).
|
|
42
|
+
*/
|
|
43
|
+
export declare function hostRotationCapability(hostKind: PromptInjectionTargetHost): Extract<PromptProductionRotationState, {
|
|
44
|
+
state: 'rotates' | 'does_not_rotate';
|
|
45
|
+
}>;
|
|
46
|
+
/**
|
|
47
|
+
* PRI-1137 final review: the rotation truth of the ONE production route.
|
|
48
|
+
* Explicit host binding resolves that host's actual capability; otherwise a
|
|
49
|
+
* workspace with exactly one applicable host resolves to that host's
|
|
50
|
+
* capability, and anything else (no host has ever operated here, several
|
|
51
|
+
* applicable hosts, unreadable host facts) stays `unknown` — aggregate host
|
|
52
|
+
* facts are never flattened into "all hosts are FIFO" (P1-1.6). Route
|
|
53
|
+
* confirmation (`shared_render` for everyone) and host binding are separate
|
|
54
|
+
* facts; this function only answers the binding question.
|
|
55
|
+
*/
|
|
56
|
+
export declare function productionRouteRotationState(input: {
|
|
57
|
+
workspaceDir: string;
|
|
58
|
+
targetHost?: PromptInjectionTargetHost;
|
|
59
|
+
}): PromptProductionRotationState;
|
|
13
60
|
/**
|
|
14
61
|
* Which serialization the budget is charged against (SPEC R-A2): the legacy
|
|
15
62
|
* list route bills only the selected `- [id] text` lines (the directive
|
|
@@ -20,15 +67,14 @@ export type PromptInjectionRouteName = 'legacy_trim' | 'shared_render';
|
|
|
20
67
|
export type PromptInjectionBudgetScope = 'selected_lines' | 'full_directive_context';
|
|
21
68
|
export declare const PROMPT_INJECTION_UNIT: 'utf16_code_units';
|
|
22
69
|
/**
|
|
23
|
-
* AC-01
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
-
*
|
|
31
|
-
* consumer must say so instead of guessing FIFO or rotation (SPEC R-A1).
|
|
70
|
+
* AC-01 / PRI-1137: every standard host now injects through ONE shared route.
|
|
71
|
+
* `abstraction_layer_v1` is a gone tombstone and no longer selects a route, so
|
|
72
|
+
* the decision is about WHICH host will run the build (host attribution for
|
|
73
|
+
* the Owner), never about a per-host legacy/shared split. Host facts come from
|
|
74
|
+
* the existing durable provenance (declarations ∪ pain evidence —
|
|
75
|
+
* `readWorkspaceHostKindFacts`); an explicit request-level target overrides
|
|
76
|
+
* them. Unconfirmed remains for genuinely unreadable inputs (config, prompt
|
|
77
|
+
* flag, host facts, unknown host kinds) — never for "routes differ".
|
|
32
78
|
*/
|
|
33
79
|
export interface PromptInjectionRouteDecision {
|
|
34
80
|
status: 'confirmed' | 'unconfirmed';
|
|
@@ -36,11 +82,9 @@ export interface PromptInjectionRouteDecision {
|
|
|
36
82
|
hostKind?: PromptInjectionTargetHost;
|
|
37
83
|
/** Present when status === 'confirmed'. */
|
|
38
84
|
route?: PromptInjectionRouteName;
|
|
39
|
-
basis?: 'explicit_target' | 'workspace_host_facts' | '
|
|
85
|
+
basis?: 'explicit_target' | 'workspace_host_facts' | 'single_route_all_hosts';
|
|
40
86
|
/** Present when explicit binding succeeds while workspace-wide host facts are unreadable. */
|
|
41
87
|
hostFactsStatus?: 'unreadable';
|
|
42
|
-
/** Raw `abstraction_layer_v1` flag state (context for the OpenClaw branch). */
|
|
43
|
-
flagEnabled: boolean;
|
|
44
88
|
declaredHostKinds: readonly string[];
|
|
45
89
|
effectiveHostKinds: readonly string[];
|
|
46
90
|
/** Present when status === 'unconfirmed'. */
|
|
@@ -54,14 +98,13 @@ export interface PromptInjectionRouteDecision {
|
|
|
54
98
|
}[];
|
|
55
99
|
}
|
|
56
100
|
/**
|
|
57
|
-
* THE one route formula (P4):
|
|
58
|
-
*
|
|
59
|
-
*
|
|
60
|
-
*
|
|
61
|
-
*
|
|
62
|
-
* the ternary.
|
|
101
|
+
* THE one route formula (P4 / PRI-1137): every standard host injects through
|
|
102
|
+
* the shared route. The OpenClaw legacy plugin-local route was deleted, so
|
|
103
|
+
* `legacy_trim` is retained only as a historical wire literal — production
|
|
104
|
+
* never returns it. Every consumer that needs "which route would host X take"
|
|
105
|
+
* must call this; never re-type the mapping.
|
|
63
106
|
*/
|
|
64
|
-
export declare function promptRouteForHost(
|
|
107
|
+
export declare function promptRouteForHost(_hostKind: PromptInjectionTargetHost): PromptInjectionRouteName;
|
|
65
108
|
/**
|
|
66
109
|
* Resolve the effective route for this workspace. Pure read of existing
|
|
67
110
|
* config + provenance facts — no new registry, no persisted state.
|
|
@@ -102,8 +145,13 @@ export interface PromptInjectionProjection {
|
|
|
102
145
|
* entry within N turns. So this is computed under the production policy
|
|
103
146
|
* (fair rotation whenever the route actually rotates) and is therefore
|
|
104
147
|
* non-empty even for a caller that supplied no round key — which is
|
|
105
|
-
* exactly the console's situation.
|
|
106
|
-
*
|
|
148
|
+
* exactly the console's situation. Final review P1-1: this is a CAPABILITY
|
|
149
|
+
* bound, not a per-round guarantee — it holds while the session's
|
|
150
|
+
* user-turn records keep succeeding; a round degraded to FIFO (missing
|
|
151
|
+
* sessionId / failed write / unreadable ordinal) does not advance the
|
|
152
|
+
* window. Empty when the production route genuinely does not rotate, when
|
|
153
|
+
* no single host is bound (`productionRotation.state === 'unknown'` — no
|
|
154
|
+
* attributable ring), or when nothing is eligible.
|
|
107
155
|
*/
|
|
108
156
|
eventuallyInjectedActivationIds: string[];
|
|
109
157
|
/** Number of eligible candidates that reached the selector. */
|
|
@@ -115,8 +163,12 @@ export interface PromptInjectionProjection {
|
|
|
115
163
|
* round key; this answers "will the agent's real injection rotate",
|
|
116
164
|
* which is what determines whether an out-of-window activation is queued
|
|
117
165
|
* or starved. They differ exactly in the case this whole fix is about.
|
|
166
|
+
*
|
|
167
|
+
* PRI-1137 final review (P1-1): three-state — `unknown` when no single host
|
|
168
|
+
* is bound, which consumers MUST NOT read as "does not rotate". Consumers
|
|
169
|
+
* branch on `.state`; the wire string is exactly the `state` value.
|
|
118
170
|
*/
|
|
119
|
-
|
|
171
|
+
productionRotation: PromptProductionRotationState;
|
|
120
172
|
/** R-A2: the unit `usedChars`/`budget` are counted in. */
|
|
121
173
|
unit: typeof PROMPT_INJECTION_UNIT;
|
|
122
174
|
/** R-A2: which serialization the budget is charged against on this route. */
|
|
@@ -156,43 +208,37 @@ export interface PromptInjectionProjection {
|
|
|
156
208
|
budgetFallbackDetail?: string;
|
|
157
209
|
}
|
|
158
210
|
/**
|
|
159
|
-
* PR #1844 follow-up: forecast the prompt-injection budget from the
|
|
160
|
-
* projection the agent injection itself uses:
|
|
161
|
-
*
|
|
162
|
-
*
|
|
163
|
-
* (same FIFO query + artifact resolve as the plugin's list path) trimmed by
|
|
164
|
-
* the REAL `trimToBudget` — identical input × ordering × trim logic as
|
|
165
|
-
* `openclaw-plugin/src/hooks/prompt.ts`;
|
|
166
|
-
* - shared route: delegate to `buildActivePrinciplePromptContext`, which IS
|
|
167
|
-
* the production shared path's projection source (Codex always; OpenClaw
|
|
168
|
-
* when its `abstraction_layer_v1` gate is on).
|
|
211
|
+
* PR #1844 follow-up / PRI-1137: forecast the prompt-injection budget from the
|
|
212
|
+
* SAME projection the agent injection itself uses — ONE route, no legacy path:
|
|
213
|
+
* `buildActivePrinciplePromptContext`, which IS the production shared path's
|
|
214
|
+
* projection source for every standard host.
|
|
169
215
|
*
|
|
170
|
-
*
|
|
171
|
-
*
|
|
172
|
-
*
|
|
173
|
-
* callers that lack host context should prefer
|
|
174
|
-
* `resolveLivePromptInjectionProjection`, which binds the route to real host
|
|
175
|
-
* facts and refuses to guess).
|
|
216
|
+
* `targetHost` is host attribution only. It narrows which host's round
|
|
217
|
+
* authority the forecast may assume (see `productionRouteRotationState`); it
|
|
218
|
+
* never selects a different injection route.
|
|
176
219
|
*
|
|
177
|
-
* PR-1894 — round-key alignment.
|
|
178
|
-
* key from the CURRENT session's turn ordinal
|
|
179
|
-
*
|
|
180
|
-
*
|
|
181
|
-
*
|
|
182
|
-
*
|
|
183
|
-
* function takes the key as an explicit input and exposes
|
|
184
|
-
* `selectionPolicy` on the result.
|
|
220
|
+
* PR-1894 — round-key alignment. Production derives its fair-rotation round
|
|
221
|
+
* key from the CURRENT session's turn ordinal. The console has no access to
|
|
222
|
+
* it, so passing no key selects `legacy_fifo_prefix_v1` for THIS forecast while
|
|
223
|
+
* production runs `fair_rotation_v1` on OpenClaw. The result therefore exposes
|
|
224
|
+
* both `selectionPolicy` (what this projection ran) and `productionRotation`
|
|
225
|
+
* (what the real injection will do) — never a single blended claim.
|
|
185
226
|
*/
|
|
186
227
|
export declare function buildLivePromptInjectionProjection(input: {
|
|
187
228
|
workspaceDir: string;
|
|
188
229
|
/**
|
|
189
|
-
*
|
|
230
|
+
* PRI-1137: the fair-rotation round key the production route is using this
|
|
190
231
|
* turn. Callers that hold one (the plugin) pass it; callers that do not
|
|
191
232
|
* (the console) omit it and MUST read `selectionPolicy` off the result
|
|
192
233
|
* rather than assuming FIFO.
|
|
193
234
|
*/
|
|
194
235
|
roundKey?: number;
|
|
195
|
-
/**
|
|
236
|
+
/**
|
|
237
|
+
* PRI-1137: host attribution only — every host now takes the same shared
|
|
238
|
+
* route. This narrows WHICH host's rotation authority the forecast may
|
|
239
|
+
* assume (rotation is an OpenClaw-only capability); it never selects a
|
|
240
|
+
* different injection route.
|
|
241
|
+
*/
|
|
196
242
|
targetHost?: PromptInjectionTargetHost;
|
|
197
243
|
/**
|
|
198
244
|
* SPEC-PD-MODEL-AWARE-PROMPT-BUDGET-001 §6.1: budget resolution this
|
|
@@ -213,6 +259,17 @@ export type LivePromptInjectionProjectionResolution = {
|
|
|
213
259
|
status: 'confirmed';
|
|
214
260
|
decision: PromptInjectionRouteDecision;
|
|
215
261
|
projection: PromptInjectionProjection;
|
|
262
|
+
/**
|
|
263
|
+
* PRI-1137: with ONE shared route, a workspace that binds no single host
|
|
264
|
+
* still has per-host budget facts (host attribution is a fact, not a route
|
|
265
|
+
* split). Each standard host's forecast runs under ITS OWN budget basis —
|
|
266
|
+
* never another host's window. Absent when a single host is bound (the
|
|
267
|
+
* headline projection already is that host's).
|
|
268
|
+
*/
|
|
269
|
+
perHost?: readonly {
|
|
270
|
+
hostKind: PromptInjectionTargetHost;
|
|
271
|
+
projection: PromptInjectionProjection;
|
|
272
|
+
}[];
|
|
216
273
|
} | {
|
|
217
274
|
status: 'unconfirmed';
|
|
218
275
|
decision: PromptInjectionRouteDecision;
|