@parcha/agentrun-serve 0.1.0-beta.50 → 0.1.0-beta.52

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 (232) hide show
  1. package/CHANGELOG.md +185 -0
  2. package/README.md +236 -30
  3. package/dist/adapters.js +1 -1
  4. package/dist/agent-delete.d.ts +13 -2
  5. package/dist/agent-delete.js +14 -5
  6. package/dist/agents-store.d.ts +5 -1
  7. package/dist/agents-store.js +17 -7
  8. package/dist/api-only.d.ts +6 -3
  9. package/dist/api-only.js +8 -5
  10. package/dist/archil-routes.d.ts +1 -0
  11. package/dist/archil-routes.js +28 -2
  12. package/dist/capacity.d.ts +50 -0
  13. package/dist/capacity.js +49 -0
  14. package/dist/cli-learning/claude-wire.d.ts +41 -0
  15. package/dist/cli-learning/claude-wire.js +258 -0
  16. package/dist/cli-learning/cli.d.ts +11 -0
  17. package/dist/cli-learning/cli.js +241 -0
  18. package/dist/cli-learning/codex-worktree.d.ts +10 -0
  19. package/dist/cli-learning/codex-worktree.js +119 -0
  20. package/dist/cli-learning/connections.d.ts +62 -0
  21. package/dist/cli-learning/connections.js +87 -0
  22. package/dist/cli-learning/entry.d.ts +1 -0
  23. package/dist/cli-learning/entry.js +4 -0
  24. package/dist/cli-learning/evidence.d.ts +78 -0
  25. package/dist/cli-learning/evidence.js +492 -0
  26. package/dist/cli-learning/hook.d.ts +33 -0
  27. package/dist/cli-learning/hook.js +544 -0
  28. package/dist/cli-learning/install.d.ts +33 -0
  29. package/dist/cli-learning/install.js +335 -0
  30. package/dist/cli-learning/observation-proof.d.ts +14 -0
  31. package/dist/cli-learning/observation-proof.js +10 -0
  32. package/dist/cli-learning/policy.d.ts +48 -0
  33. package/dist/cli-learning/policy.js +363 -0
  34. package/dist/cli-learning/schema.d.ts +16 -0
  35. package/dist/cli-learning/schema.js +27 -0
  36. package/dist/cli-learning/state.d.ts +23 -0
  37. package/dist/cli-learning/state.js +61 -0
  38. package/dist/cli.js +24 -2
  39. package/dist/computer-setting.d.ts +8 -0
  40. package/dist/computer-setting.js +11 -0
  41. package/dist/computers.d.ts +6 -2
  42. package/dist/computers.js +2 -2
  43. package/dist/console/assets/index-B-D0EM3j.js +733 -0
  44. package/dist/console/assets/{index-D0mr9wfZ.css → index-DlQepP2J.css} +1 -1
  45. package/dist/console/index.html +2 -2
  46. package/dist/email/email-faux.d.ts +3 -1
  47. package/dist/email/email-faux.js +3 -2
  48. package/dist/email/routes.js +22 -12
  49. package/dist/fal-price.d.ts +76 -0
  50. package/dist/fal-price.js +368 -0
  51. package/dist/harness-install.d.ts +6 -2
  52. package/dist/harness-install.js +40 -8
  53. package/dist/harness.d.ts +1 -1
  54. package/dist/harness.js +2 -2
  55. package/dist/learn/commit.d.ts +5 -0
  56. package/dist/learn/commit.js +4 -1
  57. package/dist/learn/compile.d.ts +13 -5
  58. package/dist/learn/compile.js +24 -7
  59. package/dist/learn/delete.d.ts +12 -6
  60. package/dist/learn/delete.js +17 -11
  61. package/dist/learn/folder.d.ts +11 -0
  62. package/dist/learn/folder.js +20 -3
  63. package/dist/learn/learning-of.d.ts +8 -0
  64. package/dist/learn/learning-of.js +8 -0
  65. package/dist/learn/learning.sh +14 -1
  66. package/dist/learn/promote.d.ts +51 -7
  67. package/dist/learn/promote.js +51 -8
  68. package/dist/learn/secrets.js +14 -3
  69. package/dist/learning-reset.d.ts +18 -0
  70. package/dist/learning-reset.js +115 -0
  71. package/dist/learning-routes.d.ts +1 -1
  72. package/dist/learning-words.d.ts +6 -1
  73. package/dist/learning-words.js +6 -1
  74. package/dist/learning.d.ts +8 -6
  75. package/dist/learning.js +5 -4
  76. package/dist/llms.txt +1 -0
  77. package/dist/mcp-gateway.d.ts +39 -2
  78. package/dist/mcp-gateway.js +41 -10
  79. package/dist/mcp-pin-first.js +3 -2
  80. package/dist/mcp-private-hosts.d.ts +24 -3
  81. package/dist/mcp-private-hosts.js +53 -3
  82. package/dist/mcp-servers-store.d.ts +1 -0
  83. package/dist/mcp-servers-store.js +2 -1
  84. package/dist/media-duration.d.ts +2 -0
  85. package/dist/media-duration.js +136 -0
  86. package/dist/model-gateway.d.ts +2 -0
  87. package/dist/model-gateway.js +3 -1
  88. package/dist/native/runtimes.d.ts +2 -0
  89. package/dist/native/runtimes.js +2 -0
  90. package/dist/observation/learning.d.ts +32 -0
  91. package/dist/observation/learning.js +66 -0
  92. package/dist/observation/observer.d.ts +8 -1
  93. package/dist/observation/observer.js +89 -9
  94. package/dist/observation/schema.js +12 -4
  95. package/dist/observation/usage-identity.d.ts +9 -0
  96. package/dist/observation/usage-identity.js +11 -0
  97. package/dist/openapi.js +133 -24
  98. package/dist/provider.d.ts +8 -0
  99. package/dist/provider.js +14 -2
  100. package/dist/refusal-words.d.ts +0 -3
  101. package/dist/refusal-words.js +0 -3
  102. package/dist/request-metadata.d.ts +20 -0
  103. package/dist/request-metadata.js +24 -0
  104. package/dist/run-launch.d.ts +27 -4
  105. package/dist/run-launch.js +18 -3
  106. package/dist/run-learning-served.d.ts +2 -2
  107. package/dist/run-usage.d.ts +48 -4
  108. package/dist/run-usage.js +156 -39
  109. package/dist/run-view.d.ts +2 -0
  110. package/dist/run-view.js +8 -7
  111. package/dist/runner/adapter-loop.d.ts +3 -1
  112. package/dist/runner/adapter-loop.js +41 -35
  113. package/dist/runner/adapter-run-spec.d.ts +1 -1
  114. package/dist/runner/adapter-run-spec.js +15 -15
  115. package/dist/runner/audit.d.ts +8 -3
  116. package/dist/runner/audit.js +21 -6
  117. package/dist/runner/beside.d.ts +13 -0
  118. package/dist/runner/beside.js +27 -8
  119. package/dist/runner/claim-secrets.d.ts +2 -1
  120. package/dist/runner/claim-secrets.js +5 -3
  121. package/dist/runner/cli-run-spec.d.ts +1 -1
  122. package/dist/runner/cli-run-spec.js +14 -13
  123. package/dist/runner/conformance/harness.js +4 -2
  124. package/dist/runner/disk-free.d.ts +44 -0
  125. package/dist/runner/disk-free.js +96 -0
  126. package/dist/runner/dispatch.js +4 -2
  127. package/dist/runner/feedback-round.d.ts +12 -8
  128. package/dist/runner/feedback-round.js +16 -30
  129. package/dist/runner/harness-loops.js +8 -3
  130. package/dist/runner/journal-kinds.d.ts +4 -1
  131. package/dist/runner/learning-end.d.ts +2 -1
  132. package/dist/runner/learning-end.js +51 -22
  133. package/dist/runner/main.d.ts +17 -6
  134. package/dist/runner/main.js +187 -45
  135. package/dist/runner/mcp-claim.js +1 -1
  136. package/dist/runner/mcp-run.d.ts +9 -0
  137. package/dist/runner/mcp-run.js +16 -1
  138. package/dist/runner/model-route.js +7 -4
  139. package/dist/runner/presence.d.ts +11 -2
  140. package/dist/runner/presence.js +31 -3
  141. package/dist/runner/promotion.d.ts +40 -21
  142. package/dist/runner/promotion.js +130 -59
  143. package/dist/runner/run-child-host.d.ts +12 -15
  144. package/dist/runner/run-child-host.js +52 -112
  145. package/dist/runner/run-errors.js +2 -0
  146. package/dist/runner/runner-check.d.ts +51 -0
  147. package/dist/runner/runner-check.js +206 -0
  148. package/dist/runner/runner-metrics.d.ts +19 -0
  149. package/dist/runner/runner-metrics.js +49 -0
  150. package/dist/runner/runner.d.ts +37 -0
  151. package/dist/runner/runner.js +58 -6
  152. package/dist/runner/sdk-loop.d.ts +2 -2
  153. package/dist/runner/sdk-loop.js +37 -25
  154. package/dist/runner/store-port.d.ts +3 -0
  155. package/dist/runner/workflow-spec.js +3 -3
  156. package/dist/runs-over-store.d.ts +13 -3
  157. package/dist/runs-over-store.js +71 -16
  158. package/dist/sdk/check.d.ts +6 -5
  159. package/dist/sdk/check.js +17 -16
  160. package/dist/sdk/runs.d.ts +22 -2
  161. package/dist/sdk/runs.js +167 -82
  162. package/dist/server.d.ts +3 -0
  163. package/dist/server.js +230 -43
  164. package/dist/skills/agentrun-serve/SKILL.md +52 -7
  165. package/dist/start-switches.js +2 -0
  166. package/dist/stats.d.ts +4 -0
  167. package/dist/stats.js +1 -1
  168. package/dist/store/agent-body.d.ts +16 -0
  169. package/dist/store/agent-body.js +20 -3
  170. package/dist/store/dialect.d.ts +2 -0
  171. package/dist/store/dialect.js +1 -0
  172. package/dist/store/index.d.ts +3 -3
  173. package/dist/store/index.js +2 -2
  174. package/dist/store/journal/storage.d.ts +2 -0
  175. package/dist/store/journal/storage.js +2 -1
  176. package/dist/store/postgres/connection.d.ts +5 -2
  177. package/dist/store/postgres/connection.js +19 -7
  178. package/dist/store/postgres/dialect.js +1 -0
  179. package/dist/store/postgres/migrate.d.ts +30 -0
  180. package/dist/store/postgres/migrate.js +72 -5
  181. package/dist/store/postgres/migration-lint.d.ts +8 -0
  182. package/dist/store/postgres/migration-lint.js +119 -0
  183. package/dist/store/postgres/migrations/0024_runner_capacity.sql +28 -0
  184. package/dist/store/postgres/migrations/0025_run_attempts.sql +27 -0
  185. package/dist/store/postgres/migrations/0026_run_disk.sql +23 -0
  186. package/dist/store/postgres/store.d.ts +8 -3
  187. package/dist/store/postgres/store.js +31 -11
  188. package/dist/store/schema.d.ts +32 -2
  189. package/dist/store/schema.js +74 -5
  190. package/dist/store/sqlite/run-launch.d.ts +31 -1
  191. package/dist/store/sqlite/run-launch.js +111 -2
  192. package/dist/store/sqlite/run-patch.d.ts +2 -1
  193. package/dist/store/sqlite/run-patch.js +4 -3
  194. package/dist/store/sqlite/store.d.ts +17 -0
  195. package/dist/store/sqlite/store.js +226 -37
  196. package/dist/store/store-schema.d.ts +34 -0
  197. package/dist/store/store-schema.js +125 -0
  198. package/dist/store/store.d.ts +120 -5
  199. package/dist/store/store.js +13 -0
  200. package/dist/store-reads/analytics.d.ts +3 -2
  201. package/dist/store-reads/analytics.js +20 -8
  202. package/dist/store-reads/learning.d.ts +12 -8
  203. package/dist/store-reads/learning.js +33 -24
  204. package/dist/store-reads/loop.d.ts +4 -3
  205. package/dist/store-reads/loop.js +7 -5
  206. package/dist/store-view.d.ts +4 -3
  207. package/dist/store-view.js +11 -7
  208. package/dist/template-eval.js +4 -4
  209. package/dist/templates.d.ts +6 -2
  210. package/dist/templates.js +7 -5
  211. package/dist/timeline/labels.js +1 -1
  212. package/dist/tool-gate.d.ts +4 -2
  213. package/dist/tools.js +1 -1
  214. package/dist/unified-usage.d.ts +24 -0
  215. package/dist/unified-usage.js +400 -0
  216. package/dist/uploads-archil.d.ts +100 -0
  217. package/dist/uploads-archil.js +431 -0
  218. package/dist/uploads.d.ts +52 -1
  219. package/dist/uploads.js +186 -108
  220. package/dist/validate.js +5 -1
  221. package/dist/web-save.d.ts +3 -0
  222. package/dist/web-save.js +17 -2
  223. package/dist/workspace/archil-disk.d.ts +6 -5
  224. package/dist/workspace/archil-disk.js +27 -12
  225. package/dist/workspace/archil-exec.js +1 -1
  226. package/dist/workspace/archil.js +4 -3
  227. package/dist/workspace/revision-skills.js +24 -11
  228. package/dist/workspace/synced-folder.d.ts +3 -3
  229. package/dist/workspace/synced-folder.js +7 -6
  230. package/package.json +10 -10
  231. package/skills/agentrun-serve/SKILL.md +52 -7
  232. package/dist/console/assets/index-D7G6o-1E.js +0 -720
