fuli-context 0.20.1 → 0.21.0-beta.2

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 (262) hide show
  1. package/dist/web/assets/{AboutPage-CjDenGS_.js → AboutPage-D0dTwKq8.js} +1 -1
  2. package/dist/web/assets/{AgentName-DdlJlpT3.js → AgentName-n4oqQUwE.js} +1 -1
  3. package/dist/web/assets/{AgentProfilePage-Cx_Uf5Vf.js → AgentProfilePage-DH54S93r.js} +1 -1
  4. package/dist/web/assets/{AgentsDirectoryPage-DylT-GSW.js → AgentsDirectoryPage-xwIRrNb8.js} +1 -1
  5. package/dist/web/assets/{BackLink-D7oAvDG5.js → BackLink-nM3e40IT.js} +1 -1
  6. package/dist/web/assets/{BoardMoveMenu-B0pA7LLx.js → BoardMoveMenu-Cxgkbwkl.js} +1 -1
  7. package/dist/web/assets/{CaptureChangePage-DEuqPb14.js → CaptureChangePage-DWdz9dEk.js} +1 -1
  8. package/dist/web/assets/{Card-BZFLZ_2I.js → Card-89NKHANE.js} +1 -1
  9. package/dist/web/assets/{CardHeader-C_c0keQn.js → CardHeader-9MwjWRxl.js} +1 -1
  10. package/dist/web/assets/{CardTitle-yXOhV577.js → CardTitle-BAhmXjAK.js} +1 -1
  11. package/dist/web/assets/{ConnectionsPage-DlnHdtwn.js → ConnectionsPage-Yf4UvjDT.js} +1 -1
  12. package/dist/web/assets/{CreateProjectDialog-BVJqWdlT.js → CreateProjectDialog-crpLTyDf.js} +1 -1
  13. package/dist/web/assets/{DataFormatPage-BdcjcyhZ.js → DataFormatPage-BPuUH0PG.js} +1 -1
  14. package/dist/web/assets/{DialogFooter-DYawfDCD.js → DialogFooter-D9A9hRP4.js} +1 -1
  15. package/dist/web/assets/{EmployeeRecruitDialog-CB4ARFkM.js → EmployeeRecruitDialog-DeB0XHeM.js} +1 -1
  16. package/dist/web/assets/EmployeeWorkbenchPage-0oK2RfIh.js +3 -0
  17. package/dist/web/assets/{EmployeeWorkbenchPage-BenZP7De.css → EmployeeWorkbenchPage-CMutwFBC.css} +1 -1
  18. package/dist/web/assets/{GrowthLoading-smW3-Gfp.js → GrowthLoading-Cs9brXcN.js} +1 -1
  19. package/dist/web/assets/{InboxPage-Crn1UU7s.js → InboxPage-CTQ425Ez.js} +1 -1
  20. package/dist/web/assets/{Input-F1oftPWh.js → Input-DGf4juEs.js} +1 -1
  21. package/dist/web/assets/{KnowledgeEditDialog-VdQwbX4E.js → KnowledgeEditDialog-Ccgj30Wu.js} +1 -1
  22. package/dist/web/assets/{KnowledgeHardDeleteSection-CXRmNnZF.js → KnowledgeHardDeleteSection-CSnqisUv.js} +1 -1
  23. package/dist/web/assets/{KnowledgeItemEditPage-CQo3TbCJ.js → KnowledgeItemEditPage-C0Y2DsHz.js} +1 -1
  24. package/dist/web/assets/{KnowledgeItemSummaryCard-Dd2McM-d.js → KnowledgeItemSummaryCard-BRvaf4Fw.js} +1 -1
  25. package/dist/web/assets/{KnowledgeOrganizerPage-BVgAyu6U.js → KnowledgeOrganizerPage-CRC3mk0j.js} +1 -1
  26. package/dist/web/assets/KnowledgePage-NsKFUWth.js +1 -0
  27. package/dist/web/assets/{KnowledgePeek-BNBkh1ey.js → KnowledgePeek-Bc0bqyZp.js} +1 -1
  28. package/dist/web/assets/{KnowledgeTurnReceiptPage-Ckw_olrt.js → KnowledgeTurnReceiptPage-Dl0KeFDe.js} +1 -1
  29. package/dist/web/assets/{KnowledgeWorkspace-pH2tAFld.js → KnowledgeWorkspace-BGlODG7G.js} +1 -1
  30. package/dist/web/assets/{Label-yDCtlpkb.js → Label-CafdTnDF.js} +1 -1
  31. package/dist/web/assets/ModelSettingsPage-Bz1tMXtW.js +1 -0
  32. package/dist/web/assets/ModelSettingsPage-DJuEaw6p.css +1 -0
  33. package/dist/web/assets/{NotFoundPage-8gVVukRR.js → NotFoundPage-TfZ2eoA2.js} +1 -1
  34. package/dist/web/assets/{OccupationsPage-PNoqE21Y.js → OccupationsPage-CnSp6362.js} +1 -1
  35. package/dist/web/assets/{OverviewPage-DiwYSnhh.js → OverviewPage-D5W-DhOz.js} +2 -2
  36. package/dist/web/assets/{PersonalProfilePage-C_v2BFee.js → PersonalProfilePage-CndOcRQ6.js} +1 -1
  37. package/dist/web/assets/{PersonalProjectsPage-DGRV8cM5.js → PersonalProjectsPage-CXBOwEqC.js} +1 -1
  38. package/dist/web/assets/{PopperContent-5zqbtnYr.js → PopperContent-BXbztFFi.js} +1 -1
  39. package/dist/web/assets/{Presence-BYfYJNMD.js → Presence-BLar6FCs.js} +1 -1
  40. package/dist/web/assets/{ProjectAgentDetailPage-BQ9ffaCX.js → ProjectAgentDetailPage-SmZ2NYTw.js} +1 -1
  41. package/dist/web/assets/{ProjectAgentDialog-BGckQDTq.js → ProjectAgentDialog-Bg0V3Zr2.js} +1 -1
  42. package/dist/web/assets/{ProjectAgentFirstTask-DrSd3nR-.js → ProjectAgentFirstTask-CbOWaP7Q.js} +1 -1
  43. package/dist/web/assets/{ProjectAgentsPage-U4Om3EPu.js → ProjectAgentsPage-Y6qCYRZj.js} +1 -1
  44. package/dist/web/assets/{ProjectScopePicker-D0oxbwOd.js → ProjectScopePicker-ClDUoUHW.js} +1 -1
  45. package/dist/web/assets/{PublicProjectsPage-CvkQ3E8I.js → PublicProjectsPage-C63vW9UZ.js} +1 -1
  46. package/dist/web/assets/{RadioGroupItem-CBpbQlHx.js → RadioGroupItem-tL_2upmD.js} +1 -1
  47. package/dist/web/assets/{RoundtablesPage-BEUaKOjI.js → RoundtablesPage-2Akxagrm.js} +1 -1
  48. package/dist/web/assets/{RovingFocusGroup-X9U-ufYr.js → RovingFocusGroup-D5mf9s6I.js} +1 -1
  49. package/dist/web/assets/{RovingFocusItem-_uA_OCLT.js → RovingFocusItem-DAumq9xD.js} +1 -1
  50. package/dist/web/assets/{SessionMigrationPage-WVFSDcUO.js → SessionMigrationPage-B5r2PWCF.js} +1 -1
  51. package/dist/web/assets/{SessionRecordsPage-Bs2eLXEi.js → SessionRecordsPage-DIc2GoCQ.js} +1 -1
  52. package/dist/web/assets/{SettingsPage-DlIwICIz.js → SettingsPage-BAxKpnBx.js} +1 -1
  53. package/dist/web/assets/{SharedJefaReportPage-B_rreEep.js → SharedJefaReportPage-B54qEdIV.js} +1 -1
  54. package/dist/web/assets/{TabsContent-8pXwYJPz.js → TabsContent-DZQE2Iq8.js} +1 -1
  55. package/dist/web/assets/{TabsTrigger-Cd6SI2yI.js → TabsTrigger-CHnq6mkI.js} +1 -1
  56. package/dist/web/assets/{TagVocabularyPage-BQiuKG-4.js → TagVocabularyPage-BIsHYk2i.js} +1 -1
  57. package/dist/web/assets/{TaskExecutionPlan-CupxJeyo.js → TaskExecutionPlan-IYG_JeuT.js} +1 -1
  58. package/dist/web/assets/{TaskSchedulesPage-zYQs7s6T.js → TaskSchedulesPage-Cxjqc8XQ.js} +1 -1
  59. package/dist/web/assets/{Teleport-BZX1Eb7R.js → Teleport-BKN3dSMk.js} +1 -1
  60. package/dist/web/assets/{TextField-CielK4l3.js → TextField-DoKtn--E.js} +1 -1
  61. package/dist/web/assets/{UiDialog-BSDblUpR.js → UiDialog-7pnZ-eQA.js} +1 -1
  62. package/dist/web/assets/{UiDisclosure-DLmVwmy1.js → UiDisclosure-COV4NwHI.js} +1 -1
  63. package/dist/web/assets/{UiIcon-B8eZeuGI.js → UiIcon-BADOYtHM.js} +1 -1
  64. package/dist/web/assets/{UiIconButton-e754Tmnq.js → UiIconButton-CkBP6pnX.js} +1 -1
  65. package/dist/web/assets/{UiSegmented-D1HD-qin.js → UiSegmented-FwOnE2IZ.js} +1 -1
  66. package/dist/web/assets/{UiSelect-CbkTsi2e.js → UiSelect-BIhr03Gk.js} +1 -1
  67. package/dist/web/assets/{UiToggle-Dz93aXFK.js → UiToggle-bpyawyIe.js} +1 -1
  68. package/dist/web/assets/{UiWeight-CUvyApSB.js → UiWeight-TyBehy3K.js} +1 -1
  69. package/dist/web/assets/{UnassignedConversationsPanel-xY7gsFot.js → UnassignedConversationsPanel-B4PqImRi.js} +1 -1
  70. package/dist/web/assets/{VirtualDirectoryList-Dv6PwLjU.js → VirtualDirectoryList-DNQP6X8j.js} +1 -1
  71. package/dist/web/assets/{Workbench3D--4N_uKzp.js → Workbench3D-DNwgymIE.js} +1 -1
  72. package/dist/web/assets/{WritingTastePage-B7KojA4r.js → WritingTastePage-D-ELo7mh.js} +1 -1
  73. package/dist/web/assets/{_plugin-vue_export-helper-BmfQlfI8.js → _plugin-vue_export-helper-RegzAV-H.js} +1 -1
  74. package/dist/web/assets/{accordion-gXElbGP_.js → accordion-DpqAdXTB.js} +1 -1
  75. package/dist/web/assets/{agent-occupation-ChN-1QjC.js → agent-occupation-Ba5Fl0ys.js} +1 -1
  76. package/dist/web/assets/{agent-pins-Chh_rdBi.js → agent-pins-Bb7-1Uoz.js} +1 -1
  77. package/dist/web/assets/{agent-profile.css_vue_type_style_index_0_src_true_lang-DWlz7UoN.js → agent-profile.css_vue_type_style_index_0_src_true_lang-wT8gjVyZ.js} +1 -1
  78. package/dist/web/assets/{agent-work-summary-C9yMf019.js → agent-work-summary-D0a836ik.js} +1 -1
  79. package/dist/web/assets/{attention-store-CG9cF6DX.js → attention-store-g2-_vAhV.js} +1 -1
  80. package/dist/web/assets/{badge-DvvDq2Wb.js → badge-BIoC0hjn.js} +1 -1
  81. package/dist/web/assets/{button-CFEnxtio.js → button-A2esxd6G.js} +1 -1
  82. package/dist/web/assets/{checkbox-DovdRz8u.js → checkbox-DxBVlC6t.js} +1 -1
  83. package/dist/web/assets/{client-lh80ewvs.js → client-DAoXcTUz.js} +1 -1
  84. package/dist/web/assets/{console-CQMgYkk9.js → console-DiNe1hFP.js} +1 -1
  85. package/dist/web/assets/{conversation-launcher-settings-B1QM-wZB.js → conversation-launcher-settings-CtOlr9uP.js} +1 -1
  86. package/dist/web/assets/{design-lab-BDKwIbI8.js → design-lab-UWXx2ZtA.js} +1 -1
  87. package/dist/web/assets/{dialog-D2mO6m3B.js → dialog-DTVE8tN1.js} +1 -1
  88. package/dist/web/assets/{dist-PmK0PfVA.js → dist-D-8b3yGa.js} +1 -1
  89. package/dist/web/assets/{dropdown-menu-YzCnvjAb.js → dropdown-menu-NcUrhhmG.js} +1 -1
  90. package/dist/web/assets/{field-BMEFEyVC.js → field-6mg5DSC8.js} +1 -1
  91. package/dist/web/assets/{identity-bK-fJdnj.js → identity-FG3YqHVj.js} +1 -1
  92. package/dist/web/assets/index-BpQe3IT5.js +2 -0
  93. package/dist/web/assets/{judgment-types-DJnAr9c0.js → judgment-types-rLsl2Cis.js} +1 -1
  94. package/dist/web/assets/{model-Cengn9fg.js → model-BCnsjEuP.js} +1 -1
  95. package/dist/web/assets/{model-rumuELTi.js → model-BcMr6R8m.js} +1 -1
  96. package/dist/web/assets/{model-DpVrfbnj.js → model-CYJ_LZ47.js} +1 -1
  97. package/dist/web/assets/{model-BwNZZZNP.js → model-CeF2BATq.js} +1 -1
  98. package/dist/web/assets/{model-CuY1vtEy.js → model-CtmCtjml.js} +1 -1
  99. package/dist/web/assets/{model-CPMYnu3S.js → model-t2ZvD7wL.js} +1 -1
  100. package/dist/web/assets/{motion-preference-A1AMssSH.js → motion-preference-DeZURhN7.js} +1 -1
  101. package/dist/web/assets/{occupation-catalog-DxwlYD1L.js → occupation-catalog-q0ZjGx2o.js} +1 -1
  102. package/dist/web/assets/{orchestration-filters-DZpJ0FN3.js → orchestration-filters-CKf_Gzdl.js} +1 -1
  103. package/dist/web/assets/{page-title-Bg-mVyrS.js → page-title-BLHrexaP.js} +1 -1
  104. package/dist/web/assets/{personal-profile-graph-tMneNj_m.js → personal-profile-graph-IYovB9sV.js} +1 -1
  105. package/dist/web/assets/{project-capture-QgMw6qvo.js → project-capture-BvIPecIS.js} +1 -1
  106. package/dist/web/assets/{project-origin-ppsYHpYL.js → project-origin-JnGPwlfA.js} +1 -1
  107. package/dist/web/assets/project-team-api-Cfn41MCR.js +1 -0
  108. package/dist/web/assets/{quick-edit-api-BiyK3ih-.js → quick-edit-api-DzpRAPsr.js} +1 -1
  109. package/dist/web/assets/{shared-report-D3Hem1t5.js → shared-report-BLmBg2FG.js} +3 -3
  110. package/dist/web/assets/{task-labels-7KyNw9id.js → task-labels-BArOYZEW.js} +1 -1
  111. package/dist/web/assets/{ui-Ck58paqr.js → ui-CtW0tAA1.js} +1 -1
  112. package/dist/web/assets/{useAgentRecords-C6RrZwwv.js → useAgentRecords-BoOqLQcf.js} +1 -1
  113. package/dist/web/assets/{useApi-CROJJdhE-BujjnKN_.js → useApi-CROJJdhE-CH5wlWTU.js} +1 -1
  114. package/dist/web/assets/{useFocusReturn-D9IOIg17.js → useFocusReturn-DX2zmPSK.js} +1 -1
  115. package/dist/web/assets/{useKnowledgeItemPeek-C6nAzvDL.js → useKnowledgeItemPeek-Cfvr5H1q.js} +1 -1
  116. package/dist/web/assets/{useMinimumLoadingDisplay-HnxkDut6.js → useMinimumLoadingDisplay-GhG1ICNJ.js} +1 -1
  117. package/dist/web/assets/{useRoutePeek-BvYFc1BA.js → useRoutePeek-DydCbUhy.js} +1 -1
  118. package/dist/web/assets/{vue-router-Bl55c88B.js → vue-router-Dad-4p7O.js} +1 -1
  119. package/dist/web/index.html +32 -32
  120. package/docs/agent-conversations-and-collaboration.md +10 -0
  121. package/docs/employee-agents.md +3 -1
  122. package/docs/judgment-and-autonomy.md +30 -1
  123. package/graph-provider/fuli_graph/agent_conversation_models.py +7 -0
  124. package/graph-provider/fuli_graph/agent_conversation_routes.py +5 -1
  125. package/graph-provider/fuli_graph/default_project_lead.py +7 -3
  126. package/graph-provider/fuli_graph/store_agent_conversations.py +66 -34
  127. package/graph-provider/pyproject.toml +1 -1
  128. package/native/win32/fuli-win-helper.exe +0 -0
  129. package/npm-shrinkwrap.json +2 -2
  130. package/package.json +1 -1
  131. package/packages/roundtable/src/host.js +5 -0
  132. package/packages/roundtable/src/peer/coordinator-service.js +20 -3
  133. package/packages/roundtable/src/roundtable/service.js +31 -5
  134. package/skills/capturing-session-knowledge/references/retrieval.md +10 -2
  135. package/skills/operating-fuli/references/workflow-recipes.md +2 -0
  136. package/src/agent-apps/host-tools/catalog.js +1 -0
  137. package/src/agent-tools/executor-routing-definitions.js +194 -0
  138. package/src/agent-tools/graph-definitions.js +20 -1279
  139. package/src/agent-tools/graph-handlers.js +6 -2
  140. package/src/agent-tools/graph-tool-fields.js +43 -0
  141. package/src/agent-tools/interface-catalog.js +5 -1
  142. package/src/agent-tools/knowledge-curation-definitions.js +167 -0
  143. package/src/agent-tools/knowledge-definitions.js +431 -0
  144. package/src/agent-tools/project-agent-tool-definitions.js +271 -0
  145. package/src/agent-tools/project-space-definitions.js +155 -0
  146. package/src/agent-tools/session-fuli-gate.js +33 -31
  147. package/src/agent-tools/standing-assignment-definitions.js +32 -0
  148. package/src/agent-tools/task-entry-definitions.js +105 -0
  149. package/src/agent-tools.js +5 -4
  150. package/src/agents/claude-code/lifecycle-hook.js +16 -2
  151. package/src/agents/claude-code/preference-evidence.js +11 -1
  152. package/src/app/application-error.js +21 -3
  153. package/src/conversations/capture-window.js +8 -3
  154. package/src/conversations/entry-budget.js +2 -10
  155. package/src/conversations/entry-inline-budget.js +144 -0
  156. package/src/conversations/entry-rules.js +1 -1
  157. package/src/conversations/entry-time.js +15 -0
  158. package/src/conversations/preference-evidence.js +19 -0
  159. package/src/conversations/preference-lifecycle.js +28 -7
  160. package/src/conversations/preference-session.js +26 -10
  161. package/src/conversations/preference-snapshot.js +12 -1
  162. package/src/conversations/sync-transcript.js +10 -6
  163. package/src/conversations/transcript-guard.js +4 -3
  164. package/src/conversations/transcript-lifecycle.js +6 -3
  165. package/src/data-format/local-stores.js +3 -0
  166. package/src/desktop/windows-installation.js +2 -1
  167. package/src/external-knowledge/connectors/feishu.js +3 -1
  168. package/src/graphiti/active-personal-space.js +5 -0
  169. package/src/graphiti/agent-conversations.js +23 -28
  170. package/src/graphiti/agent-knowledge-workflows.js +12 -1299
  171. package/src/graphiti/agent-project-resolution.js +11 -0
  172. package/src/graphiti/agent-view-records.js +19 -0
  173. package/src/graphiti/capture-notice.js +20 -6
  174. package/src/graphiti/collaboration-preference-entry.js +89 -0
  175. package/src/graphiti/collaboration-preference-workflow.js +1 -1
  176. package/src/graphiti/common-knowledge-candidates.js +222 -0
  177. package/src/graphiti/cross-project-knowledge-similarity.js +59 -0
  178. package/src/graphiti/current-project-knowledge-search.js +86 -0
  179. package/src/graphiti/decision-trace.js +136 -0
  180. package/src/graphiti/federated-application.js +158 -795
  181. package/src/graphiti/human-knowledge-changes.js +45 -0
  182. package/src/graphiti/knowledge-credential-guard.js +43 -0
  183. package/src/graphiti/knowledge-curation.js +178 -0
  184. package/src/graphiti/knowledge-feedback.js +25 -0
  185. package/src/graphiti/knowledge-graph-reads.js +62 -0
  186. package/src/graphiti/local-runtimes.js +78 -0
  187. package/src/graphiti/personal-global-preference-candidates.js +431 -0
  188. package/src/graphiti/personal-projects.js +33 -0
  189. package/src/graphiti/preference-conflict-requests.js +57 -0
  190. package/src/graphiti/preference-project-resolution.js +39 -0
  191. package/src/graphiti/preference-task-scope.js +18 -0
  192. package/src/graphiti/project-agent-control-plane.js +6 -1
  193. package/src/graphiti/project-agent-task-entry.js +18 -1
  194. package/src/graphiti/project-path-context.js +28 -9
  195. package/src/graphiti/provider-client.js +1 -1
  196. package/src/graphiti/public-project-relations.js +28 -0
  197. package/src/graphiti/public-projects.js +125 -0
  198. package/src/graphiti/publication-review-queues.js +50 -0
  199. package/src/graphiti/roundtable-host.js +35 -3
  200. package/src/graphiti/session-capture-pause-request.js +3 -2
  201. package/src/graphiti/session-fuli-switch.js +4 -3
  202. package/src/graphiti/session-knowledge-capture.js +59 -0
  203. package/src/graphiti/session-records.js +4 -3
  204. package/src/graphiti/source-marker.js +13 -3
  205. package/src/graphiti/standing-assignment-confirmation.js +66 -0
  206. package/src/graphiti/standing-assignment-correction.js +148 -0
  207. package/src/graphiti/standing-assignment-entry.js +223 -0
  208. package/src/graphiti/task-context-entry.js +114 -0
  209. package/src/graphiti/task-entry-preferences.js +4 -1
  210. package/src/graphiti/task-entry-project-mention.js +13 -2
  211. package/src/graphiti/task-entry-project-scope.js +12 -3
  212. package/src/graphiti/task-entry-standing-owner.js +141 -0
  213. package/src/graphiti/task-knowledge-checkpoint.js +212 -0
  214. package/src/graphiti/task-knowledge-guidance.js +13 -0
  215. package/src/graphiti/task-knowledge-recall.js +113 -2
  216. package/src/graphiti/task-preference-reader.js +1 -1
  217. package/src/graphiti/workflow-learning.js +38 -0
  218. package/src/graphiti/workspace-provider-client.js +10 -0
  219. package/src/http/api-router.js +13 -3
  220. package/src/http/standing-assignment-api-router.js +35 -0
  221. package/src/judgment/agent-view.js +29 -7
  222. package/src/judgment/conversation.js +8 -2
  223. package/src/judgment/engine.js +16 -4
  224. package/src/judgment/http.js +37 -5
  225. package/src/judgment/review-injection-precheck.js +97 -0
  226. package/src/judgment/review-suggestions.js +46 -0
  227. package/src/judgment/store.js +8 -0
  228. package/src/knowledge-hard-delete/delete-ledger.js +12 -3
  229. package/src/knowledge-hard-delete/recovery-gate.js +4 -4
  230. package/src/knowledge-owner-reads/console-port.js +8 -0
  231. package/src/knowledge-owner-reads/owner-proof.js +35 -0
  232. package/src/local-runtime/lifecycle.js +2 -1
  233. package/src/local-runtime/provider-readiness.js +35 -11
  234. package/src/mcp/instructions.js +3 -3
  235. package/src/mcp/preference-delivery.js +13 -3
  236. package/src/mcp/session-id.js +2 -0
  237. package/src/mcp/tool-annotations.js +3 -2
  238. package/src/model-backends/http.js +45 -8
  239. package/src/model-backends/role-settings.js +25 -3
  240. package/src/model-backends/role-trust.js +39 -6
  241. package/src/model-backends/runtime.js +10 -3
  242. package/src/model-backends/settings-history-list.js +132 -0
  243. package/src/model-backends/settings-history.js +175 -0
  244. package/src/native-runtime/java-runtime.js +4 -4
  245. package/src/presence/windows-helper-pin.js +1 -1
  246. package/src/semantic-version.js +5 -1
  247. package/src/server.js +3 -2
  248. package/src/setup/claude-code-config.js +1 -1
  249. package/src/setup/graph-runtime.js +42 -15
  250. package/src/setup/paths.js +2 -0
  251. package/src/standing-assignments/port.js +189 -44
  252. package/src/standing-assignments/store.js +12 -1
  253. package/src/standing-assignments/term-match.js +7 -0
  254. package/src/system/file-identity.js +11 -0
  255. package/src/system/platform-path.js +38 -0
  256. package/src/validation/values.js +22 -6
  257. package/dist/web/assets/EmployeeWorkbenchPage-BUMfMBc8.js +0 -3
  258. package/dist/web/assets/KnowledgePage-Bfbfz_Z8.js +0 -1
  259. package/dist/web/assets/ModelSettingsPage-C3eBDWRL.js +0 -1
  260. package/dist/web/assets/ModelSettingsPage-DZkrJw7R.css +0 -1
  261. package/dist/web/assets/index-r-WFOs21.js +0 -2
  262. package/dist/web/assets/project-team-api-DwP0O3rn.js +0 -1
