@haaaiawd/second-nature 0.1.43 → 0.1.50

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 (958) hide show
  1. package/HEARTBEAT.md +44 -0
  2. package/LICENSE +176 -0
  3. package/README.md +136 -0
  4. package/README.zh-CN.md +120 -0
  5. package/SKILL.md +320 -22
  6. package/dist/data/observability.db +0 -0
  7. package/dist/data/state.db +0 -0
  8. package/dist/plugin/index.d.ts +31 -0
  9. package/dist/plugin/workspace-ops-bridge.d.ts +15 -0
  10. package/dist/scripts/build-plugin-package.d.ts +12 -0
  11. package/dist/scripts/build-plugin-package.js +220 -0
  12. package/dist/scripts/build-plugin-runtime.d.ts +10 -0
  13. package/dist/scripts/build-plugin-runtime.js +198 -0
  14. package/dist/scripts/packaging-feasibility-poc.js +127 -0
  15. package/dist/scripts/plugin-smoke-check.js +124 -0
  16. package/dist/src/cli/action-bridge.d.ts +11 -0
  17. package/dist/src/cli/index.d.ts +65 -0
  18. package/dist/src/cli/ops/heartbeat-surface.d.ts +84 -0
  19. package/dist/src/cli/ops/heartbeat-surface.js +100 -0
  20. package/dist/src/cli/ops/ops-router.js +1482 -0
  21. package/dist/src/cli/ops/workspace-heartbeat-runner.d.ts +85 -0
  22. package/dist/src/cli/ops/workspace-heartbeat-runner.js +242 -0
  23. package/dist/src/core/second-nature/heartbeat/goal-lifecycle-policy.d.ts +24 -0
  24. package/dist/src/core/second-nature/heartbeat/goal-lifecycle-policy.js +61 -0
  25. package/dist/src/core/second-nature/heartbeat/heartbeat-loop.d.ts +97 -0
  26. package/dist/src/core/second-nature/heartbeat/heartbeat-loop.js +397 -0
  27. package/dist/src/core/second-nature/orchestrator/platform-capability-router.js +149 -0
  28. package/dist/src/storage/snapshots/types.js +1 -0
  29. package/dist/src/storage/user-interest/types.js +1 -0
  30. package/dist/tests/integration/cli/cli-ops-surface.test.d.ts +1 -0
  31. package/dist/tests/integration/cli/cli-ops-surface.test.js +380 -0
  32. package/dist/tests/integration/cli/heartbeat-surface-workspace.test.d.ts +1 -0
  33. package/dist/tests/integration/cli/heartbeat-surface-workspace.test.js +61 -0
  34. package/dist/tests/integration/cli/host-capability-probe.test.d.ts +1 -0
  35. package/dist/tests/integration/cli/host-capability-probe.test.js +37 -0
  36. package/dist/tests/integration/cli/host-smoke-heartbeat-tool.test.d.ts +1 -0
  37. package/dist/tests/integration/cli/host-smoke-heartbeat-tool.test.js +34 -0
  38. package/dist/tests/integration/cli/plugin-packaging-walkthrough.test.d.ts +1 -0
  39. package/dist/tests/integration/cli/plugin-packaging-walkthrough.test.js +79 -0
  40. package/dist/tests/integration/cli/plugin-runtime-registration.test.d.ts +1 -0
  41. package/dist/tests/integration/cli/plugin-runtime-registration.test.js +285 -0
  42. package/dist/tests/integration/cli/plugin-workspace-ops-bridge.test.d.ts +1 -0
  43. package/dist/tests/integration/cli/plugin-workspace-ops-bridge.test.js +487 -0
  44. package/dist/tests/integration/cli/t1-2-1-explain-read-models.test.d.ts +1 -0
  45. package/dist/tests/integration/cli/t1-2-1-explain-read-models.test.js +58 -0
  46. package/dist/tests/integration/cli/t1-2-1-narrative-command.test.d.ts +1 -0
  47. package/dist/tests/integration/cli/t1-2-1-narrative-command.test.js +194 -0
  48. package/dist/tests/integration/cli/t1-2-2-dream-recent.test.d.ts +1 -0
  49. package/dist/tests/integration/cli/t1-2-2-dream-recent.test.js +100 -0
  50. package/dist/tests/integration/cli/t1-2-3-status-observability-writeback.test.d.ts +1 -0
  51. package/dist/tests/integration/cli/t1-2-3-status-observability-writeback.test.js +71 -0
  52. package/dist/tests/integration/cli/t1-2-4-quiet-report-read-canonical.test.d.ts +1 -0
  53. package/dist/tests/integration/cli/t1-2-4-quiet-report-read-canonical.test.js +206 -0
  54. package/dist/tests/integration/cli/t1-2-5-cycle-recent.test.d.ts +1 -0
  55. package/dist/tests/integration/cli/t1-2-5-cycle-recent.test.js +156 -0
  56. package/dist/tests/integration/cli/t1-2-5-status-delivery-posture-audit-store.test.d.ts +1 -0
  57. package/dist/tests/integration/cli/t1-2-5-status-delivery-posture-audit-store.test.js +95 -0
  58. package/dist/tests/integration/cli/t1-2-6-policy-show-non-shell.test.d.ts +1 -0
  59. package/dist/tests/integration/cli/t1-2-6-policy-show-non-shell.test.js +74 -0
  60. package/dist/tests/integration/cli/t1-2-6-status-aggregate.test.d.ts +1 -0
  61. package/dist/tests/integration/cli/t1-2-6-status-aggregate.test.js +223 -0
  62. package/dist/tests/integration/cli/t1-2-7-audit-command-minimal-closure.test.d.ts +1 -0
  63. package/dist/tests/integration/cli/t1-2-7-audit-command-minimal-closure.test.js +101 -0
  64. package/dist/tests/integration/cli/t1-2-8-capability-probe-ops-surface.test.d.ts +1 -0
  65. package/dist/tests/integration/cli/t1-2-8-capability-probe-ops-surface.test.js +74 -0
  66. package/dist/tests/integration/cli/t1-2-9-decision-denied-not-degraded.test.d.ts +1 -0
  67. package/dist/tests/integration/cli/t1-2-9-decision-denied-not-degraded.test.js +79 -0
  68. package/dist/tests/integration/cli/t1-4-1-runtime-secret-bootstrap.test.d.ts +1 -0
  69. package/dist/tests/integration/cli/t1-4-1-runtime-secret-bootstrap.test.js +139 -0
  70. package/dist/tests/integration/cli/t1-4-2-activation-ux-contract.test.d.ts +1 -0
  71. package/dist/tests/integration/cli/t1-4-2-activation-ux-contract.test.js +143 -0
  72. package/dist/tests/integration/cli/t2-2-2-snapshot-life-evidence.test.d.ts +1 -0
  73. package/dist/tests/integration/cli/t2-2-2-snapshot-life-evidence.test.js +116 -0
  74. package/dist/tests/integration/cli/t3-3-2-near-real-smoke-cli-bridge.test.d.ts +1 -0
  75. package/dist/tests/integration/cli/t3-3-2-near-real-smoke-cli-bridge.test.js +69 -0
  76. package/dist/tests/integration/connectors/connector-base.test.d.ts +1 -0
  77. package/dist/tests/integration/connectors/connector-base.test.js +211 -0
  78. package/dist/tests/integration/connectors/connector-executor-adapter-honest-failure.test.d.ts +1 -0
  79. package/dist/tests/integration/connectors/connector-executor-adapter-honest-failure.test.js +311 -0
  80. package/dist/tests/integration/connectors/credential-optional-regression.test.d.ts +1 -0
  81. package/dist/tests/integration/connectors/credential-optional-regression.test.js +117 -0
  82. package/dist/tests/integration/connectors/declarative-http-runner.test.d.ts +7 -0
  83. package/dist/tests/integration/connectors/declarative-http-runner.test.js +229 -0
  84. package/dist/tests/integration/connectors/evomap-secret-port.test.d.ts +1 -0
  85. package/dist/tests/integration/connectors/evomap-secret-port.test.js +83 -0
  86. package/dist/tests/integration/connectors/life-evidence-chain.test.d.ts +1 -0
  87. package/dist/tests/integration/connectors/life-evidence-chain.test.js +188 -0
  88. package/dist/tests/integration/connectors/moltbook-client.test.d.ts +1 -0
  89. package/dist/tests/integration/connectors/moltbook-client.test.js +274 -0
  90. package/dist/tests/integration/connectors/moltbook-mock-runner.test.d.ts +7 -0
  91. package/dist/tests/integration/connectors/moltbook-mock-runner.test.js +108 -0
  92. package/dist/tests/integration/connectors/near-real-connector-smoke.test.d.ts +1 -0
  93. package/dist/tests/integration/connectors/near-real-connector-smoke.test.js +38 -0
  94. package/dist/tests/integration/connectors/platform-adapters.test.d.ts +1 -0
  95. package/dist/tests/integration/connectors/platform-adapters.test.js +189 -0
  96. package/dist/tests/integration/connectors/policy-layer.test.d.ts +1 -0
  97. package/dist/tests/integration/connectors/policy-layer.test.js +249 -0
  98. package/dist/tests/integration/connectors/scriptable-node-e2e.test.d.ts +1 -0
  99. package/dist/tests/integration/connectors/scriptable-node-e2e.test.js +228 -0
  100. package/dist/tests/integration/connectors/t3-3-1-real-connector-evidence.test.d.ts +1 -0
  101. package/dist/tests/integration/connectors/t3-3-1-real-connector-evidence.test.js +171 -0
  102. package/dist/tests/integration/control-plane/_helpers/decision-cycle-harness.d.ts +40 -0
  103. package/dist/tests/integration/control-plane/_helpers/decision-cycle-harness.js +116 -0
  104. package/dist/tests/integration/control-plane/decision-loop-validation.test.d.ts +1 -0
  105. package/dist/tests/integration/control-plane/decision-loop-validation.test.js +319 -0
  106. package/dist/tests/integration/control-plane/delivery-failed-fallback.test.d.ts +1 -0
  107. package/dist/tests/integration/control-plane/delivery-failed-fallback.test.js +118 -0
  108. package/dist/tests/integration/control-plane/dream-projection-heartbeat.test.d.ts +1 -0
  109. package/dist/tests/integration/control-plane/dream-projection-heartbeat.test.js +109 -0
  110. package/dist/tests/integration/control-plane/effect-dispatcher.test.d.ts +1 -0
  111. package/dist/tests/integration/control-plane/effect-dispatcher.test.js +157 -0
  112. package/dist/tests/integration/control-plane/guidance-request.test.d.ts +1 -0
  113. package/dist/tests/integration/control-plane/guidance-request.test.js +63 -0
  114. package/dist/tests/integration/control-plane/heartbeat-executor.test.d.ts +1 -0
  115. package/dist/tests/integration/control-plane/heartbeat-executor.test.js +363 -0
  116. package/dist/tests/integration/control-plane/heartbeat-loop.test.d.ts +1 -0
  117. package/dist/tests/integration/control-plane/heartbeat-loop.test.js +190 -0
  118. package/dist/tests/integration/control-plane/heartbeat-quiet-orchestration.test.d.ts +1 -0
  119. package/dist/tests/integration/control-plane/heartbeat-quiet-orchestration.test.js +133 -0
  120. package/dist/tests/integration/control-plane/heartbeat-spine-integration.test.d.ts +1 -0
  121. package/dist/tests/integration/control-plane/heartbeat-spine-integration.test.js +342 -0
  122. package/dist/tests/integration/control-plane/heartbeat-spine.test.d.ts +1 -0
  123. package/dist/tests/integration/control-plane/heartbeat-spine.test.js +216 -0
  124. package/dist/tests/integration/control-plane/int-s3-outreach-delivery-quiet-closure.test.d.ts +1 -0
  125. package/dist/tests/integration/control-plane/int-s3-outreach-delivery-quiet-closure.test.js +241 -0
  126. package/dist/tests/integration/control-plane/outreach-resume.test.d.ts +1 -0
  127. package/dist/tests/integration/control-plane/outreach-resume.test.js +158 -0
  128. package/dist/tests/integration/control-plane/outreach-style.test.d.ts +1 -0
  129. package/dist/tests/integration/control-plane/outreach-style.test.js +46 -0
  130. package/dist/tests/integration/control-plane/quiet-reflection.test.d.ts +1 -0
  131. package/dist/tests/integration/control-plane/quiet-reflection.test.js +73 -0
  132. package/dist/tests/integration/control-plane/rhythm-intent-guard.test.d.ts +1 -0
  133. package/dist/tests/integration/control-plane/rhythm-intent-guard.test.js +99 -0
  134. package/dist/tests/integration/control-plane/run-heartbeat-cycle.test.d.ts +1 -0
  135. package/dist/tests/integration/control-plane/run-heartbeat-cycle.test.js +80 -0
  136. package/dist/tests/integration/control-plane/t2-3-1-outreach-v6.test.d.ts +1 -0
  137. package/dist/tests/integration/control-plane/t2-3-1-outreach-v6.test.js +208 -0
  138. package/dist/tests/integration/control-plane/t2-4-1-heartbeat-platform-intent.test.d.ts +1 -0
  139. package/dist/tests/integration/control-plane/t2-4-1-heartbeat-platform-intent.test.js +156 -0
  140. package/dist/tests/integration/control-plane/t2-4-2-source-backed-outreach-loop.test.d.ts +1 -0
  141. package/dist/tests/integration/control-plane/t2-4-2-source-backed-outreach-loop.test.js +188 -0
  142. package/dist/tests/integration/control-plane/v7c-evidence-body-feedback.test.d.ts +11 -0
  143. package/dist/tests/integration/control-plane/v7c-evidence-body-feedback.test.js +213 -0
  144. package/dist/tests/integration/control-plane/v7c-heartbeat-unlock-e2e.test.d.ts +9 -0
  145. package/dist/tests/integration/control-plane/v7c-heartbeat-unlock-e2e.test.js +134 -0
  146. package/dist/tests/integration/dream/quiet-dream-trigger.test.d.ts +1 -0
  147. package/dist/tests/integration/dream/quiet-dream-trigger.test.js +86 -0
  148. package/dist/tests/integration/dream/t7-1-1-dream-pipeline.test.d.ts +1 -0
  149. package/dist/tests/integration/dream/t7-1-1-dream-pipeline.test.js +378 -0
  150. package/dist/tests/integration/dream/t7-1-2-dream-scheduler.test.d.ts +1 -0
  151. package/dist/tests/integration/dream/t7-1-2-dream-scheduler.test.js +124 -0
  152. package/dist/tests/integration/dream/v7c-rhythm-loop.test.d.ts +10 -0
  153. package/dist/tests/integration/dream/v7c-rhythm-loop.test.js +185 -0
  154. package/dist/tests/integration/guidance/assembler-and-fallback.test.d.ts +1 -0
  155. package/dist/tests/integration/guidance/assembler-and-fallback.test.js +86 -0
  156. package/dist/tests/integration/guidance/outreach-draft-contract.test.d.ts +1 -0
  157. package/dist/tests/integration/guidance/outreach-draft-contract.test.js +106 -0
  158. package/dist/tests/integration/guidance/persona-selection.test.d.ts +1 -0
  159. package/dist/tests/integration/guidance/persona-selection.test.js +70 -0
  160. package/dist/tests/integration/guidance/template-review.test.d.ts +1 -0
  161. package/dist/tests/integration/guidance/template-review.test.js +26 -0
  162. package/dist/tests/integration/guidance/user-reply-continuity.test.d.ts +1 -0
  163. package/dist/tests/integration/guidance/user-reply-continuity.test.js +96 -0
  164. package/dist/tests/integration/guidance/v7c-guidance-chain.test.d.ts +1 -0
  165. package/dist/tests/integration/guidance/v7c-guidance-chain.test.js +190 -0
  166. package/dist/tests/integration/guidance/v7c-guidance-semantics.test.d.ts +1 -0
  167. package/dist/tests/integration/guidance/v7c-guidance-semantics.test.js +146 -0
  168. package/dist/tests/integration/observability/digest-delivery.test.d.ts +14 -0
  169. package/dist/tests/integration/observability/digest-delivery.test.js +160 -0
  170. package/dist/tests/integration/observability/evidence-query-engine.test.d.ts +1 -0
  171. package/dist/tests/integration/observability/evidence-query-engine.test.js +219 -0
  172. package/dist/tests/integration/observability/explain-query-export.test.d.ts +1 -0
  173. package/dist/tests/integration/observability/explain-query-export.test.js +92 -0
  174. package/dist/tests/integration/observability/guidance-audit.test.d.ts +1 -0
  175. package/dist/tests/integration/observability/guidance-audit.test.js +55 -0
  176. package/dist/tests/integration/observability/heartbeat-decision-record.test.d.ts +1 -0
  177. package/dist/tests/integration/observability/heartbeat-decision-record.test.js +223 -0
  178. package/dist/tests/integration/observability/heartbeat-narrative-trace.test.d.ts +1 -0
  179. package/dist/tests/integration/observability/heartbeat-narrative-trace.test.js +230 -0
  180. package/dist/tests/integration/observability/lived-experience-audit-chain.test.d.ts +1 -0
  181. package/dist/tests/integration/observability/lived-experience-audit-chain.test.js +43 -0
  182. package/dist/tests/integration/observability/observability-gates.test.d.ts +1 -0
  183. package/dist/tests/integration/observability/observability-gates.test.js +224 -0
  184. package/dist/tests/integration/observability/observability-retention-cleanup.test.d.ts +1 -0
  185. package/dist/tests/integration/observability/observability-retention-cleanup.test.js +94 -0
  186. package/dist/tests/integration/observability/observability-services.test.d.ts +1 -0
  187. package/dist/tests/integration/observability/observability-services.test.js +219 -0
  188. package/dist/tests/integration/observability/projections.test.d.ts +1 -0
  189. package/dist/tests/integration/observability/projections.test.js +36 -0
  190. package/dist/tests/integration/observability/t5-1-1-dream-trace-audit.test.d.ts +1 -0
  191. package/dist/tests/integration/observability/t5-1-1-dream-trace-audit.test.js +115 -0
  192. package/dist/tests/integration/plugin/plugin-registration.test.d.ts +16 -0
  193. package/dist/tests/integration/plugin/plugin-registration.test.js +151 -0
  194. package/dist/tests/integration/runtime-ops/commands.test.d.ts +16 -0
  195. package/dist/tests/integration/runtime-ops/commands.test.js +662 -0
  196. package/dist/tests/integration/s3-exit/int-s3-body-heartbeat.test.d.ts +15 -0
  197. package/dist/tests/integration/s3-exit/int-s3-body-heartbeat.test.js +462 -0
  198. package/dist/tests/integration/s5-exit/int-s5-observability.test.d.ts +17 -0
  199. package/dist/tests/integration/s5-exit/int-s5-observability.test.js +402 -0
  200. package/dist/tests/integration/state/t4-2-1-owner-reply-relationship-loop.test.d.ts +1 -0
  201. package/dist/tests/integration/state/t4-2-1-owner-reply-relationship-loop.test.js +132 -0
  202. package/dist/tests/integration/state/v7c-identity-goal-hygiene.test.d.ts +9 -0
  203. package/dist/tests/integration/state/v7c-identity-goal-hygiene.test.js +240 -0
  204. package/dist/tests/integration/storage/packaged-runtime-smoke.test.d.ts +1 -0
  205. package/dist/tests/integration/storage/packaged-runtime-smoke.test.js +17 -0
  206. package/dist/tests/integration/storage/persona-candidate-loader.test.d.ts +1 -0
  207. package/dist/tests/integration/storage/persona-candidate-loader.test.js +23 -0
  208. package/dist/tests/integration/storage/quiet-artifact-writer.test.d.ts +1 -0
  209. package/dist/tests/integration/storage/quiet-artifact-writer.test.js +66 -0
  210. package/dist/tests/integration/storage/repair-and-backup.test.d.ts +1 -0
  211. package/dist/tests/integration/storage/repair-and-backup.test.js +125 -0
  212. package/dist/tests/integration/storage/schema-migration.test.d.ts +11 -0
  213. package/dist/tests/integration/storage/schema-migration.test.js +183 -0
  214. package/dist/tests/integration/storage/storage-mode-smoke.test.d.ts +1 -0
  215. package/dist/tests/integration/storage/storage-mode-smoke.test.js +18 -0
  216. package/dist/tests/integration/storage/t4-1-5-memory-store-lifecycle.test.d.ts +1 -0
  217. package/dist/tests/integration/storage/t4-1-5-memory-store-lifecycle.test.js +118 -0
  218. package/dist/tests/unit/body/affordance-assembler.test.d.ts +14 -0
  219. package/dist/tests/unit/body/affordance-assembler.test.js +259 -0
  220. package/dist/tests/unit/body/affordance-context-scope.test.d.ts +12 -0
  221. package/dist/tests/unit/body/affordance-context-scope.test.js +73 -0
  222. package/dist/tests/unit/body/behavior-promotion-loop.test.d.ts +15 -0
  223. package/dist/tests/unit/body/behavior-promotion-loop.test.js +130 -0
  224. package/dist/tests/unit/body/circuit-breaker-manager.test.d.ts +13 -0
  225. package/dist/tests/unit/body/circuit-breaker-manager.test.js +160 -0
  226. package/dist/tests/unit/body/experience-writer.test.d.ts +11 -0
  227. package/dist/tests/unit/body/experience-writer.test.js +77 -0
  228. package/dist/tests/unit/body/pain-signal-query.test.d.ts +11 -0
  229. package/dist/tests/unit/body/pain-signal-query.test.js +104 -0
  230. package/dist/tests/unit/cli/connector-init-manifest.test.d.ts +9 -0
  231. package/dist/tests/unit/cli/connector-init-manifest.test.js +68 -0
  232. package/dist/tests/unit/cli/delivery-target-probe.test.d.ts +1 -0
  233. package/dist/tests/unit/cli/delivery-target-probe.test.js +108 -0
  234. package/dist/tests/unit/cli/host-capability.test.d.ts +1 -0
  235. package/dist/tests/unit/cli/host-capability.test.js +50 -0
  236. package/dist/tests/unit/cli/operator-fallback-view.test.d.ts +1 -0
  237. package/dist/tests/unit/cli/operator-fallback-view.test.js +60 -0
  238. package/dist/tests/unit/cli/runtime-artifact-boundary.test.d.ts +1 -0
  239. package/dist/tests/unit/cli/runtime-artifact-boundary.test.js +57 -0
  240. package/dist/tests/unit/cli/t1-2-3-connector-status.test.d.ts +1 -0
  241. package/dist/tests/unit/cli/t1-2-3-connector-status.test.js +214 -0
  242. package/dist/tests/unit/cli/t1-2-4-goal-command.test.d.ts +1 -0
  243. package/dist/tests/unit/cli/t1-2-4-goal-command.test.js +207 -0
  244. package/dist/tests/unit/cli/t1-3-1-connector-init.test.d.ts +1 -0
  245. package/dist/tests/unit/cli/t1-3-1-connector-init.test.js +212 -0
  246. package/dist/tests/unit/connectors/connector-manifest-and-evidence-map.test.d.ts +1 -0
  247. package/dist/tests/unit/connectors/connector-manifest-and-evidence-map.test.js +71 -0
  248. package/dist/tests/unit/connectors/effect-commit-ledger-sqlite.test.d.ts +10 -0
  249. package/dist/tests/unit/connectors/effect-commit-ledger-sqlite.test.js +101 -0
  250. package/dist/tests/unit/connectors/evomap-runner.test.d.ts +1 -0
  251. package/dist/tests/unit/connectors/evomap-runner.test.js +136 -0
  252. package/dist/tests/unit/connectors/execution-policy.test.d.ts +1 -0
  253. package/dist/tests/unit/connectors/execution-policy.test.js +71 -0
  254. package/dist/tests/unit/connectors/instreet-registration.test.d.ts +1 -0
  255. package/dist/tests/unit/connectors/instreet-registration.test.js +102 -0
  256. package/dist/tests/unit/connectors/manifest-v7-schema.test.d.ts +9 -0
  257. package/dist/tests/unit/connectors/manifest-v7-schema.test.js +165 -0
  258. package/dist/tests/unit/connectors/scriptable-node-runner.test.d.ts +1 -0
  259. package/dist/tests/unit/connectors/scriptable-node-runner.test.js +246 -0
  260. package/dist/tests/unit/connectors/structured-unavailable-reason.test.d.ts +11 -0
  261. package/dist/tests/unit/connectors/structured-unavailable-reason.test.js +76 -0
  262. package/dist/tests/unit/connectors/t3-1-1-dynamic-registry.test.d.ts +1 -0
  263. package/dist/tests/unit/connectors/t3-1-1-dynamic-registry.test.js +178 -0
  264. package/dist/tests/unit/connectors/t3-1-2-capability-registry.test.d.ts +1 -0
  265. package/dist/tests/unit/connectors/t3-1-2-capability-registry.test.js +105 -0
  266. package/dist/tests/unit/connectors/t3-2-1-v5-parity.test.d.ts +1 -0
  267. package/dist/tests/unit/connectors/t3-2-1-v5-parity.test.js +103 -0
  268. package/dist/tests/unit/connectors/t3-3-1-evidence-mapper.test.d.ts +1 -0
  269. package/dist/tests/unit/connectors/t3-3-1-evidence-mapper.test.js +198 -0
  270. package/dist/tests/unit/connectors/t3-3-1-evidence-redaction.test.d.ts +1 -0
  271. package/dist/tests/unit/connectors/t3-3-1-evidence-redaction.test.js +95 -0
  272. package/dist/tests/unit/connectors/wet-probe-runner.test.d.ts +11 -0
  273. package/dist/tests/unit/connectors/wet-probe-runner.test.js +84 -0
  274. package/dist/tests/unit/control-plane/decision-trace-emitter.test.d.ts +1 -0
  275. package/dist/tests/unit/control-plane/decision-trace-emitter.test.js +51 -0
  276. package/dist/tests/unit/control-plane/downstream-intent-orchestrator.test.d.ts +1 -0
  277. package/dist/tests/unit/control-plane/downstream-intent-orchestrator.test.js +57 -0
  278. package/dist/tests/unit/control-plane/embodied-context-assembler.test.d.ts +13 -0
  279. package/dist/tests/unit/control-plane/embodied-context-assembler.test.js +182 -0
  280. package/dist/tests/unit/control-plane/goal-lifecycle-policy.test.d.ts +1 -0
  281. package/dist/tests/unit/control-plane/goal-lifecycle-policy.test.js +75 -0
  282. package/dist/tests/unit/control-plane/hard-guard-evaluator.test.d.ts +1 -0
  283. package/dist/tests/unit/control-plane/hard-guard-evaluator.test.js +113 -0
  284. package/dist/tests/unit/control-plane/idle-curiosity-policy.test.d.ts +1 -0
  285. package/dist/tests/unit/control-plane/idle-curiosity-policy.test.js +69 -0
  286. package/dist/tests/unit/control-plane/intent-planner-source-ref-fallback.test.d.ts +7 -0
  287. package/dist/tests/unit/control-plane/intent-planner-source-ref-fallback.test.js +124 -0
  288. package/dist/tests/unit/control-plane/rhythm-policy-snapshot-window.test.d.ts +1 -0
  289. package/dist/tests/unit/control-plane/rhythm-policy-snapshot-window.test.js +64 -0
  290. package/dist/tests/unit/control-plane/run-heartbeat-cycle-v7.test.d.ts +1 -0
  291. package/dist/tests/unit/control-plane/run-heartbeat-cycle-v7.test.js +165 -0
  292. package/dist/tests/unit/control-plane/t2-1-4-goal-priority.test.d.ts +1 -0
  293. package/dist/tests/unit/control-plane/t2-1-4-goal-priority.test.js +185 -0
  294. package/dist/tests/unit/control-plane/t2-1-5-narrative-update.test.d.ts +1 -0
  295. package/dist/tests/unit/control-plane/t2-1-5-narrative-update.test.js +313 -0
  296. package/dist/tests/unit/control-plane/t2-4-1-credential-route.test.d.ts +1 -0
  297. package/dist/tests/unit/control-plane/t2-4-1-credential-route.test.js +75 -0
  298. package/dist/tests/unit/control-plane/t2-4-1-platform-intent.test.d.ts +1 -0
  299. package/dist/tests/unit/control-plane/t2-4-1-platform-intent.test.js +168 -0
  300. package/dist/tests/unit/core/outreach-judgment.test.d.ts +1 -0
  301. package/dist/tests/unit/core/outreach-judgment.test.js +109 -0
  302. package/dist/tests/unit/core/resolve-allowed-intent.test.d.ts +1 -0
  303. package/dist/tests/unit/core/resolve-allowed-intent.test.js +69 -0
  304. package/dist/tests/unit/core/t2-2-3-connector-action-honest-result.test.d.ts +1 -0
  305. package/dist/tests/unit/core/t2-2-3-connector-action-honest-result.test.js +130 -0
  306. package/dist/tests/unit/core/t2-2-3-connector-dispatch-wired.test.d.ts +1 -0
  307. package/dist/tests/unit/core/t2-2-3-connector-dispatch-wired.test.js +99 -0
  308. package/dist/tests/unit/dream/dream-input-loader.test.d.ts +15 -0
  309. package/dist/tests/unit/dream/dream-input-loader.test.js +424 -0
  310. package/dist/tests/unit/dream/dream-scheduler.test.d.ts +1 -0
  311. package/dist/tests/unit/dream/dream-scheduler.test.js +57 -0
  312. package/dist/tests/unit/dream/t-dqs-c3-redacted-evidence.test.d.ts +11 -0
  313. package/dist/tests/unit/dream/t-dqs-c3-redacted-evidence.test.js +298 -0
  314. package/dist/tests/unit/dream/t7-1-3-insight-extraction.test.d.ts +1 -0
  315. package/dist/tests/unit/dream/t7-1-3-insight-extraction.test.js +79 -0
  316. package/dist/tests/unit/dream/t7-1-4-narrative-update.test.d.ts +1 -0
  317. package/dist/tests/unit/dream/t7-1-4-narrative-update.test.js +93 -0
  318. package/dist/tests/unit/dream/t7-1-5-relationship-update.test.d.ts +1 -0
  319. package/dist/tests/unit/dream/t7-1-5-relationship-update.test.js +116 -0
  320. package/dist/tests/unit/feedback/t4-2-1-owner-reply-inference.test.d.ts +1 -0
  321. package/dist/tests/unit/feedback/t4-2-1-owner-reply-inference.test.js +58 -0
  322. package/dist/tests/unit/guidance/capability-class.test.d.ts +1 -0
  323. package/dist/tests/unit/guidance/capability-class.test.js +96 -0
  324. package/dist/tests/unit/guidance/channel-feedback-ingestion.test.d.ts +1 -0
  325. package/dist/tests/unit/guidance/channel-feedback-ingestion.test.js +163 -0
  326. package/dist/tests/unit/guidance/evidence-guidance.test.d.ts +1 -0
  327. package/dist/tests/unit/guidance/evidence-guidance.test.js +40 -0
  328. package/dist/tests/unit/guidance/guidance-draft-service.test.d.ts +1 -0
  329. package/dist/tests/unit/guidance/guidance-draft-service.test.js +140 -0
  330. package/dist/tests/unit/guidance/impulse-assembler.test.d.ts +1 -0
  331. package/dist/tests/unit/guidance/impulse-assembler.test.js +169 -0
  332. package/dist/tests/unit/guidance/outreach-draft-schema.test.d.ts +1 -0
  333. package/dist/tests/unit/guidance/outreach-draft-schema.test.js +56 -0
  334. package/dist/tests/unit/guidance/outreach-strategy-selector.test.d.ts +1 -0
  335. package/dist/tests/unit/guidance/outreach-strategy-selector.test.js +208 -0
  336. package/dist/tests/unit/guidance/outreach-style-fixtures.test.d.ts +1 -0
  337. package/dist/tests/unit/guidance/outreach-style-fixtures.test.js +81 -0
  338. package/dist/tests/unit/guidance/t6-1-1-narrative-outreach.test.d.ts +1 -0
  339. package/dist/tests/unit/guidance/t6-1-1-narrative-outreach.test.js +256 -0
  340. package/dist/tests/unit/observability/audit-envelope.test.d.ts +1 -0
  341. package/dist/tests/unit/observability/audit-envelope.test.js +169 -0
  342. package/dist/tests/unit/observability/connector-inventory-ledger.test.d.ts +1 -0
  343. package/dist/tests/unit/observability/connector-inventory-ledger.test.js +128 -0
  344. package/dist/tests/unit/observability/family-registry.test.d.ts +12 -0
  345. package/dist/tests/unit/observability/family-registry.test.js +105 -0
  346. package/dist/tests/unit/observability/governance-plane-recorder.test.d.ts +1 -0
  347. package/dist/tests/unit/observability/governance-plane-recorder.test.js +72 -0
  348. package/dist/tests/unit/observability/heartbeat-digest-assembler.test.d.ts +1 -0
  349. package/dist/tests/unit/observability/heartbeat-digest-assembler.test.js +227 -0
  350. package/dist/tests/unit/observability/lived-experience-audit.test.d.ts +1 -0
  351. package/dist/tests/unit/observability/lived-experience-audit.test.js +105 -0
  352. package/dist/tests/unit/observability/narrative-timeline-query.test.d.ts +18 -0
  353. package/dist/tests/unit/observability/narrative-timeline-query.test.js +239 -0
  354. package/dist/tests/unit/observability/restore-audit-service.test.d.ts +16 -0
  355. package/dist/tests/unit/observability/restore-audit-service.test.js +186 -0
  356. package/dist/tests/unit/observability/runtime-decision-recorder.test.d.ts +1 -0
  357. package/dist/tests/unit/observability/runtime-decision-recorder.test.js +66 -0
  358. package/dist/tests/unit/observability/runtime-secret-anchor-view.test.d.ts +18 -0
  359. package/dist/tests/unit/observability/runtime-secret-anchor-view.test.js +209 -0
  360. package/dist/tests/unit/observability/self-health-snapshot.test.d.ts +1 -0
  361. package/dist/tests/unit/observability/self-health-snapshot.test.js +223 -0
  362. package/dist/tests/unit/observability/verify-audit-hash-chain.test.d.ts +1 -0
  363. package/dist/tests/unit/observability/verify-audit-hash-chain.test.js +93 -0
  364. package/dist/tests/unit/ops/manual-run-dispatcher.test.d.ts +13 -0
  365. package/dist/tests/unit/ops/manual-run-dispatcher.test.js +219 -0
  366. package/dist/tests/unit/quiet/claim-synthesizer.test.d.ts +17 -0
  367. package/dist/tests/unit/quiet/claim-synthesizer.test.js +289 -0
  368. package/dist/tests/unit/quiet/daily-diary-writer.test.d.ts +12 -0
  369. package/dist/tests/unit/quiet/daily-diary-writer.test.js +108 -0
  370. package/dist/tests/unit/shared/v7-entities.test.d.ts +13 -0
  371. package/dist/tests/unit/shared/v7-entities.test.js +306 -0
  372. package/dist/tests/unit/storage/delivery-attempt.test.d.ts +1 -0
  373. package/dist/tests/unit/storage/delivery-attempt.test.js +72 -0
  374. package/dist/tests/unit/storage/diary-dream-store.test.d.ts +12 -0
  375. package/dist/tests/unit/storage/diary-dream-store.test.js +118 -0
  376. package/dist/tests/unit/storage/embodied-context-state-port.test.d.ts +4 -0
  377. package/dist/tests/unit/storage/embodied-context-state-port.test.js +77 -0
  378. package/dist/tests/unit/storage/goal-lifecycle-store.test.d.ts +4 -0
  379. package/dist/tests/unit/storage/goal-lifecycle-store.test.js +143 -0
  380. package/dist/tests/unit/storage/history-digest-store.test.d.ts +10 -0
  381. package/dist/tests/unit/storage/history-digest-store.test.js +126 -0
  382. package/dist/tests/unit/storage/identity-profile-store.test.d.ts +4 -0
  383. package/dist/tests/unit/storage/identity-profile-store.test.js +48 -0
  384. package/dist/tests/unit/storage/life-evidence-snapshot.test.d.ts +1 -0
  385. package/dist/tests/unit/storage/life-evidence-snapshot.test.js +60 -0
  386. package/dist/tests/unit/storage/life-evidence.test.d.ts +1 -0
  387. package/dist/tests/unit/storage/life-evidence.test.js +54 -0
  388. package/dist/tests/unit/storage/migration-runner.test.d.ts +12 -0
  389. package/dist/tests/unit/storage/migration-runner.test.js +197 -0
  390. package/dist/tests/unit/storage/repair-gate.test.d.ts +1 -0
  391. package/dist/tests/unit/storage/repair-gate.test.js +41 -0
  392. package/dist/tests/unit/storage/restore-snapshot-store.test.d.ts +11 -0
  393. package/dist/tests/unit/storage/restore-snapshot-store.test.js +161 -0
  394. package/dist/tests/unit/storage/rhythm-policy-snapshot.test.d.ts +1 -0
  395. package/dist/tests/unit/storage/rhythm-policy-snapshot.test.js +31 -0
  396. package/dist/tests/unit/storage/runtime-secret-anchor-store.test.d.ts +10 -0
  397. package/dist/tests/unit/storage/runtime-secret-anchor-store.test.js +81 -0
  398. package/dist/tests/unit/storage/t1-4-1-credential-health-mapper.test.d.ts +1 -0
  399. package/dist/tests/unit/storage/t1-4-1-credential-health-mapper.test.js +83 -0
  400. package/dist/tests/unit/storage/t4-1-1-session-chronicle.test.d.ts +1 -0
  401. package/dist/tests/unit/storage/t4-1-1-session-chronicle.test.js +112 -0
  402. package/dist/tests/unit/storage/t4-1-2-narrative-state.test.d.ts +1 -0
  403. package/dist/tests/unit/storage/t4-1-2-narrative-state.test.js +80 -0
  404. package/dist/tests/unit/storage/t4-1-3-relationship-memory.test.d.ts +1 -0
  405. package/dist/tests/unit/storage/t4-1-3-relationship-memory.test.js +65 -0
  406. package/dist/tests/unit/storage/t4-1-4-agent-goal.test.d.ts +1 -0
  407. package/dist/tests/unit/storage/t4-1-4-agent-goal.test.js +166 -0
  408. package/dist/tests/unit/storage/tool-experience-store.test.d.ts +4 -0
  409. package/dist/tests/unit/storage/tool-experience-store.test.js +92 -0
  410. package/dist/tests/unit/storage/user-interest-snapshot.test.d.ts +1 -0
  411. package/dist/tests/unit/storage/user-interest-snapshot.test.js +48 -0
  412. package/dist/tests/unit/storage/write-queue.test.d.ts +12 -0
  413. package/dist/tests/unit/storage/write-queue.test.js +177 -0
  414. package/dist/tests/unit/storage/write-validation-gate.test.d.ts +9 -0
  415. package/dist/tests/unit/storage/write-validation-gate.test.js +153 -0
  416. package/docs/claw-second-nature-inner-guide.md +144 -0
  417. package/package.json +84 -55
  418. package/agent-inner-guide.md +0 -187
  419. package/openclaw.plugin.json +0 -29
  420. package/runtime/cli/ops/heartbeat-surface.d.ts +0 -75
  421. package/runtime/cli/ops/heartbeat-surface.js +0 -97
  422. package/runtime/cli/ops/ops-router.js +0 -1454
  423. package/runtime/cli/ops/workspace-heartbeat-runner.d.ts +0 -76
  424. package/runtime/cli/ops/workspace-heartbeat-runner.js +0 -236
  425. package/runtime/core/second-nature/heartbeat/goal-lifecycle-policy.d.ts +0 -37
  426. package/runtime/core/second-nature/heartbeat/goal-lifecycle-policy.js +0 -61
  427. package/runtime/core/second-nature/heartbeat/heartbeat-loop.d.ts +0 -88
  428. package/runtime/core/second-nature/heartbeat/heartbeat-loop.js +0 -329
  429. package/runtime/core/second-nature/orchestrator/platform-capability-router.js +0 -131
  430. /package/{index.js → dist/plugin/index.js} +0 -0
  431. /package/{workspace-ops-bridge.js → dist/plugin/workspace-ops-bridge.js} +0 -0
  432. /package/{runtime/cli/read-models/types.js → dist/scripts/packaging-feasibility-poc.d.ts} +0 -0
  433. /package/{runtime/core/second-nature/types.js → dist/scripts/plugin-smoke-check.d.ts} +0 -0
  434. /package/{runtime → dist/src}/cli/action-bridge.js +0 -0
  435. /package/{runtime → dist/src}/cli/commands/connector-behavior.d.ts +0 -0
  436. /package/{runtime → dist/src}/cli/commands/connector-behavior.js +0 -0
  437. /package/{runtime → dist/src}/cli/commands/connector-init.d.ts +0 -0
  438. /package/{runtime → dist/src}/cli/commands/connector-init.js +0 -0
  439. /package/{runtime → dist/src}/cli/commands/connector-status.d.ts +0 -0
  440. /package/{runtime → dist/src}/cli/commands/connector-status.js +0 -0
  441. /package/{runtime → dist/src}/cli/commands/credential.d.ts +0 -0
  442. /package/{runtime → dist/src}/cli/commands/credential.js +0 -0
  443. /package/{runtime → dist/src}/cli/commands/goal.d.ts +0 -0
  444. /package/{runtime → dist/src}/cli/commands/goal.js +0 -0
  445. /package/{runtime → dist/src}/cli/commands/index.d.ts +0 -0
  446. /package/{runtime → dist/src}/cli/commands/index.js +0 -0
  447. /package/{runtime → dist/src}/cli/commands/policy.d.ts +0 -0
  448. /package/{runtime → dist/src}/cli/commands/policy.js +0 -0
  449. /package/{runtime → dist/src}/cli/explain/explain-surface-subject.d.ts +0 -0
  450. /package/{runtime → dist/src}/cli/explain/explain-surface-subject.js +0 -0
  451. /package/{runtime → dist/src}/cli/explain/format-explanation.d.ts +0 -0
  452. /package/{runtime → dist/src}/cli/explain/format-explanation.js +0 -0
  453. /package/{runtime → dist/src}/cli/explain/resolve-subject.d.ts +0 -0
  454. /package/{runtime → dist/src}/cli/explain/resolve-subject.js +0 -0
  455. /package/{runtime → dist/src}/cli/host-capability/classify-delivery.d.ts +0 -0
  456. /package/{runtime → dist/src}/cli/host-capability/classify-delivery.js +0 -0
  457. /package/{runtime → dist/src}/cli/host-capability/probe-host-capability.d.ts +0 -0
  458. /package/{runtime → dist/src}/cli/host-capability/probe-host-capability.js +0 -0
  459. /package/{runtime → dist/src}/cli/host-capability/record-host-capability.d.ts +0 -0
  460. /package/{runtime → dist/src}/cli/host-capability/record-host-capability.js +0 -0
  461. /package/{runtime → dist/src}/cli/host-capability/types.d.ts +0 -0
  462. /package/{runtime → dist/src}/cli/host-capability/types.js +0 -0
  463. /package/{runtime → dist/src}/cli/host-smoke/run-host-smoke.d.ts +0 -0
  464. /package/{runtime → dist/src}/cli/host-smoke/run-host-smoke.js +0 -0
  465. /package/{runtime → dist/src}/cli/host-smoke/types.d.ts +0 -0
  466. /package/{runtime → dist/src}/cli/host-smoke/types.js +0 -0
  467. /package/{runtime → dist/src}/cli/index.js +0 -0
  468. /package/{runtime → dist/src}/cli/ops/manual-run-dispatcher.d.ts +0 -0
  469. /package/{runtime → dist/src}/cli/ops/manual-run-dispatcher.js +0 -0
  470. /package/{runtime → dist/src}/cli/ops/ops-router.d.ts +0 -0
  471. /package/{runtime → dist/src}/cli/ops/show-operator-fallback.d.ts +0 -0
  472. /package/{runtime → dist/src}/cli/ops/show-operator-fallback.js +0 -0
  473. /package/{runtime → dist/src}/cli/read-models/index.d.ts +0 -0
  474. /package/{runtime → dist/src}/cli/read-models/index.js +0 -0
  475. /package/{runtime → dist/src}/cli/read-models/operator-explain-map.d.ts +0 -0
  476. /package/{runtime → dist/src}/cli/read-models/operator-explain-map.js +0 -0
  477. /package/{runtime → dist/src}/cli/read-models/types.d.ts +0 -0
  478. /package/{runtime/guidance → dist/src/cli/read-models}/types.js +0 -0
  479. /package/{runtime → dist/src}/cli/runtime/runtime-artifact-boundary.d.ts +0 -0
  480. /package/{runtime → dist/src}/cli/runtime/runtime-artifact-boundary.js +0 -0
  481. /package/{runtime → dist/src}/connectors/agent-network/agent-world/adapter.d.ts +0 -0
  482. /package/{runtime → dist/src}/connectors/agent-network/agent-world/adapter.js +0 -0
  483. /package/{runtime → dist/src}/connectors/agent-network/agent-world/index.d.ts +0 -0
  484. /package/{runtime → dist/src}/connectors/agent-network/agent-world/index.js +0 -0
  485. /package/{runtime → dist/src}/connectors/agent-network/agent-world/manifest.d.ts +0 -0
  486. /package/{runtime → dist/src}/connectors/agent-network/agent-world/manifest.js +0 -0
  487. /package/{runtime → dist/src}/connectors/agent-network/evomap/adapter.d.ts +0 -0
  488. /package/{runtime → dist/src}/connectors/agent-network/evomap/adapter.js +0 -0
  489. /package/{runtime → dist/src}/connectors/agent-network/evomap/index.d.ts +0 -0
  490. /package/{runtime → dist/src}/connectors/agent-network/evomap/index.js +0 -0
  491. /package/{runtime → dist/src}/connectors/agent-network/evomap/manifest.d.ts +0 -0
  492. /package/{runtime → dist/src}/connectors/agent-network/evomap/manifest.js +0 -0
  493. /package/{runtime → dist/src}/connectors/base/channel-health.d.ts +0 -0
  494. /package/{runtime → dist/src}/connectors/base/channel-health.js +0 -0
  495. /package/{runtime → dist/src}/connectors/base/contract.d.ts +0 -0
  496. /package/{runtime → dist/src}/connectors/base/contract.js +0 -0
  497. /package/{runtime → dist/src}/connectors/base/effect-commit-ledger-sqlite.d.ts +0 -0
  498. /package/{runtime → dist/src}/connectors/base/effect-commit-ledger-sqlite.js +0 -0
  499. /package/{runtime → dist/src}/connectors/base/execution-policy.d.ts +0 -0
  500. /package/{runtime → dist/src}/connectors/base/execution-policy.js +0 -0
  501. /package/{runtime → dist/src}/connectors/base/failure-taxonomy.d.ts +0 -0
  502. /package/{runtime → dist/src}/connectors/base/failure-taxonomy.js +0 -0
  503. /package/{runtime → dist/src}/connectors/base/index.d.ts +0 -0
  504. /package/{runtime → dist/src}/connectors/base/index.js +0 -0
  505. /package/{runtime → dist/src}/connectors/base/manifest-v7.d.ts +0 -0
  506. /package/{runtime → dist/src}/connectors/base/manifest-v7.js +0 -0
  507. /package/{runtime → dist/src}/connectors/base/manifest.d.ts +0 -0
  508. /package/{runtime → dist/src}/connectors/base/manifest.js +0 -0
  509. /package/{runtime → dist/src}/connectors/base/map-life-evidence.d.ts +0 -0
  510. /package/{runtime → dist/src}/connectors/base/map-life-evidence.js +0 -0
  511. /package/{runtime → dist/src}/connectors/base/policy-layer.d.ts +0 -0
  512. /package/{runtime → dist/src}/connectors/base/policy-layer.js +0 -0
  513. /package/{runtime → dist/src}/connectors/base/route-planner.d.ts +0 -0
  514. /package/{runtime → dist/src}/connectors/base/route-planner.js +0 -0
  515. /package/{runtime → dist/src}/connectors/base/structured-unavailable-reason.d.ts +0 -0
  516. /package/{runtime → dist/src}/connectors/base/structured-unavailable-reason.js +0 -0
  517. /package/{runtime → dist/src}/connectors/base/wet-probe-runner.d.ts +0 -0
  518. /package/{runtime → dist/src}/connectors/base/wet-probe-runner.js +0 -0
  519. /package/{runtime → dist/src}/connectors/index.d.ts +0 -0
  520. /package/{runtime → dist/src}/connectors/index.js +0 -0
  521. /package/{runtime → dist/src}/connectors/manifest/manifest-parser.d.ts +0 -0
  522. /package/{runtime → dist/src}/connectors/manifest/manifest-parser.js +0 -0
  523. /package/{runtime → dist/src}/connectors/manifest/manifest-schema.d.ts +0 -0
  524. /package/{runtime → dist/src}/connectors/manifest/manifest-schema.js +0 -0
  525. /package/{runtime → dist/src}/connectors/near-real/near-real-connector-smoke.d.ts +0 -0
  526. /package/{runtime → dist/src}/connectors/near-real/near-real-connector-smoke.js +0 -0
  527. /package/{runtime → dist/src}/connectors/registry/dynamic-connector-registry.d.ts +0 -0
  528. /package/{runtime → dist/src}/connectors/registry/dynamic-connector-registry.js +0 -0
  529. /package/{runtime → dist/src}/connectors/registry/index.d.ts +0 -0
  530. /package/{runtime → dist/src}/connectors/registry/index.js +0 -0
  531. /package/{runtime → dist/src}/connectors/registry/manifest-scanner.d.ts +0 -0
  532. /package/{runtime → dist/src}/connectors/registry/manifest-scanner.js +0 -0
  533. /package/{runtime → dist/src}/connectors/registry/trust-policy.d.ts +0 -0
  534. /package/{runtime → dist/src}/connectors/registry/trust-policy.js +0 -0
  535. /package/{runtime → dist/src}/connectors/services/connector-executor-adapter.d.ts +0 -0
  536. /package/{runtime → dist/src}/connectors/services/connector-executor-adapter.js +0 -0
  537. /package/{runtime → dist/src}/connectors/services/credential-route-context.d.ts +0 -0
  538. /package/{runtime → dist/src}/connectors/services/credential-route-context.js +0 -0
  539. /package/{runtime → dist/src}/connectors/social-community/instreet/adapter.d.ts +0 -0
  540. /package/{runtime → dist/src}/connectors/social-community/instreet/adapter.js +0 -0
  541. /package/{runtime → dist/src}/connectors/social-community/instreet/index.d.ts +0 -0
  542. /package/{runtime → dist/src}/connectors/social-community/instreet/index.js +0 -0
  543. /package/{runtime → dist/src}/connectors/social-community/instreet/manifest.d.ts +0 -0
  544. /package/{runtime → dist/src}/connectors/social-community/instreet/manifest.js +0 -0
  545. /package/{runtime → dist/src}/connectors/social-community/moltbook/adapter.d.ts +0 -0
  546. /package/{runtime → dist/src}/connectors/social-community/moltbook/adapter.js +0 -0
  547. /package/{runtime → dist/src}/connectors/social-community/moltbook/api-client.d.ts +0 -0
  548. /package/{runtime → dist/src}/connectors/social-community/moltbook/api-client.js +0 -0
  549. /package/{runtime → dist/src}/connectors/social-community/moltbook/index.d.ts +0 -0
  550. /package/{runtime → dist/src}/connectors/social-community/moltbook/index.js +0 -0
  551. /package/{runtime → dist/src}/connectors/social-community/moltbook/manifest.d.ts +0 -0
  552. /package/{runtime → dist/src}/connectors/social-community/moltbook/manifest.js +0 -0
  553. /package/{runtime → dist/src}/core/second-nature/body/behavior-promotion/behavior-promotion-loop.d.ts +0 -0
  554. /package/{runtime → dist/src}/core/second-nature/body/behavior-promotion/behavior-promotion-loop.js +0 -0
  555. /package/{runtime → dist/src}/core/second-nature/body/circuit-breaker/circuit-breaker-manager.d.ts +0 -0
  556. /package/{runtime → dist/src}/core/second-nature/body/circuit-breaker/circuit-breaker-manager.js +0 -0
  557. /package/{runtime → dist/src}/core/second-nature/body/probe-signal-adapter.d.ts +0 -0
  558. /package/{runtime → dist/src}/core/second-nature/body/probe-signal-adapter.js +0 -0
  559. /package/{runtime → dist/src}/core/second-nature/body/tool-affordance/affordance-assembler.d.ts +0 -0
  560. /package/{runtime → dist/src}/core/second-nature/body/tool-affordance/affordance-assembler.js +0 -0
  561. /package/{runtime → dist/src}/core/second-nature/body/tool-affordance/affordance-context-scope.d.ts +0 -0
  562. /package/{runtime → dist/src}/core/second-nature/body/tool-affordance/affordance-context-scope.js +0 -0
  563. /package/{runtime → dist/src}/core/second-nature/body/tool-experience/experience-writer.d.ts +0 -0
  564. /package/{runtime → dist/src}/core/second-nature/body/tool-experience/experience-writer.js +0 -0
  565. /package/{runtime → dist/src}/core/second-nature/body/tool-experience/pain-signal-query.d.ts +0 -0
  566. /package/{runtime → dist/src}/core/second-nature/body/tool-experience/pain-signal-query.js +0 -0
  567. /package/{runtime → dist/src}/core/second-nature/feedback/owner-reply-feedback.d.ts +0 -0
  568. /package/{runtime → dist/src}/core/second-nature/feedback/owner-reply-feedback.js +0 -0
  569. /package/{runtime → dist/src}/core/second-nature/guidance/apply-guidance.d.ts +0 -0
  570. /package/{runtime → dist/src}/core/second-nature/guidance/apply-guidance.js +0 -0
  571. /package/{runtime → dist/src}/core/second-nature/guidance/request-guidance.d.ts +0 -0
  572. /package/{runtime → dist/src}/core/second-nature/guidance/request-guidance.js +0 -0
  573. /package/{runtime → dist/src}/core/second-nature/guidance/user-reply-continuity.d.ts +0 -0
  574. /package/{runtime → dist/src}/core/second-nature/guidance/user-reply-continuity.js +0 -0
  575. /package/{runtime → dist/src}/core/second-nature/heartbeat/decision-trace-emitter.d.ts +0 -0
  576. /package/{runtime → dist/src}/core/second-nature/heartbeat/decision-trace-emitter.js +0 -0
  577. /package/{runtime → dist/src}/core/second-nature/heartbeat/embodied-context-assembler.d.ts +0 -0
  578. /package/{runtime → dist/src}/core/second-nature/heartbeat/embodied-context-assembler.js +0 -0
  579. /package/{runtime → dist/src}/core/second-nature/heartbeat/heartbeat-executor.d.ts +0 -0
  580. /package/{runtime → dist/src}/core/second-nature/heartbeat/heartbeat-executor.js +0 -0
  581. /package/{runtime → dist/src}/core/second-nature/heartbeat/idle-curiosity-policy.d.ts +0 -0
  582. /package/{runtime → dist/src}/core/second-nature/heartbeat/idle-curiosity-policy.js +0 -0
  583. /package/{runtime → dist/src}/core/second-nature/heartbeat/index.d.ts +0 -0
  584. /package/{runtime → dist/src}/core/second-nature/heartbeat/index.js +0 -0
  585. /package/{runtime → dist/src}/core/second-nature/heartbeat/run-heartbeat-cycle-v7.d.ts +0 -0
  586. /package/{runtime → dist/src}/core/second-nature/heartbeat/run-heartbeat-cycle-v7.js +0 -0
  587. /package/{runtime → dist/src}/core/second-nature/heartbeat/run-heartbeat-cycle.d.ts +0 -0
  588. /package/{runtime → dist/src}/core/second-nature/heartbeat/run-heartbeat-cycle.js +0 -0
  589. /package/{runtime → dist/src}/core/second-nature/heartbeat/runtime-snapshot.d.ts +0 -0
  590. /package/{runtime → dist/src}/core/second-nature/heartbeat/runtime-snapshot.js +0 -0
  591. /package/{runtime → dist/src}/core/second-nature/heartbeat/scope-router.d.ts +0 -0
  592. /package/{runtime → dist/src}/core/second-nature/heartbeat/scope-router.js +0 -0
  593. /package/{runtime → dist/src}/core/second-nature/heartbeat/signal.d.ts +0 -0
  594. /package/{runtime → dist/src}/core/second-nature/heartbeat/signal.js +0 -0
  595. /package/{runtime → dist/src}/core/second-nature/heartbeat/snapshot-builder.d.ts +0 -0
  596. /package/{runtime → dist/src}/core/second-nature/heartbeat/snapshot-builder.js +0 -0
  597. /package/{runtime → dist/src}/core/second-nature/index.d.ts +0 -0
  598. /package/{runtime → dist/src}/core/second-nature/index.js +0 -0
  599. /package/{runtime → dist/src}/core/second-nature/orchestrator/downstream-intent-orchestrator.d.ts +0 -0
  600. /package/{runtime → dist/src}/core/second-nature/orchestrator/downstream-intent-orchestrator.js +0 -0
  601. /package/{runtime → dist/src}/core/second-nature/orchestrator/effect-dispatcher.d.ts +0 -0
  602. /package/{runtime → dist/src}/core/second-nature/orchestrator/effect-dispatcher.js +0 -0
  603. /package/{runtime → dist/src}/core/second-nature/orchestrator/goal-priority.d.ts +0 -0
  604. /package/{runtime → dist/src}/core/second-nature/orchestrator/goal-priority.js +0 -0
  605. /package/{runtime → dist/src}/core/second-nature/orchestrator/guard-layer.d.ts +0 -0
  606. /package/{runtime → dist/src}/core/second-nature/orchestrator/guard-layer.js +0 -0
  607. /package/{runtime → dist/src}/core/second-nature/orchestrator/hard-guard-evaluator.d.ts +0 -0
  608. /package/{runtime → dist/src}/core/second-nature/orchestrator/hard-guard-evaluator.js +0 -0
  609. /package/{runtime → dist/src}/core/second-nature/orchestrator/index.d.ts +0 -0
  610. /package/{runtime → dist/src}/core/second-nature/orchestrator/index.js +0 -0
  611. /package/{runtime → dist/src}/core/second-nature/orchestrator/intent-planner.d.ts +0 -0
  612. /package/{runtime → dist/src}/core/second-nature/orchestrator/intent-planner.js +0 -0
  613. /package/{runtime → dist/src}/core/second-nature/orchestrator/lease-manager.d.ts +0 -0
  614. /package/{runtime → dist/src}/core/second-nature/orchestrator/lease-manager.js +0 -0
  615. /package/{runtime → dist/src}/core/second-nature/orchestrator/narrative-update.d.ts +0 -0
  616. /package/{runtime → dist/src}/core/second-nature/orchestrator/narrative-update.js +0 -0
  617. /package/{runtime → dist/src}/core/second-nature/orchestrator/platform-capability-router.d.ts +0 -0
  618. /package/{runtime → dist/src}/core/second-nature/orchestrator/resume-from-checkpoint.d.ts +0 -0
  619. /package/{runtime → dist/src}/core/second-nature/orchestrator/resume-from-checkpoint.js +0 -0
  620. /package/{runtime → dist/src}/core/second-nature/outreach/build-message.d.ts +0 -0
  621. /package/{runtime → dist/src}/core/second-nature/outreach/build-message.js +0 -0
  622. /package/{runtime → dist/src}/core/second-nature/outreach/build-outreach-draft-request.d.ts +0 -0
  623. /package/{runtime → dist/src}/core/second-nature/outreach/build-outreach-draft-request.js +0 -0
  624. /package/{runtime → dist/src}/core/second-nature/outreach/delivery-target.d.ts +0 -0
  625. /package/{runtime → dist/src}/core/second-nature/outreach/delivery-target.js +0 -0
  626. /package/{runtime → dist/src}/core/second-nature/outreach/dispatch-user-outreach.d.ts +0 -0
  627. /package/{runtime → dist/src}/core/second-nature/outreach/dispatch-user-outreach.js +0 -0
  628. /package/{runtime → dist/src}/core/second-nature/outreach/evaluate-outreach.d.ts +0 -0
  629. /package/{runtime → dist/src}/core/second-nature/outreach/evaluate-outreach.js +0 -0
  630. /package/{runtime → dist/src}/core/second-nature/outreach/judge-input-from-snapshot.d.ts +0 -0
  631. /package/{runtime → dist/src}/core/second-nature/outreach/judge-input-from-snapshot.js +0 -0
  632. /package/{runtime → dist/src}/core/second-nature/outreach/judge-outreach.d.ts +0 -0
  633. /package/{runtime → dist/src}/core/second-nature/outreach/judge-outreach.js +0 -0
  634. /package/{runtime → dist/src}/core/second-nature/quiet/claim-synthesizer.d.ts +0 -0
  635. /package/{runtime → dist/src}/core/second-nature/quiet/claim-synthesizer.js +0 -0
  636. /package/{runtime → dist/src}/core/second-nature/quiet/daily-diary-writer.d.ts +0 -0
  637. /package/{runtime → dist/src}/core/second-nature/quiet/daily-diary-writer.js +0 -0
  638. /package/{runtime → dist/src}/core/second-nature/quiet/index.d.ts +0 -0
  639. /package/{runtime → dist/src}/core/second-nature/quiet/index.js +0 -0
  640. /package/{runtime → dist/src}/core/second-nature/quiet/quiet-pipeline.d.ts +0 -0
  641. /package/{runtime → dist/src}/core/second-nature/quiet/quiet-pipeline.js +0 -0
  642. /package/{runtime → dist/src}/core/second-nature/quiet/run-source-backed-quiet.d.ts +0 -0
  643. /package/{runtime → dist/src}/core/second-nature/quiet/run-source-backed-quiet.js +0 -0
  644. /package/{runtime → dist/src}/core/second-nature/reflection/run-narrative-reflection.d.ts +0 -0
  645. /package/{runtime → dist/src}/core/second-nature/reflection/run-narrative-reflection.js +0 -0
  646. /package/{runtime → dist/src}/core/second-nature/rhythm/planner-rhythm-window.d.ts +0 -0
  647. /package/{runtime → dist/src}/core/second-nature/rhythm/planner-rhythm-window.js +0 -0
  648. /package/{runtime → dist/src}/core/second-nature/rhythm/policy-bridge.d.ts +0 -0
  649. /package/{runtime → dist/src}/core/second-nature/rhythm/policy-bridge.js +0 -0
  650. /package/{runtime → dist/src}/core/second-nature/rhythm/rhythm-policy.d.ts +0 -0
  651. /package/{runtime → dist/src}/core/second-nature/rhythm/rhythm-policy.js +0 -0
  652. /package/{runtime → dist/src}/core/second-nature/rhythm/select-window.d.ts +0 -0
  653. /package/{runtime → dist/src}/core/second-nature/rhythm/select-window.js +0 -0
  654. /package/{runtime → dist/src}/core/second-nature/runtime/lifecycle-service.d.ts +0 -0
  655. /package/{runtime → dist/src}/core/second-nature/runtime/lifecycle-service.js +0 -0
  656. /package/{runtime → dist/src}/core/second-nature/runtime/service-entry.d.ts +0 -0
  657. /package/{runtime → dist/src}/core/second-nature/runtime/service-entry.js +0 -0
  658. /package/{runtime → dist/src}/core/second-nature/types.d.ts +0 -0
  659. /package/{runtime/storage/delivery → dist/src/core/second-nature}/types.js +0 -0
  660. /package/{runtime → dist/src}/dream/dream-engine.d.ts +0 -0
  661. /package/{runtime → dist/src}/dream/dream-engine.js +0 -0
  662. /package/{runtime → dist/src}/dream/dream-input-loader.d.ts +0 -0
  663. /package/{runtime → dist/src}/dream/dream-input-loader.js +0 -0
  664. /package/{runtime → dist/src}/dream/dream-scheduler.d.ts +0 -0
  665. /package/{runtime → dist/src}/dream/dream-scheduler.js +0 -0
  666. /package/{runtime → dist/src}/dream/index.d.ts +0 -0
  667. /package/{runtime → dist/src}/dream/index.js +0 -0
  668. /package/{runtime → dist/src}/dream/insight-extractor.d.ts +0 -0
  669. /package/{runtime → dist/src}/dream/insight-extractor.js +0 -0
  670. /package/{runtime → dist/src}/dream/memory-consolidator.d.ts +0 -0
  671. /package/{runtime → dist/src}/dream/memory-consolidator.js +0 -0
  672. /package/{runtime → dist/src}/dream/narrative-update-proposal.d.ts +0 -0
  673. /package/{runtime → dist/src}/dream/narrative-update-proposal.js +0 -0
  674. /package/{runtime → dist/src}/dream/output-validator.d.ts +0 -0
  675. /package/{runtime → dist/src}/dream/output-validator.js +0 -0
  676. /package/{runtime → dist/src}/dream/redaction-gate.d.ts +0 -0
  677. /package/{runtime → dist/src}/dream/redaction-gate.js +0 -0
  678. /package/{runtime → dist/src}/dream/relationship-update-proposal.d.ts +0 -0
  679. /package/{runtime → dist/src}/dream/relationship-update-proposal.js +0 -0
  680. /package/{runtime → dist/src}/dream/sampler.d.ts +0 -0
  681. /package/{runtime → dist/src}/dream/sampler.js +0 -0
  682. /package/{runtime → dist/src}/dream/types.d.ts +0 -0
  683. /package/{runtime → dist/src}/dream/types.js +0 -0
  684. /package/{runtime → dist/src}/guidance/capability-class.d.ts +0 -0
  685. /package/{runtime → dist/src}/guidance/capability-class.js +0 -0
  686. /package/{runtime → dist/src}/guidance/channel-feedback-ingestion-service.d.ts +0 -0
  687. /package/{runtime → dist/src}/guidance/channel-feedback-ingestion-service.js +0 -0
  688. /package/{runtime → dist/src}/guidance/contracts.d.ts +0 -0
  689. /package/{runtime → dist/src}/guidance/contracts.js +0 -0
  690. /package/{runtime → dist/src}/guidance/draft-narrative-outreach.d.ts +0 -0
  691. /package/{runtime → dist/src}/guidance/draft-narrative-outreach.js +0 -0
  692. /package/{runtime → dist/src}/guidance/draft-outreach-message.d.ts +0 -0
  693. /package/{runtime → dist/src}/guidance/draft-outreach-message.js +0 -0
  694. /package/{runtime → dist/src}/guidance/evidence-guidance.d.ts +0 -0
  695. /package/{runtime → dist/src}/guidance/evidence-guidance.js +0 -0
  696. /package/{runtime → dist/src}/guidance/fallback.d.ts +0 -0
  697. /package/{runtime → dist/src}/guidance/fallback.js +0 -0
  698. /package/{runtime → dist/src}/guidance/guidance-assembler.d.ts +0 -0
  699. /package/{runtime → dist/src}/guidance/guidance-assembler.js +0 -0
  700. /package/{runtime → dist/src}/guidance/guidance-draft-service.d.ts +0 -0
  701. /package/{runtime → dist/src}/guidance/guidance-draft-service.js +0 -0
  702. /package/{runtime → dist/src}/guidance/impulse-assembler.d.ts +0 -0
  703. /package/{runtime → dist/src}/guidance/impulse-assembler.js +0 -0
  704. /package/{runtime → dist/src}/guidance/index.d.ts +0 -0
  705. /package/{runtime → dist/src}/guidance/index.js +0 -0
  706. /package/{runtime → dist/src}/guidance/output-guard.d.ts +0 -0
  707. /package/{runtime → dist/src}/guidance/output-guard.js +0 -0
  708. /package/{runtime → dist/src}/guidance/outreach-draft-schema.d.ts +0 -0
  709. /package/{runtime → dist/src}/guidance/outreach-draft-schema.js +0 -0
  710. /package/{runtime → dist/src}/guidance/outreach-strategy-selector.d.ts +0 -0
  711. /package/{runtime → dist/src}/guidance/outreach-strategy-selector.js +0 -0
  712. /package/{runtime → dist/src}/guidance/persona-selection.d.ts +0 -0
  713. /package/{runtime → dist/src}/guidance/persona-selection.js +0 -0
  714. /package/{runtime → dist/src}/guidance/review-workflow.d.ts +0 -0
  715. /package/{runtime → dist/src}/guidance/review-workflow.js +0 -0
  716. /package/{runtime → dist/src}/guidance/template-registry.d.ts +0 -0
  717. /package/{runtime → dist/src}/guidance/template-registry.js +0 -0
  718. /package/{runtime → dist/src}/guidance/types.d.ts +0 -0
  719. /package/{runtime/storage/memory/workspace → dist/src/guidance}/types.js +0 -0
  720. /package/{runtime → dist/src}/observability/audit/append-only-audit-store.d.ts +0 -0
  721. /package/{runtime → dist/src}/observability/audit/append-only-audit-store.js +0 -0
  722. /package/{runtime → dist/src}/observability/audit/audit-envelope.d.ts +0 -0
  723. /package/{runtime → dist/src}/observability/audit/audit-envelope.js +0 -0
  724. /package/{runtime → dist/src}/observability/audit/audit-family-registry.json +0 -0
  725. /package/{runtime → dist/src}/observability/audit/family-registry.d.ts +0 -0
  726. /package/{runtime → dist/src}/observability/audit/family-registry.js +0 -0
  727. /package/{runtime → dist/src}/observability/audit/verify-audit-hash-chain.d.ts +0 -0
  728. /package/{runtime → dist/src}/observability/audit/verify-audit-hash-chain.js +0 -0
  729. /package/{runtime → dist/src}/observability/connector-inventory-ledger.d.ts +0 -0
  730. /package/{runtime → dist/src}/observability/connector-inventory-ledger.js +0 -0
  731. /package/{runtime → dist/src}/observability/db/index.d.ts +0 -0
  732. /package/{runtime → dist/src}/observability/db/index.js +0 -0
  733. /package/{runtime → dist/src}/observability/db/schema/connector-inventory.d.ts +0 -0
  734. /package/{runtime → dist/src}/observability/db/schema/connector-inventory.js +0 -0
  735. /package/{runtime → dist/src}/observability/db/schema/host-capability-reports.d.ts +0 -0
  736. /package/{runtime → dist/src}/observability/db/schema/host-capability-reports.js +0 -0
  737. /package/{runtime → dist/src}/observability/db/schema/index.d.ts +0 -0
  738. /package/{runtime → dist/src}/observability/db/schema/index.js +0 -0
  739. /package/{runtime → dist/src}/observability/index.d.ts +0 -0
  740. /package/{runtime → dist/src}/observability/index.js +0 -0
  741. /package/{runtime → dist/src}/observability/projections/guidance-audit.d.ts +0 -0
  742. /package/{runtime → dist/src}/observability/projections/guidance-audit.js +0 -0
  743. /package/{runtime → dist/src}/observability/projections/outreach-quality-audit.d.ts +0 -0
  744. /package/{runtime → dist/src}/observability/projections/outreach-quality-audit.js +0 -0
  745. /package/{runtime → dist/src}/observability/projections/reflection-audit.d.ts +0 -0
  746. /package/{runtime → dist/src}/observability/projections/reflection-audit.js +0 -0
  747. /package/{runtime → dist/src}/observability/query/compose-evidence.d.ts +0 -0
  748. /package/{runtime → dist/src}/observability/query/compose-evidence.js +0 -0
  749. /package/{runtime → dist/src}/observability/query/evidence-query-engine.d.ts +0 -0
  750. /package/{runtime → dist/src}/observability/query/evidence-query-engine.js +0 -0
  751. /package/{runtime → dist/src}/observability/query/explain-query.d.ts +0 -0
  752. /package/{runtime → dist/src}/observability/query/explain-query.js +0 -0
  753. /package/{runtime → dist/src}/observability/query/export-audit-bundle.d.ts +0 -0
  754. /package/{runtime → dist/src}/observability/query/export-audit-bundle.js +0 -0
  755. /package/{runtime → dist/src}/observability/redaction/manifest.d.ts +0 -0
  756. /package/{runtime → dist/src}/observability/redaction/manifest.js +0 -0
  757. /package/{runtime → dist/src}/observability/redaction/policy.d.ts +0 -0
  758. /package/{runtime → dist/src}/observability/redaction/policy.js +0 -0
  759. /package/{runtime → dist/src}/observability/services/decision-ledger.d.ts +0 -0
  760. /package/{runtime → dist/src}/observability/services/decision-ledger.js +0 -0
  761. /package/{runtime → dist/src}/observability/services/execution-telemetry.d.ts +0 -0
  762. /package/{runtime → dist/src}/observability/services/execution-telemetry.js +0 -0
  763. /package/{runtime → dist/src}/observability/services/governance-audit.d.ts +0 -0
  764. /package/{runtime → dist/src}/observability/services/governance-audit.js +0 -0
  765. /package/{runtime → dist/src}/observability/services/governance-plane-recorder.d.ts +0 -0
  766. /package/{runtime → dist/src}/observability/services/governance-plane-recorder.js +0 -0
  767. /package/{runtime → dist/src}/observability/services/heartbeat-digest-assembler.d.ts +0 -0
  768. /package/{runtime → dist/src}/observability/services/heartbeat-digest-assembler.js +0 -0
  769. /package/{runtime → dist/src}/observability/services/lived-experience-audit.d.ts +0 -0
  770. /package/{runtime → dist/src}/observability/services/lived-experience-audit.js +0 -0
  771. /package/{runtime → dist/src}/observability/services/narrative-timeline-query-service.d.ts +0 -0
  772. /package/{runtime → dist/src}/observability/services/narrative-timeline-query-service.js +0 -0
  773. /package/{runtime → dist/src}/observability/services/observability-retention.d.ts +0 -0
  774. /package/{runtime → dist/src}/observability/services/observability-retention.js +0 -0
  775. /package/{runtime → dist/src}/observability/services/redaction-store.d.ts +0 -0
  776. /package/{runtime → dist/src}/observability/services/redaction-store.js +0 -0
  777. /package/{runtime → dist/src}/observability/services/restore-audit-service.d.ts +0 -0
  778. /package/{runtime → dist/src}/observability/services/restore-audit-service.js +0 -0
  779. /package/{runtime → dist/src}/observability/services/runtime-decision-recorder.d.ts +0 -0
  780. /package/{runtime → dist/src}/observability/services/runtime-decision-recorder.js +0 -0
  781. /package/{runtime → dist/src}/observability/services/runtime-secret-anchor-view.d.ts +0 -0
  782. /package/{runtime → dist/src}/observability/services/runtime-secret-anchor-view.js +0 -0
  783. /package/{runtime → dist/src}/observability/services/self-health-snapshot.d.ts +0 -0
  784. /package/{runtime → dist/src}/observability/services/self-health-snapshot.js +0 -0
  785. /package/{runtime → dist/src}/shared/types/continuity.d.ts +0 -0
  786. /package/{runtime → dist/src}/shared/types/continuity.js +0 -0
  787. /package/{runtime → dist/src}/shared/types/credential.d.ts +0 -0
  788. /package/{runtime → dist/src}/shared/types/credential.js +0 -0
  789. /package/{runtime → dist/src}/shared/types/goal.d.ts +0 -0
  790. /package/{runtime → dist/src}/shared/types/goal.js +0 -0
  791. /package/{runtime → dist/src}/shared/types/index.d.ts +0 -0
  792. /package/{runtime → dist/src}/shared/types/index.js +0 -0
  793. /package/{runtime → dist/src}/shared/types/outreach.d.ts +0 -0
  794. /package/{runtime → dist/src}/shared/types/outreach.js +0 -0
  795. /package/{runtime → dist/src}/shared/types/source-ref.d.ts +0 -0
  796. /package/{runtime → dist/src}/shared/types/source-ref.js +0 -0
  797. /package/{runtime → dist/src}/shared/types/v7-entities.d.ts +0 -0
  798. /package/{runtime → dist/src}/shared/types/v7-entities.js +0 -0
  799. /package/{runtime → dist/src}/storage/bootstrap/native-sqlite-probe.d.ts +0 -0
  800. /package/{runtime → dist/src}/storage/bootstrap/native-sqlite-probe.js +0 -0
  801. /package/{runtime → dist/src}/storage/bootstrap/repair-gate.d.ts +0 -0
  802. /package/{runtime → dist/src}/storage/bootstrap/repair-gate.js +0 -0
  803. /package/{runtime → dist/src}/storage/bootstrap/repair.d.ts +0 -0
  804. /package/{runtime → dist/src}/storage/bootstrap/repair.js +0 -0
  805. /package/{runtime → dist/src}/storage/bootstrap/storage-mode-smoke.d.ts +0 -0
  806. /package/{runtime → dist/src}/storage/bootstrap/storage-mode-smoke.js +0 -0
  807. /package/{runtime → dist/src}/storage/chronicle/session-chronicle-store.d.ts +0 -0
  808. /package/{runtime → dist/src}/storage/chronicle/session-chronicle-store.js +0 -0
  809. /package/{runtime → dist/src}/storage/db/index.d.ts +0 -0
  810. /package/{runtime → dist/src}/storage/db/index.js +0 -0
  811. /package/{runtime → dist/src}/storage/db/migration-runner.d.ts +0 -0
  812. /package/{runtime → dist/src}/storage/db/migration-runner.js +0 -0
  813. /package/{runtime → dist/src}/storage/db/migrations/index.d.ts +0 -0
  814. /package/{runtime → dist/src}/storage/db/migrations/index.js +0 -0
  815. /package/{runtime → dist/src}/storage/db/migrations/v7-001-foundation.d.ts +0 -0
  816. /package/{runtime → dist/src}/storage/db/migrations/v7-001-foundation.js +0 -0
  817. /package/{runtime → dist/src}/storage/db/migrations/v7-002-effect-commit-ledger.d.ts +0 -0
  818. /package/{runtime → dist/src}/storage/db/migrations/v7-002-effect-commit-ledger.js +0 -0
  819. /package/{runtime → dist/src}/storage/db/migrations/v7-003-circuit-breaker.d.ts +0 -0
  820. /package/{runtime → dist/src}/storage/db/migrations/v7-003-circuit-breaker.js +0 -0
  821. /package/{runtime → dist/src}/storage/db/migrations/v7-004-behavior-promotion.d.ts +0 -0
  822. /package/{runtime → dist/src}/storage/db/migrations/v7-004-behavior-promotion.js +0 -0
  823. /package/{runtime → dist/src}/storage/db/schema/agent-goal.d.ts +0 -0
  824. /package/{runtime → dist/src}/storage/db/schema/agent-goal.js +0 -0
  825. /package/{runtime → dist/src}/storage/db/schema/assets.d.ts +0 -0
  826. /package/{runtime → dist/src}/storage/db/schema/assets.js +0 -0
  827. /package/{runtime → dist/src}/storage/db/schema/credentials.d.ts +0 -0
  828. /package/{runtime → dist/src}/storage/db/schema/credentials.js +0 -0
  829. /package/{runtime → dist/src}/storage/db/schema/delivery-attempts.d.ts +0 -0
  830. /package/{runtime → dist/src}/storage/db/schema/delivery-attempts.js +0 -0
  831. /package/{runtime → dist/src}/storage/db/schema/index.d.ts +0 -0
  832. /package/{runtime → dist/src}/storage/db/schema/index.js +0 -0
  833. /package/{runtime → dist/src}/storage/db/schema/intent-commits.d.ts +0 -0
  834. /package/{runtime → dist/src}/storage/db/schema/intent-commits.js +0 -0
  835. /package/{runtime → dist/src}/storage/db/schema/life-evidence-index.d.ts +0 -0
  836. /package/{runtime → dist/src}/storage/db/schema/life-evidence-index.js +0 -0
  837. /package/{runtime → dist/src}/storage/db/schema/memory-store.d.ts +0 -0
  838. /package/{runtime → dist/src}/storage/db/schema/memory-store.js +0 -0
  839. /package/{runtime → dist/src}/storage/db/schema/narrative-state.d.ts +0 -0
  840. /package/{runtime → dist/src}/storage/db/schema/narrative-state.js +0 -0
  841. /package/{runtime → dist/src}/storage/db/schema/operator-fallback-artifacts.d.ts +0 -0
  842. /package/{runtime → dist/src}/storage/db/schema/operator-fallback-artifacts.js +0 -0
  843. /package/{runtime → dist/src}/storage/db/schema/policies.d.ts +0 -0
  844. /package/{runtime → dist/src}/storage/db/schema/policies.js +0 -0
  845. /package/{runtime → dist/src}/storage/db/schema/proposals.d.ts +0 -0
  846. /package/{runtime → dist/src}/storage/db/schema/proposals.js +0 -0
  847. /package/{runtime → dist/src}/storage/db/schema/provenance.d.ts +0 -0
  848. /package/{runtime → dist/src}/storage/db/schema/provenance.js +0 -0
  849. /package/{runtime → dist/src}/storage/db/schema/relationship-memory.d.ts +0 -0
  850. /package/{runtime → dist/src}/storage/db/schema/relationship-memory.js +0 -0
  851. /package/{runtime → dist/src}/storage/db/schema/session-chronicle.d.ts +0 -0
  852. /package/{runtime → dist/src}/storage/db/schema/session-chronicle.js +0 -0
  853. /package/{runtime → dist/src}/storage/db/transaction-utils.d.ts +0 -0
  854. /package/{runtime → dist/src}/storage/db/transaction-utils.js +0 -0
  855. /package/{runtime → dist/src}/storage/db/write-queue.d.ts +0 -0
  856. /package/{runtime → dist/src}/storage/db/write-queue.js +0 -0
  857. /package/{runtime → dist/src}/storage/delivery/query-delivery-attempts.d.ts +0 -0
  858. /package/{runtime → dist/src}/storage/delivery/query-delivery-attempts.js +0 -0
  859. /package/{runtime → dist/src}/storage/delivery/types.d.ts +0 -0
  860. /package/{runtime/storage/snapshots → dist/src/storage/delivery}/types.js +0 -0
  861. /package/{runtime → dist/src}/storage/delivery/write-delivery-attempt.d.ts +0 -0
  862. /package/{runtime → dist/src}/storage/delivery/write-delivery-attempt.js +0 -0
  863. /package/{runtime → dist/src}/storage/fallback/load-operator-fallback.d.ts +0 -0
  864. /package/{runtime → dist/src}/storage/fallback/load-operator-fallback.js +0 -0
  865. /package/{runtime → dist/src}/storage/fallback/operator-fallback-types.d.ts +0 -0
  866. /package/{runtime → dist/src}/storage/fallback/operator-fallback-types.js +0 -0
  867. /package/{runtime → dist/src}/storage/fallback/operator-fallback-view.d.ts +0 -0
  868. /package/{runtime → dist/src}/storage/fallback/operator-fallback-view.js +0 -0
  869. /package/{runtime → dist/src}/storage/fallback/write-operator-fallback.d.ts +0 -0
  870. /package/{runtime → dist/src}/storage/fallback/write-operator-fallback.js +0 -0
  871. /package/{runtime → dist/src}/storage/goal/agent-goal-store.d.ts +0 -0
  872. /package/{runtime → dist/src}/storage/goal/agent-goal-store.js +0 -0
  873. /package/{runtime → dist/src}/storage/index.d.ts +0 -0
  874. /package/{runtime → dist/src}/storage/index.js +0 -0
  875. /package/{runtime → dist/src}/storage/life-evidence/append-life-evidence.d.ts +0 -0
  876. /package/{runtime → dist/src}/storage/life-evidence/append-life-evidence.js +0 -0
  877. /package/{runtime → dist/src}/storage/life-evidence/types.d.ts +0 -0
  878. /package/{runtime → dist/src}/storage/life-evidence/types.js +0 -0
  879. /package/{runtime → dist/src}/storage/memory/workspace/paths.d.ts +0 -0
  880. /package/{runtime → dist/src}/storage/memory/workspace/paths.js +0 -0
  881. /package/{runtime → dist/src}/storage/memory/workspace/store.d.ts +0 -0
  882. /package/{runtime → dist/src}/storage/memory/workspace/store.js +0 -0
  883. /package/{runtime → dist/src}/storage/memory/workspace/types.d.ts +0 -0
  884. /package/{runtime/storage/user-interest → dist/src/storage/memory/workspace}/types.js +0 -0
  885. /package/{runtime → dist/src}/storage/memory-store/memory-store-lifecycle.d.ts +0 -0
  886. /package/{runtime → dist/src}/storage/memory-store/memory-store-lifecycle.js +0 -0
  887. /package/{runtime → dist/src}/storage/narrative/narrative-state-store.d.ts +0 -0
  888. /package/{runtime → dist/src}/storage/narrative/narrative-state-store.js +0 -0
  889. /package/{runtime → dist/src}/storage/quiet/persist-quiet-artifact.d.ts +0 -0
  890. /package/{runtime → dist/src}/storage/quiet/persist-quiet-artifact.js +0 -0
  891. /package/{runtime → dist/src}/storage/quiet/quiet-artifact-types.d.ts +0 -0
  892. /package/{runtime → dist/src}/storage/quiet/quiet-artifact-types.js +0 -0
  893. /package/{runtime → dist/src}/storage/quiet/quiet-artifact-writer.d.ts +0 -0
  894. /package/{runtime → dist/src}/storage/quiet/quiet-artifact-writer.js +0 -0
  895. /package/{runtime → dist/src}/storage/relationship/relationship-memory-store.d.ts +0 -0
  896. /package/{runtime → dist/src}/storage/relationship/relationship-memory-store.js +0 -0
  897. /package/{runtime → dist/src}/storage/repositories/asset-repository.d.ts +0 -0
  898. /package/{runtime → dist/src}/storage/repositories/asset-repository.js +0 -0
  899. /package/{runtime → dist/src}/storage/repositories/credential-repository.d.ts +0 -0
  900. /package/{runtime → dist/src}/storage/repositories/credential-repository.js +0 -0
  901. /package/{runtime → dist/src}/storage/repositories/index.d.ts +0 -0
  902. /package/{runtime → dist/src}/storage/repositories/index.js +0 -0
  903. /package/{runtime → dist/src}/storage/repositories/intent-commit-repository.d.ts +0 -0
  904. /package/{runtime → dist/src}/storage/repositories/intent-commit-repository.js +0 -0
  905. /package/{runtime → dist/src}/storage/repositories/policy-repository.d.ts +0 -0
  906. /package/{runtime → dist/src}/storage/repositories/policy-repository.js +0 -0
  907. /package/{runtime → dist/src}/storage/repositories/proposal-repository.d.ts +0 -0
  908. /package/{runtime → dist/src}/storage/repositories/proposal-repository.js +0 -0
  909. /package/{runtime → dist/src}/storage/repositories/provenance-repository.d.ts +0 -0
  910. /package/{runtime → dist/src}/storage/repositories/provenance-repository.js +0 -0
  911. /package/{runtime → dist/src}/storage/rhythm/rhythm-policy-snapshot.d.ts +0 -0
  912. /package/{runtime → dist/src}/storage/rhythm/rhythm-policy-snapshot.js +0 -0
  913. /package/{runtime → dist/src}/storage/services/credential-vault.d.ts +0 -0
  914. /package/{runtime → dist/src}/storage/services/credential-vault.js +0 -0
  915. /package/{runtime → dist/src}/storage/services/daily-log-pipeline.d.ts +0 -0
  916. /package/{runtime → dist/src}/storage/services/daily-log-pipeline.js +0 -0
  917. /package/{runtime → dist/src}/storage/services/diary-dream-store.d.ts +0 -0
  918. /package/{runtime → dist/src}/storage/services/diary-dream-store.js +0 -0
  919. /package/{runtime → dist/src}/storage/services/effect-commit-store.d.ts +0 -0
  920. /package/{runtime → dist/src}/storage/services/effect-commit-store.js +0 -0
  921. /package/{runtime → dist/src}/storage/services/embodied-context-state-port.d.ts +0 -0
  922. /package/{runtime → dist/src}/storage/services/embodied-context-state-port.js +0 -0
  923. /package/{runtime → dist/src}/storage/services/goal-lifecycle-store.d.ts +0 -0
  924. /package/{runtime → dist/src}/storage/services/goal-lifecycle-store.js +0 -0
  925. /package/{runtime → dist/src}/storage/services/governance-layer.d.ts +0 -0
  926. /package/{runtime → dist/src}/storage/services/governance-layer.js +0 -0
  927. /package/{runtime → dist/src}/storage/services/history-digest-store.d.ts +0 -0
  928. /package/{runtime → dist/src}/storage/services/history-digest-store.js +0 -0
  929. /package/{runtime → dist/src}/storage/services/identity-profile-store.d.ts +0 -0
  930. /package/{runtime → dist/src}/storage/services/identity-profile-store.js +0 -0
  931. /package/{runtime → dist/src}/storage/services/interaction-snapshot-projector.d.ts +0 -0
  932. /package/{runtime → dist/src}/storage/services/interaction-snapshot-projector.js +0 -0
  933. /package/{runtime → dist/src}/storage/services/persona-candidate-loader.d.ts +0 -0
  934. /package/{runtime → dist/src}/storage/services/persona-candidate-loader.js +0 -0
  935. /package/{runtime → dist/src}/storage/services/provenance-service.d.ts +0 -0
  936. /package/{runtime → dist/src}/storage/services/provenance-service.js +0 -0
  937. /package/{runtime → dist/src}/storage/services/quiet-input-loader.d.ts +0 -0
  938. /package/{runtime → dist/src}/storage/services/quiet-input-loader.js +0 -0
  939. /package/{runtime → dist/src}/storage/services/repair-and-backup.d.ts +0 -0
  940. /package/{runtime → dist/src}/storage/services/repair-and-backup.js +0 -0
  941. /package/{runtime → dist/src}/storage/services/restore-snapshot-store.d.ts +0 -0
  942. /package/{runtime → dist/src}/storage/services/restore-snapshot-store.js +0 -0
  943. /package/{runtime → dist/src}/storage/services/runtime-secret-anchor-store.d.ts +0 -0
  944. /package/{runtime → dist/src}/storage/services/runtime-secret-anchor-store.js +0 -0
  945. /package/{runtime → dist/src}/storage/services/tool-experience-store.d.ts +0 -0
  946. /package/{runtime → dist/src}/storage/services/tool-experience-store.js +0 -0
  947. /package/{runtime → dist/src}/storage/services/write-validation-gate.d.ts +0 -0
  948. /package/{runtime → dist/src}/storage/services/write-validation-gate.js +0 -0
  949. /package/{runtime → dist/src}/storage/snapshots/continuity-snapshot.d.ts +0 -0
  950. /package/{runtime → dist/src}/storage/snapshots/continuity-snapshot.js +0 -0
  951. /package/{runtime → dist/src}/storage/snapshots/life-evidence-snapshot.d.ts +0 -0
  952. /package/{runtime → dist/src}/storage/snapshots/life-evidence-snapshot.js +0 -0
  953. /package/{runtime → dist/src}/storage/snapshots/types.d.ts +0 -0
  954. /package/{runtime → dist/src}/storage/state-api.d.ts +0 -0
  955. /package/{runtime → dist/src}/storage/state-api.js +0 -0
  956. /package/{runtime → dist/src}/storage/user-interest/load-user-interest-snapshot.d.ts +0 -0
  957. /package/{runtime → dist/src}/storage/user-interest/load-user-interest-snapshot.js +0 -0
  958. /package/{runtime → dist/src}/storage/user-interest/types.d.ts +0 -0
