@namzu/sdk 54.0.0 → 55.1.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.
Files changed (325) hide show
  1. package/CHANGELOG.md +43 -0
  2. package/dist/agents/QueryAgent.d.ts.map +1 -1
  3. package/dist/agents/QueryAgent.js +1 -0
  4. package/dist/agents/QueryAgent.js.map +1 -1
  5. package/dist/compaction/extractor.d.ts.map +1 -1
  6. package/dist/compaction/extractor.js +5 -1
  7. package/dist/compaction/extractor.js.map +1 -1
  8. package/dist/compaction/managers/structured.d.ts.map +1 -1
  9. package/dist/compaction/managers/structured.js +5 -0
  10. package/dist/compaction/managers/structured.js.map +1 -1
  11. package/dist/compaction/manual.d.ts.map +1 -1
  12. package/dist/compaction/manual.js +6 -0
  13. package/dist/compaction/manual.js.map +1 -1
  14. package/dist/compaction/serializer.d.ts +6 -0
  15. package/dist/compaction/serializer.d.ts.map +1 -1
  16. package/dist/compaction/serializer.js +21 -3
  17. package/dist/compaction/serializer.js.map +1 -1
  18. package/dist/compaction/verifier.d.ts.map +1 -1
  19. package/dist/compaction/verifier.js +27 -6
  20. package/dist/compaction/verifier.js.map +1 -1
  21. package/dist/constants/compaction/index.d.ts +1 -0
  22. package/dist/constants/compaction/index.d.ts.map +1 -1
  23. package/dist/constants/compaction/index.js +1 -0
  24. package/dist/constants/compaction/index.js.map +1 -1
  25. package/dist/{manager/resident/learning-cycle.d.ts → learning/cycle.d.ts} +45 -36
  26. package/dist/learning/cycle.d.ts.map +1 -0
  27. package/dist/{manager/resident/learning-cycle.js → learning/cycle.js} +52 -20
  28. package/dist/learning/cycle.js.map +1 -0
  29. package/dist/learning/deprecated.d.ts +86 -0
  30. package/dist/learning/deprecated.d.ts.map +1 -0
  31. package/dist/learning/deprecated.js +22 -0
  32. package/dist/learning/deprecated.js.map +1 -0
  33. package/dist/learning/experience-store.d.ts +35 -0
  34. package/dist/learning/experience-store.d.ts.map +1 -0
  35. package/dist/learning/experience-store.js +143 -0
  36. package/dist/learning/experience-store.js.map +1 -0
  37. package/dist/learning/experience.d.ts +150 -0
  38. package/dist/learning/experience.d.ts.map +1 -0
  39. package/dist/learning/experience.js +146 -0
  40. package/dist/learning/experience.js.map +1 -0
  41. package/dist/learning/generator.d.ts +118 -0
  42. package/dist/learning/generator.d.ts.map +1 -0
  43. package/dist/learning/generator.js +275 -0
  44. package/dist/learning/generator.js.map +1 -0
  45. package/dist/learning/leak-tripwire.d.ts +66 -0
  46. package/dist/learning/leak-tripwire.d.ts.map +1 -0
  47. package/dist/learning/leak-tripwire.js +208 -0
  48. package/dist/learning/leak-tripwire.js.map +1 -0
  49. package/dist/{manager/resident/learning-observation.d.ts → learning/observation.d.ts} +4 -4
  50. package/dist/learning/observation.d.ts.map +1 -0
  51. package/dist/{manager/resident/learning-observation.js → learning/observation.js} +3 -3
  52. package/dist/learning/observation.js.map +1 -0
  53. package/dist/{manager/resident/learning.d.ts → learning/skill.d.ts} +29 -29
  54. package/dist/learning/skill.d.ts.map +1 -0
  55. package/dist/{manager/resident/learning.js → learning/skill.js} +27 -27
  56. package/dist/learning/skill.js.map +1 -0
  57. package/dist/{manager/resident/learning-store.d.ts → learning/store.d.ts} +38 -31
  58. package/dist/learning/store.d.ts.map +1 -0
  59. package/dist/{manager/resident/learning-store.js → learning/store.js} +52 -20
  60. package/dist/learning/store.js.map +1 -0
  61. package/dist/manager/resident/activity.d.ts +30 -6
  62. package/dist/manager/resident/activity.d.ts.map +1 -1
  63. package/dist/manager/resident/activity.js.map +1 -1
  64. package/dist/manager/resident/agenda.d.ts +42 -12
  65. package/dist/manager/resident/agenda.d.ts.map +1 -1
  66. package/dist/manager/resident/agenda.js +9 -7
  67. package/dist/manager/resident/agenda.js.map +1 -1
  68. package/dist/manager/resident/consumption.d.ts +27 -5
  69. package/dist/manager/resident/consumption.d.ts.map +1 -1
  70. package/dist/manager/resident/consumption.js +2 -0
  71. package/dist/manager/resident/consumption.js.map +1 -1
  72. package/dist/manager/resident/delivery-window.d.ts +7 -1
  73. package/dist/manager/resident/delivery-window.d.ts.map +1 -1
  74. package/dist/manager/resident/delivery-window.js +2 -0
  75. package/dist/manager/resident/delivery-window.js.map +1 -1
  76. package/dist/manager/resident/evidence-recall.d.ts +7 -1
  77. package/dist/manager/resident/evidence-recall.d.ts.map +1 -1
  78. package/dist/manager/resident/evidence-recall.js +2 -0
  79. package/dist/manager/resident/evidence-recall.js.map +1 -1
  80. package/dist/manager/resident/history.d.ts +45 -9
  81. package/dist/manager/resident/history.d.ts.map +1 -1
  82. package/dist/manager/resident/history.js.map +1 -1
  83. package/dist/manager/resident/host.d.ts +44 -10
  84. package/dist/manager/resident/host.d.ts.map +1 -1
  85. package/dist/manager/resident/host.js +4 -2
  86. package/dist/manager/resident/host.js.map +1 -1
  87. package/dist/manager/resident/initiative.d.ts +32 -6
  88. package/dist/manager/resident/initiative.d.ts.map +1 -1
  89. package/dist/manager/resident/initiative.js +2 -0
  90. package/dist/manager/resident/initiative.js.map +1 -1
  91. package/dist/manager/resident/loop.d.ts +22 -4
  92. package/dist/manager/resident/loop.d.ts.map +1 -1
  93. package/dist/manager/resident/loop.js +7 -1
  94. package/dist/manager/resident/loop.js.map +1 -1
  95. package/dist/manager/resident/outbox.d.ts +42 -8
  96. package/dist/manager/resident/outbox.d.ts.map +1 -1
  97. package/dist/manager/resident/outbox.js +2 -0
  98. package/dist/manager/resident/outbox.js.map +1 -1
  99. package/dist/manager/resident/proposal.d.ts +19 -5
  100. package/dist/manager/resident/proposal.d.ts.map +1 -1
  101. package/dist/manager/resident/proposal.js +2 -0
  102. package/dist/manager/resident/proposal.js.map +1 -1
  103. package/dist/manager/resident/store.d.ts +31 -9
  104. package/dist/manager/resident/store.d.ts.map +1 -1
  105. package/dist/manager/resident/store.js +7 -1
  106. package/dist/manager/resident/store.js.map +1 -1
  107. package/dist/manager/resident/tool-evidence.d.ts +45 -9
  108. package/dist/manager/resident/tool-evidence.d.ts.map +1 -1
  109. package/dist/manager/resident/tool-evidence.js +5 -1
  110. package/dist/manager/resident/tool-evidence.js.map +1 -1
  111. package/dist/prompt/coding-agent-doctrine.d.ts +3 -3
  112. package/dist/prompt/coding-agent-doctrine.d.ts.map +1 -1
  113. package/dist/prompt/coding-agent-doctrine.js +18 -20
  114. package/dist/prompt/coding-agent-doctrine.js.map +1 -1
  115. package/dist/prompt/resident-learning.d.ts +12 -2
  116. package/dist/prompt/resident-learning.d.ts.map +1 -1
  117. package/dist/prompt/resident-learning.js +6 -5
  118. package/dist/prompt/resident-learning.js.map +1 -1
  119. package/dist/prompt/resident-step.d.ts +10 -4
  120. package/dist/prompt/resident-step.d.ts.map +1 -1
  121. package/dist/prompt/resident-step.js +6 -4
  122. package/dist/prompt/resident-step.js.map +1 -1
  123. package/dist/public-runtime.d.ts +10 -4
  124. package/dist/public-runtime.d.ts.map +1 -1
  125. package/dist/public-runtime.js +11 -4
  126. package/dist/public-runtime.js.map +1 -1
  127. package/dist/public-types.d.ts +9 -4
  128. package/dist/public-types.d.ts.map +1 -1
  129. package/dist/runtime/query/checkpoint.d.ts +12 -2
  130. package/dist/runtime/query/checkpoint.d.ts.map +1 -1
  131. package/dist/runtime/query/checkpoint.js +42 -8
  132. package/dist/runtime/query/checkpoint.js.map +1 -1
  133. package/dist/runtime/query/executor.d.ts +39 -1
  134. package/dist/runtime/query/executor.d.ts.map +1 -1
  135. package/dist/runtime/query/executor.js +115 -7
  136. package/dist/runtime/query/executor.js.map +1 -1
  137. package/dist/runtime/query/index.d.ts +18 -0
  138. package/dist/runtime/query/index.d.ts.map +1 -1
  139. package/dist/runtime/query/index.js +20 -1
  140. package/dist/runtime/query/index.js.map +1 -1
  141. package/dist/runtime/query/iteration/index.d.ts.map +1 -1
  142. package/dist/runtime/query/iteration/index.js +17 -8
  143. package/dist/runtime/query/iteration/index.js.map +1 -1
  144. package/dist/runtime/query/iteration/phases/context.d.ts +24 -2
  145. package/dist/runtime/query/iteration/phases/context.d.ts.map +1 -1
  146. package/dist/runtime/query/iteration/phases/context.js +22 -22
  147. package/dist/runtime/query/iteration/phases/context.js.map +1 -1
  148. package/dist/runtime/query/iteration/phases/per-call-review.d.ts +87 -0
  149. package/dist/runtime/query/iteration/phases/per-call-review.d.ts.map +1 -0
  150. package/dist/runtime/query/iteration/phases/per-call-review.js +513 -0
  151. package/dist/runtime/query/iteration/phases/per-call-review.js.map +1 -0
  152. package/dist/runtime/query/iteration/phases/tool-review.d.ts.map +1 -1
  153. package/dist/runtime/query/iteration/phases/tool-review.js +129 -62
  154. package/dist/runtime/query/iteration/phases/tool-review.js.map +1 -1
  155. package/dist/runtime/query/iteration/step-context.d.ts +14 -0
  156. package/dist/runtime/query/iteration/step-context.d.ts.map +1 -1
  157. package/dist/runtime/query/iteration/step-context.js +29 -0
  158. package/dist/runtime/query/iteration/step-context.js.map +1 -1
  159. package/dist/runtime/query/iteration/step-shaping.d.ts.map +1 -1
  160. package/dist/runtime/query/iteration/step-shaping.js +6 -2
  161. package/dist/runtime/query/iteration/step-shaping.js.map +1 -1
  162. package/dist/runtime/query/prepare-turn.d.ts.map +1 -1
  163. package/dist/runtime/query/prepare-turn.js +16 -3
  164. package/dist/runtime/query/prepare-turn.js.map +1 -1
  165. package/dist/runtime/query/project-instructions.d.ts +24 -5
  166. package/dist/runtime/query/project-instructions.d.ts.map +1 -1
  167. package/dist/runtime/query/project-instructions.js +107 -35
  168. package/dist/runtime/query/project-instructions.js.map +1 -1
  169. package/dist/runtime/query/prompt.d.ts +6 -0
  170. package/dist/runtime/query/prompt.d.ts.map +1 -1
  171. package/dist/runtime/query/prompt.js +10 -49
  172. package/dist/runtime/query/prompt.js.map +1 -1
  173. package/dist/runtime/query/resume-pending.d.ts +8 -0
  174. package/dist/runtime/query/resume-pending.d.ts.map +1 -1
  175. package/dist/runtime/query/resume-pending.js +101 -0
  176. package/dist/runtime/query/resume-pending.js.map +1 -1
  177. package/dist/runtime/query/review-policy.d.ts +18 -0
  178. package/dist/runtime/query/review-policy.d.ts.map +1 -1
  179. package/dist/runtime/query/review-policy.js +10 -0
  180. package/dist/runtime/query/review-policy.js.map +1 -1
  181. package/dist/runtime/query/steering.d.ts +55 -56
  182. package/dist/runtime/query/steering.d.ts.map +1 -1
  183. package/dist/runtime/query/steering.js +78 -72
  184. package/dist/runtime/query/steering.js.map +1 -1
  185. package/dist/tools/builtins/bash.d.ts +8 -0
  186. package/dist/tools/builtins/bash.d.ts.map +1 -1
  187. package/dist/tools/builtins/bash.js +13 -18
  188. package/dist/tools/builtins/bash.js.map +1 -1
  189. package/dist/tools/builtins/browser.d.ts.map +1 -1
  190. package/dist/tools/builtins/browser.js +38 -12
  191. package/dist/tools/builtins/browser.js.map +1 -1
  192. package/dist/tools/builtins/edit.js +4 -4
  193. package/dist/tools/builtins/edit.js.map +1 -1
  194. package/dist/tools/builtins/job.js +1 -1
  195. package/dist/tools/builtins/job.js.map +1 -1
  196. package/dist/tools/builtins/skill.js +1 -1
  197. package/dist/tools/builtins/skill.js.map +1 -1
  198. package/dist/tools/builtins/structuredOutput.js +1 -1
  199. package/dist/tools/builtins/structuredOutput.js.map +1 -1
  200. package/dist/tools/builtins/verify-outputs.js +1 -1
  201. package/dist/tools/builtins/verify-outputs.js.map +1 -1
  202. package/dist/tools/builtins/write-file.js +4 -4
  203. package/dist/tools/builtins/write-file.js.map +1 -1
  204. package/dist/tools/coordinator/ask-user-question.d.ts +6 -0
  205. package/dist/tools/coordinator/ask-user-question.d.ts.map +1 -1
  206. package/dist/tools/coordinator/ask-user-question.js +6 -1
  207. package/dist/tools/coordinator/ask-user-question.js.map +1 -1
  208. package/dist/tools/coordinator/index.d.ts.map +1 -1
  209. package/dist/tools/coordinator/index.js +10 -3
  210. package/dist/tools/coordinator/index.js.map +1 -1
  211. package/dist/tools/resident-history.d.ts +2 -0
  212. package/dist/tools/resident-history.d.ts.map +1 -1
  213. package/dist/tools/resident-history.js +2 -0
  214. package/dist/tools/resident-history.js.map +1 -1
  215. package/dist/tools/resident-tool-evidence.d.ts +5 -1
  216. package/dist/tools/resident-tool-evidence.d.ts.map +1 -1
  217. package/dist/tools/resident-tool-evidence.js +5 -1
  218. package/dist/tools/resident-tool-evidence.js.map +1 -1
  219. package/dist/tools/schedules/loop-tool.d.ts.map +1 -1
  220. package/dist/tools/schedules/loop-tool.js +4 -2
  221. package/dist/tools/schedules/loop-tool.js.map +1 -1
  222. package/dist/tools/schedules/schedule-tool.js +2 -2
  223. package/dist/tools/schedules/schedule-tool.js.map +1 -1
  224. package/dist/tools/task/create.js +1 -1
  225. package/dist/tools/task/create.js.map +1 -1
  226. package/dist/tools/untrusted-envelope.js +1 -1
  227. package/dist/tools/untrusted-envelope.js.map +1 -1
  228. package/dist/turn/evidence-query.d.ts.map +1 -1
  229. package/dist/turn/evidence-query.js +16 -1
  230. package/dist/turn/evidence-query.js.map +1 -1
  231. package/dist/turn/evidence-recall.js +1 -1
  232. package/dist/turn/evidence-recall.js.map +1 -1
  233. package/dist/types/agent/base.d.ts +7 -0
  234. package/dist/types/agent/base.d.ts.map +1 -1
  235. package/dist/types/hitl/index.d.ts +66 -0
  236. package/dist/types/hitl/index.d.ts.map +1 -1
  237. package/dist/types/hitl/index.js.map +1 -1
  238. package/dist/types/message/index.d.ts +8 -0
  239. package/dist/types/message/index.d.ts.map +1 -1
  240. package/dist/types/message/index.js +12 -2
  241. package/dist/types/message/index.js.map +1 -1
  242. package/dist/types/message/notice-frame.d.ts +41 -0
  243. package/dist/types/message/notice-frame.d.ts.map +1 -0
  244. package/dist/types/message/notice-frame.js +65 -0
  245. package/dist/types/message/notice-frame.js.map +1 -0
  246. package/package.json +1 -1
  247. package/src/agents/QueryAgent.ts +1 -0
  248. package/src/compaction/extractor.ts +8 -1
  249. package/src/compaction/managers/structured.ts +3 -0
  250. package/src/compaction/manual.ts +5 -0
  251. package/src/compaction/serializer.ts +28 -3
  252. package/src/compaction/verifier.ts +32 -6
  253. package/src/constants/compaction/index.ts +1 -0
  254. package/src/{manager/resident/learning-cycle.ts → learning/cycle.ts} +130 -78
  255. package/src/learning/deprecated.ts +124 -0
  256. package/src/learning/experience-store.ts +202 -0
  257. package/src/learning/experience.ts +238 -0
  258. package/src/learning/generator.ts +388 -0
  259. package/src/learning/leak-tripwire.ts +280 -0
  260. package/src/{manager/resident/learning-observation.ts → learning/observation.ts} +5 -5
  261. package/src/{manager/resident/learning.ts → learning/skill.ts} +64 -67
  262. package/src/{manager/resident/learning-store.ts → learning/store.ts} +97 -67
  263. package/src/manager/resident/activity.ts +30 -6
  264. package/src/manager/resident/agenda.ts +63 -33
  265. package/src/manager/resident/consumption.ts +27 -5
  266. package/src/manager/resident/delivery-window.ts +7 -1
  267. package/src/manager/resident/evidence-recall.ts +7 -1
  268. package/src/manager/resident/history.ts +45 -9
  269. package/src/manager/resident/host.ts +45 -11
  270. package/src/manager/resident/initiative.ts +32 -6
  271. package/src/manager/resident/loop.ts +22 -4
  272. package/src/manager/resident/outbox.ts +42 -8
  273. package/src/manager/resident/proposal.ts +17 -3
  274. package/src/manager/resident/store.ts +27 -5
  275. package/src/manager/resident/tool-evidence.ts +45 -9
  276. package/src/prompt/coding-agent-doctrine.ts +18 -20
  277. package/src/prompt/resident-learning.ts +16 -7
  278. package/src/prompt/resident-step.ts +19 -13
  279. package/src/public-runtime.ts +36 -5
  280. package/src/public-types.ts +96 -34
  281. package/src/runtime/query/checkpoint.ts +49 -8
  282. package/src/runtime/query/executor.ts +165 -15
  283. package/src/runtime/query/index.ts +45 -1
  284. package/src/runtime/query/iteration/index.ts +19 -6
  285. package/src/runtime/query/iteration/phases/context.ts +37 -11
  286. package/src/runtime/query/iteration/phases/per-call-review.ts +617 -0
  287. package/src/runtime/query/iteration/phases/tool-review.ts +168 -83
  288. package/src/runtime/query/iteration/step-context.ts +29 -0
  289. package/src/runtime/query/iteration/step-shaping.ts +6 -2
  290. package/src/runtime/query/prepare-turn.ts +18 -1
  291. package/src/runtime/query/project-instructions.ts +119 -38
  292. package/src/runtime/query/prompt.ts +11 -54
  293. package/src/runtime/query/resume-pending.ts +131 -0
  294. package/src/runtime/query/review-policy.ts +28 -0
  295. package/src/runtime/query/steering.ts +100 -96
  296. package/src/tools/builtins/bash.ts +13 -19
  297. package/src/tools/builtins/browser.ts +38 -12
  298. package/src/tools/builtins/edit.ts +4 -4
  299. package/src/tools/builtins/job.ts +1 -1
  300. package/src/tools/builtins/skill.ts +1 -1
  301. package/src/tools/builtins/structuredOutput.ts +1 -1
  302. package/src/tools/builtins/verify-outputs.ts +1 -1
  303. package/src/tools/builtins/write-file.ts +4 -4
  304. package/src/tools/coordinator/ask-user-question.ts +12 -1
  305. package/src/tools/coordinator/index.ts +10 -3
  306. package/src/tools/resident-history.ts +2 -0
  307. package/src/tools/resident-tool-evidence.ts +5 -1
  308. package/src/tools/schedules/loop-tool.ts +4 -2
  309. package/src/tools/schedules/schedule-tool.ts +2 -2
  310. package/src/tools/task/create.ts +1 -1
  311. package/src/tools/untrusted-envelope.ts +1 -1
  312. package/src/turn/evidence-query.ts +19 -1
  313. package/src/turn/evidence-recall.ts +1 -1
  314. package/src/types/agent/base.ts +8 -0
  315. package/src/types/hitl/index.ts +67 -0
  316. package/src/types/message/index.ts +20 -2
  317. package/src/types/message/notice-frame.ts +88 -0
  318. package/dist/manager/resident/learning-cycle.d.ts.map +0 -1
  319. package/dist/manager/resident/learning-cycle.js.map +0 -1
  320. package/dist/manager/resident/learning-observation.d.ts.map +0 -1
  321. package/dist/manager/resident/learning-observation.js.map +0 -1
  322. package/dist/manager/resident/learning-store.d.ts.map +0 -1
  323. package/dist/manager/resident/learning-store.js.map +0 -1
  324. package/dist/manager/resident/learning.d.ts.map +0 -1
  325. package/dist/manager/resident/learning.js.map +0 -1