@@ -33,16 +33,29 @@ export async function layOwnSkills(work, skills, options = {}) {
33
33
  files.push([brought[0], kind.text]);
34
34
  if (!files.length)
35
35
  return brought;
36
- const there = await work.list(RUN_SKILLS_DIR).then((entries) => new Set(entries.map((entry) => entry.name)), (error) => {
37
- if (error instanceof WorkspaceError && error.code === "NOT_FOUND")
38
- return new Set();
39
- throw error;
40
- });
41
- const missing = files.filter(([path]) => !there.has(relativeSegments(path)[0]));
42
- if (!missing.length)
43
- return brought;
44
- await work.mkdir(RUN_SKILLS_DIR);
45
- for (const [path, text] of missing)
46
- await work.write(`${RUN_SKILLS_DIR}/${path}`, text);
36
+ try {
37
+ // What is there is asked with stat, which answers a fresh folder's missing .agents/skills/ with undefined: no error
38
+ // is read as "not there", so no check of an error's class decides it (a run's own process gets its errors over its
39
+ // channel, where beta.50 lost WorkspaceError's class and failed every new run that had a skill).
40
+ const there = (await work.stat(RUN_SKILLS_DIR)) === undefined ? new Set() : new Set((await work.list(RUN_SKILLS_DIR)).map((entry) => entry.name));
41
+ const missing = files.filter(([path]) => !there.has(relativeSegments(path)[0]));
42
+ if (!missing.length)
43
+ return brought;
44
+ await work.mkdir(RUN_SKILLS_DIR);
45
+ for (const [path, text] of missing)
46
+ await work.write(`${RUN_SKILLS_DIR}/${path}`, text);
47
+ }
48
+ catch (error) {
49
+ throw laidFailed(error);
50
+ }
47
51
  return brought;
48
52
  }