@@ -27,7 +27,17 @@ A review approval is written back without the person only when all of these hold
27
27
  - **Tonborg's configured model answered it.** The role is enabled in `model-backends.json`, `knowledge_review` is in its allowed operations, and the role still names the same connection that answered: the same connection id, protocol, endpoint and model. An answer from the current session (no model, a disabled role, or a fallback after the model failed) or from an opted-in legacy CLI is a suggestion, as before this change (`session_answer`). An answer from a connection the role no longer names is not trusted (`connection_changed`), including the same model name on another connection and the same connection with its endpoint changed in place.
28
28
  - **The role is not set to 「只给建议 / Suggestions only」.** Each role card on the model settings page has this switch; it is off by default. When it is on, every answer is a suggestion (`suggestions_only`).
29
29
  - **The person has read the warning.** Next to the switch the card says: 「模型可能判断错,它的判断会直接生效;你可以随时改成「只给建议」,部分写入可在回执里撤回。」 It counts as read only when the person presses 「我已看过 / I have read this」 on the settings page. Opening the page, rendering a receipt or any background read never sets it. Until then the configured model's approval is a suggestion (`warning_not_seen`), and that receipt shows the same warning with a link to the settings page. The item stays a suggestion for the person; it is not asked again while its evidence is unchanged.