@@ -0,0 +1,65 @@
1
+ import test from "node:test";
2
+ import assert from "node:assert/strict";
3
+ import { createStateDatabase } from "../../../src/storage/db/index.js";
4
+ import { createRelationshipMemoryStore, } from "../../../src/storage/relationship/relationship-memory-store.js";
5
+ function makeUpdate(overrides = {}) {
6
+ return {
7
+ relationshipId: "default",
8
+ revision: 1,
9
+ tonePreference: "casual",
10
+ averageReplyDelayMinutes: 15,
11
+ noReplyCount: 0,
12
+ topicAffinities: [{ topic: "coding", affinity: 0.9 }],
13
+ lastInteractionAt: new Date().toISOString(),
14
+ sourceRefs: [{ sourceId: "reply-1", kind: "owner_reply" }],
15
+ updatedAt: new Date().toISOString(),
16
+ ...overrides,
17
+ };
18
+ }
19
+ test("upsertRelationshipMemory writes and load returns complete memory", async () => {
20
+ const db = createStateDatabase(":memory:");
21
+ const store = createRelationshipMemoryStore(db);
22
+ const update = makeUpdate();
23
+ const ack = await store.upsertRelationshipMemory(update);
24
+ assert.equal(ack.relationshipId, "default");
25
+ const loaded = await store.loadRelationshipMemory();
26
+ assert.ok(loaded);
27
+ assert.equal(loaded.tonePreference, "casual");
28
+ assert.equal(loaded.averageReplyDelayMinutes, 15);
29
+ assert.equal(loaded.topicAffinities[0].topic, "coding");
30
+ assert.equal(loaded.sourceRefs[0].sourceId, "reply-1");
31
+ });
32
+ test("noReplyCount increment records cooldown without invented preference", async () => {
33
+ const db = createStateDatabase(":memory:");
34
+ const store = createRelationshipMemoryStore(db);
35
+ await store.upsertRelationshipMemory(makeUpdate({ noReplyCount: 0 }));
36
+ await store.upsertRelationshipMemory(makeUpdate({ noReplyCount: 1, averageReplyDelayMinutes: undefined }));
37
+ const loaded = await store.loadRelationshipMemory();
38
+ assert.ok(loaded);
39
+ assert.equal(loaded.noReplyCount, 1);
40
+ assert.equal(loaded.averageReplyDelayMinutes, undefined);
41
+ // tonePreference should still be what was recorded, not invented
42
+ assert.equal(loaded.tonePreference, "casual");
43
+ });
44
+ test("unknown tonePreference when insufficient history", async () => {
45
+ const db = createStateDatabase(":memory:");
46
+ const store = createRelationshipMemoryStore(db);
47
+ await store.upsertRelationshipMemory(makeUpdate({ tonePreference: "unknown", topicAffinities: [] }));
48
+ const loaded = await store.loadRelationshipMemory();
49
+ assert.equal(loaded.tonePreference, "unknown");
50
+ });
51
+ test("upsert bumps revision and updates topicAffinities", async () => {
52
+ const db = createStateDatabase(":memory:");
53
+ const store = createRelationshipMemoryStore(db);
54
+ await store.upsertRelationshipMemory(makeUpdate({ revision: 1, topicAffinities: [{ topic: "a", affinity: 0.5 }] }));
55
+ await store.upsertRelationshipMemory(makeUpdate({ revision: 2, topicAffinities: [{ topic: "a", affinity: 0.8 }, { topic: "b", affinity: 0.3 }] }));
56
+ const loaded = await store.loadRelationshipMemory();
57
+ assert.equal(loaded.revision, 2);
58
+ assert.equal(loaded.topicAffinities.length, 2);
59
+ });
60
+ test("loadRelationshipMemory returns null when nothing written", async () => {
61
+ const db = createStateDatabase(":memory:");
62
+ const store = createRelationshipMemoryStore(db);
63
+ const loaded = await store.loadRelationshipMemory("missing");
64
+ assert.equal(loaded, null);
65
+ });
@@ -0,0 +1,166 @@
1
+ import test from "node:test";
2
+ import assert from "node:assert/strict";
3
+ import { createStateDatabase } from "../../../src/storage/db/index.js";
4
+ import { createAgentGoalStore, } from "../../../src/storage/goal/agent-goal-store.js";
5
+ function makeGoal(overrides = {}) {
6
+ return {
7
+ goalId: `goal-${Date.now()}-${Math.random().toString(36).slice(2)}`,
8
+ kind: "short_term",
9
+ status: "proposal",
10
+ origin: "agent_proposed",
11
+ description: "Improve connector onboarding",
12
+ completionCriteria: "Manifest scan passes all tests",
13
+ risk: "low",
14
+ priorityHint: 5,
15
+ sourceRefs: [{ sourceId: "dream-1", kind: "insight" }],
16
+ createdAt: new Date().toISOString(),
17
+ updatedAt: new Date().toISOString(),
18
+ ...overrides,
19
+ };
20
+ }
21
+ test("owner-set goal is accepted on write", async () => {
22
+ const db = createStateDatabase(":memory:");
23
+ const store = createAgentGoalStore(db);
24
+ const goal = makeGoal({ origin: "owner_set", status: "accepted", acceptedBy: "owner" });
25
+ const ack = await store.upsertAgentGoal(goal);
26
+ assert.equal(ack.goalId, goal.goalId);
27
+ const loaded = await store.loadAgentGoal(goal.goalId);
28
+ assert.ok(loaded);
29
+ assert.equal(loaded.status, "accepted");
30
+ assert.equal(loaded.acceptedBy, "owner");
31
+ assert.equal(loaded.origin, "owner_set");
32
+ });
33
+ test("agent-proposed goal remains proposal by default", async () => {
34
+ const db = createStateDatabase(":memory:");
35
+ const store = createAgentGoalStore(db);
36
+ const goal = makeGoal({ origin: "agent_proposed", status: "proposal" });
37
+ await store.upsertAgentGoal(goal);
38
+ const loaded = await store.loadAgentGoal(goal.goalId);
39
+ assert.equal(loaded.status, "proposal");
40
+ assert.equal(loaded.acceptedBy, undefined);
41
+ });
42
+ test("transitionGoalStatus from proposal to accepted with policy_allowlist", async () => {
43
+ const db = createStateDatabase(":memory:");
44
+ const store = createAgentGoalStore(db);
45
+ const goal = makeGoal({ origin: "agent_proposed", status: "proposal" });
46
+ await store.upsertAgentGoal(goal);
47
+ const transition = {
48
+ goalId: goal.goalId,
49
+ newStatus: "accepted",
50
+ acceptedBy: "policy_allowlist",
51
+ updatedAt: new Date().toISOString(),
52
+ };
53
+ const ack = await store.transitionGoalStatus(transition);
54
+ assert.equal(ack.status, "acknowledged");
55
+ const loaded = await store.loadAgentGoal(goal.goalId);
56
+ assert.equal(loaded.status, "accepted");
57
+ assert.equal(loaded.acceptedBy, "policy_allowlist");
58
+ });
59
+ test("transitionGoalStatus rejects proposal back to rejected", async () => {
60
+ const db = createStateDatabase(":memory:");
61
+ const store = createAgentGoalStore(db);
62
+ const goal = makeGoal({ origin: "agent_proposed", status: "proposal" });
63
+ await store.upsertAgentGoal(goal);
64
+ await store.transitionGoalStatus({
65
+ goalId: goal.goalId,
66
+ newStatus: "rejected",
67
+ updatedAt: new Date().toISOString(),
68
+ });
69
+ const loaded = await store.loadAgentGoal(goal.goalId);
70
+ assert.equal(loaded.status, "rejected");
71
+ });
72
+ test("listAgentGoals filters by status", async () => {
73
+ const db = createStateDatabase(":memory:");
74
+ const store = createAgentGoalStore(db);
75
+ const g1 = makeGoal({ status: "accepted", origin: "owner_set", scope: "global" });
76
+ const g2 = makeGoal({ status: "proposal", origin: "agent_proposed", scope: "moltbook" });
77
+ const g3 = makeGoal({ status: "completed", origin: "owner_set", scope: "instreet" });
78
+ await store.upsertAgentGoal(g1);
79
+ await store.upsertAgentGoal(g2);
80
+ await store.upsertAgentGoal(g3);
81
+ const accepted = await store.listAgentGoals({ statuses: ["accepted"] });
82
+ assert.equal(accepted.length, 1);
83
+ assert.equal(accepted[0].goalId, g1.goalId);
84
+ const active = await store.listAgentGoals({ statuses: ["accepted", "proposal"] });
85
+ assert.equal(active.length, 2);
86
+ });
87
+ test("listAgentGoals filters by origin", async () => {
88
+ const db = createStateDatabase(":memory:");
89
+ const store = createAgentGoalStore(db);
90
+ const g1 = makeGoal({ origin: "owner_set" });
91
+ const g2 = makeGoal({ origin: "agent_proposed" });
92
+ await store.upsertAgentGoal(g1);
93
+ await store.upsertAgentGoal(g2);
94
+ const ownerSet = await store.listAgentGoals({ origins: ["owner_set"] });
95
+ assert.equal(ownerSet.length, 1);
96
+ assert.equal(ownerSet[0].origin, "owner_set");
97
+ });
98
+ test("loadAgentGoal returns null for missing goal", async () => {
99
+ const db = createStateDatabase(":memory:");
100
+ const store = createAgentGoalStore(db);
101
+ const loaded = await store.loadAgentGoal("missing");
102
+ assert.equal(loaded, null);
103
+ });
104
+ test("goal update preserves createdAt and changes updatedAt", async () => {
105
+ const db = createStateDatabase(":memory:");
106
+ const store = createAgentGoalStore(db);
107
+ const created = new Date(Date.now() - 86400000).toISOString();
108
+ const goal = makeGoal({ createdAt: created, updatedAt: created });
109
+ await store.upsertAgentGoal(goal);
110
+ const updated = new Date().toISOString();
111
+ await store.upsertAgentGoal({ ...goal, description: "Updated", updatedAt: updated });
112
+ const loaded = await store.loadAgentGoal(goal.goalId);
113
+ assert.equal(loaded.createdAt, created);
114
+ assert.equal(loaded.updatedAt, updated);
115
+ assert.equal(loaded.description, "Updated");
116
+ });
117
+ // ─── T-V7C.C.4: goal dedupe ────────────────────────────────────────────────
118
+ test("upsert accepted goal marks old same-kind-scope as replaced", async () => {
119
+ const db = createStateDatabase(":memory:");
120
+ const store = createAgentGoalStore(db);
121
+ const oldGoal = makeGoal({ status: "accepted", origin: "owner_set", scope: "global", acceptedBy: "owner" });
122
+ const newGoal = makeGoal({ status: "accepted", origin: "owner_set", scope: "global", acceptedBy: "owner" });
123
+ await store.upsertAgentGoal(oldGoal);
124
+ await store.upsertAgentGoal(newGoal);
125
+ const oldLoaded = await store.loadAgentGoal(oldGoal.goalId);
126
+ assert.equal(oldLoaded.status, "replaced");
127
+ const newLoaded = await store.loadAgentGoal(newGoal.goalId);
128
+ assert.equal(newLoaded.status, "accepted");
129
+ });
130
+ test("upsert accepted goal does NOT replace different scope", async () => {
131
+ const db = createStateDatabase(":memory:");
132
+ const store = createAgentGoalStore(db);
133
+ const globalGoal = makeGoal({ status: "accepted", scope: "global", acceptedBy: "owner" });
134
+ const platformGoal = makeGoal({ status: "accepted", scope: "moltbook", acceptedBy: "owner" });
135
+ await store.upsertAgentGoal(globalGoal);
136
+ await store.upsertAgentGoal(platformGoal);
137
+ const globalLoaded = await store.loadAgentGoal(globalGoal.goalId);
138
+ assert.equal(globalLoaded.status, "accepted");
139
+ const platformLoaded = await store.loadAgentGoal(platformGoal.goalId);
140
+ assert.equal(platformLoaded.status, "accepted");
141
+ });
142
+ test("listAgentGoals dedupes by kind+scope keeping newest", async () => {
143
+ const db = createStateDatabase(":memory:");
144
+ const store = createAgentGoalStore(db);
145
+ const now = Date.now();
146
+ const oldGoal = makeGoal({
147
+ status: "accepted", scope: "global", acceptedBy: "owner",
148
+ updatedAt: new Date(now - 1000).toISOString(),
149
+ });
150
+ const newGoal = makeGoal({
151
+ status: "accepted", scope: "global", acceptedBy: "owner",
152
+ updatedAt: new Date(now).toISOString(),
153
+ });
154
+ // Insert old as "replaced" manually to simulate a race condition where DB still has both accepted
155
+ await store.upsertAgentGoal(oldGoal);
156
+ await store.upsertAgentGoal(newGoal);
157
+ // Force old back to accepted to test listAgentGoals dedupe
158
+ await store.transitionGoalStatus({
159
+ goalId: oldGoal.goalId,
160
+ newStatus: "accepted",
161
+ updatedAt: oldGoal.updatedAt,
162
+ });
163
+ const listed = await store.listAgentGoals({ statuses: ["accepted"] });
164
+ assert.equal(listed.length, 1);
165
+ assert.equal(listed[0].goalId, newGoal.goalId);
166
+ });
@@ -0,0 +1,4 @@
1
+ /**
2
+ * T-SMS.C.5 — ToolExperienceStore + CapabilityProbeResultStore 单元测试
3
+ */
4
+ export {};
@@ -0,0 +1,92 @@
1
+ /**
2
+ * T-SMS.C.5 — ToolExperienceStore + CapabilityProbeResultStore 单元测试
3
+ */
4
+ import { describe, it } from "node:test";
5
+ import assert from "node:assert";
6
+ import { createStateDatabase } from "../../../src/storage/db/index.js";
7
+ import { createToolExperienceStore, createCapabilityProbeResultStore, } from "../../../src/storage/services/tool-experience-store.js";
8
+ describe("ToolExperienceStore", () => {
9
+ it("appends and lists tool experience", async () => {
10
+ const db = createStateDatabase(":memory:");
11
+ const store = createToolExperienceStore(db);
12
+ await store.appendToolExperience({
13
+ experienceId: "exp-1",
14
+ connectorId: "moltbook",
15
+ capabilityId: "feed.read",
16
+ outcome: "failure",
17
+ failureClass: "http_404",
18
+ latencyMs: 120,
19
+ evidenceQuality: 0,
20
+ sourceRefs: ["probe:result-1"],
21
+ triggerSource: "probe",
22
+ createdAt: "2026-05-21T00:00:00Z",
23
+ });
24
+ const rows = await store.listToolExperience({ connectorId: "moltbook" });
25
+ assert.strictEqual(rows.length, 1);
26
+ assert.strictEqual(rows[0].failureClass, "http_404");
27
+ assert.strictEqual(rows[0].triggerSource, "probe");
28
+ });
29
+ it("rejects raw payload through gate", async () => {
30
+ const db = createStateDatabase(":memory:");
31
+ const store = createToolExperienceStore(db);
32
+ await assert.rejects(store.appendToolExperience({
33
+ experienceId: "exp-bad",
34
+ connectorId: "x",
35
+ capabilityId: "x",
36
+ outcome: "success",
37
+ latencyMs: 0,
38
+ evidenceQuality: 0,
39
+ sourceRefs: ["ref:1"],
40
+ triggerSource: "heartbeat",
41
+ createdAt: "2026-05-21T00:00:00Z",
42
+ credential: "secret", // sensitive field
43
+ }));
44
+ });
45
+ });
46
+ describe("CapabilityProbeResultStore", () => {
47
+ it("appends and lists probe results", async () => {
48
+ const db = createStateDatabase(":memory:");
49
+ const store = createCapabilityProbeResultStore(db);
50
+ await store.appendProbeResult({
51
+ probeResultId: "probe-1",
52
+ capabilityId: "moltbook:feed.read",
53
+ connectorId: "moltbook",
54
+ actualStatus: "available",
55
+ httpStatus: 200,
56
+ sampleResponseRef: "ref:1",
57
+ probeConfigRef: "cfg:1",
58
+ createdAt: "2026-05-21T00:00:00Z",
59
+ });
60
+ const rows = await store.listProbeResults("moltbook");
61
+ assert.strictEqual(rows.length, 1);
62
+ assert.strictEqual(rows[0].actualStatus, "available");
63
+ assert.strictEqual(rows[0].httpStatus, 200);
64
+ });
65
+ it("upserts duplicate probe result ids instead of crashing", async () => {
66
+ const db = createStateDatabase(":memory:");
67
+ const store = createCapabilityProbeResultStore(db);
68
+ await store.appendProbeResult({
69
+ probeResultId: "probe-repeat",
70
+ capabilityId: "moltbook:feed.read",
71
+ connectorId: "moltbook",
72
+ actualStatus: "degraded",
73
+ httpStatus: 503,
74
+ probeConfigRef: "cfg:old",
75
+ createdAt: "2026-05-21T00:00:00Z",
76
+ });
77
+ await store.appendProbeResult({
78
+ probeResultId: "probe-repeat",
79
+ capabilityId: "moltbook:feed.read",
80
+ connectorId: "moltbook",
81
+ actualStatus: "available",
82
+ httpStatus: 200,
83
+ probeConfigRef: "cfg:new",
84
+ createdAt: "2026-05-21T00:01:00Z",
85
+ });
86
+ const rows = await store.listProbeResults("moltbook");
87
+ assert.strictEqual(rows.length, 1);
88
+ assert.strictEqual(rows[0].actualStatus, "available");
89
+ assert.strictEqual(rows[0].httpStatus, 200);
90
+ assert.strictEqual(rows[0].probeConfigRef, "cfg:new");
91
+ });
92
+ });
@@ -0,0 +1,48 @@
1
+ import test from "node:test";
2
+ import assert from "node:assert/strict";
3
+ import * as fs from "fs/promises";
4
+ import * as os from "node:os";
5
+ import * as path from "node:path";
6
+ import { loadUserInterestSnapshot } from "../../../src/storage/user-interest/load-user-interest-snapshot.js";
7
+ const anchorBody = "# Profile\n" + "x".repeat(40);
8
+ test("T4.2.2 missing anchors and curated → insufficient + missing_user_interest_model", async () => {
9
+ const dir = await fs.mkdtemp(path.join(os.tmpdir(), "sn-interest-"));
10
+ const snap = await loadUserInterestSnapshot(dir);
11
+ assert.equal(snap.staleness, "insufficient");
12
+ assert.equal(snap.confidence, 0);
13
+ assert.ok(snap.missingReasons?.includes("missing_user_interest_model"));
14
+ assert.equal(snap.signals.length, 0);
15
+ await fs.rm(dir, { recursive: true, force: true });
16
+ });
17
+ test("T4.2.2 USER.md + MEMORY.md anchors yield fresh snapshot with source-backed signals", async () => {
18
+ const dir = await fs.mkdtemp(path.join(os.tmpdir(), "sn-interest-"));
19
+ await fs.writeFile(path.join(dir, "USER.md"), anchorBody, "utf-8");
20
+ await fs.writeFile(path.join(dir, "MEMORY.md"), anchorBody, "utf-8");
21
+ const snap = await loadUserInterestSnapshot(dir);
22
+ assert.equal(snap.staleness, "fresh");
23
+ assert.ok(snap.confidence > 0);
24
+ assert.ok(snap.signals.length >= 2);
25
+ assert.ok(snap.signals.every((s) => s.sourceRefs.length > 0));
26
+ assert.ok(snap.sourceRefs.length > 0);
27
+ await fs.rm(dir, { recursive: true, force: true });
28
+ });
29
+ test("T4.2.2 stale mtime on anchors yields staleness stale", async () => {
30
+ const dir = await fs.mkdtemp(path.join(os.tmpdir(), "sn-interest-"));
31
+ const userPath = path.join(dir, "USER.md");
32
+ await fs.writeFile(userPath, anchorBody, "utf-8");
33
+ const old = new Date("2020-01-01T00:00:00Z");
34
+ await fs.utimes(userPath, old, old);
35
+ const snap = await loadUserInterestSnapshot(dir);
36
+ assert.equal(snap.staleness, "stale");
37
+ assert.ok(snap.signals.length >= 1);
38
+ await fs.rm(dir, { recursive: true, force: true });
39
+ });
40
+ test("T4.2.2 curated memory file alone can produce signals", async () => {
41
+ const dir = await fs.mkdtemp(path.join(os.tmpdir(), "sn-interest-"));
42
+ await fs.mkdir(path.join(dir, "memory", "curated"), { recursive: true });
43
+ await fs.writeFile(path.join(dir, "memory", "curated", "note.md"), anchorBody, "utf-8");
44
+ const snap = await loadUserInterestSnapshot(dir);
45
+ assert.equal(snap.staleness, "fresh");
46
+ assert.ok(snap.signals.some((s) => s.topic.startsWith("curated:")));
47
+ await fs.rm(dir, { recursive: true, force: true });
48
+ });
@@ -0,0 +1,12 @@
1
+ /**
2
+ * T-SMS.F.3 — Write Queue unit tests.
3
+ *
4
+ * Verification (05A / 05B):
5
+ * - Concurrent writes serialize correctly
6
+ * - Flush failure writes to stderr, read path unblocked
7
+ * - triggerSource preserved through pipeline
8
+ * - Retry on busy errors
9
+ *
10
+ * Dependencies: sql.js, src/storage/db/write-queue.ts
11
+ */
12
+ export {};
@@ -0,0 +1,177 @@
1
+ /**
2
+ * T-SMS.F.3 — Write Queue unit tests.
3
+ *
4
+ * Verification (05A / 05B):
5
+ * - Concurrent writes serialize correctly
6
+ * - Flush failure writes to stderr, read path unblocked
7
+ * - triggerSource preserved through pipeline
8
+ * - Retry on busy errors
9
+ *
10
+ * Dependencies: sql.js, src/storage/db/write-queue.ts
11
+ */
12
+ import { describe, it } from "node:test";
13
+ import assert from "node:assert/strict";
14
+ import initSqlJs from "sql.js";
15
+ import { createWriteQueue, } from "../../../src/storage/db/write-queue.js";
16
+ async function createMemoryDb() {
17
+ const SQL = await initSqlJs();
18
+ const db = new SQL.Database();
19
+ db.exec(`
20
+ CREATE TABLE test_writes (
21
+ id TEXT PRIMARY KEY,
22
+ value TEXT NOT NULL,
23
+ trigger_source TEXT NOT NULL
24
+ );
25
+ `);
26
+ return db;
27
+ }
28
+ describe("write-queue", () => {
29
+ it("serializes concurrent write requests", async () => {
30
+ const sqlite = await createMemoryDb();
31
+ const queue = createWriteQueue(sqlite);
32
+ const order = [];
33
+ const req1 = {
34
+ label: "write-1",
35
+ triggerSource: "heartbeat",
36
+ execute: (db) => {
37
+ db.exec("INSERT INTO test_writes (id, value, trigger_source) VALUES ('w1', 'first', 'heartbeat')");
38
+ order.push(1);
39
+ },
40
+ };
41
+ const req2 = {
42
+ label: "write-2",
43
+ triggerSource: "manual_run",
44
+ execute: (db) => {
45
+ db.exec("INSERT INTO test_writes (id, value, trigger_source) VALUES ('w2', 'second', 'manual_run')");
46
+ order.push(2);
47
+ },
48
+ };
49
+ // Enqueue both simultaneously
50
+ const [r1, r2] = await Promise.all([
51
+ queue.enqueue(req1),
52
+ queue.enqueue(req2),
53
+ ]);
54
+ assert.equal(r1.ok, true);
55
+ assert.equal(r2.ok, true);
56
+ // Both writes should be present
57
+ const rows = sqlite.exec("SELECT id FROM test_writes ORDER BY id");
58
+ assert.equal(rows[0].values.length, 2);
59
+ assert.deepEqual(rows[0].values.map((r) => r[0]), ["w1", "w2"]);
60
+ // Order should be sequential (1 then 2)
61
+ assert.deepEqual(order, [1, 2]);
62
+ sqlite.close();
63
+ });
64
+ it("preserves triggerSource through the pipeline", async () => {
65
+ const sqlite = await createMemoryDb();
66
+ const queue = createWriteQueue(sqlite);
67
+ const sources = ["heartbeat", "manual_run", "probe", "idle_curiosity"];
68
+ for (const source of sources) {
69
+ const result = await queue.enqueue({
70
+ label: `write-${source}`,
71
+ triggerSource: source,
72
+ execute: (db) => {
73
+ db.exec(`INSERT INTO test_writes (id, value, trigger_source) VALUES ('${source}', 'val', '${source}')`);
74
+ return source;
75
+ },
76
+ });
77
+ assert.equal(result.ok, true);
78
+ assert.equal(result.triggerSource, source);
79
+ assert.equal(result.value, source);
80
+ }
81
+ // Verify stored trigger sources
82
+ for (const source of sources) {
83
+ const rows = sqlite.exec(`SELECT trigger_source FROM test_writes WHERE id = '${source}'`);
84
+ assert.equal(rows[0].values[0][0], source);
85
+ }
86
+ sqlite.close();
87
+ });
88
+ it("manual_run triggerSource is not overwritten", async () => {
89
+ const sqlite = await createMemoryDb();
90
+ const queue = createWriteQueue(sqlite);
91
+ const result = await queue.enqueue({
92
+ label: "manual-write",
93
+ triggerSource: "manual_run",
94
+ execute: (db) => {
95
+ db.exec("INSERT INTO test_writes (id, value, trigger_source) VALUES ('m1', 'manual', 'manual_run')");
96
+ },
97
+ });
98
+ assert.equal(result.ok, true);
99
+ assert.equal(result.triggerSource, "manual_run");
100
+ const rows = sqlite.exec("SELECT trigger_source FROM test_writes WHERE id = 'm1'");
101
+ assert.equal(rows[0].values[0][0], "manual_run");
102
+ sqlite.close();
103
+ });
104
+ it("write failure sends error to stderr without blocking reads", async () => {
105
+ const sqlite = await createMemoryDb();
106
+ const queue = createWriteQueue(sqlite);
107
+ const result = await queue.enqueue({
108
+ label: "bad-write",
109
+ triggerSource: "heartbeat",
110
+ execute: () => {
111
+ throw new Error("simulated write failure");
112
+ },
113
+ });
114
+ assert.equal(result.ok, false);
115
+ assert.ok(result.error);
116
+ assert.ok(result.error.includes("simulated write failure"));
117
+ // Read path still works
118
+ const rows = sqlite.exec("SELECT COUNT(*) FROM test_writes");
119
+ assert.equal(rows[0].values[0][0], 0);
120
+ sqlite.close();
121
+ });
122
+ it("failed write does not block subsequent writes", async () => {
123
+ const sqlite = await createMemoryDb();
124
+ const queue = createWriteQueue(sqlite);
125
+ // First write fails
126
+ await queue.enqueue({
127
+ label: "fail",
128
+ triggerSource: "heartbeat",
129
+ execute: () => {
130
+ throw new Error("first failure");
131
+ },
132
+ });
133
+ // Second write succeeds
134
+ const result = await queue.enqueue({
135
+ label: "succeed",
136
+ triggerSource: "heartbeat",
137
+ execute: (db) => {
138
+ db.exec("INSERT INTO test_writes (id, value, trigger_source) VALUES ('s1', 'ok', 'heartbeat')");
139
+ },
140
+ });
141
+ assert.equal(result.ok, true);
142
+ const rows = sqlite.exec("SELECT id FROM test_writes");
143
+ assert.equal(rows[0].values.length, 1);
144
+ assert.equal(rows[0].values[0][0], "s1");
145
+ sqlite.close();
146
+ });
147
+ it("returns value from successful write execution", async () => {
148
+ const sqlite = await createMemoryDb();
149
+ const queue = createWriteQueue(sqlite);
150
+ const result = await queue.enqueue({
151
+ label: "return-val",
152
+ triggerSource: "probe",
153
+ execute: (db) => {
154
+ db.exec("INSERT INTO test_writes (id, value, trigger_source) VALUES ('r1', 'ret', 'probe')");
155
+ return { inserted: "r1" };
156
+ },
157
+ });
158
+ assert.equal(result.ok, true);
159
+ assert.deepEqual(result.value, { inserted: "r1" });
160
+ sqlite.close();
161
+ });
162
+ it("pending count reflects queue state", async () => {
163
+ const sqlite = await createMemoryDb();
164
+ const queue = createWriteQueue(sqlite);
165
+ assert.equal(queue.pending, 0);
166
+ // Quick sequential writes to verify pending doesn't grow unexpectedly
167
+ await queue.enqueue({
168
+ label: "p1",
169
+ triggerSource: "heartbeat",
170
+ execute: (db) => {
171
+ db.exec("INSERT INTO test_writes (id, value, trigger_source) VALUES ('p1', 'v', 'heartbeat')");
172
+ },
173
+ });
174
+ assert.equal(queue.pending, 0);
175
+ sqlite.close();
176
+ });
177
+ });
@@ -0,0 +1,9 @@
1
+ /**
2
+ * T-SMS.C.1 — WriteValidationGate 单元测试
3
+ *
4
+ * Verification types (05A / 05B):
5
+ * - 单元测试: 4 类拒绝条件;gate 不可绕过;敏感字段检测
6
+ *
7
+ * Dependencies: `src/storage/services/write-validation-gate.ts`
8
+ */
9
+ export {};