53
+ /** A lay's failure, saying it was the lay of the run's skills: a WorkspaceError keeps its code, its path and its words
54
+ * (the backend's, an Archil key and Archil's own included) after that. */
55
+ function laidFailed(error) {
56
+ const code = error?.code;
57
+ if (!(error instanceof Error) || error.name !== "WorkspaceError" || typeof code !== "string")
58
+ return error;
59
+ const path = error.path;
60
+ return new WorkspaceError(code, `laying the run's skills in ${RUN_SKILLS_DIR}/: ${error.message}`, { ...(typeof path === "string" ? { path } : {}), cause: error });
61
+ }
@@ -38,9 +38,9 @@ export type HeldFolder = {
38
38
  };
39
39
  /**
40
40
  * The stored folder pushed into the computer's empty /workspace through `client` (the computer's own, under no sync),
41
- * one streaming tar, then the computer's listing read as the manifest: the sync the claim holds from then on (the
42
- * caller sets HeldFolder.folder to it), at the claim's start and for a new sandbox in place of a lost one, whose fresh
43
- * mtimes the old manifest would read as every file changed. The links an exec made on the disk (linkObjects), now links
41
+ * one streaming tar, each file at PUSHED_MTIME, then the computer's listing read as the manifest: the sync the claim
42
+ * holds from then on (the caller sets HeldFolder.folder to it), at the claim's start and for a new sandbox in place of a
43
+ * lost one, whose files the old manifest does not describe. The links an exec made on the disk (linkObjects), now links
44
44
  * in the computer, are then removed from the disk. Throws in words where the push, the listing or a remove fails.
45
45
  */