30
- - **Every rule that applied before still allows it.** Trust relaxes none of them: the autonomy choice (**I decide** keeps every approval a suggestion), items that need attention or have negative or conflicting evidence, the confidence floor, Tonborg's permission for the scope, the role's data-sharing approval for the review's project as it is now (`egress_not_approved`), the capture switch for the scope, globally and for the project (`capture_off`), the hard-delete fence, injection isolation of the evidence, and the Provider's evidence snapshot check. These checks govern what passes through FULI's host; they are not a sandbox.
30
+ - **Every rule that applied before still allows it.** Trust relaxes none of them: the autonomy choice (**I decide** keeps every approval a suggestion), items that need attention or have negative or conflicting evidence, the confidence floor, Tonborg's permission for the scope, the role's data-sharing approval for the review's project as it is now (`egress_not_approved`), the capture switch for the scope, globally and for the project (`capture_off`), the hard-delete fence, injection isolation of the evidence, the injection pattern pre-check below, and the Provider's evidence snapshot check. These checks govern what passes through FULI's host; they are not a sandbox.
31
+
32
+ ### Injection pattern pre-check
33
+
34
+ Before an approval can apply, the host matches every text of the candidate against a fixed list of known injection patterns (`src/judgment/review-injection-precheck.js`, rec#26). The patterns cover six shapes: instructions addressed to the reviewer or the model, or text that replaces its instructions (`reviewer_instruction`); claims that a system, host, administrator or the user already approved it (`authority_claim`); attempts to set the outcome or the confidence (`outcome_directive`); the review prompt's own sections, chat-template turns or review JSON (`boundary_or_format`); tool-call syntax (`tool_call`); and characters that hide or reorder text (`hidden_characters`). Full-width letters and zero-width characters are folded first. The check uses no model and no Agent and is the same for every client.
35
+
36
+ When a candidate matches, its approval gets the interception `injection_suspected`: it is escalated to the person whatever the model answered and whether or not the role is trusted. The record keeps the model's own conclusion and lists the matched signals in `aiReview.injectionSignals`. The workbench shows them as 「已知注入格式 / Known injection pattern」, and the person's question starts with 「宿主预检:候选文本匹配已知注入格式」. The signals are recorded even when the model escalated by itself. Nothing is rejected or discarded by the check.
37
+
38
+ One model request judges a batch of up to ten candidates, so injected text in one of them may steer the verdicts of all. When any candidate of a batch matches, no approval from that answer applies: each other candidate's approval gets `batch_contaminated`, its record says `aiReview.injectionInBatch`, and the person sees 「宿主预检:同批候选匹配已知注入格式」. Those candidates are not reviewed again in a separate request; the person decides them like any other suggestion.
39
+
40
+ **Limits.** This is a narrow layer, not injection protection. It catches only the shapes its patterns were written against. On a 40-sample synthetic blind set (20 injection, 20 ordinary) written without reading the patterns, recall was 6/20 and false positives 1/20 (rec#11 D-56); this is not a real-world attack recall rate. The patterns were written after reading the injected texts of the Tonborg review evaluation sets, so the 10/10 they catch there says nothing about unseen text. Paraphrases, other languages, encodings, text split across fields and injection phrased as ordinary evidence (a false claim that the user stated a standing rule) pass it. A candidate without a match is not thereby safe; the other checks above and the person's decision remain the safeguards, and this check replaces none of them.
31
41
 
32
42
  The choice and the acknowledgement are kept per role in `model-trust.sqlite`, a versioned store in the data directory. A missing store means trusted, warning not read. Nothing migrates into it: upgrading changes no existing choice, neither the autonomy policy nor the model settings. A role whose model was configured before the upgrade executes nothing by itself until its warning is read.
33
43
 
@@ -40,6 +50,10 @@ The choice and the acknowledgement are kept per role in `model-trust.sqlite`, a
40
50
 
41
51
  A review applied this way reads 「由 <模型名> 自动执行 / Executed automatically by <model>」 in Tonborg's workbench. Undo is offered only for an applied review whose knowledge was not permanently deleted. It removes only that review's AI marks. The Provider locks the item before it checks it, so an undo asked while an edit or later review of the same item is still being written waits for it and then judges what it left. When the person changed the item after the review (an edit, a new version, or a later review), the Provider refuses and the receipt says 「无法撤回:已被修改」; when the item was permanently deleted, FULI refuses before sending anything and says 「无法撤回:已删除」. A refused undo changes nothing and nothing is brought back. This operation has no effect outside FULI, so there is nothing external to roll back.
42
52
 
53
+ ### Suggestions in the console
54
+
55
+ A review the host did not apply (`ai_suggested`) is also listed under Settings → 模型与用量 → 「建议记录」, beside what Astro, Bole and Jefa suggested (rec#8). Each row shows the item's title, the model's own conclusion and reason, why it was left to the person (the host's interceptions in plain words, such as 「模型把握不足」 or 「你选了「只给建议」」), who answered (the model, or 「当前会话」) and when. Its one action, 「查看知识条目」, opens the item in 知识整理, where the person confirms, edits or corrects it as for any item; the row itself applies nothing. Like the rest of that section it is what Tonborg said at the time, not a to-do: an older suggestion for the same item in the same project reads 「已有更新」, and the item shows whether it still waits. The console reads the newest 50 at `GET /api/judgment/suggestions?personalSpaceId=` (`src/judgment/review-suggestions.js`). That route is guarded like every full judgment read, with the same known limit (「Console trust boundary」 below): a verdict keeps the item's title and key from when Tonborg read it, the item may have been given to one FLA since, and the model's reason was written with Tonborg's scoped preferences, memory and earlier feedback in the same request. There is no filtered view for anyone else, and no MCP or Agent tool reaches the route. The page drops a shown list when a refresh is refused or fails, and when the active space changes or is lost, cancelling a read still under way. A permanently deleted item keeps its row without its words or a link.
56
+
43
57
  ### Local evaluation line
44
58
 
45
59
  If the Tonborg review evaluation was recorded on this computer for the configured model at its configured endpoint (`node acceptance/tonborg-review-eval/score.js … --record <data dir>/model-evaluations.json`), the card shows one line naming the case set, the day and the model, for example 「本机评测 2026/10/22 · tonborg-review-eval/holdout · qwen3.5:4b · 一致率 44%(不代表普遍准确率)」. Without such a result the line is absent. The result changes what the page says only; it neither allows nor blocks anything.
@@ -65,3 +79,18 @@ Tonborg uses only its own scoped memory and authorized evidence. Client failure,
65
79
  ## Interfaces
66
80
 
67
81
  The MCP tools are `get_judgment_policy`, `list_judgments`, `review_with_tonborg`, `assess_agent_action`, `assess_task_completion`, `get_agent_pins`, and `pin_agent`. Autonomy changes and feedback remain local user operations, and so do a role's 「只给建议」 switch and the acknowledgement of its warning (`PUT /api/model-backends/roles/:role/trust`, loopback only) and the undo of an automatic review (`POST /api/judgment/undo`); `GET /api/model-backends/roles` shows each role's `trust` read-only. Agent entry context supplies the current policy and workflow guidance; existing sessions should reconnect to discover newly installed tools.
82
+
83
+ ### Console trust boundary
84
+
85
+ From 0.21 every console route that answers with Tonborg's full records or a model's free text works like the console's other full reads (knowledge details, session records) (rec#11 D-60):
86
+
87
+ - `GET /api/judgment/records` (records, receipts, feedback reasons and the questions for the person);
88
+ - `POST /api/judgment/feedback`, `POST /api/judgment/review`, `POST /api/judgment/assess` and `POST /api/judgment/accept`, which answer with the full records they wrote or ran;
89
+ - `GET /api/judgment/suggestions` (above);
90
+ - `GET /api/model-backends/suggestions`, the built-in Agents' suggestion log (docs/employee-agents.md).
91
+
92
+ Each answers only a loopback request. A request from another device is refused with `local_user_only`, even when LAN access is on and it carries a valid LAN code. Then the console server confirms its own human-review proof with the Provider through the owner-read port (`src/knowledge-owner-reads/owner-proof.js`, one bounded read whose answer is not used), before anything is read, run or written. The HTTP caller does not supply that proof: the server reads the token from its data directory's provider env and attaches it itself. Without that port or token the route answers 403 `human_review_proof_required`; a proof the Provider refuses is refused as the Provider answered. A refused request gets no data, and a refused feedback, review or assessment changes nothing. The console page needs nothing new.
93
+
94
+ Agents keep their own tools (`list_judgments`, `review_with_tonborg`, `assess_agent_action`, `assess_task_completion`), and no MCP or Agent tool module imports these routes or the proof check (`test/judgment-console-owner.test.js`). `GET /api/agent-pins` and `GET /api/judgment/policy` hold no history and stay as they were; the undo keeps its own check, since only the human-review channel can send it.
95
+
96
+ **Known limit: local HTTP callers are trusted.** The console server trusts every local HTTP caller and attaches the proof itself. The proof shows only that the console server holds the token; it shows nothing about who sent the request. So any local process, including an Agent with a shell, can still read the full history over loopback HTTP (for example `GET /api/judgment/records` with only a `Host` header) without reading any token. D-60 makes these routes consistent with the console's other full reads and refuses LAN requests; it does not close that local HTTP path. Authenticating the caller with a console session is a separate future change (rec#11 D-61).
@@ -71,6 +71,13 @@ class ConversationWrite(ConversationScope):
71
71
  return self
72
72
 
73
73
 
74
+ class ConversationBegin(ConversationScope):
75
+ """A task entry: recover this session's conversation and open this task's (rec#11 D-53)."""
76
+ source_application: SourceApplication
77
+ session_id: str = Field(min_length=1, max_length=256)
78
+ task_context_token: str = Field(min_length=1, max_length=160)
79
+
80
+
74
81
  class ConversationResume(ConversationScope):
75
82
  source_application: SourceApplication
76
83
  session_id: str = Field(min_length=1, max_length=256)
@@ -2,7 +2,7 @@ from .staffing_demand import StaffingDemandQuery, query_staffing_demand
2
2
  from .agent_verification_models import AgentQualityQuery, AgentVerification
3
3
  from .agent_loan_models import AgentLoanRequest, AgentLoanDecision, AgentLoanQuery
4
4
  from .agent_conversation_models import (
5
- ConversationQuery, ConversationWrite, ConversationResume, ConversationPolicyWrite,
5
+ ConversationQuery, ConversationBegin, ConversationWrite, ConversationResume, ConversationPolicyWrite,
6
6
  )
7
7
  from .conversation_triage_models import (
8
8
  ConversationTriageWrite, ConversationTriageRead, ConversationTopicQuery, ConversationTopicFormation,
@@ -39,6 +39,10 @@ def register_agent_conversation_routes(application, store, Actor):
39
39
  async def query(request: ConversationQuery, actor: Actor):
40
40
  return await store.query_conversations(actor, request)
41
41
 
42
+ @application.post('/v1/agent-conversations/begin')
43
+ async def begin(request: ConversationBegin, actor: Actor):
44
+ return await store.begin_conversation(actor, request)
45
+
42
46
  @application.post('/v1/agent-conversations/boundary')
43
47
  async def boundary(request: ConversationWrite, actor: Actor):
44
48
  return await store.claim_conversation_boundary(actor, request)
@@ -18,12 +18,16 @@ class DefaultProjectLeadRequest(StrictModel):
18
18
  personal_space_id: str = Field(min_length=1, max_length=128)
19
19
  personal_project_id: str = Field(min_length=1, max_length=128)
20
20
  source_application: SourceApplication = 'other'
21
+ # What the person confirmed this project's lead is for (a standing
22
+ # assignment, rec#29 D-41 D4); it leads the hired lead's responsibility.
23
+ responsibility: str | None = Field(default=None, min_length=1, max_length=240)
21
24
 
22
25
 
23
- def default_lead_profile(project_name):
26
+ def default_lead_profile(project_name, responsibility=None):
27
+ duties = f'统筹 {project_name} 的任务拆分、分工、集成与交付,延续项目上下文;有明确边界的工作委派给合适成员,实质性改动由另一位 FLA 独立验收。'
24
28
  return ProjectAgentProfile(
25
29
  name=f'{project_name} 负责人'[:160],
26
- responsibility=f'统筹 {project_name} 的任务拆分、分工、集成与交付,延续项目上下文;有明确边界的工作委派给合适成员,实质性改动由另一位 FLA 独立验收。'[:4096],
30
+ responsibility=(f'{responsibility.strip()}\n{duties}' if responsibility else duties)[:4096],
27
31
  work_kinds=['project_context', 'planning', 'delegation', 'integration', 'reporting'],
28
32
  capabilities=['任务拆分', '工作委派', '成果集成', '进度汇报', '项目上下文'],
29
33
  initial_preferences=['先理解目标与边界,再拆分和委派。', '结论附带可复现的验证证据。',
@@ -54,7 +58,7 @@ class StoreDefaultProjectLead:
54
58
  staffing_intent='default_lead',
55
59
  source_application=request.source_application,
56
60
  routing_reason='Every task needs a FULI Agent; this project had no team lead.',
57
- recruitment_profile=default_lead_profile(project.profile.name),
61
+ recruitment_profile=default_lead_profile(project.profile.name, request.responsibility),
58
62
  )
59
63
  routed = await self.submit_project_agent_task(actor, submit)
60
64
  lead = routed.assigned_agent
@@ -4,7 +4,7 @@ import gzip
4
4
  import hashlib
5
5
  import json
6
6
  from fastapi import HTTPException
7
- from .agent_conversation_models import ConversationPolicy
7
+ from .agent_conversation_models import ConversationPolicy, ConversationWrite
8
8
  from .conversation_context import (
9
9
  DIGEST_VERSION, add_delivery_proofs, add_task_result, fold_messages, message_bytes, pack_context, refold_digest, render_digest,
10
10
  )
@@ -73,41 +73,13 @@ class StoreAgentConversations:
73
73
  if request.mode == 'policy':
74
74
  return policy.model_dump()
75
75
  if request.mode == 'session':
76
- rows, _, _ = await self.runtime.driver.execute_query(
77
- 'OPTIONAL MATCH (b:FuliConversationBinding {id: $id}) '
78
- 'OPTIONAL MATCH (s:FuliTranscriptCursor {id: $stream}) '
79
- 'RETURN b.conversation_id AS conversation_id, coalesce(s.cursor,0) AS cursor, '
80
- 'coalesce(s.initialized, s.cursor > 0, false) AS initialized',
81
- stream=stable_uuid(request.personal_space_id, request.source_application, request.session_id or ''),
82
- id=conversation_binding_id(scope, request.source_application, request.session_id or ''))
83
- return dict(rows[0]) if rows else {'conversation_id': None, 'cursor': 0, 'initialized': False}
76
+ return await self._session_binding(scope, request)
84
77
  if request.mode == 'list':
85
- # Jefa's triage label travels with each conversation so a list can
86
- # show what is still unclaimed without a second read per row.
87
- rows, _, _ = await self.runtime.driver.execute_query(
88
- 'MATCH (c:FuliConversation {scope: $scope}) '
89
- 'OPTIONAL MATCH (t:FuliConversationTriage {id: c.id}) '
90
- 'RETURN c, t ORDER BY c.last_activity DESC, c.id LIMIT $limit',
91
- scope=scope, limit=request.limit)
92
- return {'conversations': [{**self._conversation_view(dict(r['c']), policy),
93
- 'triage': StoreConversationTriage._triage_view(dict(r.get('t'))) if r.get('t') else None} for r in rows]}
94
- rows, _, _ = await self.runtime.driver.execute_query(
95
- 'MATCH (c:FuliConversation {scope: $scope, id: $id}) RETURN c', scope=scope, id=request.conversation_id)
96
- if not rows:
97
- raise HTTPException(404, 'Conversation not found in this Agent and project')
98
- record = dict(rows[0]['c'])
99
- view = self._conversation_view(record, policy)
78
+ return {'conversations': await self._latest_conversations(scope, policy, request.limit)}
79
+ record = await self._scoped_conversation(scope, request.conversation_id)
100
80
  if request.mode == 'context':
101
- decoded, omitted, scan_truncated = await self._context_events(record, request.after)
102
- checkpoint = {'status': record.get('status') or 'reported', 'summary': record.get('summary')}
103
- context = pack_context('', decoded, policy.context_budget, checkpoint,
104
- conversation_id=record['id'], revision=record['revision'],
105
- omitted_sequence=omitted, scan_truncated=scan_truncated)
106
- # A session's task entry asks with its own ID; the host strips these
107
- # proofs once it knows what that session has already seen.
108
- if request.session_id is not None and request.source_application is not None:
109
- add_delivery_proofs(context, decoded, request.source_application, request.session_id)
110
- return {**view, 'context': context}
81
+ return await self._recovery_context(record, policy, request, after=request.after)
82
+ view = self._conversation_view(record, policy)
111
83
  events, _, _ = await self.runtime.driver.execute_query(
112
84
  'MATCH (c:FuliConversation {id: $id})-[:HAS_EVENT]->(e:FuliConversationEvent) '
113
85
  'WHERE e.sequence > $after AND e.sequence <= $revision '
@@ -131,6 +103,66 @@ class StoreAgentConversations:
131
103
  page['digest'] = await self._current_digest(record)
132
104
  return page
133
105
 
106
+ async def begin_conversation(self, actor, request):
107
+ """A task entry's conversation in one request and one transaction (rec#11 D-53).
108
+
109
+ The three steps a host used to send one by one, in the same order: the
110
+ session's bound conversation; then its recovery window with this
111
+ session's delivery proofs, or else the latest conversation of this
112
+ Agent's scope; then the empty append that opens this task's
113
+ conversation. The reads keep the query route's checks and the append
114
+ all of append_conversation's; a refused append rolls the request back,
115
+ so no read leaves the Provider without the write."""
116
+ async with query_store_transaction(self) as store:
117
+ scope = await store._conversation_scope(actor, request)
118
+ policy = await store._conversation_policy(scope)
119
+ previous_id = (await store._session_binding(scope, request))['conversation_id']
120
+ previous = await store._recovery_context(await store._scoped_conversation(scope, previous_id),
121
+ policy, request) if previous_id else None
122
+ recent = None if previous_id else next(iter(await store._latest_conversations(scope, policy, 1)), None)
123
+ saved = await store.append_conversation(actor, ConversationWrite(**request.model_dump()))
124
+ return {**saved, 'recovered_from': previous_id, 'previous': previous, 'recent': recent}
125
+
126
+ async def _session_binding(self, scope, request):
127
+ rows, _, _ = await self.runtime.driver.execute_query(
128
+ 'OPTIONAL MATCH (b:FuliConversationBinding {id: $id}) '
129
+ 'OPTIONAL MATCH (s:FuliTranscriptCursor {id: $stream}) '
130
+ 'RETURN b.conversation_id AS conversation_id, coalesce(s.cursor,0) AS cursor, '
131
+ 'coalesce(s.initialized, s.cursor > 0, false) AS initialized',
132
+ stream=stable_uuid(request.personal_space_id, request.source_application, request.session_id or ''),
133
+ id=conversation_binding_id(scope, request.source_application, request.session_id or ''))
134
+ return dict(rows[0]) if rows else {'conversation_id': None, 'cursor': 0, 'initialized': False}
135
+
136
+ async def _latest_conversations(self, scope, policy, limit):
137
+ # Jefa's triage label travels with each conversation so a list can
138
+ # show what is still unclaimed without a second read per row.
139
+ rows, _, _ = await self.runtime.driver.execute_query(
140
+ 'MATCH (c:FuliConversation {scope: $scope}) '
141
+ 'OPTIONAL MATCH (t:FuliConversationTriage {id: c.id}) '
142
+ 'RETURN c, t ORDER BY c.last_activity DESC, c.id LIMIT $limit',
143
+ scope=scope, limit=limit)
144
+ return [{**self._conversation_view(dict(r['c']), policy),
145
+ 'triage': StoreConversationTriage._triage_view(dict(r.get('t'))) if r.get('t') else None} for r in rows]
146
+
147
+ async def _scoped_conversation(self, scope, conversation_id):
148
+ rows, _, _ = await self.runtime.driver.execute_query(
149
+ 'MATCH (c:FuliConversation {scope: $scope, id: $id}) RETURN c', scope=scope, id=conversation_id)
150
+ if not rows:
151
+ raise HTTPException(404, 'Conversation not found in this Agent and project')
152
+ return dict(rows[0]['c'])
153
+
154
+ async def _recovery_context(self, record, policy, request, *, after=0):
155
+ decoded, omitted, scan_truncated = await self._context_events(record, after)
156
+ checkpoint = {'status': record.get('status') or 'reported', 'summary': record.get('summary')}
157
+ context = pack_context('', decoded, policy.context_budget, checkpoint,
158
+ conversation_id=record['id'], revision=record['revision'],
159
+ omitted_sequence=omitted, scan_truncated=scan_truncated)
160
+ # A session's task entry asks with its own ID; the host strips these
161
+ # proofs once it knows what that session has already seen.
162
+ if request.session_id is not None and request.source_application is not None:
163
+ add_delivery_proofs(context, decoded, request.source_application, request.session_id)
164
+ return {**self._conversation_view(record, policy), 'context': context}
165
+
134
166
  async def _current_digest(self, record):
135
167
  """The stored digest, rebuilt once from raw events when older folding rules made it."""
136
168
  if not record.get('digest'):
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "fuli-graph-provider"
3
- version = "0.20.1"
3
+ version = "0.21.0b1"
4
4
  description = "Graphiti-backed personal and shared project provider for Fuli."
5
5
  requires-python = ">=3.12"
6
6
  dependencies = [
Binary file
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "fuli-context",
3
- "version": "0.20.1",
3
+ "version": "0.21.0-beta.2",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "fuli-context",
9
- "version": "0.20.1",
9
+ "version": "0.21.0-beta.2",
10
10
  "license": "Apache-2.0",
11
11
  "dependencies": {
12
12
  "@a2a-js/sdk": "1.3.0",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fuli-context",
3
- "version": "0.20.1",
3
+ "version": "0.21.0-beta.2",
4
4
  "description": "Local-first collaboration relationship graph for AI agents.",
5
5
  "type": "module",
6
6
  "files": [
@@ -32,6 +32,11 @@
32
32
  // remoteOriginAuthority() public keys that verify those origins
33
33
  // recordMemoryUsage(input) optional: { recorded, reason? }
34
34
  // projectFolder(projectId) optional: the project's known folder for fresh sessions
35
+ // matchWork(query) optional: leads the person's own names for work point to, in
36
+ // this space: [{ agentId, projectId, project, responsibility?,
37
+ // matchedTerms? }] (a project name, or an active standing assignment);
38
+ // when it throws, find_agents answers from the directory
39
+ // and names its code as workUnavailable
35
40
  // requestSignal() optional, sync: the current request's AbortSignal
36
41
  // inRestrictedWorker() optional, sync: true inside a sealed worker run
37
42
  export const ROUNDTABLE_HOST_METHODS = Object.freeze([
@@ -9,6 +9,14 @@ import {
9
9
  } from './protocol.js';
10
10
 
11
11
  const ONLINE_MS = 90_000;
12
+ // last_seen_at only feeds the "online" flag of directory() and devices(); no trust,
13
+ // revocation or claim decision reads it. A connected device re-authenticates on every
14
+ // claim-poll tick (400 ms) and status poll, so the coordinator records last-seen at most
15
+ // once per this interval instead of making a durable commit per request. The stored value
16
+ // then lags the last request by less than this interval: a device shows offline 75-90 s
17
+ // after it last spoke, and a connected device (it publishes at least once a minute) stays online.
18
+ // A stored time ahead of the clock is never "within" either window (see seenWithin).
19
+ const LAST_SEEN_WRITE_MS = 15_000;
12
20
  const PAIRING_FAILURE_WINDOW_MS = 10 * 60_000;
13
21
  const PAIRING_FAILURE_LIMIT = 10;
14
22
 
@@ -57,7 +65,8 @@ export function createCoordinatorService({ store, identity, authority, name, clo
57
65
  function authenticate(nodeId) {
58
66
  const node = store.node(nodeId);
59
67
  if (!node || node.status !== 'active') throw new PeerError('device_not_trusted', 'This device is not paired or was revoked', 403);
60
- store.touchNode(nodeId, iso());
68
+ const now = clock();
69
+ if (!seenWithin(node, now, LAST_SEEN_WRITE_MS)) store.touchNode(nodeId, new Date(now).toISOString());
61
70
  return node;
62
71
  }
63
72
 
@@ -72,7 +81,7 @@ export function createCoordinatorService({ store, identity, authority, name, clo
72
81
  const now = clock();
73
82
  return { devices: store.nodes().filter((node) => node.status === 'active' && node.id !== nodeId).map((node) => ({
74
83
  nodeId: node.id, name: node.name,
75
- online: Boolean(node.last_seen_at) && now - Date.parse(node.last_seen_at) < ONLINE_MS,
84
+ online: seenWithin(node, now, ONLINE_MS),
76
85
  agents: JSON.parse(node.directory_json),
77
86
  })) };
78
87
  }
@@ -250,7 +259,7 @@ export function createCoordinatorService({ store, identity, authority, name, clo
250
259
  const now = clock();
251
260
  return store.nodes().map((node) => ({ nodeId: node.id, name: node.name, status: node.status,
252
261
  self: node.id === identity.fingerprint, pairedAt: node.paired_at, revokedAt: node.revoked_at,
253
- online: node.id === identity.fingerprint || (Boolean(node.last_seen_at) && now - Date.parse(node.last_seen_at) < ONLINE_MS),
262
+ online: node.id === identity.fingerprint || seenWithin(node, now, ONLINE_MS),
254
263
  sharedAgents: JSON.parse(node.directory_json).length }));
255
264
  }
256
265
 
@@ -259,6 +268,14 @@ export function createCoordinatorService({ store, identity, authority, name, clo
259
268
  openInvitations: () => store.openInvitations(iso()).length };
260
269
  }
261
270
 
271
+ // A last-seen time ahead of the clock (the clock was set back) proves nothing about
272
+ // now: it neither counts as online nor skips the next write, which records the current time.
273
+ function seenWithin(node, now, windowMs) {
274
+ if (!node.last_seen_at) return false;
275
+ const age = now - Date.parse(node.last_seen_at);
276
+ return age >= 0 && age < windowMs;
277
+ }
278
+
262
279
  // Message IDs are chosen by senders, so the coordinator keys them per sending device.
263
280
  function messageKey(senderNode, messageId) {
264
281
  return sha256Hex(`${senderNode}:${messageId}`);
@@ -82,21 +82,47 @@ export function createAgentRoundtable({ host, peer = null, openStore, wake = wak
82
82
  return sessions.filter((session) => WAKE_CLIENTS.includes(session.client));
83
83
  }
84
84
 
85
+ // A host that knows the person's own names for work (project names, standing
86
+ // assignments) matches the query against them; Roundtable only places the
87
+ // leads it names. Asked for one project, only that project's work counts.
88
+ // A host that cannot match leaves the directory's answer as it is and names
89
+ // why, as an unreachable peer does.
90
+ async function workMatches(query, personalProjectId) {
91
+ const work = new Map();
92
+ if (!query || !host.matchWork) return { work };
93
+ let found;
94
+ try { found = await host.matchWork(query); }
95
+ catch (error) { return { work, workUnavailable: error.code ?? 'work_match_failed' }; }
96
+ for (const { agentId, ...match } of found) {
97
+ if (personalProjectId && match.projectId !== personalProjectId) continue;
98
+ work.set(agentId, [...(work.get(agentId) ?? []), match]);
99
+ }
100
+ return { work };
101
+ }
102
+
85
103
  async function findAgents({ query = null, personalProjectId = null, occupation = null, capability = null, projectId = null } = {}) {
86
104
  const project = personalProjectId ? await resolveProjectLead(host, personalProjectId) : null;
87
105
  const needle = query?.trim().toLowerCase();
88
- const matches = (project ? (project.agent ? [project.agent] : []) : await agents()).filter((agent) => matchesAgentDiscovery(agentDiscoveryProfile(agent), { occupation, capability, projectId }) && (!needle || [agent.agentId,
89
- agent.employeeNumber ? `FLA ${agent.employeeNumber}` : null, agent.profile.displayName,
90
- agent.profile.name, agent.profile.responsibility, ...(agent.profile.capabilities ?? [])]
91
- .some((value) => value?.toLowerCase().includes(needle))));
106
+ const { work, workUnavailable } = await workMatches(query?.trim(), personalProjectId);
107
+ const names = (agent) => [agent.agentId, agent.employeeNumber ? `FLA ${agent.employeeNumber}` : null,
108
+ agent.profile.displayName, agent.profile.name];
109
+ const matches = (project ? (project.agent ? [project.agent] : []) : await agents()).filter((agent) => matchesAgentDiscovery(agentDiscoveryProfile(agent), { occupation, capability, projectId })
110
+ && (!needle || work.has(agent.agentId) || [...names(agent), agent.profile.responsibility, ...(agent.profile.capabilities ?? [])]
111
+ .some((value) => value?.toLowerCase().includes(needle))));
112
+ // An exact name still comes first, then the leads the person's work names;
113
+ // without work matches the directory's order stays as it is.
114
+ const rank = (agent) => [...names(agent), agent.employeeNumber].some((name) => name?.toLowerCase() === needle) ? 0
115
+ : work.has(agent.agentId) ? 1 : 2;
116
+ if (work.size) matches.sort((a, b) => rank(a) - rank(b));
92
117
  const local = await Promise.all(matches.slice(0, 20).map(async (agent) => ({
93
118
  agentId: agent.agentId, employeeNumber: agent.employeeNumber, name: label(agent), responsibility: agent.profile.responsibility,
119
+ ...(work.has(agent.agentId) ? { matchedWork: work.get(agent.agentId) } : {}),
94
120
  ...agentDiscoveryProfile(agent),
95
121
  clients: (agent.profile.allowedClients ?? []).filter((client) => WAKE_CLIENTS.includes(client)),
96
122
  recentConversations: await conversations(agent, personalProjectId)
97
123
  })));
98
124
  const remote = peer ? await peer.remoteAgents({ query: needle, occupation, capability, projectId }).catch(() => null) : null;
99
- return { agents: local,
125
+ return { agents: local, ...(workUnavailable ? { workUnavailable } : {}),
100
126
  ...(project ? { project: { projectId: personalProjectId, address: `project:${personalProjectId}`, reason: project.reason } } : {}),
101
127
  ...(remote ? { remoteAgents: remote.agents, ...(remote.unavailable ? { remoteUnavailable: remote.unavailable } : {}) } : {}),
102
128
  guidance: remote
@@ -28,7 +28,12 @@ First inspect `task_knowledge_recall` returned by the lifecycle or preference to
28
28
  query plan is deliberately bounded and based on implementation trigger categories, not on a
29
29
  claim that every returned candidate supports the task. If it misses or its candidates are
30
30
  irrelevant while durable context may still matter, call `search_current_project_knowledge`
31
- yourself. Derive one to four focused queries from the action, artifact, target system, distinctive
31
+ yourself. A coding task without such a trigger may instead get `status: indexed` with a
32
+ `knowledge_index`: up to five `[id, title]` pairs of matching items in the exact current project and
33
+ `matched_in_search`, how many items that one bounded search kept, never their bodies. It is not the
34
+ project's total: more may match a search of your own. A title is only a pointer: read the item with
35
+ `search_current_project_knowledge` (query its title) before relying on it, and cite only what you
36
+ read. Derive one to four focused queries from the action, artifact, target system, distinctive
32
37
  identifier, and likely runbook category. Never pass the full conversational request as the sole
33
38
  query. For example, a version-release request should search release/publish and push/commit
34
39
  runbook concepts separately instead of searching the entire sentence.
@@ -154,6 +159,9 @@ For the chosen marker, the final answer must begin with its `leadMarkdown` uncha
154
159
  before any heading or prose, and append its `markdown` unchanged after the answer. If
155
160
  any search supports the answer, choose `sourceMarker` from one supporting search. If
156
161
  none do, choose `noMatchSourceMarker`. Never show either marker when no search was
157
- called. For a no-match search, `noMatchSourceMarker.markdown` is intentionally empty:
162
+ called: `noMatchSourceMarker` reads "searched, no match" (已检索,未命中), so it belongs only
163
+ to a search that ran in this task. A `task_knowledge_recall` without markers ran no search
164
+ (for example `not_needed` or `project_unresolved`); do not reuse a marker from an earlier
165
+ task. For a no-match search, `noMatchSourceMarker.markdown` is intentionally empty:
158
166
  show only its `leadMarkdown` and do not synthesize a footer. Never fabricate, rewrite,
159
167
  omit, or wrap markers in HTML. A capture or write result is not a read citation.
@@ -10,6 +10,8 @@ Use these as sequencing hints only. Always call `list_agent_interfaces` and insp
10
10
  | Pause or resume recording of this session ("这次别记" / "继续记") | none | `update_capture_policy` with only `sessionPaused` and the current `taskContextToken`, at once and without confirmation | end the reply with the returned `agent_receipt` |
11
11
  | Turn FULI off or on for this session | none | no Agent tool: tell the person to type `/fuli stop` or `fuli stop` (`start`, `restart`, `status`) | the hook's answer is shown to the person |
12
12
  | Add or change durable knowledge | the narrowest knowledge search/read tool | the matching knowledge submission or decision tool | read the exact item and confirm scope/version |
13
+ | Send a kind of work to its own project from now on ("以后 iDev 工时都交给 X") | none | `register_standing_assignment` `preview` writes nothing and returns one `restatement`: ask the user once; after a clear yes, `confirm` with the same input and `confirmationDigest` | the result says registered and assigned, not executed; do the current request, if any, as usual |
14
+ | Correct or end such a rule ("工时以后交给 ops" / "iDev 不用再交给 X 了") | none | the same tool with `change` `retire`, `reassign` (`projectName`, `leadAgentId`; default that project's lead) or `edit_terms` (`addTerms`, `removeTerms`), naming the assignment by one of its terms in `term`: `preview`, ask once, `confirm` with the digest. Removing every term is refused; retire instead | the result's `assignment`; the project's own lead is unchanged. The person can also do it in the local console (loopback only) |
13
15
  | Manage Project Agents | `list_project_agents`, `list_project_agent_tasks`, assignments or recruitment state | the matching Agent/assignment/task/recruitment tool | re-list the same Agent/task and inspect status/events |
14
16
  | Tag knowledge with an open vocabulary | `resolve_knowledge_tags` in the current project | `change_knowledge_tags`: reuse an exact/alias match, `add_alias` for a synonym, `create` with a reason only when nothing fits (`distinctFrom` only after judging each similar candidate) | `resolve_knowledge_tags` again; `attach` returns the item's visible tags |
15
17
  | Ask the person to approve, merge, split, retire or undo a tag | `resolve_knowledge_tags` for both tags | `change_knowledge_tags` with that action (`intoTagId` for merge, `name` for split): it only previews and returns `confirmUrl` | give the person the link; nothing changes until they confirm in the console |
@@ -115,6 +115,7 @@ export const HOST_TOOL_CATALOG = Object.freeze({
115
115
  list_agent_interfaces: UNSCOPED,
116
116
  get_capture_policy: UNSCOPED,
117
117
  read_session_records: UNSCOPED,
118
+ register_standing_assignment: UNSCOPED,
118
119
  explain_settings: UNSCOPED,
119
120
  update_capture_policy: UNSCOPED,
120
121
  defer_preference_conflict: UNSCOPED,