@@ -1,10 +1,11 @@
1
1
  import { z } from 'zod';
2
- import { type HarnessProtectionPlan } from '../../eval/harness-protection.js';
3
- import { type HarnessReview, type HarnessVerificationBatch } from '../../eval/harness-verification.js';
4
- import type { DiskResidentAgenda } from './agenda.js';
5
- import { type ResidentLearningEvidence, type ResidentSkillCandidate } from './learning.js';
2
+ import { type HarnessProtectionPlan } from '../eval/harness-protection.js';
3
+ import { type HarnessReview, type HarnessVerificationBatch } from '../eval/harness-verification.js';
4
+ import type { DiskResidentAgenda } from '../manager/resident/agenda.js';
5
+ import { type LearningLeakFinding, type LearningLeakGuard } from './leak-tripwire.js';
6
+ import { type LearningEvidence, type LearningSkillCandidate } from './skill.js';
6
7
  /** @experimental One explicitly requested experiment; callbacks own inference and evaluation. */
7
- export type ResidentLearningStage = 'explore' | 'generate' | 'verification' | 'confirmation';
8
+ export type LearningStage = 'explore' | 'generate' | 'verification' | 'confirmation';
8
9
  declare const receiptSchema: z.ZodObject<{
9
10
  /** The session and turn of the execution this usage belongs to; one receipt per turn. */
10
11
  sessionId: z.ZodString;
@@ -23,9 +24,9 @@ declare const receiptSchema: z.ZodObject<{
23
24
  costUsd: number | null;
24
25
  }>;
25
26
  /** @experimental One non-overlapping execution's usage, including its retries. Null is unknown. */
26
- export type ResidentLearningReceipt = Readonly<z.infer<typeof receiptSchema>>;
27
+ export type LearningReceipt = Readonly<z.infer<typeof receiptSchema>>;
27
28
  /** @experimental Recorded values are lower bounds when a receipt or stage is incomplete. */
28
- export interface ResidentLearningConsumption {
29
+ export interface LearningConsumption {
29
30
  readonly tokens: number;
30
31
  readonly costUsd: number;
31
32
  readonly receipts: number;
@@ -34,51 +35,51 @@ export interface ResidentLearningConsumption {
34
35
  readonly unfinishedStages: number;
35
36
  }
36
37
  /** @experimental Append in sequence to host-owned durable storage before acknowledging. */
37
- export interface ResidentLearningCycleEvent {
38
+ export interface LearningCycleEvent {
38
39
  readonly cycleId: string;
39
40
  readonly sequence: number;
40
41
  readonly kind: 'started' | 'stage-started' | 'stage-finished' | 'usage' | 'exploration' | 'candidate' | 'evaluation' | 'activation-requested' | 'finished';
41
- readonly stage?: ResidentLearningStage;
42
+ readonly stage?: LearningStage;
42
43
  readonly data: Readonly<Record<string, unknown>>;
43
44
  }
44
45
  /** @experimental Use this stage's signal for every owned execution; await every usage append. */
45
- export interface ResidentLearningCycleContext {
46
+ export interface LearningCycleContext {
46
47
  readonly cycleId: string;
47
- readonly stage: ResidentLearningStage;
48
+ readonly stage: LearningStage;
48
49
  readonly signal: AbortSignal;
49
50
  /** Planning allowance, not a reservation or a cap on a callback's in-flight work. */
50
51
  readonly remainingUnits: number;
51
- recordUsage(receipt: ResidentLearningReceipt): Promise<void>;
52
+ recordUsage(receipt: LearningReceipt): Promise<void>;
52
53
  }
53
54
  /** @experimental Original failure and active baseline; never contains confirmation tasks. */
54
- export interface ResidentLearningExplorationContext extends ResidentLearningCycleContext {
55
+ export interface LearningExplorationContext extends LearningCycleContext {
55
56
  readonly skillName: string;
56
57
  /** Admitted by the host before generation; cannot be changed by a candidate. */
57
58
  readonly purpose?: 'task' | 'exploration';
58
59
  readonly failure: Readonly<{
59
- evidence: ResidentLearningEvidence;
60
+ evidence: LearningEvidence;
60
61
  trace: string;
61
62
  }>;
62
- readonly baseline: ResidentSkillCandidate | null;
63
+ readonly baseline: LearningSkillCandidate | null;
63
64
  }
64
65
  /** @experimental Host-retained environment observations, not a model's claim of success. */
65
- export interface ResidentLearningExploration {
66
- readonly evidence: ResidentLearningEvidence;
66
+ export interface LearningExploration {
67
+ readonly evidence: LearningEvidence;
67
68
  readonly trace: string;
68
69
  }
69
70
  /** @experimental Generation sees completed exploration, never held-out evaluation cases. */
70
- export interface ResidentLearningGenerationContext extends ResidentLearningExplorationContext {
71
- readonly exploration?: Readonly<ResidentLearningExploration>;
71
+ export interface LearningGenerationContext extends LearningExplorationContext {
72
+ readonly exploration?: Readonly<LearningExploration>;
72
73
  }
73
74
  /** @experimental The host supplies independently scored, retained traces for these exact revisions. */
74
- export interface ResidentLearningEvaluationContext extends ResidentLearningCycleContext {
75
- readonly baseline: ResidentSkillCandidate | null;
76
- readonly candidate: ResidentSkillCandidate;
75
+ export interface LearningEvaluationContext extends LearningCycleContext {
76
+ readonly baseline: LearningSkillCandidate | null;
77
+ readonly candidate: LearningSkillCandidate;
77
78
  readonly baselineRevision: string;
78
79
  readonly candidateRevision: string;
79
80
  }
80
- /** @experimental No provider, default background loop or executable-code activation is installed. */
81
- export interface ResidentLearningCycleOptions {
81
+ /** @experimental The SDK installs no provider, background loop or executable-code activation; the host supplies them. */
82
+ export interface LearningCycleOptions {
82
83
  /** Omitted means task guidance. Explicitly select exploration to improve an explorer policy. */
83
84
  readonly purpose?: 'task' | 'exploration';
84
85
  /** Fixed before generation; both rounds must preserve every named task. */
@@ -86,43 +87,51 @@ export interface ResidentLearningCycleOptions {
86
87
  readonly agenda: Pick<DiskResidentAgenda, 'read' | 'promoteSkill'>;
87
88
  readonly skillName: string;
88
89
  readonly failure: {
89
- readonly evidence: ResidentLearningEvidence;
90
+ readonly evidence: LearningEvidence;
90
91
  readonly trace: string;
91
92
  };
92
93
  readonly parentCycleId?: string;
94
+ /**
95
+ * Evaluator-side material to keep out of the evidence and the guidance built
96
+ * from it. The built-in markers and secret shapes always apply. A hit refuses
97
+ * the cycle as a leak (see `LearningCycleResult.leak`), before anything is built.
98
+ */
99
+ readonly leakGuard?: LearningLeakGuard;
93
100
  readonly signal: AbortSignal;
94
101
  /** Stops subsequent stages/activation after observed excess; callbacks enforce in-flight limits. */
95
102
  readonly resources: {
96
103
  readonly unit: 'tokens' | 'usd';
97
104
  readonly maxUnits: number;
98
105
  };
99
- readonly record: (event: ResidentLearningCycleEvent) => Promise<void>;
106
+ readonly record: (event: LearningCycleEvent) => Promise<void>;
100
107
  /** Optional active tool exploration before synthesis; the host retains actual observations. */
101
- readonly explore?: (context: ResidentLearningExplorationContext) => Promise<{
102
- readonly observations: ResidentLearningExploration;
108
+ readonly explore?: (context: LearningExplorationContext) => Promise<{
109
+ readonly observations: LearningExploration;
103
110
  readonly usageComplete: boolean;
104
111
  }>;
105
- readonly generate: (context: ResidentLearningGenerationContext) => Promise<{
106
- readonly candidate: ResidentSkillCandidate;
112
+ readonly generate: (context: LearningGenerationContext) => Promise<{
113
+ readonly candidate: LearningSkillCandidate;
107
114
  /** All executions, including failures and side calls, have supplied receipts. */
108
115
  readonly usageComplete: boolean;
109
116
  }>;
110
- readonly evaluate: (context: ResidentLearningEvaluationContext) => Promise<{
117
+ readonly evaluate: (context: LearningEvaluationContext) => Promise<{
111
118
  readonly batch: HarnessVerificationBatch;
112
119
  readonly usageComplete: boolean;
113
120
  }>;
114
121
  }
115
122
  /** @experimental An ambiguous activation must be inspected, never automatically replayed. */
116
- export interface ResidentLearningCycleResult {
123
+ export interface LearningCycleResult {
117
124
  readonly cycleId: string;
118
125
  readonly status: 'activated' | 'rejected' | 'inconclusive' | 'conflict' | 'cancelled' | 'failed' | 'activation-unknown';
119
126
  readonly reason: string;
120
- readonly candidate?: ResidentSkillCandidate;
127
+ readonly candidate?: LearningSkillCandidate;
121
128
  readonly candidateRevision?: string;
122
129
  readonly baselineRevision?: string;
123
130
  readonly agendaRevision?: number;
124
131
  readonly review?: HarnessReview;
125
- readonly consumption: ResidentLearningConsumption;
132
+ /** Present when the cycle was refused as a leak: where it was seen, never the text. */
133
+ readonly leak?: readonly LearningLeakFinding[];
134
+ readonly consumption: LearningConsumption;
126
135
  readonly auditComplete: boolean;
127
136
  }
128
137
  /**
@@ -130,6 +139,6 @@ export interface ResidentLearningCycleResult {
130
139
  * activate through the existing exact-revision transaction. No internal inference
131
140
  * loop, retry or model-generated success claim replaces the host's evaluator.
132
141
  */
133
- export declare function runResidentLearningCycle(options: ResidentLearningCycleOptions): Promise<ResidentLearningCycleResult>;
142
+ export declare function runLearningCycle(options: LearningCycleOptions): Promise<LearningCycleResult>;
134
143
  export {};
135
- //# sourceMappingURL=learning-cycle.d.ts.map
144
+ //# sourceMappingURL=cycle.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cycle.d.ts","sourceRoot":"","sources":["../../src/learning/cycle.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AACvB,OAAO,EACN,KAAK,qBAAqB,EAE1B,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AAE,sBAAsB,CAAA;QAC1C,iFAAiF;QACjF,QAAQ,CAAC,aAAa,EAAE,OAAO,CAAA;KAC/B,CAAC,CAAA;IACF,QAAQ,CAAC,QAAQ,EAAE,CAAC,OAAO,EAAE,yBAAyB,KAAK,OAAO,CAAC;QAClE,QAAQ,CAAC,KAAK,EAAE,wBAAwB,CAAA;QACxC,QAAQ,CAAC,aAAa,EAAE,OAAO,CAAA;KAC/B,CAAC,CAAA;CACF;AAED,6FAA6F;AAC7F,MAAM,WAAW,mBAAmB;IACnC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;IACxB,QAAQ,CAAC,MAAM,EACZ,WAAW,GACX,UAAU,GACV,cAAc,GACd,UAAU,GACV,WAAW,GACX,QAAQ,GACR,oBAAoB,CAAA;IACvB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;IACvB,QAAQ,CAAC,SAAS,CAAC,EAAE,sBAAsB,CAAA;IAC3C,QAAQ,CAAC,iBAAiB,CAAC,EAAE,MAAM,CAAA;IACnC,QAAQ,CAAC,gBAAgB,CAAC,EAAE,MAAM,CAAA;IAClC,QAAQ,CAAC,cAAc,CAAC,EAAE,MAAM,CAAA;IAChC,QAAQ,CAAC,MAAM,CAAC,EAAE,aAAa,CAAA;IAC/B,uFAAuF;IACvF,QAAQ,CAAC,IAAI,CAAC,EAAE,SAAS,mBAAmB,EAAE,CAAA;IAC9C,QAAQ,CAAC,WAAW,EAAE,mBAAmB,CAAA;IACzC,QAAQ,CAAC,aAAa,EAAE,OAAO,CAAA;CAC/B;AAED;;;;GAIG;AACH,wBAAsB,gBAAgB,CACrC,OAAO,EAAE,oBAAoB,GAC3B,OAAO,CAAC,mBAAmB,CAAC,CAyX9B"}
@@ -1,9 +1,10 @@
1
1
  import { createHash, randomUUID } from 'node:crypto';
2
2
  import { z } from 'zod';
3
- import { normalizeHarnessProtection, } from '../../eval/harness-protection.js';
4
- import { reviewHarnessCandidate, } from '../../eval/harness-verification.js';
5
- import { hashResidentSkill, normalizeResidentSkill, promoteResidentSkill, residentLearningEvidenceSchema, } from './learning.js';
6
- import { ResidentConflictError } from './store.js';
3
+ import { normalizeHarnessProtection, } from '../eval/harness-protection.js';
4
+ import { reviewHarnessCandidate, } from '../eval/harness-verification.js';
5
+ import { ResidentConflictError } from '../manager/resident/store.js';
6
+ import { LearningLeakError, assertNoLearningLeak, } from './leak-tripwire.js';
7
+ import { hashLearningSkill, learningEvidenceSchema, normalizeLearningSkill, promoteLearningSkill, } from './skill.js';
7
8
  const receiptSchema = z.object({
8
9
  /** The session and turn of the execution this usage belongs to; one receipt per turn. */
9
10
  sessionId: z.string().uuid(),
@@ -16,7 +17,7 @@ const receiptSchema = z.object({
16
17
  * activate through the existing exact-revision transaction. No internal inference
17
18
  * loop, retry or model-generated success claim replaces the host's evaluator.
18
19
  */
19
- export async function runResidentLearningCycle(options) {
20
+ export async function runLearningCycle(options) {
20
21
  const protection = normalizeHarnessProtection(options.protection);
21
22
  const purpose = z.enum(['task', 'exploration']).parse(options.purpose ?? 'task');
22
23
  const purposeContext = options.purpose === undefined ? {} : { purpose };
@@ -25,7 +26,7 @@ export async function runResidentLearningCycle(options) {
25
26
  .regex(/^[a-z0-9][a-z0-9_-]{0,63}$/)
26
27
  .parse(options.skillName);
27
28
  const failure = Object.freeze({
28
- evidence: Object.freeze(residentLearningEvidenceSchema.parse(options.failure.evidence)),
29
+ evidence: Object.freeze(learningEvidenceSchema.parse(options.failure.evidence)),
29
30
  trace: z.string().trim().min(1).max(32_000).parse(options.failure.trace),
30
31
  });
31
32
  const resources = z
@@ -44,6 +45,7 @@ export async function runResidentLearningCycle(options) {
44
45
  let review;
45
46
  let activatedRevision;
46
47
  let activationRequested = false;
48
+ let leak;
47
49
  const usage = () => ({
48
50
  tokens: [...receipts.values()].reduce((n, r) => n + (r.tokens ?? 0), 0),
49
51
  costUsd: [...receipts.values()].reduce((n, r) => n + (r.costUsd ?? 0), 0),
@@ -75,6 +77,7 @@ export async function runResidentLearningCycle(options) {
75
77
  ...(candidate ? { candidate, candidateRevision } : {}),
76
78
  ...(baselineRevision ? { baselineRevision } : {}),
77
79
  ...(review ? { review } : {}),
80
+ ...(leak ? { leak } : {}),
78
81
  ...(activatedRevision !== undefined ? { agendaRevision: activatedRevision } : {}),
79
82
  consumption: usage(),
80
83
  auditComplete,
@@ -93,6 +96,11 @@ export async function runResidentLearningCycle(options) {
93
96
  };
94
97
  const execute = async () => {
95
98
  options.signal.throwIfAborted();
99
+ const guard = (...subjects) => assertNoLearningLeak(options.leakGuard, subjects);
100
+ guard({
101
+ subject: 'failure.evidence',
102
+ text: `${failure.evidence.key}\n${failure.evidence.source}\n${failure.evidence.reason}`,
103
+ }, { subject: 'failure.trace', text: failure.trace });
96
104
  const snapshot = structuredClone(await options.agenda.read());
97
105
  if (!snapshot)
98
106
  throw new Error('No resident agenda exists for this learning cycle.');
@@ -101,8 +109,18 @@ export async function runResidentLearningCycle(options) {
101
109
  const current = snapshot.learning?.skills.find((s) => s.name === skillName);
102
110
  if (current && (current.purpose ?? 'task') !== purpose)
103
111
  throw new Error('The active skill has a different learning purpose; use a distinct skill name.');
104
- const baseline = current ? normalizeResidentSkill(current) : null;
105
- baselineRevision = baseline ? hashResidentSkill(baseline) : 'none';
112
+ const baseline = current ? normalizeLearningSkill(current) : null;
113
+ baselineRevision = baseline ? hashLearningSkill(baseline) : 'none';
114
+ if (baseline)
115
+ guard({
116
+ subject: 'baseline',
117
+ text: [
118
+ baseline.name,
119
+ baseline.description,
120
+ baseline.body,
121
+ ...(baseline.sources ? [JSON.stringify(baseline.sources)] : []),
122
+ ].join('\n'),
123
+ });
106
124
  await append('started', {
107
125
  tenantId: snapshot.tenantId,
108
126
  agentKey: snapshot.agentKey,
@@ -187,9 +205,13 @@ export async function runResidentLearningCycle(options) {
187
205
  const explore = options.explore;
188
206
  const observed = await stage('explore', (context) => explore(Object.freeze({ ...context, skillName, ...purposeContext, failure, baseline })));
189
207
  exploration = Object.freeze({
190
- evidence: Object.freeze(residentLearningEvidenceSchema.parse(observed.observations.evidence)),
208
+ evidence: Object.freeze(learningEvidenceSchema.parse(observed.observations.evidence)),
191
209
  trace: z.string().trim().min(1).max(32_000).parse(observed.observations.trace),
192
210
  });
211
+ guard({
212
+ subject: 'exploration.evidence',
213
+ text: `${exploration.evidence.key}\n${exploration.evidence.source}\n${exploration.evidence.reason}`,
214
+ }, { subject: 'exploration.trace', text: exploration.trace });
193
215
  await append('exploration', {
194
216
  observations: exploration,
195
217
  digest: createHash('sha256').update(JSON.stringify(exploration)).digest('hex'),
@@ -206,8 +228,14 @@ export async function runResidentLearningCycle(options) {
206
228
  baseline,
207
229
  ...(exploration ? { exploration } : {}),
208
230
  })));
209
- candidateRevision = hashResidentSkill(generated.candidate);
210
- candidate = normalizeResidentSkill(generated.candidate);
231
+ const built = normalizeLearningSkill(generated.candidate);
232
+ guard({ subject: 'candidate.name', text: built.name }, { subject: 'candidate.description', text: built.description }, { subject: 'candidate.body', text: built.body }, {
233
+ subject: 'candidate.sources',
234
+ text: (built.sources ?? []).map((s) => `${s.key}\n${s.revision}`).join('\n'),
235
+ paths: (built.sources ?? []).map((s) => s.key),
236
+ });
237
+ candidateRevision = hashLearningSkill(generated.candidate);
238
+ candidate = built;
211
239
  if ((candidate.purpose ?? 'task') !== purpose)
212
240
  throw new Error('Generated skill purpose does not match the host-admitted learning purpose.');
213
241
  if (candidate.name !== skillName)
@@ -270,7 +298,7 @@ export async function runResidentLearningCycle(options) {
270
298
  };
271
299
  // Validate all existing activation contracts before entering the ambiguous
272
300
  // commit interval. The store repeats this against its atomic snapshot.
273
- promoteResidentSkill(snapshot.learning, candidate, { verification, confirmation, protection }, evidence);
301
+ promoteLearningSkill(snapshot.learning, candidate, { verification, confirmation, protection }, evidence);
274
302
  await append('activation-requested', {
275
303
  baselineRevision,
276
304
  candidateRevision,
@@ -287,13 +315,17 @@ export async function runResidentLearningCycle(options) {
287
315
  outcome = await execute();
288
316
  }
289
317
  catch (error) {
290
- outcome = result(error instanceof ResidentConflictError
291
- ? 'conflict'
292
- : activationRequested
293
- ? 'activation-unknown'
294
- : options.signal.aborted
295
- ? 'cancelled'
296
- : 'failed', error instanceof Error ? error.message : String(error));
318
+ if (error instanceof LearningLeakError)
319
+ leak = error.findings;
320
+ outcome = result(error instanceof LearningLeakError
321
+ ? 'failed'
322
+ : error instanceof ResidentConflictError
323
+ ? 'conflict'
324
+ : activationRequested
325
+ ? 'activation-unknown'
326
+ : options.signal.aborted
327
+ ? 'cancelled'
328
+ : 'failed', error instanceof Error ? error.message : String(error));
297
329
  }
298
330
  if (auditComplete) {
299
331
  try {
@@ -305,4 +337,4 @@ export async function runResidentLearningCycle(options) {
305
337
  }
306
338
  return { ...outcome, auditComplete };
307
339
  }
308
- //# sourceMappingURL=learning-cycle.js.map
340
+ //# sourceMappingURL=cycle.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cycle.js","sourceRoot":"","sources":["../../src/learning/cycle.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AACpD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AACvB,OAAO,EAEN,0BAA0B,GAC1B,MAAM,+BAA+B,CAAA;AACtC,OAAO,EAGN,sBAAsB,GACtB,MAAM,iCAAiC,CAAA;AAExC,OAAO,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAA;AACpE,OAAO,EACN,iBAAiB,EAIjB,oBAAoB,GACpB,MAAM,oBAAoB,CAAA;AAC3B,OAAO,EAGN,iBAAiB,EACjB,sBAAsB,EACtB,sBAAsB,EACtB,oBAAoB,GACpB,MAAM,YAAY,CAAA;AAKnB,MAAM,aAAa,GAAG,CAAC,CAAC,MAAM,CAAC;IAC9B,yFAAyF;IACzF,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE;IAC5B,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE;IACzB,M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AAO,MAAM,CAAC,WAAW,EAAE,6DAA6D,CAAC,CAAA;IAC1F,CAAC,CAAA;IACD,IAAI,OAA4B,CAAA;IAChC,IAAI,CAAC;QACJ,OAAO,GAAG,MAAM,OAAO,EAAE,CAAA;IAC1B,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QAChB,IAAI,KAAK,YAAY,iBAAiB;YAAE,IAAI,GAAG,KAAK,CAAC,QAAQ,CAAA;QAC7D,OAAO,GAAG,MAAM,CACf,KAAK,YAAY,iBAAiB;YACjC,CAAC,CAAC,QAAQ;YACV,CAAC,CAAC,KAAK,YAAY,qBAAqB;gBACvC,CAAC,CAAC,UAAU;gBACZ,CAAC,CAAC,mBAAmB;oBACpB,CAAC,CAAC,oBAAoB;oBACtB,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,OAAO;wBACvB,CAAC,CAAC,WAAW;wBACb,CAAC,CAAC,QAAQ,EACd,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CACtD,CAAA;IACF,CAAC;IACD,IAAI,aAAa,EAAE,CAAC;QACnB,IAAI,CAAC;YACJ,MAAM,MAAM,CAAC,UAAU,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,CAAA;QAC9C,CAAC;QAAC,MAAM,CAAC;YACR,gEAAgE;QACjE,CAAC;IACF,CAAC;IACD,OAAO,EAAE,GAAG,OAAO,EAAE,aAAa,EAAE,CAAA;AACrC,CAAC"}
@@ -0,0 +1,86 @@
1
+ /**
2
+ * The learning module used to live under `manager/resident` and carried a
3
+ * `Resident` prefix. Learning is a feature of all of Namzu, not of residents,
4
+ * so every name now lives in `learning/` without the prefix. The old names stay
5
+ * as aliases of the new ones until the next major release.
6
+ */
7
+ import { runLearningCycle } from './cycle.js';
8
+ import type * as Cycle from './cycle.js';
9
+ import type * as Observation from './observation.js';
10
+ import { hashLearningSkill, projectLearning } from './skill.js';
11
+ import type * as Skill from './skill.js';
12
+ import { SqliteLearningStore, runStoredLearningCycle, runStoredLearningFromObservations } from './store.js';
13
+ import type * as Store from './store.js';
14
+ /** @deprecated Renamed to `LearningEvidence`; the old name is removed in the next major release. */
15
+ export type ResidentLearningEvidence = Skill.LearningEvidence;
16
+ /** @deprecated Renamed to `LearningSkillCandidate`; the old name is removed in the next major release. */
17
+ export type ResidentSkillCandidate = Skill.LearningSkillCandidate;
18
+ /** @deprecated Renamed to `LearnedSkill`; the old name is removed in the next major release. */
19
+ export type ResidentLearnedSkill = Skill.LearnedSkill;
20
+ /** @deprecated Renamed to `LearningState`; the old name is removed in the next major release. */
21
+ export type ResidentLearningState = Skill.LearningState;
22
+ /** @deprecated Renamed to `LearningProfileUpdate`; the old name is removed in the next major release. */
23
+ export type ResidentProfileUpdate = Skill.LearningProfileUpdate;
24
+ /** @deprecated Renamed to `LearningSkillEvaluation`; the old name is removed in the next major release. */
25
+ export type ResidentSkillEvaluation = Skill.LearningSkillEvaluation;
26
+ /** @deprecated Renamed to `LearningProjectionOptions`; the old name is removed in the next major release. */
27
+ export type ResidentLearningProjectionOptions = Skill.LearningProjectionOptions;
28
+ /** @deprecated Renamed to `LearningSource`; the old name is removed in the next major release. */
29
+ export type ResidentLearningSource = Skill.LearningSource;
30
+ /** @deprecated Renamed to `LearningProjection`; the old name is removed in the next major release. */
31
+ export type ResidentLearningProjection = Skill.LearningProjection;
32
+ /** @deprecated Renamed to `LearningStage`; the old name is removed in the next major release. */
33
+ export type ResidentLearningStage = Cycle.LearningStage;
34
+ /** @deprecated Renamed to `LearningReceipt`; the old name is removed in the next major release. */
35
+ export type ResidentLearningReceipt = Cycle.LearningReceipt;
36
+ /** @deprecated Renamed to `LearningConsumption`; the old name is removed in the next major release. */
37
+ export type ResidentLearningConsumption = Cycle.LearningConsumption;
38
+ /** @deprecated Renamed to `LearningCycleEvent`; the old name is removed in the next major release. */
39
+ export type ResidentLearningCycleEvent = Cycle.LearningCycleEvent;
40
+ /** @deprecated Renamed to `LearningCycleContext`; the old name is removed in the next major release. */
41
+ export type ResidentLearningCycleContext = Cycle.LearningCycleContext;
42
+ /** @deprecated Renamed to `LearningGenerationContext`; the old name is removed in the next major release. */
43
+ export type ResidentLearningGenerationContext = Cycle.LearningGenerationContext;
44
+ /** @deprecated Renamed to `LearningExplorationContext`; the old name is removed in the next major release. */
45
+ export type ResidentLearningExplorationContext = Cycle.LearningExplorationContext;
46
+ /** @deprecated Renamed to `LearningExploration`; the old name is removed in the next major release. */
47
+ export type ResidentLearningExploration = Cycle.LearningExploration;
48
+ /** @deprecated Renamed to `LearningEvaluationContext`; the old name is removed in the next major release. */
49
+ export type ResidentLearningEvaluationContext = Cycle.LearningEvaluationContext;
50
+ /** @deprecated Renamed to `LearningCycleOptions`; the old name is removed in the next major release. */
51
+ export type ResidentLearningCycleOptions = Cycle.LearningCycleOptions;
52
+ /** @deprecated Renamed to `LearningCycleResult`; the old name is removed in the next major release. */
53
+ export type ResidentLearningCycleResult = Cycle.LearningCycleResult;
54
+ /** @deprecated Renamed to `SqliteLearningStoreOptions`; the old name is removed in the next major release. */
55
+ export type SqliteResidentLearningStoreOptions = Store.SqliteLearningStoreOptions;
56
+ /** @deprecated Renamed to `LearningArtifact`; the old name is removed in the next major release. */
57
+ export type ResidentLearningArtifact = Store.LearningArtifact;
58
+ /** @deprecated Renamed to `LearningRecordedUsage`; the old name is removed in the next major release. */
59
+ export type ResidentLearningRecordedUsage = Store.LearningRecordedUsage;
60
+ /** @deprecated Renamed to `LearningCycleSummary`; the old name is removed in the next major release. */
61
+ export type ResidentLearningCycleSummary = Store.LearningCycleSummary;
62
+ /** @deprecated Renamed to `LearningDiscoveryOptions`; the old name is removed in the next major release. */
63
+ export type ResidentLearningDiscoveryOptions = Store.LearningDiscoveryOptions;
64
+ /** @deprecated Renamed to `LearningDiscoveryResult`; the old name is removed in the next major release. */
65
+ export type ResidentLearningDiscoveryResult = Store.LearningDiscoveryResult;
66
+ /** @deprecated Renamed to `LearningObservation`; the old name is removed in the next major release. */
67
+ export type ResidentLearningObservation = Observation.LearningObservation;
68
+ /** @deprecated Renamed to `LearningObservationRecord`; the old name is removed in the next major release. */
69
+ export type ResidentLearningObservationRecord = Observation.LearningObservationRecord;
70
+ /** @deprecated Renamed to `LearningTarget`; the old name is removed in the next major release. */
71
+ export type ResidentLearningTarget = Observation.LearningTarget;
72
+ /** @deprecated Renamed to `hashLearningSkill`; the old name is removed in the next major release. */
73
+ export declare const hashResidentSkill: typeof hashLearningSkill;
74
+ /** @deprecated Renamed to `projectLearning`; the old name is removed in the next major release. */
75
+ export declare const projectResidentLearning: typeof projectLearning;
76
+ /** @deprecated Renamed to `runLearningCycle`; the old name is removed in the next major release. */
77
+ export declare const runResidentLearningCycle: typeof runLearningCycle;
78
+ /** @deprecated Renamed to `runStoredLearningCycle`; the old name is removed in the next major release. */
79
+ export declare const runStoredResidentLearningCycle: typeof runStoredLearningCycle;
80
+ /** @deprecated Renamed to `runStoredLearningFromObservations`; the old name is removed in the next major release. */
81
+ export declare const runStoredResidentLearningFromObservations: typeof runStoredLearningFromObservations;
82
+ /** @deprecated Renamed to `SqliteLearningStore`; the old name is removed in the next major release. */
83
+ export declare const SqliteResidentLearningStore: typeof SqliteLearningStore;
84
+ /** @deprecated Renamed to `SqliteLearningStore`; the old name is removed in the next major release. */
85
+ export type SqliteResidentLearningStore = SqliteLearningStore;
86
+ //# sourceMappingURL=deprecated.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"deprecated.d.ts","sourceRoot":"","sources":["../../src/learning/deprecated.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAA;AAC7C,OAAO,KAAK,KAAK,KAAK,MAAM,YAAY,CAAA;AACxC,OAAO,KAAK,KAAK,WAAW,MAAM,kBAAkB,CAAA;AACpD,OAAO,EAAE,iBAAiB,EAAE,eAAe,EAAE,MAAM,YAAY,CAAA;AAC/D,OAAO,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AAwB,yBAAmB,CAAA;AAExD,0GAA0G;AAC1G,eAAO,MAAM,8BAA8B,+BAAyB,CAAA;AAEpE,qHAAqH;AACrH,eAAO,MAAM,yCAAyC,0CAAoC,CAAA;AAE1F,uGAAuG;AACvG,eAAO,MAAM,2BAA2B,4BAAsB,CAAA;AAC9D,uGAAuG;AACvG,MAAM,MAAM,2BAA2B,GAAG,mBAAmB,CAAA"}
@@ -0,0 +1,22 @@
1
+ /**
2
+ * The learning module used to live under `manager/resident` and carried a
3
+ * `Resident` prefix. Learning is a feature of all of Namzu, not of residents,
4
+ * so every name now lives in `learning/` without the prefix. The old names stay
5
+ * as aliases of the new ones until the next major release.
6
+ */
7
+ import { runLearningCycle } from './cycle.js';
8
+ import { hashLearningSkill, projectLearning } from './skill.js';
9
+ import { SqliteLearningStore, runStoredLearningCycle, runStoredLearningFromObservations, } from './store.js';
10
+ /** @deprecated Renamed to `hashLearningSkill`; the old name is removed in the next major release. */
11
+ export const hashResidentSkill = hashLearningSkill;
12
+ /** @deprecated Renamed to `projectLearning`; the old name is removed in the next major release. */
13
+ export const projectResidentLearning = projectLearning;
14
+ /** @deprecated Renamed to `runLearningCycle`; the old name is removed in the next major release. */
15
+ export const runResidentLearningCycle = runLearningCycle;
16
+ /** @deprecated Renamed to `runStoredLearningCycle`; the old name is removed in the next major release. */
17
+ export const runStoredResidentLearningCycle = runStoredLearningCycle;
18
+ /** @deprecated Renamed to `runStoredLearningFromObservations`; the old name is removed in the next major release. */
19
+ export const runStoredResidentLearningFromObservations = runStoredLearningFromObservations;
20
+ /** @deprecated Renamed to `SqliteLearningStore`; the old name is removed in the next major release. */
21
+ export const SqliteResidentLearningStore = SqliteLearningStore;
22
+ //# sourceMappingURL=deprecated.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"deprecated.js","sourceRoot":"","sources":["../../src/learning/deprecated.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAA;AAG7C,OAAO,EAAE,iBAAiB,EAAE,eAAe,EAAE,MAAM,YAAY,CAAA;AAE/D,OAAO,EACN,mBAAmB,EACnB,sBAAsB,EACtB,iCAAiC,GACjC,MAAM,YAAY,CAAA;AA0FnB,qGAAqG;AACrG,MAAM,CAAC,MAAM,iBAAiB,GAAG,iBAAiB,CAAA;AAElD,mGAAmG;AACnG,MAAM,CAAC,MAAM,uBAAuB,GAAG,eAAe,CAAA;AAEtD,oGAAoG;AACpG,MAAM,CAAC,MAAM,wBAAwB,GAAG,gBAAgB,CAAA;AAExD,0GAA0G;AAC1G,MAAM,CAAC,MAAM,8BAA8B,GAAG,sBAAsB,CAAA;AAEpE,qHAAqH;AACrH,MAAM,CAAC,MAAM,yCAAyC,GAAG,iCAAiC,CAAA;AAE1F,uGAAuG;AACvG,MAAM,CAAC,MAAM,2BAA2B,GAAG,mBAAmB,CAAA"}
@@ -0,0 +1,35 @@
1
+ import type { ProjectId, TenantId } from '../types/ids/index.js';
2
+ import { type LearningExperienceEntry, type LearningExperienceInput, type LearningExperienceQuery } from './experience.js';
3
+ /** The schema version this store reads and writes. */
4
+ export declare const LEARNING_EXPERIENCE_STORE_VERSION = 1;
5
+ /** @experimental Where the library lives; a separate file from the observation journal. */
6
+ export interface SqliteLearningExperienceStoreOptions {
7
+ readonly databasePath: string;
8
+ readonly scope: {
9
+ readonly tenantId: TenantId;
10
+ readonly projectId: ProjectId;
11
+ readonly agentKey: string;
12
+ };
13
+ readonly readOnly?: boolean;
14
+ }
15
+ /**
16
+ * @experimental Durable experience library. Entries are immutable: recording
17
+ * the same cycle again with identical content returns the stored entry, with
18
+ * different content is refused. The artefact is stored whole.
19
+ */
20
+ export declare class SqliteLearningExperienceStore {
21
+ readonly databasePath: string;
22
+ private readonly scope;
23
+ private readonly readOnly;
24
+ constructor(options: SqliteLearningExperienceStoreOptions);
25
+ private use;
26
+ private scopeArgs;
27
+ private decode;
28
+ /** Record one finished cycle. Throws `LearningLeakError` when the entry carries evaluator-side material. */
29
+ record(input: LearningExperienceInput): Promise<LearningExperienceEntry>;
30
+ /** The ordinal the next entry will be recorded after; pass it as `beforeOrdinal` to read everything so far. */
31
+ nextOrdinal(): Promise<number>;
32
+ /** Entries of one domain and evaluator revision recorded before `beforeOrdinal`, newest first. */
33
+ retrieve(query: LearningExperienceQuery): Promise<LearningExperienceEntry[]>;
34
+ }
35
+ //# sourceMappingURL=experience-store.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"experience-store.d.ts","sourceRoot":"","sources":["../../src/learning/experience-store.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAA;AAEhE,OAAO,EACN,KAAK,uBAAuB,EAC5B,KAAK,uBAAuB,EAC5B,KAAK,uBAAuB,EAI5B,MAAM,iBAAiB,CAAA;AAexB,sDAAsD;AACtD,eAAO,MAAM,iCAAiC,IAAI,CAAA;AAElD,2FAA2F;AAC3F,MAAM,WAAW,oCAAoC;IACpD,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAA;IAC7B,QAAQ,CAAC,KAAK,EAAE;QACf,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAA;QAC3B,QAAQ,CAAC,SAAS,EAAE,SAAS,CAAA;QAC7B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAA;KACzB,CAAA;IACD,QAAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAA;CAC3B;AAID;;;;GAIG;AACH,qBAAa,6BAA6B;IACzC,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAA;IAC7B,OAAO,CAAC,QAAQ,CAAC,KAAK,CAA+C;IACrE,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAS;gBAEtB,OAAO,EAAE,oCAAoC;IAazD,OAAO,CAAC,GAAG;IA6CX,OAAO,CAAC,SAAS;IAIjB,OAAO,CAAC,MAAM;IAOd,4GAA4G;IACtG,MAAM,CAAC,KAAK,EAAE,uBAAuB,GAAG,OAAO,CAAC,uBAAuB,CAAC;IAkC9E,+GAA+G;IACzG,WAAW,IAAI,OAAO,CAAC,MAAM,CAAC;IAepC,kGAAkG;IAC5F,QAAQ,CAAC,KAAK,EAAE,uBAAuB,GAAG,OAAO,CAAC,uBAAuB,EAAE,CAAC;CAyBlF"}