46
46
  export declare function holdSynced(store: FolderStore, client: ComputerClient, stored: StoredFolder, signal?: AbortSignal): Promise<FolderSync>;
@@ -23,7 +23,7 @@
23
23
  // the disk (storedFolder, holdSynced).
24
24
  // - Every write of a claim's goes through fencedStore: once a later claim has taken the run (the run's epoch and runner
25
25
  // say so, held or not), it is refused, never sent.
26
- import { fail, folderPathProblem, FolderSync, ok, pushTar, SYNC_MAX_BYTES, SYNC_MAX_ENTRIES, tarStream, WORKSPACE } from "@parcha/agentrun-computer";
26
+ import { fail, folderPathProblem, FolderSync, ok, PUSHED_MTIME, pushTar, SYNC_MAX_BYTES, SYNC_MAX_ENTRIES, tarStream, WORKSPACE } from "@parcha/agentrun-computer";
27
27
  /** How many files a push reads ahead of the one the tar is writing. */
28
28
  const AHEAD = 4;
29
29
  const FILE_MODE = 0o644;
@@ -66,7 +66,8 @@ const quiet = (promise) => {
66
66
  return promise;
67
67
  };
68
68
  /** The folder's entries as tar entries, by path (a directory before what is in it), then its links: each file read
69
- * AHEAD ahead of the one written, so what is held is those few, never the folder. */
69
+ * AHEAD ahead of the one written, so what is held is those few, never the folder; each file at PUSHED_MTIME, which
70
+ * the baseline after the push needs. */
70
71
  async function* tarEntries(store, { entries, meta }) {
71
72
  const modeOf = (path, fallback) => (Object.hasOwn(meta.modes, path) ? meta.modes[path] : fallback);
72
73
  const sorted = [...entries].sort(byPath);
@@ -85,16 +86,16 @@ async function* tarEntries(store, { entries, meta }) {
85
86
  }
86
87
  const body = await reads.shift();
87
88
  ahead();
88
- yield { name: entry.path, type: "file", mode: modeOf(entry.path, FILE_MODE), body };
89
+ yield { name: entry.path, type: "file", mode: modeOf(entry.path, FILE_MODE), body, mtime: PUSHED_MTIME };
89
90
  }
