@ngockhoale/ukit 3.5.4 → 3.5.6

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.
Files changed (68) hide show
  1. package/CHANGELOG.md +27 -0
  2. package/manifests/engineConformance.yaml +0 -13
  3. package/manifests/platform.full.yaml +25 -0
  4. package/package.json +3 -9
  5. package/src/cli/commands/indexTools.js +1 -0
  6. package/src/cli/commands/memory.js +44 -4
  7. package/src/core/applyPlan.js +25 -72
  8. package/src/core/diffPlan.js +38 -9
  9. package/src/core/managedTemplateMerge.js +146 -0
  10. package/src/core/memory/memoryCheckRun.js +13 -1
  11. package/src/core/memory/memoryFlags.js +5 -6
  12. package/src/core/memory/memoryHit.js +31 -15
  13. package/src/core/memory/policy.js +5 -0
  14. package/src/core/memory/recallEngine.js +39 -3
  15. package/src/core/memory/recallLanes.js +182 -0
  16. package/src/core/memory/retrieval.js +13 -1
  17. package/src/core/memory/store.js +17 -0
  18. package/src/core/memory/topicCommand.js +75 -0
  19. package/src/core/memory/topicPages.js +545 -0
  20. package/src/core/metadata.js +12 -8
  21. package/src/core/runInstallPipeline.js +16 -10
  22. package/src/core/runtimeConfig.js +59 -83
  23. package/src/core/uninstall.js +8 -1
  24. package/src/decision/registry.js +33 -16
  25. package/src/decision/runtimeDecide.js +5 -5
  26. package/src/index/buildIndex.js +287 -6
  27. package/src/index/languageTools.js +100 -0
  28. package/src/index/paths.js +2 -1
  29. package/src/index/queryIndex.js +174 -10
  30. package/src/index/routeResolver.js +2 -2
  31. package/src/index/semanticLane.js +269 -0
  32. package/src/learning/lessonClass.js +110 -0
  33. package/src/learning/patternProposals.js +111 -7
  34. package/src/learning/reeditMiner.js +104 -0
  35. package/src/learning/selfImprove.js +9 -1
  36. package/template_project/.claude/skills/canvas-design/SKILL.md +2 -2
  37. package/template_project/.claude/skills/canvas-design/canvas-fonts/{InstrumentSans-OFL.txt → InstrumentSerif-OFL.txt} +3 -3
  38. package/template_project/.claude/skills/canvas-design/scripts/fetch-fonts.mjs +148 -0
  39. package/template_project/.claude/ukit/index/embed-index.mjs +26 -0
  40. package/template_project/.claude/ukit/index/lib/index-core.mjs +561 -14
  41. package/template_project/.claude/ukit/index/lib/semantic-lane.mjs +269 -0
  42. package/template_project/.claude/ukit/index/query-index.mjs +9 -1
  43. package/template_project/.claude/ukit/index/refresh-index.mjs +11 -0
  44. package/template_project/.claude/ukit/index/route-resolver.mjs +2 -2
  45. package/template_project/.claude/ukit/runtime/memory-lanes.mjs +9 -2
  46. package/template_project/.claude/ukit/runtime/memory-policy.mjs +5 -0
  47. package/template_project/.claude/ukit/runtime/memory-recall.mjs +39 -3
  48. package/template_project/.claude/ukit/runtime/memory-topics.mjs +545 -0
  49. package/template_project/ukit/storage/config.json +19 -34
  50. package/manifests/instructionRules.yaml +0 -442
  51. package/template_project/.claude/skills/canvas-design/canvas-fonts/BricolageGrotesque-Bold.ttf +0 -0
  52. package/template_project/.claude/skills/canvas-design/canvas-fonts/BricolageGrotesque-OFL.txt +0 -93
  53. package/template_project/.claude/skills/canvas-design/canvas-fonts/BricolageGrotesque-Regular.ttf +0 -0
  54. package/template_project/.claude/skills/canvas-design/canvas-fonts/InstrumentSans-Bold.ttf +0 -0
  55. package/template_project/.claude/skills/canvas-design/canvas-fonts/InstrumentSans-BoldItalic.ttf +0 -0
  56. package/template_project/.claude/skills/canvas-design/canvas-fonts/InstrumentSans-Italic.ttf +0 -0
  57. package/template_project/.claude/skills/canvas-design/canvas-fonts/InstrumentSans-Regular.ttf +0 -0
  58. package/template_project/.claude/skills/canvas-design/canvas-fonts/InstrumentSerif-Italic.ttf +0 -0
  59. package/template_project/.claude/skills/canvas-design/canvas-fonts/JetBrainsMono-Bold.ttf +0 -0
  60. package/template_project/.claude/skills/canvas-design/canvas-fonts/Lora-Bold.ttf +0 -0
  61. package/template_project/.claude/skills/canvas-design/canvas-fonts/Lora-BoldItalic.ttf +0 -0
  62. package/template_project/.claude/skills/canvas-design/canvas-fonts/Lora-Italic.ttf +0 -0
  63. package/template_project/.claude/skills/canvas-design/canvas-fonts/Lora-OFL.txt +0 -93
  64. package/template_project/.claude/skills/canvas-design/canvas-fonts/Lora-Regular.ttf +0 -0
  65. package/template_project/.claude/skills/canvas-design/canvas-fonts/Outfit-Bold.ttf +0 -0
  66. package/template_project/.claude/skills/canvas-design/canvas-fonts/Tektur-Medium.ttf +0 -0
  67. package/template_project/.claude/skills/canvas-design/canvas-fonts/YoungSerif-OFL.txt +0 -93
  68. package/template_project/.claude/skills/canvas-design/canvas-fonts/YoungSerif-Regular.ttf +0 -0