90
91
  for (const [path, target] of Object.entries(meta.links))
91
92
  yield { name: path, type: "symlink", mode: 0o777, link: target };
92
93
  }
93
94
  /**
94
95
  * The stored folder pushed into the computer's empty /workspace through `client` (the computer's own, under no sync),
95
- * one streaming tar, then the computer's listing read as the manifest: the sync the claim holds from then on (the
96
- * caller sets HeldFolder.folder to it), at the claim's start and for a new sandbox in place of a lost one, whose fresh
97
- * mtimes the old manifest would read as every file changed. The links an exec made on the disk (linkObjects), now links
96
+ * one streaming tar, each file at PUSHED_MTIME, then the computer's listing read as the manifest: the sync the claim
97
+ * holds from then on (the caller sets HeldFolder.folder to it), at the claim's start and for a new sandbox in place of a
98
+ * lost one, whose files the old manifest does not describe. The links an exec made on the disk (linkObjects), now links
98
99
  * in the computer, are then removed from the disk. Throws in words where the push, the listing or a remove fails.
99
100
  */
100
101
  export async function holdSynced(store, client, stored, signal) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@parcha/agentrun-serve",
3
- "version": "0.1.0-beta.50",
3
+ "version": "0.1.0-beta.52",
4
4
  "description": "The AgentRun server: the /v2 API and console over one store, with runners that run your agents; the deployable process of the AgentRun platform.",
5
5
  "keywords": [
6
6
  "agentrun",
@@ -62,15 +62,15 @@
62
62
  "@earendil-works/pi-coding-agent": "1.5.2",
63
63
  "@modelcontextprotocol/client": "2.4.0",
64
64
  "@modelcontextprotocol/server": "2.4.0",
65
- "@parcha/agentrun-computer": "0.1.0-beta.50",
66
- "@parcha/agentrun-decisions": "0.1.0-beta.50",
67
- "@parcha/agentrun-dsl": "0.1.0-beta.50",
68
- "@parcha/agentrun-harness-acp": "0.1.0-beta.50",
69
- "@parcha/agentrun-harness-claude": "0.1.0-beta.50",
70
- "@parcha/agentrun-harness-codex": "0.1.0-beta.50",
71
- "@parcha/agentrun-jev": "0.1.0-beta.50",
72
- "@parcha/agentrun-kernel": "0.1.0-beta.50",
73
- "@parcha/pi-browser": "0.1.0-beta.50",
65
+ "@parcha/agentrun-computer": "0.1.0-beta.52",
66
+ "@parcha/agentrun-decisions": "0.1.0-beta.52",
67
+ "@parcha/agentrun-dsl": "0.1.0-beta.52",
68
+ "@parcha/agentrun-harness-acp": "0.1.0-beta.52",
69
+ "@parcha/agentrun-harness-claude": "0.1.0-beta.52",
70
+ "@parcha/agentrun-harness-codex": "0.1.0-beta.52",
71
+ "@parcha/agentrun-jev": "0.1.0-beta.52",
72
+ "@parcha/agentrun-kernel": "0.1.0-beta.52",
73
+ "@parcha/pi-browser": "0.1.0-beta.52",
74
74
  "@secretlint/core": "13.1.0",
75
75
  "@secretlint/profiler": "13.1.0",
76
76
  "@secretlint/secretlint-rule-preset-recommend": "13.1.0",
@@ -30,7 +30,7 @@ Inspect configured models before asking for a key. For an existing setup, follow
30
30
  and history import need no destination model key. Live jobs use the source runtime's existing sign-in.
31
31
 
32
32
  Finish with the first requested run's result and console link, or imported history and counts. Offer optional
33
- self-improvement separately, and verify accepted notes or skills in a fresh later run when requested.
33
+ self-improvement separately, and verify owner corrections in a fresh later run when requested.
34
34
 
35
35
  ## Connect agent
36
36
 
@@ -108,11 +108,56 @@ reported model/harness and activity/usage. CLI `configured` or `delivery_state:
108
108
  delivery. Observed sessions are read-only: idle is not proof of completion, and missing telemetry is not proof of
109
109
  an agent failure. No prompts, transcripts or tool contents are uploaded through this metadata path.
110
110
 
111
- If the user also wants self-improvement for application-owned jobs, follow the supported backend SDK learning
111
+ For independently started **Codex CLI or Claude Code** sessions, use the existing CLI learning path below.
112
+ For SDK application-owned jobs, follow the supported backend SDK learning
112
113
  integration and verify accepted-revision delivery in a fresh run. Observation alone cannot enable it. The current
113
114
  Claude Agent SDK and Codex SDK wrappers are TypeScript integrations; do not claim a Python SDK backend is wrapped
114
115
  by setting OTEL variables. Do not fabricate a runnable native agent or use a copied prompt as proof.
115
116
 
117
+ ### Learning in existing CLI sessions
118
+
119
+ For a connected-session card handoff, read its exact `GET /v2/observations?session_id=...` record.
120
+ On the source machine, resolve `external_session_id` through the collector's private identity map to the
121
+ native session, then inspect that session's actual project through its harness. Never print the identity
122
+ map or credentials, and never select a project from a display name or basename. A verified
123
+ `learning.agent_id` links to the existing shared project/runtime learning profile; reuse it. If the
124
+ source is unavailable, ask the user to open the original session. Run and Edit continue or change that
125
+ original setup, not a managed run or a replacement definition. Delegated children cannot enable independent
126
+ hook learning. Only offer enrollment for the selected root session's project, with its shared scope clear.
127
+
128
+ When requested, use the matching build's `learning connect` on the source machine. This path keeps the
129
+ original CLI in control of task execution and does not require an SDK wrapper. The initial integration
130
+ requires AgentRun on that same machine; identify its loopback port and actual data directory. Do not
131
+ silently replace a remote destination with a new local server. Enrollment uses the local owner credential
132
+ privately and leaves a scoped connection credential for hooks, never an owner key in project files.
133
+
134
+ ```sh
135
+ agentrun-serve learning connect --project /absolute/project --runtime codex \
136
+ --url http://127.0.0.1:7340 --data /absolute/server-data
137
+ ```
138
+
139
+ Use `claude-code` for Claude Code. Scope enrollment to the selected project/runtime. Installation merges
140
+ source hooks without replacing other hooks or changing tools, permissions, instructions or sign-in.
141
+ Codex linked worktrees append exact project-scoped hooks to the corresponding main-checkout
142
+ `.codex/hooks.json`, following native discovery. They keep separate local receipts and a local `.codex`
143
+ directory; disconnect preserves surviving native hook positions. If `learning status` reports `migration-required`,
144
+ rerun the same connect command to migrate unchanged owned hooks without replacing the connection.
145
+ Verify `/hooks`; Codex must trust the current declaration. Project configuration does not hot reload:
146
+ open a new session or close and resume it after the current task finishes. Reloading user settings alone
147
+ does not reload these project hooks. Do not interrupt the user's running task to activate them.
148
+ Do not claim merely writing a configuration file activated a running session. Begin on the next complete
149
+ prompt after activation, without importing earlier conversations or learning from an in-flight turn.
150
+
151
+ The prompt hook supplies pinned owner corrections; completion hooks record bounded role-preserving evidence
152
+ and reported usage. Source dialogue never becomes a standing correction automatically. Source hooks do not
153
+ provide a workflow execution bridge or make extra native reflection calls. Missing policy, truncated evidence
154
+ and cancellation stay explicit. This is not metadata-only observation.
155
+
156
+ Use `learning status` with the same project/runtime/data arguments and open the returned agent's Learning
157
+ tab. Save a correction explicitly, then verify an actual completed source run and its delivery and use
158
+ on a later prompt. Report incomplete evidence accurately. Learning Off controls guidance for future prompts;
159
+ `learning disconnect` revokes enrollment and removes only its installed hooks, retaining prior history.
160
+
116
161
  ### Live connection on this server
117
162
 
118
163
  Verify that the coding agent, source project and AgentRun server are on the same machine. A browser's loopback
@@ -210,11 +255,11 @@ target; duplicates are skipped. The worker does not continuously upload historic
210
255
 
211
256
  ### Optional self-improvement
212
257
 
213
- When requested, verify the imported agent and enable its existing **Self-improving** control. Notes and skills are
214
- additive, pinned to a learning revision for each run. Reflection resumes the exact task session with tools disabled;
215
- the existing checker, grader and merge rules decide what becomes active. Risky proposals await owner review in
216
- Learning Dojo; a connector cannot approve them. Reflection and grading add model usage. Off means later runs
217
- receive and create no AgentRun learning. Do not start a paid run unless authorized, and do not promise enforcement
258
+ When requested, verify the imported agent and enable its existing **Self-improving** control. Owner corrections
259
+ are additive, pinned to a learning revision for each run. Eligible jobs compile into workflow drafts by resuming
260
+ the exact task session with tools disabled; checks and a dry run decide whether to keep a draft. Compilation
261
+ adds model usage. Learned workflows do not serve native runs in this release. Off means later runs receive
262
+ and create no AgentRun learning. Do not start a paid run unless authorized, and do not promise enforcement
218
263
  of native dollar caps, interactive approvals, learned workflows or unsupported desktop tools.
219
264
 
220
265
  ### Historical import into a local store