@@ -207,9 +207,7 @@ export function resolveConfigStage(config = null, path) {
207
207
 
208
208
  // decisionRuntime family stage resolver (V-03): resolves
209
209
  // `decisionRuntime.<key>.stage` for one pinned family flag ('vm',
210
- // 'supervisor', 'scheduler', 'contract', 'adapters', 'context',
211
- // 'completion', 'quality', 'promotion', 'resourcePolicy',
212
- // 'diagnostics'). Same semantics as resolveConfigStage: absent config,
210
+ // 'supervisor', 'contract', 'adapters', 'promotion', 'diagnostics'). Same semantics as resolveConfigStage: absent config,
213
211
  // absent family, non-string key, or malformed stage all resolve 'off'
214
212
  // — a bad config can never promote a decisionRuntime slice.
215
213
  export function resolveDecisionRuntimeStage(config = null, key = 'vm') {
@@ -522,6 +520,10 @@ export function buildDefaultRuntimeConfig(overrides = {}) {
522
520
  canaryProjects: [],
523
521
  killSwitch: false,
524
522
  },
523
+ // Index query (3.5.5): opt-in RRF fusion of the hashed-embedding lane for weak natural
524
+ // queries. Off by default: it lowered natural-en top-3 and mirror-over-original on the
525
+ // gold bench. Read by queryCodeIndex from .ukit/storage/config.json -> index.fusion.
526
+ index: { fusion: false },
525
527
  memory: {
526
528
  enabled: true,
527
529
  progressiveRetrieval: true,
@@ -539,6 +541,14 @@ export function buildDefaultRuntimeConfig(overrides = {}) {
539
541
  // evidence and near-duplicate checks on every non-generated record write;
540
542
  // 'off' = no gate. scope user needs no file evidence. See writeGate.js.
541
543
  writeGate: 'strict',
544
+ // Topic pages (3.5.5, docs/memory/topics/*.md, `ukit memory topic`): recall = pages
545
+ // are recall documents (inert until a page is built); hint = the edit hint names
546
+ // the module page (a path only, never the page text).
547
+ topics: { recall: true, hint: true },
548
+ // Optional CLI-only recall lanes (3.5.5), both off: vector = embedding
549
+ // cosine fused with BM25 by RRF; rerank = unic-decision confirms the top
550
+ // candidates (stage off|shadow|canary|default; active at canary/default).
551
+ recall: { vector: { enabled: false }, rerank: { stage: 'off' } },
542
552
  editHints: { enabled: true, mirrors: [], ignoreMirrors: [], coChange: false },
543
553
  },
544
554
  validation: {
@@ -561,13 +571,6 @@ export function buildDefaultRuntimeConfig(overrides = {}) {
561
571
  // codeProposalsCommit is a reserved hard-false — writing a task file is
562
572
  // the ceiling; self-improve never commits code (clamped below).
563
573
  selfImprove: { enabled: true, codeProposals: true, codeProposalsCommit: false },
564
- // C52 M04.2 stage keys (SPEC §5 FR-016–FR-018). candidates: repeated
565
- // corrections/suppressions/escalations promote to a LearningCandidate
566
- // only after minOccurrences + cross-session evidence (status
567
- // 'proposed'; rule promotion still needs approval). overlays: only
568
- // approved + enabled overlays apply; base-version mismatch → conflict.
569
- candidates: { stage: 'default', minOccurrences: 3 },
570
- overlays: { stage: 'default' },
571
574
  },
572
575
  // C52 M04.1 compact resumable state (SPEC §5 FR-012–FR-015): a bounded
573
576
  // resumable-run record per route so a compacted session resumes mid-task.
@@ -578,14 +581,11 @@ export function buildDefaultRuntimeConfig(overrides = {}) {
578
581
  // decision-first-runtime (SPEC §2 G1-FR07, §2 G2-FR07/08, §2 G4-FR07,
579
582
  // §2 G5-FR07, §2 G7-FR04/07). Pinned keys — `decisionRuntime.contract`
580
583
  // gates the G1 contract/eventStore prototype; `decisionRuntime.supervisor`
581
- // gates the G2 owned-process supervisor; `decisionRuntime.scheduler`
582
- // gates the G3 scheduler; `decisionRuntime.vm` gates the G4 plan-VM
583
- // engine; `decisionRuntime.adapters`, `decisionRuntime.context`,
584
- // `decisionRuntime.completion`, and `decisionRuntime.quality` gate the
585
- // G5 adapters/context/completion/quality slice; `decisionRuntime.promotion`
586
- // gates the G6 caller-wait promotion profile and
587
- // `decisionRuntime.resourcePolicy` gates the G6 pressure/coalescing
588
- // policy; `decisionRuntime.diagnostics` gates the G7 explainable-trace /
584
+ // gates the G2 owned-process supervisor; `decisionRuntime.vm` gates the
585
+ // G4 plan-VM engine; `decisionRuntime.adapters` gates the G5 adapters
586
+ // slice; `decisionRuntime.promotion`
587
+ // gates the G6 caller-wait promotion profile;
588
+ // `decisionRuntime.diagnostics` gates the G7 explainable-trace /
589
589
  // replay / support-record readers. 3.3.0 zero-config: every family ships
590
590
  // 'shadow' — evidence is recorded while the deterministic owners stay
591
591
  // authoritative; promotion.js promotes a family only once its frozen
@@ -594,14 +594,9 @@ export function buildDefaultRuntimeConfig(overrides = {}) {
594
594
  decisionRuntime: {
595
595
  contract: { stage: 'shadow' },
596
596
  supervisor: { stage: 'shadow' },
597
- scheduler: { stage: 'shadow' },
598
597
  vm: { stage: 'shadow' },
599
598
  adapters: { stage: 'shadow' },
600
- context: { stage: 'shadow' },
601
- completion: { stage: 'shadow' },
602
- quality: { stage: 'shadow' },
603
599
  promotion: { stage: 'shadow' },
604
- resourcePolicy: { stage: 'shadow' },
605
600
  diagnostics: { stage: 'default' },
606
601
  },
607
602
 
@@ -617,14 +612,6 @@ export function buildDefaultRuntimeConfig(overrides = {}) {
617
612
  roleAdvice: { stage: 'off' },
618
613
  contextSelection: { stage: 'off' },
619
614
  },
620
-
621
- // C52 M06 experiments (SPEC §5 FR-021–FR-023). 3.3.0 zero-config: enabled;
622
- // each experiment still runs only where a caller invokes it and never
623
- // auto-promotes its own result.
624
- experiments: {
625
- deliberation: { enabled: true },
626
- dynamicWorkflow: { enabled: true, maxAttemptsPerFailure: 2, noProgressCap: 3 },
627
- },
628
615
  // Flight recorder (docs/OBSERVABILITY.md): 'default' activates recorder,
629
616
  // analytics, support projection and evaluation. 'off' is the kill switch.
630
617
  observability: { stage: 'default' },
@@ -932,16 +919,18 @@ export function validateRuntimeConfig(config) {
932
919
  // C63 DR-02 + C64 DR-03/04 + C67 DR-07/08 + C68 DR-09 + C69 DR-10
933
920
  // decisionRuntime — optional-present; carries one stage key per prototype
934
921
  // (pinned: decisionRuntime.contract, decisionRuntime.supervisor,
935
- // decisionRuntime.scheduler, decisionRuntime.vm, decisionRuntime.adapters,
936
- // decisionRuntime.context, decisionRuntime.completion,
937
- // decisionRuntime.quality, decisionRuntime.promotion,
938
- // decisionRuntime.resourcePolicy, decisionRuntime.diagnostics). Absent →
939
- // valid; malformed stage → error + resolver falls back to 'off'.
922
+ // decisionRuntime.vm, decisionRuntime.adapters, decisionRuntime.promotion,
923
+ // decisionRuntime.diagnostics). Absent →
924
+ // valid; malformed stage → error + resolver falls back to 'off'. Retired
925
+ // keys (decisionRuntime.scheduler/context/completion/quality/resourcePolicy,
926
+ // experiments.*, learning.candidates/overlays — no reader, removed in
927
+ // 3.5.6) are not validated, so old configs carrying them stay valid and
928
+ // their values are ignored without a warning.
940
929
  if (config.decisionRuntime !== undefined) {
941
930
  if (!isPlainObject(config.decisionRuntime)) {
942
931
  errors.push('decisionRuntime must be an object.');
943
932
  } else {
944
- for (const key of ['contract', 'supervisor', 'scheduler', 'vm', 'adapters', 'context', 'completion', 'quality', 'promotion', 'resourcePolicy', 'diagnostics']) {
933
+ for (const key of ['contract', 'supervisor', 'vm', 'adapters', 'promotion', 'diagnostics']) {
945
934
  const stageKey = config.decisionRuntime[key];
946
935
  if (stageKey === undefined) continue;
947
936
  if (!isPlainObject(stageKey)) {
@@ -972,34 +961,6 @@ export function validateRuntimeConfig(config) {
972
961
  }
973
962
  }
974
963
  }
975
- // C52 M06 experiments — optional-present; both experiments are
976
- // disabled-by-default booleans plus bounded breakers.
977
- if (config.experiments !== undefined) {
978
- if (!isPlainObject(config.experiments)) {
979
- errors.push('experiments must be an object.');
980
- } else {
981
- if (config.experiments.deliberation !== undefined) {
982
- if (!isPlainObject(config.experiments.deliberation)) {
983
- errors.push('experiments.deliberation must be an object.');
984
- } else {
985
- pushBooleanError(errors, config.experiments.deliberation.enabled, 'experiments.deliberation.enabled');
986
- }
987
- }
988
- if (config.experiments.dynamicWorkflow !== undefined) {
989
- if (!isPlainObject(config.experiments.dynamicWorkflow)) {
990
- errors.push('experiments.dynamicWorkflow must be an object.');
991
- } else {
992
- pushBooleanError(errors, config.experiments.dynamicWorkflow.enabled, 'experiments.dynamicWorkflow.enabled');
993
- if (config.experiments.dynamicWorkflow.maxAttemptsPerFailure !== undefined) {
994
- pushPositiveNumberError(errors, config.experiments.dynamicWorkflow.maxAttemptsPerFailure, 'experiments.dynamicWorkflow.maxAttemptsPerFailure');
995
- }
996
- if (config.experiments.dynamicWorkflow.noProgressCap !== undefined) {
997
- pushPositiveNumberError(errors, config.experiments.dynamicWorkflow.noProgressCap, 'experiments.dynamicWorkflow.noProgressCap');
998
- }
999
- }
1000
- }
1001
- }
1002
- }
1003
964
 
1004
965
  // modelRoles is optional-present and additive-namespaced (SPEC-model-roles): absent →
1005
966
  // valid (pre-v3 configs); present → must be an object. Entry-level issues (unknown
@@ -1028,6 +989,14 @@ export function validateRuntimeConfig(config) {
1028
989
  }
1029
990
  }
1030
991
 
992
+ if (config.index !== undefined) {
993
+ if (!isPlainObject(config.index)) {
994
+ errors.push('index must be an object.');
995
+ } else if (config.index.fusion !== undefined) {
996
+ pushBooleanError(errors, config.index.fusion, 'index.fusion');
997
+ }
998
+ }
999
+
1031
1000
  if (!isPlainObject(config.codeIntel)) {
1032
1001
  errors.push('codeIntel must be an object.');
1033
1002
  } else {
@@ -1205,6 +1174,31 @@ export function validateRuntimeConfig(config) {
1205
1174
  if (config.memory.writeGate !== undefined && !['strict', 'off', false].includes(config.memory.writeGate)) {
1206
1175
  errors.push('memory.writeGate must be "strict" or "off".');
1207
1176
  }
1177
+ if (config.memory.topics !== undefined) {
1178
+ if (!isPlainObject(config.memory.topics)) {
1179
+ errors.push('memory.topics must be an object.');
1180
+ } else {
1181
+ for (const key of ['recall', 'hint']) {
1182
+ if (config.memory.topics[key] !== undefined) pushBooleanError(errors, config.memory.topics[key], `memory.topics.${key}`);
1183
+ }
1184
+ }
1185
+ }
1186
+ // Optional recall lanes (3.5.5): absent = both off.
1187
+ const lanes = config.memory.recall;
1188
+ if (lanes !== undefined) {
1189
+ if (!isPlainObject(lanes)) {
1190
+ errors.push('memory.recall must be an object.');
1191
+ } else {
1192
+ if (lanes.vector !== undefined) {
1193
+ if (!isPlainObject(lanes.vector)) errors.push('memory.recall.vector must be an object.');
1194
+ else pushBooleanError(errors, lanes.vector.enabled, 'memory.recall.vector.enabled');
1195
+ }
1196
+ if (lanes.rerank !== undefined) {
1197
+ if (!isPlainObject(lanes.rerank)) errors.push('memory.recall.rerank must be an object.');
1198
+ else pushStageError(errors, lanes.rerank, 'memory.recall.rerank');
1199
+ }
1200
+ }
1201
+ }
1208
1202
  }
1209
1203
 
1210
1204
  if (!isPlainObject(config.validation)) {
@@ -1282,24 +1276,6 @@ export function validateRuntimeConfig(config) {
1282
1276
  pushBooleanError(errors, learning.selfImprove.codeProposalsCommit, 'learning.selfImprove.codeProposalsCommit');
1283
1277
  }
1284
1278
  }
1285
- // C52 M04.2 stage keys — same optional-present contract as routing.*.
1286
- if (learning.candidates !== undefined) {
1287
- if (!isPlainObject(learning.candidates)) {
1288
- errors.push('learning.candidates must be an object.');
1289
- } else {
1290
- pushStageError(errors, learning.candidates, 'learning.candidates');
1291
- if (learning.candidates.minOccurrences !== undefined) {
1292
- pushPositiveNumberError(errors, learning.candidates.minOccurrences, 'learning.candidates.minOccurrences');
1293
- }
1294
- }
1295
- }
1296
- if (learning.overlays !== undefined) {
1297
- if (!isPlainObject(learning.overlays)) {
1298
- errors.push('learning.overlays must be an object.');
1299
- } else {
1300
- pushStageError(errors, learning.overlays, 'learning.overlays');
1301
- }
1302
- }
1303
1279
  }
1304
1280
  }
1305
1281
 
@@ -501,7 +501,14 @@ export async function uninstallUkit({ projectRoot, dryRun = false }) {
501
501
  const sidecarRel = `${entry.normalizedRelative}.ukit-new`;
502
502
  const recordedSidecarHash = installData.sidecars?.[sidecarRel];
503
503
  const sidecarState = await readSidecarState(sidecarAbs);
504
- if (sidecarState.state === 'file' && typeof recordedSidecarHash === 'string' && recordedSidecarHash === sidecarState.hash) {
504
+ // Also attributable: bytes equal to the shipped template (what old versions wrote).
505
+ const shippedForSidecar = managedMap.has(entry.normalizedRelative) && sidecarState.state === 'file'
506
+ ? await fs.readFile(managedMap.get(entry.normalizedRelative)).catch(() => null)
507
+ : null;
508
+ if (sidecarState.state === 'file' && (
509
+ (typeof recordedSidecarHash === 'string' && recordedSidecarHash === sidecarState.hash)
510
+ || (shippedForSidecar !== null && sha256Hex(shippedForSidecar) === sidecarState.hash)
511
+ )) {
505
512
  regularPaths.push({ abs: sidecarAbs, recursive: false });
506
513
  } else if (sidecarState.state !== 'absent') {
507
514
  preservedSidecars.push(sidecarAbs);
@@ -22,6 +22,7 @@ export const DECISION_FAMILIES = new Set([
22
22
  'verify',
23
23
  'review',
24
24
  'resume',
25
+ 'memory',
25
26
  'learn',
26
27
  'runtime',
27
28
  ]);
@@ -272,22 +273,6 @@ export const DECISION_REGISTRY = Object.freeze([
272
273
  cacheSensitivity: 'none',
273
274
  leasePolicy: 'none',
274
275
  },
275
- {
276
- decisionKey: 'learn.candidate-class.v1',
277
- schemaVersion: 1,
278
- family: 'learn',
279
- owner: 'learningCandidates',
280
- kind: 'choice',
281
- description: 'Learning candidate classification for a captured signal. Reserved for the memoryV2 decision lane; promotion gates via decisionPlane.families.learn.stage.',
282
- candidatePolicy: 'owner-shortlist',
283
- hardConstraints: ['promotion-approval'],
284
- probabilityPolicy: 'raw-label',
285
- fallbackPolicy: 'deterministic-classifier',
286
- telemetryClass: 'decision',
287
- rolloutStage: 'off',
288
- cacheSensitivity: 'none',
289
- leasePolicy: 'none',
290
- },
291
276
  {
292
277
  decisionKey: 'review.verdict.v1',
293
278
  schemaVersion: 1,
@@ -432,6 +417,38 @@ export const DECISION_REGISTRY = Object.freeze([
432
417
  cacheSensitivity: 'none',
433
418
  leasePolicy: 'none',
434
419
  },
420
+ {
421
+ decisionKey: 'memory.relevance.v1',
422
+ schemaVersion: 1,
423
+ family: 'memory',
424
+ owner: 'memoryRecall',
425
+ kind: 'noul',
426
+ description: 'Whether one recalled note answers the query (rerank of the top BM25 candidates; asked once per candidate, wire name carries `#c<n>`). Gated by memory.recall.rerank.stage, CLI path only.',
427
+ candidatePolicy: 'bm25-top-candidates',
428
+ hardConstraints: ['no-new-candidates', 'abstention-unchanged'],
429
+ probabilityPolicy: 'raw-label',
430
+ fallbackPolicy: 'bm25-order',
431
+ telemetryClass: 'decision',
432
+ rolloutStage: 'off',
433
+ cacheSensitivity: 'none',
434
+ leasePolicy: 'none',
435
+ },
436
+ {
437
+ decisionKey: 'learn.candidate-class.v1',
438
+ schemaVersion: 1,
439
+ family: 'learn',
440
+ owner: 'lessonClass',
441
+ kind: 'noul',
442
+ description: 'Whether one mined pattern is a real recurring lesson (asked once per ambiguous candidate, wire name carries `#c<n>`). A low answer can only downgrade a candidate to noise; it never approves or promotes. Gated by decisionPlane.families.learn.stage; session end and `ukit memory learn` only.',
443
+ candidatePolicy: 'ambiguous-mined-patterns',
444
+ hardConstraints: ['no-promotion', 'downgrade-only'],
445
+ probabilityPolicy: 'raw-label',
446
+ fallbackPolicy: 'deterministic-rules',
447
+ telemetryClass: 'decision',
448
+ rolloutStage: 'off',
449
+ cacheSensitivity: 'none',
450
+ leasePolicy: 'none',
451
+ },
435
452
  ]);
436
453
 
437
454
  // Deep-freeze the shipped catalog — entries are shared metadata consumed by
@@ -2,7 +2,7 @@
2
2
  // C65 G3-FR03/FR04 — registered semantic decisions + bounded fallback.
3
3
  //
4
4
  // createRuntimeDecider({ client, registry?, confidenceFloor?, now? }) produces
5
- // the `decideFn` runtimeScheduler expects: one ambiguous classified item →
5
+ // a `decideFn`: one ambiguous classified item →
6
6
  // exactly one client.requestBatch → TypedDecision, or a typed conservative
7
7
  // Fallback on every failure mode. The gateway is contacted ONLY for items
8
8
  // classified 'model_decision' with a registered decisionKey — known signals
@@ -33,7 +33,7 @@ export const RUNTIME_DECISIONS = Object.freeze([
33
33
  decisionKey: 'runtime.stall_action.v1',
34
34
  schemaVersion: 1,
35
35
  family: 'runtime',
36
- owner: 'runtimeScheduler',
36
+ owner: 'runtimeDecide',
37
37
  kind: 'choice',
38
38
  description: 'Action for an ambiguous stalled/timeout observation without explicit spec policy.',
39
39
  candidatePolicy: 'conservative-stall-actions',
@@ -51,7 +51,7 @@ export const RUNTIME_DECISIONS = Object.freeze([
51
51
  decisionKey: 'runtime.wake_needed.v1',
52
52
  schemaVersion: 1,
53
53
  family: 'runtime',
54
- owner: 'runtimeScheduler',
54
+ owner: 'runtimeDecide',
55
55
  kind: 'choice',
56
56
  description: 'Whether an ambiguous runtime event needs to wake a host/human, from an unparseable or unknown payload.',
57
57
  candidatePolicy: 'conservative-wake-actions',
@@ -69,7 +69,7 @@ export const RUNTIME_DECISIONS = Object.freeze([
69
69
  decisionKey: 'runtime.safe_retry.v1',
70
70
  schemaVersion: 1,
71
71
  family: 'runtime',
72
- owner: 'runtimeScheduler',
72
+ owner: 'runtimeDecide',
73
73
  kind: 'choice',
74
74
  description: 'Whether an ambiguous failure-adjacent event is safe to retry within registered bounds.',
75
75
  candidatePolicy: 'conservative-retry-actions',
@@ -231,7 +231,7 @@ export function createRuntimeDecider({
231
231
  return fallback('invalid', 'escalate');
232
232
  }
233
233
  // Only 'model_decision' items reach the gateway — known local signals are
234
- // decided upstream by runtimeFilter and pass through untouched.
234
+ // decided by the caller and pass through untouched.
235
235
  if (item.action !== 'model_decision') {
236
236
  return item;
237
237
  }