fuli-context 0.27.0 → 0.27.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.
- package/dist/web/assets/{AboutPage-Bp2Edkdg.js → AboutPage-Bgcf03U0.js} +1 -1
- package/dist/web/assets/{AboutSectionHeading-DFfY2f_Z.js → AboutSectionHeading-BaQBY_Xs.js} +1 -1
- package/dist/web/assets/AgentAppsPage-DNuujLT2.js +1 -0
- package/dist/web/assets/{AgentAvatar-w-2A3nsJ.js → AgentAvatar-DGXedNUs.js} +1 -1
- package/dist/web/assets/{AgentHand-BGGU49Jt.js → AgentHand-BwE2VGth.js} +1 -1
- package/dist/web/assets/AgentManagement-2r8DUS1N.js +7 -0
- package/dist/web/assets/AgentManagement-hRkMpjvY.css +1 -0
- package/dist/web/assets/{AgentMentionCopy-BAHZjubz.js → AgentMentionCopy-y3JD1Cef.js} +1 -1
- package/dist/web/assets/{AgentName-CXlsC-4o.js → AgentName-XrBcHq4R.js} +1 -1
- package/dist/web/assets/AgentProfilePage-DE7z980p.js +5 -0
- package/dist/web/assets/AgentServicesPage-CWfGSxcb.js +1 -0
- package/dist/web/assets/{AppViewerPage-6gWP6nAf.js → AppViewerPage-BaKMk9pp.js} +1 -1
- package/dist/web/assets/{BackToTop-Cs5_rV99.js → BackToTop-DITd9y7X.js} +1 -1
- package/dist/web/assets/{BoardCardFieldsMenu-CvFrsIgy.js → BoardCardFieldsMenu-CWtHiVR-.js} +1 -1
- package/dist/web/assets/{BoardMoveMenu-B5isxIcK.js → BoardMoveMenu-CEDdltY7.js} +1 -1
- package/dist/web/assets/Breadcrumb-C98voz9V.js +1 -0
- package/dist/web/assets/{CaptureChangePage-Ca72_PHc.js → CaptureChangePage-CE8tJfiQ.js} +1 -1
- package/dist/web/assets/{CopyFixPrompt-wGATZKOq.js → CopyFixPrompt-C2hC04lV.js} +1 -1
- package/dist/web/assets/DataFormatPage-BjZkck9o.js +2 -0
- package/dist/web/assets/DebugTurnPage-B82geu1y.js +1 -0
- package/dist/web/assets/DebugTurnsPage-BlDDz1Fk.js +1 -0
- package/dist/web/assets/DialogTitle-fpANsAcy.js +1 -0
- package/dist/web/assets/{EmployeeRedirectPage-C2SHpAEF.js → EmployeeRedirectPage-CSSuvAqx.js} +1 -1
- package/dist/web/assets/EmployeeScopeDialog-BoEMQOEj.js +1 -0
- package/dist/web/assets/EmployeeWorkbench-DvEojWb7.js +4 -0
- package/dist/web/assets/{EmployeeWorkbench-Bp9pUkfS.css → EmployeeWorkbench-rhY970vW.css} +1 -1
- package/dist/web/assets/FieldRoot-D3lnRut5.js +1 -0
- package/dist/web/assets/{FlaGrowth-DGnUPN7D.js → FlaGrowth-OdlmgEVi.js} +1 -1
- package/dist/web/assets/{FlaOccupationKit-DAJjSrmL.js → FlaOccupationKit-CnouVWnU.js} +1 -1
- package/dist/web/assets/{FlaTaskSheets-DRLgfrVC.js → FlaTaskSheets-rSIdCtzz.js} +1 -1
- package/dist/web/assets/FlasPage-BZ791caF.js +1 -0
- package/dist/web/assets/{FlasPage-H99IZ9M6.css → FlasPage-D3CcJcvN.css} +1 -1
- package/dist/web/assets/{GrowthLoading-NLj2W4jj.js → GrowthLoading-BYOSvxZY.js} +1 -1
- package/dist/web/assets/{HowtoPage-CrvMmT6K.css → HowtoPage-DNTwYQCD.css} +1 -1
- package/dist/web/assets/HowtoPage-lYwzi4Vm.js +1 -0
- package/dist/web/assets/InboxPage-C3cSvJjB.js +6 -0
- package/dist/web/assets/{KnowledgeDeleteButton-DaT-gTmm.js → KnowledgeDeleteButton-yc8Gi-BH.js} +1 -1
- package/dist/web/assets/{KnowledgeHardDeleteSection-C9d7DVLa.js → KnowledgeHardDeleteSection-D9Ktc-uC.js} +1 -1
- package/dist/web/assets/KnowledgeItemEditPage-Csy4oOxD.js +1 -0
- package/dist/web/assets/{KnowledgeItemSummaryCard-eLzjKvgN.js → KnowledgeItemSummaryCard-BH5UYmde.js} +1 -1
- package/dist/web/assets/KnowledgeOrganizerPage-BTeQX0gH.js +1 -0
- package/dist/web/assets/KnowledgePage-BuukvNxz.js +1 -0
- package/dist/web/assets/KnowledgePeek-D0pcU7U5.js +1 -0
- package/dist/web/assets/KnowledgeTurnReceiptPage-Bd_LIdCc.js +1 -0
- package/dist/web/assets/{KnowledgeWorkspace-DDg3tUb3.css → KnowledgeWorkspace-Be2gUul5.css} +1 -1
- package/dist/web/assets/KnowledgeWorkspace-Dr-zYpDQ.js +4 -0
- package/dist/web/assets/{MeAvatar-f6qxg9dN.js → MeAvatar-CmhuRFOf.js} +1 -1
- package/dist/web/assets/{MeLink-DTvFYaYE.js → MeLink-BesUihiS.js} +1 -1
- package/dist/web/assets/MenuSeparator-BGo0DgyF.js +1 -0
- package/dist/web/assets/{ModelSettingsPage-B38R-kBZ.css → ModelSettingsPage-BZcyT7Vy.css} +1 -1
- package/dist/web/assets/ModelSettingsPage-CBPwuIBM.js +1 -0
- package/dist/web/assets/{NewSessionPanel-9yINjwyx.js → NewSessionPanel-Bvp9ElzU.js} +1 -1
- package/dist/web/assets/{NotFoundPage-CqevPz0_.js → NotFoundPage-BrolI2fz.js} +1 -1
- package/dist/web/assets/{workbench-card-Dt0820yW.css → NoticeRow-DD-J76Yo.css} +1 -1
- package/dist/web/assets/NoticeRow-Q9QT5NqB.js +1 -0
- package/dist/web/assets/OccupationsPage-CZCeeihl.js +1 -0
- package/dist/web/assets/{PageOutline-HHUlu2x3.js → PageOutline-DULpqEwg.js} +1 -1
- package/dist/web/assets/PageStack-BMzrkyV4.css +1 -0
- package/dist/web/assets/PageStack-DTzWJuae.js +1 -0
- package/dist/web/assets/{PersonalProfilePage-DnjNX2xK.css → PersonalProfilePage-BE5q2bqc.css} +1 -1
- package/dist/web/assets/PersonalProfilePage-DbXWycCQ.js +1 -0
- package/dist/web/assets/PersonalProjectsPage-pdAJpnZd.js +1 -0
- package/dist/web/assets/{PinIcon-DP-9Iisk.js → PinIcon-YYoaYKTx.js} +1 -1
- package/dist/web/assets/PopperContent-CnNwFMIA.js +1 -0
- package/dist/web/assets/Presence-CuIoA2sH.js +3 -0
- package/dist/web/assets/{ProfileAuthorChip-BKZJC_N2.js → ProfileAuthorChip-BEfiuJbm.js} +1 -1
- package/dist/web/assets/ProjectAgentsPage-BPf2RLsw.js +5 -0
- package/dist/web/assets/{ProjectJudgmentPolicy-BJ5sVuFI.js → ProjectJudgmentPolicy-CCzHtmOb.js} +1 -1
- package/dist/web/assets/{RoundtablesPage-D5Xc3yun.js → RoundtablesPage-BDU4W-bg.js} +1 -1
- package/dist/web/assets/RovingFocusGroup-DS4v3bEq.js +1 -0
- package/dist/web/assets/RovingFocusItem-bLEnnw2Y.js +1 -0
- package/dist/web/assets/SessionMigrationPage-DrK4df0L.js +1 -0
- package/dist/web/assets/{SessionRecordsPage-C6U5YGSt.js → SessionRecordsPage-CFAgM65g.js} +1 -1
- package/dist/web/assets/SettingsPage-CsJxhhsu.js +1 -0
- package/dist/web/assets/SettingsPage-VX_e4ty2.css +1 -0
- package/dist/web/assets/SharedJefaReportPage-DbTPYwa_.js +1 -0
- package/dist/web/assets/StatementCalendarPage-CIo5R14R.js +1 -0
- package/dist/web/assets/StatementCalendarPage-t8pJI4G6.css +1 -0
- package/dist/web/assets/StatementRows-CubaC9KG.js +1 -0
- package/dist/web/assets/StatementRows-TQ2i_uXU.css +1 -0
- package/dist/web/assets/{TagVocabularyPage-Brpr-Q-y.js → TagVocabularyPage-BVlLmKv2.js} +1 -1
- package/dist/web/assets/TaskBlockerNotice-YSvmy6B4.js +1 -0
- package/dist/web/assets/{TaskReason-RKKs4Kb5.js → TaskReason-CrLPeiOg.js} +1 -1
- package/dist/web/assets/{TeamCard-8hjo1h0x.js → TeamCard-SBMJMd7P.js} +1 -1
- package/dist/web/assets/TeamCardsWidget-CGLW04TH.js +1 -0
- package/dist/web/assets/TeamIsland-jJKTwCJD.js +9 -0
- package/dist/web/assets/Teleport-CRjWb-eC.js +1 -0
- package/dist/web/assets/{TextField-G2fJ4aFQ.js → TextField-Cd8UOHKv.js} +1 -1
- package/dist/web/assets/TodayPage-BvbZCEFJ.js +1 -0
- package/dist/web/assets/TodayPage-EJ8SWFE0.css +1 -0
- package/dist/web/assets/TonborgDelegationSwitch-BFb1JkWe.css +1 -0
- package/dist/web/assets/TonborgDelegationSwitch-BOidSjkk.js +1 -0
- package/dist/web/assets/{UiChip-BHEJVA6L.js → UiChip-B2z0UERX.js} +1 -1
- package/dist/web/assets/{UiDisclosure-B1pd8qXW.js → UiDisclosure-Bw4Wu0Dm.js} +1 -1
- package/dist/web/assets/{UiIcon-K7OhYTSy.js → UiIcon-BuaIQ57Z.js} +1 -1
- package/dist/web/assets/UiSegmented-DlI1vR3k.js +1 -0
- package/dist/web/assets/{UiWeight-eAw682rH.js → UiWeight-DpBexUUy.js} +1 -1
- package/dist/web/assets/{VirtualDirectoryList-BGum1GZc.js → VirtualDirectoryList-RV2XtTPO.js} +1 -1
- package/dist/web/assets/{VisuallyHidden-Ck6D7rq-.js → VisuallyHidden-DciDIEua.js} +1 -1
- package/dist/web/assets/{VisuallyHiddenInput-DXWhIUlB.js → VisuallyHiddenInput-mfi7gVBu.js} +1 -1
- package/dist/web/assets/WidgetSlot-xFZKjZ5z.js +2 -0
- package/dist/web/assets/WorkbenchListPage-BKT03RRO.css +1 -0
- package/dist/web/assets/WorkbenchListPage-suawrzji.js +1 -0
- package/dist/web/assets/_plugin-vue_export-helper-CYsAcErn.js +9 -0
- package/dist/web/assets/{agent-apps-D0eG1aMx.js → agent-apps-B_0syRPr.js} +1 -1
- package/dist/web/assets/agent-occupation-C-9THmIG.js +1 -0
- package/dist/web/assets/{agent-pins-OYjJQ38F.js → agent-pins-B9wMvxGh.js} +1 -1
- package/dist/web/assets/{agent-roster-records-CsYjmaNn.js → agent-roster-records-CY0aSUNq.js} +1 -1
- package/dist/web/assets/{agent-work-summary-BOeJ4JXc.js → agent-work-summary-Cs8jPFL0.js} +1 -1
- package/dist/web/assets/{attach-closest-edge-C75rKXiz.js → attach-closest-edge-BRDsvYPn.js} +1 -1
- package/dist/web/assets/{attention-store-k4mPCefZ.js → attention-store-HMiJ1K6M.js} +1 -1
- package/dist/web/assets/{badge-B2rll-68.js → badge-jafr8Jg1.js} +1 -1
- package/dist/web/assets/{button-q6JhonlL.js → button-d6TCVE0s.js} +1 -1
- package/dist/web/assets/{card-CPQiMHSu.js → card-ebnaJXQA.js} +1 -1
- package/dist/web/assets/{catalog-CBPcEkXC.js → catalog-CvdvPGYk.js} +1 -1
- package/dist/web/assets/checkbox-CdIozFRY.js +1 -0
- package/dist/web/assets/{client-KFFphxpK.js → client--hZxcKYo.js} +1 -1
- package/dist/web/assets/{client-links-store-Cw9c8MWc.js → client-links-store-XyR0EzJi.js} +1 -1
- package/dist/web/assets/combobox-DzLSYxyO.js +1 -0
- package/dist/web/assets/{console-BCR2S3AF.js → console-D597wx3f.js} +1 -1
- package/dist/web/assets/conversation-launcher-settings-CFFH9C2y.js +1 -0
- package/dist/web/assets/copy-mention-CWsw8po1.js +1 -0
- package/dist/web/assets/dialog-SLa8cPbS.js +1 -0
- package/dist/web/assets/{dist-CaVgk2QB.js → dist-B78L06NL.js} +1 -1
- package/dist/web/assets/{dist-D73EXNtz.js → dist-Dy5JoHWF.js} +1 -1
- package/dist/web/assets/dropdown-menu-C-PcZxRY.js +1 -0
- package/dist/web/assets/{field-BaUOZtN5.js → field-DeguT8it.js} +1 -1
- package/dist/web/assets/{format-bytes-D5eCtdg1.js → format-bytes-Br4RwHnA.js} +1 -1
- package/dist/web/assets/hover-card-B-H7mMvg.js +1 -0
- package/dist/web/assets/identity-V8oA_IuB.js +1 -0
- package/dist/web/assets/{index-HRZACEmh.css → index-CHDkJLQR.css} +1 -1
- package/dist/web/assets/index-DdAVEwQV.js +24 -0
- package/dist/web/assets/{input-Dxh25T4M.js → input-CRCpCN_c.js} +1 -1
- package/dist/web/assets/label-DwMBzI2m.js +1 -0
- package/dist/web/assets/label-table-DiaZlHIp.js +1 -0
- package/dist/web/assets/{model-ZwOxwk2m.js → model-B4AuKvPj.js} +1 -1
- package/dist/web/assets/model-BwOv-HBS.js +1 -0
- package/dist/web/assets/{model-Blk5Wgg2.js → model-C-60EMcI.js} +1 -1
- package/dist/web/assets/{model-Bgh75q3j.js → model-CB4ObIOH.js} +1 -1
- package/dist/web/assets/{model--lR9icA_.js → model-CUAxIOXR.js} +1 -1
- package/dist/web/assets/{model-jC3F-J2F.js → model-CjQPAeCy.js} +1 -1
- package/dist/web/assets/{model-D4DkvMH-.js → model-CwFZ_IgV.js} +1 -1
- package/dist/web/assets/{model-CWMP5GOL.js → model-D-vak-m0.js} +1 -1
- package/dist/web/assets/{motion-BL3lek9c.js → motion-Cr9JChF9.js} +1 -1
- package/dist/web/assets/motion-D5Fs3-ut.js +1 -0
- package/dist/web/assets/{motion-preference-D3UMHojT.js → motion-preference-DgdzdVh8.js} +1 -1
- package/dist/web/assets/{occupation-catalog-BeJ2O9nm.js → occupation-catalog-DHsjkd_q.js} +1 -1
- package/dist/web/assets/{occupation-kits-Bkiu6MzD.js → occupation-kits-BVLLRN4V.js} +1 -1
- package/dist/web/assets/{option-Crs2MA88.js → option-DhAwzags.js} +1 -1
- package/dist/web/assets/{orchestration-filters-3AfjDoHQ.js → orchestration-filters-lhR2CHlQ.js} +1 -1
- package/dist/web/assets/overview-data-QDnygL-x.js +1 -0
- package/dist/web/assets/{page-refresh-Bz5r7A_Q.js → page-refresh-BVRlo-dI.js} +1 -1
- package/dist/web/assets/{page-title-KYZApNys.js → page-title-ReSXziuS.js} +1 -1
- package/dist/web/assets/{person-profile-mhLxWtq7.js → person-profile-BgUfg57K.js} +1 -1
- package/dist/web/assets/popover-UYksnAeH.js +1 -0
- package/dist/web/assets/popup-host-DMoMkD3v.js +1 -0
- package/dist/web/assets/preference-conflicts-a-H51vUw.js +1 -0
- package/dist/web/assets/{profile-model-DWutKuCZ.js → profile-model-CM98TJsj.js} +1 -1
- package/dist/web/assets/{project-board-layout-CWMHQuUA.js → project-board-layout-RH6UXkCA.js} +1 -1
- package/dist/web/assets/{project-capture-CebFSnn0.js → project-capture-DcQ8cXIt.js} +1 -1
- package/dist/web/assets/{project-origin-BnUVE0be.js → project-origin-BNzeAazi.js} +1 -1
- package/dist/web/assets/{quick-edit-api-YwzoODMc.js → quick-edit-api-COKVNuPk.js} +1 -1
- package/dist/web/assets/radio-group-DfegNkLG.js +1 -0
- package/dist/web/assets/review-api-CAKGInLD.js +1 -0
- package/dist/web/assets/{review-list-_PN7ljSY.js → review-list-CbpXvBp-.js} +1 -1
- package/dist/web/assets/{review-store-CobX9No6.js → review-store-BzrmqVoj.js} +1 -1
- package/dist/web/assets/{role-names-wD9l8uz5.js → role-names-Ba0c6AbS.js} +1 -1
- package/dist/web/assets/{roundtable-live-Dm4Vwo75.js → roundtable-live-CoKmaXKd.js} +1 -1
- package/dist/web/assets/{runtime-dom.esm-bundler-DzfwnSj8.js → runtime-dom.esm-bundler-CaYBCU9Y.js} +1 -1
- package/dist/web/assets/select-Bq2TQ0Gw.js +1 -0
- package/dist/web/assets/{session-launch-offers-C9UkoKUJ.js → session-launch-offers-C-oBkMKe.js} +1 -1
- package/dist/web/assets/{settings-autosave-L0zSXnBO.js → settings-autosave-C3bTildI.js} +1 -1
- package/dist/web/assets/settings-tabs-DFZcxOaQ.js +1 -0
- package/dist/web/assets/shared-report-Ci1jBiYV.js +3 -0
- package/dist/web/assets/{source-adapters-r-NIqO77.js → source-adapters-CunVF9JG.js} +1 -1
- package/dist/web/assets/switch-DaUSEDq0.js +1 -0
- package/dist/web/assets/tabs-B_7xQRfl.js +1 -0
- package/dist/web/assets/{task-card-fields-B1z1PmTT.js → task-card-fields-Ce11pWnv.js} +1 -1
- package/dist/web/assets/{task-evidence-DydhKn9x.js → task-evidence-D0XkNnb8.js} +1 -1
- package/dist/web/assets/{task-labels-DTc5OuFF.js → task-labels-BulIuDQB.js} +1 -1
- package/dist/web/assets/{task-reason-CneTZWRv.js → task-reason-gHlp8KHO.js} +1 -1
- package/dist/web/assets/{team-sheets-CUt3Vp2s.js → team-sheets-BzV1WjjK.js} +1 -1
- package/dist/web/assets/{textarea-DJ0ucCir.js → textarea-D6czUY3a.js} +1 -1
- package/dist/web/assets/ui-BCHzwL4X.js +1 -0
- package/dist/web/assets/ui-CgwSWg1F.css +1 -0
- package/dist/web/assets/{useAgentRecords-CwkwZy8H.js → useAgentRecords-DijrJ79w.js} +1 -1
- package/dist/web/assets/{useAgentWorkSummary-DoiCqME7.js → useAgentWorkSummary-CUv88AVP.js} +1 -1
- package/dist/web/assets/{useApi-CROJJdhE-CenjhnR5.js → useApi-CROJJdhE-CxqsMZ6P.js} +1 -1
- package/dist/web/assets/{useClipboardCopy-Ba86PzjA.js → useClipboardCopy-uGyNKuWB.js} +1 -1
- package/dist/web/assets/useDirection-Bi78LycK.js +1 -0
- package/dist/web/assets/{useFocusReturn-B0ErBkt_.js → useFocusReturn-7BKdKvqF.js} +1 -1
- package/dist/web/assets/{useForwardPropsEmits-D1vvIUcB.js → useForwardPropsEmits-BMeknK03.js} +1 -1
- package/dist/web/assets/useForwardScopeId-DHGSyWlZ.js +1 -0
- package/dist/web/assets/{useKnowledgeConfirm-781LUhoU.js → useKnowledgeConfirm-mFWI8EbK.js} +1 -1
- package/dist/web/assets/{useKnowledgeItemPeek-CnuCvJKQ.js → useKnowledgeItemPeek-DtazLM2s.js} +1 -1
- package/dist/web/assets/{useMinimumLoadingDisplay-DCC9EfQ9.js → useMinimumLoadingDisplay-D5UC2KRz.js} +1 -1
- package/dist/web/assets/{usePageTools-BaB021q0.js → usePageTools-BXkR_gpB.js} +1 -1
- package/dist/web/assets/usePrimitiveElement-BxOn-Fn_.js +1 -0
- package/dist/web/assets/{useProjectAgentRoster-M3wbWpS-.js → useProjectAgentRoster-blZ5REnH.js} +1 -1
- package/dist/web/assets/{useRoutePeek-CYg5JyYt.js → useRoutePeek-D_j5KVFv.js} +1 -1
- package/dist/web/assets/useTeamWork-e57CKhLW.js +1 -0
- package/dist/web/assets/{useTypeahead-DYb5kVkH.js → useTypeahead-6a1q-4Oq.js} +1 -1
- package/dist/web/assets/{utils-Cli0RsEd.js → utils-BQtZ8ZUw.js} +1 -1
- package/dist/web/assets/{utils-B7sUn8rD.js → utils-DBsOpQt4.js} +1 -1
- package/dist/web/assets/{verification-DY7kllTI.js → verification-BlF0avgs.js} +1 -1
- package/dist/web/assets/{version-CBgUEmnM.js → version-oG6VyAd6.js} +1 -1
- package/dist/web/assets/{vue-router-ab7kABlJ.js → vue-router-CCvxNose.js} +1 -1
- package/dist/web/index.html +75 -79
- package/docs/agent-roundtable.md +45 -3
- package/docs/judgment-and-autonomy.md +2 -0
- package/graph-provider/fuli_graph/app.py +6 -0
- package/graph-provider/fuli_graph/knowledge_duplicates.py +27 -14
- package/graph-provider/fuli_graph/knowledge_search.py +31 -32
- package/graph-provider/fuli_graph/knowledge_semantic.py +38 -11
- package/graph-provider/fuli_graph/knowledge_statement.py +230 -0
- package/graph-provider/fuli_graph/knowledge_statement_days.py +109 -0
- package/graph-provider/fuli_graph/models.py +15 -0
- package/graph-provider/fuli_graph/preference_organizing.py +162 -0
- package/graph-provider/fuli_graph/project_agent_routes.py +22 -0
- package/graph-provider/fuli_graph/project_agent_task_models.py +26 -2
- package/graph-provider/fuli_graph/store_project_agent_task_activity.py +51 -11
- package/graph-provider/fuli_graph/store_project_agent_task_blockers.py +13 -6
- package/graph-provider/fuli_graph/store_project_agent_task_person_close.py +82 -0
- package/graph-provider/fuli_graph/store_project_agent_tasks.py +18 -1
- package/graph-provider/fuli_graph/task_blocker.py +10 -0
- package/graph-provider/pyproject.toml +1 -1
- package/native/win32/fuli-win-helper.exe +0 -0
- package/npm-shrinkwrap.json +57 -9
- package/package.json +4 -3
- package/packages/roundtable/package.json +1 -0
- package/packages/roundtable/src/agents/claude-code/wake.js +4 -2
- package/packages/roundtable/src/agents/codex/wake.js +1 -0
- package/packages/roundtable/src/host.js +4 -1
- package/packages/roundtable/src/peer/control-cli.js +103 -2
- package/packages/roundtable/src/peer/control.js +29 -3
- package/packages/roundtable/src/peer/coordinator-http.js +23 -2
- package/packages/roundtable/src/peer/coordinator-service.js +92 -14
- package/packages/roundtable/src/peer/coordinator-store.js +2 -1
- package/packages/roundtable/src/peer/lan-addresses.js +43 -0
- package/packages/roundtable/src/peer/nearby-attempts.js +73 -0
- package/packages/roundtable/src/peer/nearby-discovery.js +132 -0
- package/packages/roundtable/src/peer/nearby-pairing.js +422 -0
- package/packages/roundtable/src/peer/nearby-presence.js +93 -0
- package/packages/roundtable/src/peer/node-store.js +10 -0
- package/packages/roundtable/src/peer/pairing-share.js +139 -0
- package/packages/roundtable/src/peer/peer-runtime.js +684 -89
- package/packages/roundtable/src/peer/peer-transport.js +58 -3
- package/packages/roundtable/src/peer/protocol.js +24 -1
- package/packages/roundtable/src/roundtable/chat-service.js +14 -3
- package/packages/roundtable/src/roundtable/chat.js +1 -0
- package/packages/roundtable/src/roundtable/delivery-state.js +2 -1
- package/packages/roundtable/src/roundtable/group-discussion-store.js +130 -5
- package/packages/roundtable/src/roundtable/group-discussion.js +596 -111
- package/packages/roundtable/src/roundtable/service.js +10 -2
- package/packages/roundtable/src/roundtable/store.js +11 -1
- package/packages/roundtable/src/roundtable/wake.js +3 -1
- package/packages/roundtable/src/standalone/cli.js +1 -1
- package/skills/capturing-session-knowledge/SKILL.md +1 -1
- package/skills/capturing-session-knowledge/references/coordination.md +28 -4
- package/skills/grilling-project/references/project-profile.md +13 -5
- package/skills/operating-fuli/SKILL.md +30 -5
- package/skills/operating-fuli/references/workflow-recipes.md +6 -2
- package/src/agent-apps/host-tools/catalog.js +2 -0
- package/src/agent-delegation/operation-log.js +15 -1
- package/src/agent-delegation/port.js +2 -3
- package/src/agent-delegation/refusals.js +12 -4
- package/src/agent-roundtable/task-context.js +1 -1
- package/src/agent-roundtable/tools.js +5 -2
- package/src/agent-tools/graph-definitions.js +2 -0
- package/src/agent-tools/graph-handlers.js +6 -3
- package/src/agent-tools/interface-catalog.js +11 -1
- package/src/agent-tools/interface-definitions.js +3 -2
- package/src/agent-tools/project-agent-definitions.js +2 -1
- package/src/agent-tools/project-organizing-definitions.js +7 -4
- package/src/agent-tools/project-space-definitions.js +2 -0
- package/src/agent-tools/session-fuli-gate.js +6 -1
- package/src/agent-tools/statement-definitions.js +18 -0
- package/src/agents/codex/lifecycle-hook.js +3 -1
- package/src/agents/identity-receipt.js +3 -1
- package/src/agents/native-session-env.js +7 -0
- package/src/conversations/entry-budget.js +3 -2
- package/src/conversations/entry-inline-budget.js +40 -10
- package/src/conversations/preference-lifecycle.js +3 -3
- package/src/conversations/turn-findings.js +9 -2
- package/src/graphiti/agent-project-resolution.js +18 -0
- package/src/graphiti/collaboration-preference-entry.js +5 -2
- package/src/graphiti/current-project-knowledge-search.js +3 -3
- package/src/graphiti/fla-mention.js +48 -9
- package/src/graphiti/local-runtimes.js +5 -0
- package/src/graphiti/project-agent-task-sessions.js +49 -0
- package/src/graphiti/project-agent-task-summaries.js +82 -0
- package/src/graphiti/project-agent-workflows.js +8 -5
- package/src/graphiti/project-path-context.js +23 -9
- package/src/graphiti/provider-client.js +23 -1
- package/src/graphiti/repository-remote.js +34 -8
- package/src/graphiti/roundtable-host.js +13 -1
- package/src/graphiti/task-context-entry.js +14 -7
- package/src/graphiti/task-entry-group-discussion.js +111 -25
- package/src/graphiti/task-entry-owner-change.js +22 -2
- package/src/graphiti/task-entry-preferences.js +9 -4
- package/src/graphiti/task-entry-project-scope.js +19 -0
- package/src/graphiti/task-preference-pages.js +3 -3
- package/src/graphiti/task-preference-reader.js +44 -9
- package/src/graphiti/worker-task-context.js +1 -1
- package/src/http/api-router.js +5 -0
- package/src/http/graph-api-router.js +5 -2
- package/src/http/statement-api-router.js +27 -0
- package/src/http/task-blocker-api-router.js +11 -1
- package/src/http/task-close-api-router.js +59 -0
- package/src/judgment/engine.js +6 -1
- package/src/judgment/http.js +2 -2
- package/src/judgment/review-delegation.js +16 -4
- package/src/judgment/review-egress.js +25 -0
- package/src/judgment/service.js +1 -1
- package/src/judgment/store.js +9 -0
- package/src/knowledge-impressions/store.js +72 -9
- package/src/mcp/create-mcp-server.js +2 -2
- package/src/mcp/direct-call.js +3 -2
- package/src/mcp/preference-delivery.js +64 -6
- package/src/mcp/session-id.js +12 -4
- package/src/mcp/tool-annotations.js +1 -0
- package/src/mcp/tool-result.js +8 -6
- package/src/model-backends/config.js +7 -0
- package/src/model-backends/egress.js +8 -0
- package/src/model-backends/failures.js +8 -0
- package/src/model-backends/port.js +39 -16
- package/src/model-backends/role-trust.js +3 -9
- package/src/model-backends/usage-ledger.js +20 -9
- package/src/notices/recent-notices.js +2 -1
- package/src/presence/windows-helper-pin.js +1 -1
- package/src/project-organizing/agent-tool.js +34 -7
- package/src/server.js +7 -0
- package/src/statement/agent-tool.js +29 -0
- package/src/statement/compounding-statement.js +134 -0
- package/src/task-blockers/agent-resume.js +73 -0
- package/src/task-blockers/console-port.js +5 -2
- package/src/task-blockers/resume-status.js +2 -0
- package/src/task-closing/console-port.js +26 -0
- package/src/whats-new/lines/0.27.1.json +13 -0
- package/src/whats-new/lines/0.27.2.json +13 -0
- package/dist/web/assets/AgentAppsPage-CjyvPZSs.js +0 -1
- package/dist/web/assets/AgentManagement-Cc00RLSO.css +0 -1
- package/dist/web/assets/AgentManagement-MMGrwdD2.js +0 -7
- package/dist/web/assets/AgentProfilePage-eDKbJJwY.js +0 -5
- package/dist/web/assets/AgentServicesPage-CZwsN5U2.js +0 -1
- package/dist/web/assets/Breadcrumb-BXTA4e-W.js +0 -1
- package/dist/web/assets/DataFormatPage-CQKkFhcH.js +0 -2
- package/dist/web/assets/DebugTurnPage-CUqbuhgX.js +0 -1
- package/dist/web/assets/DebugTurnsPage-HwaTG8Fa.js +0 -1
- package/dist/web/assets/DialogTitle-HYzAHbGg.js +0 -1
- package/dist/web/assets/EmployeeScopeDialog-yUCgujKT.js +0 -1
- package/dist/web/assets/EmployeeWorkbench-CbRJhkJO.js +0 -4
- package/dist/web/assets/FieldRoot-BLcsuPMA.js +0 -1
- package/dist/web/assets/FlasPage-CMv2awKJ.js +0 -1
- package/dist/web/assets/HowtoPage-CkGRrKpf.js +0 -1
- package/dist/web/assets/InboxPage-DfQvtnyq.js +0 -6
- package/dist/web/assets/KnowledgeItemEditPage-BUKQK37o.js +0 -1
- package/dist/web/assets/KnowledgeOrganizerPage-CiZ9JlNX.js +0 -1
- package/dist/web/assets/KnowledgePage-C3_Cvz4g.js +0 -1
- package/dist/web/assets/KnowledgePeek-DtOOiARX.js +0 -1
- package/dist/web/assets/KnowledgeTurnReceiptPage-Dne5NQ9q.js +0 -1
- package/dist/web/assets/KnowledgeWorkspace-Cq_XYcma.js +0 -4
- package/dist/web/assets/MenuSeparator-CLmsZ9rj.js +0 -1
- package/dist/web/assets/ModelSettingsPage-COVaW4eh.js +0 -1
- package/dist/web/assets/NoticeRow-D5MWTeBY.js +0 -1
- package/dist/web/assets/NoticeRow-ktVO_9Es.css +0 -1
- package/dist/web/assets/OccupationsPage-BKd051j1.js +0 -1
- package/dist/web/assets/OverviewPage-C90G_adj.js +0 -1
- package/dist/web/assets/OverviewPage-KVt4LcE-.css +0 -1
- package/dist/web/assets/PageColumns-DEideeB7.css +0 -1
- package/dist/web/assets/PageColumns-Df60nEzj.js +0 -1
- package/dist/web/assets/PersonalProfilePage-DIDgG3NH.js +0 -1
- package/dist/web/assets/PersonalProjectsPage-DwhlEpNg.js +0 -1
- package/dist/web/assets/PopperContent-DWCMeKSL.js +0 -1
- package/dist/web/assets/Presence-Ba3jqPYx.js +0 -3
- package/dist/web/assets/ProjectAgentsPage-BefVF9ZP.js +0 -5
- package/dist/web/assets/RecentNotices-CDHGIky1.js +0 -1
- package/dist/web/assets/RovingFocusGroup-DoGybG5V.js +0 -1
- package/dist/web/assets/RovingFocusItem-B455TzUI.js +0 -1
- package/dist/web/assets/SessionMigrationPage-BAzXqxxO.js +0 -1
- package/dist/web/assets/SettingsPage-7mNL3bwe.js +0 -1
- package/dist/web/assets/SettingsPage-Cku8SoLk.css +0 -1
- package/dist/web/assets/SharedJefaReportPage-rH6I4cI9.js +0 -1
- package/dist/web/assets/TaskBlockerClear-BBmPbomO.css +0 -1
- package/dist/web/assets/TaskBlockerClear-BHOMZYwm.js +0 -1
- package/dist/web/assets/TaskBlockerNotice-POmS2neR.js +0 -1
- package/dist/web/assets/TeamCardsWidget-DIHFUDrF.js +0 -1
- package/dist/web/assets/TeamIsland-DdhEcVOZ.js +0 -9
- package/dist/web/assets/Teleport-CukHuRhz.js +0 -1
- package/dist/web/assets/TonborgDelegationSwitch-BA3Qb8Wr.js +0 -1
- package/dist/web/assets/TonborgDelegationSwitch-DeqERWoo.css +0 -1
- package/dist/web/assets/UiDialog-bUwGQz96.js +0 -1
- package/dist/web/assets/UiIconButton-D3R6WwwI.css +0 -1
- package/dist/web/assets/UiIconButton-DlLZ5_Yc.js +0 -1
- package/dist/web/assets/UiSegmented-CYrTxDn1.js +0 -1
- package/dist/web/assets/WidgetSlot-D6vCSWaz.js +0 -2
- package/dist/web/assets/WorkbenchListHead-CR_fDYYr.js +0 -1
- package/dist/web/assets/WorkbenchListPage-BX6Z9gkB.css +0 -1
- package/dist/web/assets/WorkbenchListPage-Zr5PW-cf.js +0 -1
- package/dist/web/assets/_plugin-vue_export-helper-BRS32yXs.js +0 -9
- package/dist/web/assets/agent-occupation-CEd3bAhb.js +0 -1
- package/dist/web/assets/agent-workflows-D3VeY6Yz.js +0 -1
- package/dist/web/assets/checkbox-C67upxzl.js +0 -1
- package/dist/web/assets/combobox-yHRJ-zN-.js +0 -1
- package/dist/web/assets/conversation-launcher-settings-28CqC1Gn.js +0 -1
- package/dist/web/assets/copy-mention-C4Nos381.js +0 -1
- package/dist/web/assets/dialog-Cjoy4nsv.js +0 -1
- package/dist/web/assets/dropdown-menu-Dto6hjoc.js +0 -1
- package/dist/web/assets/hover-card-Bg0dulGq.js +0 -1
- package/dist/web/assets/index-B-aRUs9w.js +0 -24
- package/dist/web/assets/label-CbrduZla.js +0 -1
- package/dist/web/assets/label-table-_YAtPkRI.js +0 -1
- package/dist/web/assets/model-DcsCYhXk.js +0 -1
- package/dist/web/assets/motion-_MepnmMC.js +0 -1
- package/dist/web/assets/overview-data-BIeNATEJ.js +0 -1
- package/dist/web/assets/popover-CMahoDLo.js +0 -1
- package/dist/web/assets/popup-host-DKN99Od3.js +0 -1
- package/dist/web/assets/radio-group-vRt8y8mF.js +0 -1
- package/dist/web/assets/review-api-WhNB3ppo.js +0 -1
- package/dist/web/assets/select-B9mVptgx.js +0 -1
- package/dist/web/assets/settings-tabs-DTbgqX8g.js +0 -1
- package/dist/web/assets/shared-report-0FO_y0sa.js +0 -3
- package/dist/web/assets/switch-BCzrGc4W.js +0 -1
- package/dist/web/assets/tabs-CB38D8N0.js +0 -1
- package/dist/web/assets/ui-D4nAhcmu.css +0 -1
- package/dist/web/assets/ui-M_UKzb_A.js +0 -1
- package/dist/web/assets/useForwardExpose-DJ6fcpI2.js +0 -1
- package/dist/web/assets/useForwardScopeId-CoSQtoUU.js +0 -1
- package/dist/web/assets/usePrimitiveElement-iRKqOVuY.js +0 -1
- package/dist/web/assets/useTeamPeople-CPC62La3.js +0 -1
- package/dist/web/assets/useTeamWork-Dql3_qLV.js +0 -1
|
@@ -22,7 +22,7 @@ from .search_projection import (
|
|
|
22
22
|
read_edge_epistemic_metadata,
|
|
23
23
|
source_uris_from_references,
|
|
24
24
|
)
|
|
25
|
-
from .knowledge_semantic import fused_ranking,
|
|
25
|
+
from .knowledge_semantic import cosine_parts, fused_ranking, standing_out, usable_cosine, vector_norm
|
|
26
26
|
from .knowledge_weight import knowledge_weight, ranking_weight
|
|
27
27
|
from .knowledge_tag_ranking import TagRanking
|
|
28
28
|
from .knowledge_visibility import AgentReader, fla_endpoints_visible_cypher, fla_visible, reader_parameter
|
|
@@ -83,7 +83,7 @@ async def search_knowledge(store, actor: dict, request: SearchRequest, *, tag_ex
|
|
|
83
83
|
edges = [*edges, *(edge for edge in term_edges if edge.uuid not in found)]
|
|
84
84
|
lexical_ids = {edge.uuid for edge in edges}
|
|
85
85
|
# Relationships found by meaning pass the very same filters below.
|
|
86
|
-
|
|
86
|
+
meaning_scores, meaning_edges = await _semantic_edge_candidates(store, personal_space, request)
|
|
87
87
|
edges = [*edges, *(edge for edge in meaning_edges if edge.uuid not in lexical_ids)]
|
|
88
88
|
if not request.include_historical:
|
|
89
89
|
edges = [edge for edge in edges if edge.invalid_at is None]
|
|
@@ -119,7 +119,7 @@ async def search_knowledge(store, actor: dict, request: SearchRequest, *, tag_ex
|
|
|
119
119
|
]
|
|
120
120
|
names = await _entity_names(store, edges)
|
|
121
121
|
tag_ranking = await TagRanking.for_search(store, personal_space, request, project_scopes)
|
|
122
|
-
|
|
122
|
+
in_scope_scores = {edge.uuid: meaning_scores[edge.uuid] for edge in edges if edge.uuid in meaning_scores}
|
|
123
123
|
edges = [edge for edge in edges if edge.uuid in lexical_ids]
|
|
124
124
|
matched_edges = [
|
|
125
125
|
(_edge_relevance(request.query, edge, names, position, len(edges), edge_terms.get(edge.uuid)), edge)
|
|
@@ -135,7 +135,7 @@ async def search_knowledge(store, actor: dict, request: SearchRequest, *, tag_ex
|
|
|
135
135
|
]
|
|
136
136
|
meaning_edges = {edge.uuid: edge for edge in meaning_edges}
|
|
137
137
|
ranked_edges, edge_matches = _fused_with_meaning(
|
|
138
|
-
ranked_edges, [meaning_edges[edge_id] for edge_id in
|
|
138
|
+
ranked_edges, [meaning_edges[edge_id] for edge_id in standing_out(in_scope_scores, request.limit)],
|
|
139
139
|
lambda edge: edge.uuid)
|
|
140
140
|
if personal_space:
|
|
141
141
|
ranked_edges = _dedupe_ranked_edges(
|
|
@@ -378,8 +378,9 @@ async def _personal_entities(
|
|
|
378
378
|
async def _scoped_entity_records(store, space, request: SearchRequest, project_scopes: dict[str, dict],
|
|
379
379
|
*, semantic_model: str | None = None) -> list[dict]:
|
|
380
380
|
"""The entities this search may return, with their scope. With a
|
|
381
|
-
semantic_model, only those carrying a vector of that model, and
|
|
382
|
-
|
|
381
|
+
semantic_model, only those carrying a vector of that model, and what
|
|
382
|
+
its cosine with the query is made of: the same filters decide either way
|
|
383
|
+
(rec#88)."""
|
|
383
384
|
records, _, _ = await store.runtime.driver.execute_query(
|
|
384
385
|
'''
|
|
385
386
|
MATCH (node:Entity {group_id: $group_id})
|
|
@@ -470,8 +471,7 @@ async def _scoped_entity_records(store, space, request: SearchRequest, project_s
|
|
|
470
471
|
node.fuli_last_feedback_at AS last_feedback_at,
|
|
471
472
|
node.fuli_retrieval_terms AS retrieval_terms,
|
|
472
473
|
node.fuli_retrieval_context AS retrieval_context,
|
|
473
|
-
|
|
474
|
-
AS semantic_vector,
|
|
474
|
+
<semantic parts>,
|
|
475
475
|
CASE WHEN $semantic_model IS NOT NULL THEN node.fuli_semantic_hash END
|
|
476
476
|
AS semantic_hash,
|
|
477
477
|
[episode IN episodes | episode.uuid] AS evidence_ids,
|
|
@@ -484,13 +484,15 @@ async def _scoped_entity_records(store, space, request: SearchRequest, project_s
|
|
|
484
484
|
}] AS source_references
|
|
485
485
|
ORDER BY node.name, node.uuid
|
|
486
486
|
LIMIT $candidate_limit
|
|
487
|
-
''',
|
|
487
|
+
'''.replace('<semantic parts>',
|
|
488
|
+
cosine_parts('node.fuli_semantic_vector') if semantic_model else 'null AS semantic_dot'),
|
|
488
489
|
group_id=space['group_id'],
|
|
489
490
|
space_id=space['id'],
|
|
490
491
|
project_ids=list(project_scopes),
|
|
491
492
|
include_historical=request.include_historical,
|
|
492
493
|
include_pending=request.include_pending,
|
|
493
494
|
semantic_model=semantic_model,
|
|
495
|
+
**({'query_vector': request.semantic.vector, 'length': len(request.semantic.vector)} if semantic_model else {}),
|
|
494
496
|
candidate_limit=SEMANTIC_CANDIDATE_LIMIT if semantic_model else store.settings.graph_limit,
|
|
495
497
|
routing_='r',
|
|
496
498
|
)
|
|
@@ -526,21 +528,21 @@ async def _semantic_entities(store, space, request: SearchRequest, project_scope
|
|
|
526
528
|
return []
|
|
527
529
|
records = await _scoped_entity_records(store, space, request, project_scopes,
|
|
528
530
|
semantic_model=request.semantic.model)
|
|
529
|
-
|
|
530
|
-
by_id,
|
|
531
|
+
query_norm = vector_norm(request.semantic.vector)
|
|
532
|
+
by_id, scores = {}, {}
|
|
531
533
|
for record in records:
|
|
532
|
-
|
|
533
|
-
if
|
|
534
|
-
by_id[record['id']],
|
|
535
|
-
return [by_id[item_id] for item_id in
|
|
534
|
+
score = usable_cosine('entity', record, query_norm)
|
|
535
|
+
if score is not None:
|
|
536
|
+
by_id[record['id']], scores[record['id']] = record, score
|
|
537
|
+
return [by_id[item_id] for item_id in standing_out(scores, request.limit)]
|
|
536
538
|
|
|
537
539
|
|
|
538
540
|
async def _semantic_edge_candidates(store, space, request: SearchRequest) -> tuple[dict, list[EntityEdge]]:
|
|
539
541
|
"""Every relationship of the personal space with a usable vector of the
|
|
540
|
-
query's model, as candidates for the
|
|
542
|
+
query's model and its cosine with the query, as candidates for the
|
|
543
|
+
search's own filters (rec#88)."""
|
|
541
544
|
if request.semantic is None or space is None:
|
|
542
545
|
return {}, []
|
|
543
|
-
length = len(request.semantic.vector)
|
|
544
546
|
records, _, _ = await store.runtime.driver.execute_query(
|
|
545
547
|
'''
|
|
546
548
|
MATCH (source:Entity)-[edge:RELATES_TO {group_id: $group_id}]->(target:Entity)
|
|
@@ -550,25 +552,27 @@ async def _semantic_edge_candidates(store, space, request: SearchRequest) -> tup
|
|
|
550
552
|
edge.group_id AS group_id, edge.name AS name, edge.fact AS fact,
|
|
551
553
|
coalesce(edge.episodes, []) AS episodes, edge.created_at AS created_at,
|
|
552
554
|
edge.valid_at AS valid_at, edge.invalid_at AS invalid_at, edge.expired_at AS expired_at,
|
|
553
|
-
|
|
555
|
+
<semantic parts>, edge.fuli_semantic_hash AS semantic_hash,
|
|
554
556
|
edge.fuli_retrieval_terms AS retrieval_terms, edge.fuli_retrieval_context AS retrieval_context
|
|
555
557
|
ORDER BY edge.uuid
|
|
556
558
|
LIMIT $candidate_limit
|
|
557
|
-
''',
|
|
559
|
+
'''.replace('<semantic parts>', cosine_parts('edge.fuli_semantic_vector')),
|
|
558
560
|
group_id=space['group_id'],
|
|
559
561
|
semantic_model=request.semantic.model,
|
|
560
|
-
|
|
562
|
+
query_vector=request.semantic.vector,
|
|
563
|
+
length=len(request.semantic.vector),
|
|
561
564
|
candidate_limit=SEMANTIC_CANDIDATE_LIMIT,
|
|
562
565
|
routing_='r',
|
|
563
566
|
)
|
|
564
|
-
|
|
567
|
+
query_norm = vector_norm(request.semantic.vector)
|
|
568
|
+
scores, edges = {}, []
|
|
565
569
|
for record in records:
|
|
566
|
-
|
|
567
|
-
if
|
|
570
|
+
score = usable_cosine('relationship', record, query_norm)
|
|
571
|
+
if score is None:
|
|
568
572
|
continue
|
|
569
|
-
|
|
573
|
+
scores[record['uuid']] = score
|
|
570
574
|
edges.append(_edge_from_record(record))
|
|
571
|
-
return
|
|
575
|
+
return scores, edges
|
|
572
576
|
|
|
573
577
|
|
|
574
578
|
async def _term_edge_candidates(store, space, request: SearchRequest) -> tuple[dict, list[EntityEdge]]:
|
|
@@ -611,12 +615,6 @@ def _edge_from_record(record) -> EntityEdge:
|
|
|
611
615
|
)
|
|
612
616
|
|
|
613
617
|
|
|
614
|
-
def _meaning_order(request: SearchRequest, vectors: dict) -> list[str]:
|
|
615
|
-
if request.semantic is None:
|
|
616
|
-
return []
|
|
617
|
-
return list(meaning_matches(vectors, request.semantic.vector, request.limit))
|
|
618
|
-
|
|
619
|
-
|
|
620
618
|
def _fused_with_meaning(lexical, meaning, item_id):
|
|
621
619
|
"""lexical: [(score, payload)] in its ranked order; meaning: [payload] best
|
|
622
620
|
first. Without meaning the lexical result stands as it is. Otherwise every
|
|
@@ -894,7 +892,8 @@ def _entity_search_result(record, score: float, space_id: str, matched_by: str =
|
|
|
894
892
|
'has_global_episode',
|
|
895
893
|
'reference_project_ids',
|
|
896
894
|
'inherited',
|
|
897
|
-
'
|
|
895
|
+
'semantic_dot',
|
|
896
|
+
'semantic_norm2',
|
|
898
897
|
'semantic_hash',
|
|
899
898
|
'retrieval_terms',
|
|
900
899
|
'retrieval_context',
|
|
@@ -55,17 +55,44 @@ def usable_vector(item_kind: str, record: dict, length: int) -> list[float] | No
|
|
|
55
55
|
return vector
|
|
56
56
|
|
|
57
57
|
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
58
|
+
# Cypher for a search: the stored vector's dot product with the query's and
|
|
59
|
+
# its own squared length, when it has the query's length. The database does
|
|
60
|
+
# the arithmetic so the vectors themselves never travel: reading 5000 of them
|
|
61
|
+
# back cost a search most of its time (rec#126).
|
|
62
|
+
#
|
|
63
|
+
# The one-element list binds the stored vector once. Indexing the property
|
|
64
|
+
# itself inside reduce made Neo4j read the whole vector from the store again
|
|
65
|
+
# for every element wherever the plan did not happen to cache it: 1400
|
|
66
|
+
# entities of 512 floats took 7.3 s, bound once 0.14 s (rec#126).
|
|
67
|
+
def cosine_parts(vector: str) -> str:
|
|
68
|
+
stored = f'[stored IN [{vector}] WHERE size(stored) = $length |'
|
|
69
|
+
return f'''head({stored}
|
|
70
|
+
reduce(sum = 0.0, i IN range(0, $length - 1) | sum + stored[i] * $query_vector[i])])
|
|
71
|
+
AS semantic_dot,
|
|
72
|
+
head({stored}
|
|
73
|
+
reduce(sum = 0.0, value IN stored | sum + value * value)])
|
|
74
|
+
AS semantic_norm2'''
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
def vector_norm(vector: list[float]) -> float:
|
|
78
|
+
return math.sqrt(sum(value * value for value in vector))
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
def usable_cosine(item_kind: str, record: dict, query_norm: float) -> float | None:
|
|
82
|
+
"""The cosine of the record's stored vector (already read for the query's
|
|
83
|
+
model) with the query, from cosine_parts: None when the vector has another
|
|
84
|
+
length or no length at all, or was computed from an earlier text."""
|
|
85
|
+
dot, norm2 = record.get('semantic_dot'), record.get('semantic_norm2')
|
|
86
|
+
if dot is None or not norm2 or not query_norm:
|
|
87
|
+
return None
|
|
88
|
+
if record.get('semantic_hash') != semantic_hash(semantic_text(item_kind, record)):
|
|
89
|
+
return None
|
|
90
|
+
return dot / (query_norm * math.sqrt(norm2))
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
def standing_out(scores: dict, limit: int) -> dict:
|
|
94
|
+
"""{key: cosine} of the scores ({key: cosine}, every in-scope item with a
|
|
95
|
+
usable vector) that stand out for this query, best first, at most limit."""
|
|
69
96
|
if len(scores) < MIN_IN_SCOPE_ITEMS:
|
|
70
97
|
return {}
|
|
71
98
|
mean = fmean(scores.values())
|
|
@@ -0,0 +1,230 @@
|
|
|
1
|
+
"""The graph's part of the person's weekly compounding statement (复利账单).
|
|
2
|
+
|
|
3
|
+
Counts only, for one personal space and one window: how many items stand
|
|
4
|
+
confirmed at each week's end, what was learned and retired in the window,
|
|
5
|
+
the uses Agents reported, the Agent tasks that ended and the questions the
|
|
6
|
+
person answered. Five aggregate queries, run side by side; no item text,
|
|
7
|
+
no id and no vector leaves the Provider, and nothing is scanned in Python.
|
|
8
|
+
|
|
9
|
+
Who confirmed an item is read from its stored confirmation basis, a JSON
|
|
10
|
+
string every writer serialises with json.dumps(sort_keys=True); Cypher has no
|
|
11
|
+
JSON parser, so the queries match the exact fragments that serialisation
|
|
12
|
+
spells (test_knowledge_statement.py checks them against real bases). A basis
|
|
13
|
+
that does not hold a valid confirmation counts as unconfirmed, as
|
|
14
|
+
effective_confirmation_status reads it.
|
|
15
|
+
|
|
16
|
+
An item counts from the later of its confirmation and its own creation: a new
|
|
17
|
+
version carries its predecessor's confirmation, and must not be counted
|
|
18
|
+
before it existed. A new version is neither captured nor retired: the edit
|
|
19
|
+
keeps the same knowledge current (fuli_replaced_by_item_id links the two).
|
|
20
|
+
"""
|
|
21
|
+
import asyncio
|
|
22
|
+
import json
|
|
23
|
+
from datetime import datetime
|
|
24
|
+
|
|
25
|
+
from pydantic import Field, model_validator
|
|
26
|
+
|
|
27
|
+
from .knowledge_audit import AGENT_CONFIRMATION_POLICY_VERSION
|
|
28
|
+
from .knowledge_item_view import personal_reader_space
|
|
29
|
+
from .knowledge_versions import invalid_property
|
|
30
|
+
from .model_base import StrictModel
|
|
31
|
+
from .tonborg_confirmation import TONBORG_CONFIRMATION_POLICY_VERSION
|
|
32
|
+
|
|
33
|
+
MAX_POINTS = 26
|
|
34
|
+
# A stored confirmation time Neo4j's datetime() reads; anything else counts as absent.
|
|
35
|
+
_INSTANT = r'\d{4}-\d{2}-\d{2}T\d{2}:\d{2}(:\d{2}(\.\d{1,9})?)?(Z|[+-]\d{2}:\d{2})?'
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
def _key_fragment(value: dict, *, open_value: bool) -> str:
|
|
39
|
+
"""One top-level key as the basis serialisation spells it; with
|
|
40
|
+
open_value, only up to the start of its value."""
|
|
41
|
+
text = json.dumps(value, ensure_ascii=False, sort_keys=True)[1:-1]
|
|
42
|
+
return text[:-1] if open_value else text
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
BASIS_FRAGMENTS = {
|
|
46
|
+
'by_user': _key_fragment({'confirmed_by': {'kind': 'user'}}, open_value=True),
|
|
47
|
+
'by_source': _key_fragment({'confirmed_by': {'kind': 'authoritative_source'}}, open_value=True),
|
|
48
|
+
'by_agent': _key_fragment({'confirmed_by': {'kind': 'agent'}}, open_value=True),
|
|
49
|
+
'any_policy': _key_fragment({'agent_policy_version': ''}, open_value=True),
|
|
50
|
+
'tonborg_policy': _key_fragment({'agent_policy_version': TONBORG_CONFIRMATION_POLICY_VERSION}, open_value=False),
|
|
51
|
+
'usage_policy': _key_fragment({'agent_policy_version': AGENT_CONFIRMATION_POLICY_VERSION}, open_value=False),
|
|
52
|
+
'confirmed_at_key': _key_fragment({'confirmed_at': ''}, open_value=True),
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
class KnowledgeStatementRequest(StrictModel):
|
|
57
|
+
personal_space_id: str = Field(min_length=1, max_length=128)
|
|
58
|
+
since: datetime
|
|
59
|
+
until: datetime
|
|
60
|
+
# Each week's end, oldest first; the last one is `until`.
|
|
61
|
+
points: list[datetime] = Field(min_length=1, max_length=MAX_POINTS)
|
|
62
|
+
|
|
63
|
+
@model_validator(mode='after')
|
|
64
|
+
def validate_window(self):
|
|
65
|
+
instants = [self.since, self.until, *self.points]
|
|
66
|
+
if any(value.tzinfo is None for value in instants):
|
|
67
|
+
raise ValueError('statement times need a time zone')
|
|
68
|
+
if self.since >= self.until:
|
|
69
|
+
raise ValueError('since must be before until')
|
|
70
|
+
if self.points != sorted(set(self.points)) or self.points[-1] != self.until:
|
|
71
|
+
raise ValueError('points must rise and end at until')
|
|
72
|
+
return self
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
class StatementUse(StrictModel):
|
|
76
|
+
times: int
|
|
77
|
+
tasks: int
|
|
78
|
+
cited: int
|
|
79
|
+
applied: int
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
class StatementLearned(StrictModel):
|
|
83
|
+
captured: int
|
|
84
|
+
confirmed_by_you: int
|
|
85
|
+
confirmed_by_tonborg: int
|
|
86
|
+
promoted_by_use: int
|
|
87
|
+
retired: int
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
class StatementDone(StrictModel):
|
|
91
|
+
finished: int
|
|
92
|
+
failed: int
|
|
93
|
+
|
|
94
|
+
|
|
95
|
+
class KnowledgeStatement(StrictModel):
|
|
96
|
+
# Confirmed and current at each point, aligned with the request's points.
|
|
97
|
+
series: list[int]
|
|
98
|
+
used: StatementUse
|
|
99
|
+
learned: StatementLearned
|
|
100
|
+
done: StatementDone
|
|
101
|
+
answered: int
|
|
102
|
+
|
|
103
|
+
|
|
104
|
+
# The confirmations counted as learned: by the person, by Tonborg, or kept by
|
|
105
|
+
# use (a source's or another Agent's confirmation is not counted).
|
|
106
|
+
COUNTED_CONFIRMERS = "['you', 'tonborg', 'usage']"
|
|
107
|
+
|
|
108
|
+
|
|
109
|
+
def item_facts(item_kind: str) -> str:
|
|
110
|
+
"""Per item of the space: who confirmed it and when, when it was created
|
|
111
|
+
and retired, and the instant it counts from. The weekly and the per-day
|
|
112
|
+
statement both read items through this, so "learned" means one thing."""
|
|
113
|
+
match = ('MATCH (item:Entity {group_id: $group_id})' if item_kind == 'entity'
|
|
114
|
+
else 'MATCH ()-[item:RELATES_TO {group_id: $group_id}]->()')
|
|
115
|
+
return match + f'''
|
|
116
|
+
WITH item, coalesce(item.fuli_confirmation_basis_json, '') AS basis,
|
|
117
|
+
coalesce(item.fuli_confirmation_status, 'pending') AS status,
|
|
118
|
+
item.{invalid_property(item_kind)} AS retired_at, item.created_at AS created_at
|
|
119
|
+
WITH item, retired_at, created_at,
|
|
120
|
+
CASE
|
|
121
|
+
WHEN status = 'confirmed' AND NOT basis CONTAINS $any_policy
|
|
122
|
+
AND (basis CONTAINS $by_user OR basis CONTAINS $by_source)
|
|
123
|
+
THEN CASE WHEN basis CONTAINS $by_user THEN 'you' ELSE 'source' END
|
|
124
|
+
WHEN status = 'agent_confirmed' AND basis CONTAINS $by_agent AND basis CONTAINS $any_policy
|
|
125
|
+
THEN CASE WHEN basis CONTAINS $tonborg_policy THEN 'tonborg'
|
|
126
|
+
WHEN basis CONTAINS $usage_policy THEN 'usage' ELSE 'agent' END
|
|
127
|
+
END AS confirmer,
|
|
128
|
+
CASE WHEN basis CONTAINS $confirmed_at_key
|
|
129
|
+
THEN split(split(basis, $confirmed_at_key)[1], '"')[0] END AS confirmed_text
|
|
130
|
+
WITH item, retired_at, created_at, confirmer,
|
|
131
|
+
CASE WHEN confirmed_text =~ $instant THEN datetime(confirmed_text) END AS confirmed_at
|
|
132
|
+
WITH item, retired_at, created_at, confirmer, confirmed_at,
|
|
133
|
+
CASE WHEN confirmed_at IS NULL OR created_at > confirmed_at
|
|
134
|
+
THEN coalesce(created_at, confirmed_at) ELSE confirmed_at END AS counted_from
|
|
135
|
+
'''
|
|
136
|
+
|
|
137
|
+
|
|
138
|
+
def items_query(item_kind: str) -> str:
|
|
139
|
+
return item_facts(item_kind) + f'''
|
|
140
|
+
WITH collect(CASE WHEN confirmer IS NOT NULL AND counted_from IS NOT NULL
|
|
141
|
+
THEN [counted_from, retired_at] END) AS confirmed,
|
|
142
|
+
collect(item.fuli_replaced_by_item_id) AS versions,
|
|
143
|
+
collect(CASE WHEN created_at >= $since AND created_at < $until THEN item.uuid END) AS created,
|
|
144
|
+
collect(CASE WHEN confirmer IN {COUNTED_CONFIRMERS}
|
|
145
|
+
AND confirmed_at >= $since AND confirmed_at < $until
|
|
146
|
+
THEN [item.uuid, confirmer] END) AS confirmations,
|
|
147
|
+
sum(CASE WHEN retired_at >= $since AND retired_at < $until
|
|
148
|
+
AND item.fuli_replaced_by_item_id IS NULL THEN 1 ELSE 0 END) AS retired
|
|
149
|
+
WITH confirmed, created, retired,
|
|
150
|
+
[row IN confirmations WHERE NOT row[0] IN versions | row[1]] AS confirmers,
|
|
151
|
+
[id IN created WHERE NOT id IN versions] AS captured
|
|
152
|
+
RETURN [point IN $points | size([row IN confirmed
|
|
153
|
+
WHERE row[0] <= point AND (row[1] IS NULL OR row[1] > point)])] AS series,
|
|
154
|
+
size(captured) AS captured, retired,
|
|
155
|
+
size([who IN confirmers WHERE who = 'you']) AS confirmed_by_you,
|
|
156
|
+
size([who IN confirmers WHERE who = 'tonborg']) AS confirmed_by_tonborg,
|
|
157
|
+
size([who IN confirmers WHERE who = 'usage']) AS promoted_by_use
|
|
158
|
+
'''
|
|
159
|
+
|
|
160
|
+
|
|
161
|
+
# The uses Agents reported in the window, read by the weekly and the per-day statement.
|
|
162
|
+
USES_MATCH = '''
|
|
163
|
+
MATCH (audit:FuliKnowledgeAudit {space_id: $space_id, action: 'knowledge_used'})
|
|
164
|
+
WHERE audit.created_at >= $since AND audit.created_at < $until
|
|
165
|
+
'''
|
|
166
|
+
|
|
167
|
+
USES_QUERY = USES_MATCH + '''
|
|
168
|
+
RETURN count(audit) AS times, count(DISTINCT audit.task_id) AS tasks,
|
|
169
|
+
sum(CASE audit.use_kind WHEN 'cited' THEN 1 ELSE 0 END) AS cited,
|
|
170
|
+
sum(CASE audit.use_kind WHEN 'applied' THEN 1 ELSE 0 END) AS applied
|
|
171
|
+
'''
|
|
172
|
+
|
|
173
|
+
# A finished task without its own completion time ends at its last change, as the task pages read it.
|
|
174
|
+
TASKS_QUERY = '''
|
|
175
|
+
MATCH (:FuliSpace {id: $space_id, kind: 'personal'})-[:HAS_PROJECT_AGENT_TASK]->
|
|
176
|
+
(task:FuliProjectAgentTask {personal_space_id: $space_id})
|
|
177
|
+
WHERE task.status IN ['completed', 'failed']
|
|
178
|
+
WITH task, coalesce(task.completed_at, task.updated_at) AS ended_at
|
|
179
|
+
WHERE ended_at >= $since AND ended_at < $until
|
|
180
|
+
RETURN sum(CASE task.status WHEN 'completed' THEN 1 ELSE 0 END) AS finished,
|
|
181
|
+
sum(CASE task.status WHEN 'failed' THEN 1 ELSE 0 END) AS failed
|
|
182
|
+
'''
|
|
183
|
+
|
|
184
|
+
# An answered request is not changed again: its last change is the person's answer.
|
|
185
|
+
ANSWERS_QUERY = '''
|
|
186
|
+
MATCH (:FuliSpace {id: $space_id, kind: 'personal'})-[:HAS_AGENT_ATTENTION]->(request:FuliAgentAttention)
|
|
187
|
+
WHERE request.responded_by = 'human'
|
|
188
|
+
AND request.updated_at >= $since AND request.updated_at < $until
|
|
189
|
+
RETURN count(request) AS questions
|
|
190
|
+
'''
|
|
191
|
+
|
|
192
|
+
|
|
193
|
+
async def knowledge_statement(store, space, request: KnowledgeStatementRequest) -> KnowledgeStatement:
|
|
194
|
+
window = {'since': request.since, 'until': request.until, 'routing_': 'r'}
|
|
195
|
+
|
|
196
|
+
async def one(query, **values):
|
|
197
|
+
records, _, _ = await store.runtime.driver.execute_query(query, **window, **values)
|
|
198
|
+
return dict(records[0]) if records else {}
|
|
199
|
+
|
|
200
|
+
item_values = {'group_id': space['group_id'], 'points': request.points, 'instant': _INSTANT, **BASIS_FRAGMENTS}
|
|
201
|
+
entities, relationships, uses, tasks, answers = await asyncio.gather(
|
|
202
|
+
one(items_query('entity'), **item_values),
|
|
203
|
+
one(items_query('relationship'), **item_values),
|
|
204
|
+
one(USES_QUERY, space_id=space['id']),
|
|
205
|
+
one(TASKS_QUERY, space_id=space['id']),
|
|
206
|
+
one(ANSWERS_QUERY, space_id=space['id']))
|
|
207
|
+
items = (entities, relationships)
|
|
208
|
+
|
|
209
|
+
def total(field):
|
|
210
|
+
return sum(int(part.get(field) or 0) for part in items)
|
|
211
|
+
|
|
212
|
+
series = [0] * len(request.points)
|
|
213
|
+
for part in items:
|
|
214
|
+
for index, count in enumerate(part.get('series') or []):
|
|
215
|
+
series[index] += int(count)
|
|
216
|
+
return KnowledgeStatement(
|
|
217
|
+
series=series,
|
|
218
|
+
used=StatementUse(**{field: int(uses.get(field) or 0) for field in ('times', 'tasks', 'cited', 'applied')}),
|
|
219
|
+
learned=StatementLearned(captured=total('captured'), confirmed_by_you=total('confirmed_by_you'),
|
|
220
|
+
confirmed_by_tonborg=total('confirmed_by_tonborg'),
|
|
221
|
+
promoted_by_use=total('promoted_by_use'), retired=total('retired')),
|
|
222
|
+
done=StatementDone(finished=int(tasks.get('finished') or 0), failed=int(tasks.get('failed') or 0)),
|
|
223
|
+
answered=int(answers.get('questions') or 0))
|
|
224
|
+
|
|
225
|
+
|
|
226
|
+
def register_knowledge_statement_route(application, store, Actor) -> None:
|
|
227
|
+
@application.post('/v1/knowledge/statement', response_model=KnowledgeStatement)
|
|
228
|
+
async def read_knowledge_statement(request: KnowledgeStatementRequest, actor: Actor):
|
|
229
|
+
space = await personal_reader_space(store, actor, request.personal_space_id)
|
|
230
|
+
return await knowledge_statement(store, space, request)
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
"""The graph's part of the compounding statement day by day (复利账单的日历).
|
|
2
|
+
|
|
3
|
+
For one personal space and a range of at most 371 days, per local day: the
|
|
4
|
+
items learned (captured) and confirmed, and the uses Agents reported. The
|
|
5
|
+
definitions are the weekly statement's own (`item_facts`, `USES_MATCH`); only
|
|
6
|
+
the grouping differs. Three aggregate queries run side by side, each grouped by
|
|
7
|
+
day in Cypher; no item text, id or vector leaves the Provider.
|
|
8
|
+
|
|
9
|
+
A day is the caller's local day: the range's own UTC offset (both ends carry
|
|
10
|
+
the same one) is added before the instant is cut into days, so an item
|
|
11
|
+
captured at 23:30 local time counts on that day, not the next.
|
|
12
|
+
"""
|
|
13
|
+
import asyncio
|
|
14
|
+
from datetime import date, datetime, timedelta
|
|
15
|
+
|
|
16
|
+
from pydantic import Field, model_validator
|
|
17
|
+
|
|
18
|
+
from .knowledge_item_view import personal_reader_space
|
|
19
|
+
from .knowledge_statement import BASIS_FRAGMENTS, COUNTED_CONFIRMERS, USES_MATCH, _INSTANT, item_facts
|
|
20
|
+
from .model_base import StrictModel
|
|
21
|
+
|
|
22
|
+
MAX_DAYS = 371
|
|
23
|
+
_DAY_MS = 24 * 60 * 60 * 1000
|
|
24
|
+
_EPOCH = date(1970, 1, 1)
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
def _local_day(instant: str) -> str:
|
|
28
|
+
"""The local day of a Neo4j datetime, as whole days since 1970-01-01."""
|
|
29
|
+
return f'toInteger(floor(({instant}.epochMillis + $offset_ms) / {_DAY_MS}.0))'
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
class KnowledgeStatementDaysRequest(StrictModel):
|
|
33
|
+
personal_space_id: str = Field(min_length=1, max_length=128)
|
|
34
|
+
since: datetime
|
|
35
|
+
until: datetime
|
|
36
|
+
|
|
37
|
+
@model_validator(mode='after')
|
|
38
|
+
def validate_range(self):
|
|
39
|
+
if self.since.tzinfo is None or self.until.tzinfo is None:
|
|
40
|
+
raise ValueError('statement times need a time zone')
|
|
41
|
+
if self.since.utcoffset() != self.until.utcoffset():
|
|
42
|
+
raise ValueError('since and until must carry the same UTC offset')
|
|
43
|
+
if self.since >= self.until:
|
|
44
|
+
raise ValueError('since must be before until')
|
|
45
|
+
if self.until - self.since > timedelta(days=MAX_DAYS):
|
|
46
|
+
raise ValueError(f'since and until may be at most {MAX_DAYS} days apart')
|
|
47
|
+
return self
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
class StatementDay(StrictModel):
|
|
51
|
+
day: date
|
|
52
|
+
learned: int
|
|
53
|
+
confirmed: int
|
|
54
|
+
used: int
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
class KnowledgeStatementDays(StrictModel):
|
|
58
|
+
# Oldest first; a day with nothing to count is left out.
|
|
59
|
+
days: list[StatementDay]
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
def item_days_query(item_kind: str) -> str:
|
|
63
|
+
return item_facts(item_kind) + f'''
|
|
64
|
+
WITH collect(item.fuli_replaced_by_item_id) AS versions,
|
|
65
|
+
collect(CASE WHEN created_at >= $since AND created_at < $until
|
|
66
|
+
THEN [item.uuid, {_local_day('created_at')}] END) AS created,
|
|
67
|
+
collect(CASE WHEN confirmer IN {COUNTED_CONFIRMERS}
|
|
68
|
+
AND confirmed_at >= $since AND confirmed_at < $until
|
|
69
|
+
THEN [item.uuid, {_local_day('confirmed_at')}] END) AS confirmations
|
|
70
|
+
UNWIND [row IN created WHERE NOT row[0] IN versions | ['learned', row[1]]]
|
|
71
|
+
+ [row IN confirmations WHERE NOT row[0] IN versions | ['confirmed', row[1]]] AS event
|
|
72
|
+
RETURN event[0] AS measure, event[1] AS day, count(*) AS count
|
|
73
|
+
'''
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
USES_DAYS_QUERY = USES_MATCH + f'''
|
|
77
|
+
WITH audit, {_local_day('audit.created_at')} AS day
|
|
78
|
+
RETURN 'used' AS measure, day, count(audit) AS count
|
|
79
|
+
'''
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
async def knowledge_statement_days(store, space, request: KnowledgeStatementDaysRequest) -> KnowledgeStatementDays:
|
|
83
|
+
offset_ms = int(request.since.utcoffset().total_seconds() * 1000)
|
|
84
|
+
window = {'since': request.since, 'until': request.until, 'offset_ms': offset_ms, 'routing_': 'r'}
|
|
85
|
+
|
|
86
|
+
async def rows(query, **values):
|
|
87
|
+
records, _, _ = await store.runtime.driver.execute_query(query, **window, **values)
|
|
88
|
+
return [dict(record) for record in records]
|
|
89
|
+
|
|
90
|
+
item_values = {'group_id': space['group_id'], 'instant': _INSTANT, **BASIS_FRAGMENTS}
|
|
91
|
+
parts = await asyncio.gather(
|
|
92
|
+
rows(item_days_query('entity'), **item_values),
|
|
93
|
+
rows(item_days_query('relationship'), **item_values),
|
|
94
|
+
rows(USES_DAYS_QUERY, space_id=space['id']))
|
|
95
|
+
days: dict[int, dict[str, int]] = {}
|
|
96
|
+
for part in parts:
|
|
97
|
+
for row in part:
|
|
98
|
+
counts = days.setdefault(int(row['day']), {'learned': 0, 'confirmed': 0, 'used': 0})
|
|
99
|
+
counts[row['measure']] += int(row['count'] or 0)
|
|
100
|
+
return KnowledgeStatementDays(days=[
|
|
101
|
+
StatementDay(day=_EPOCH + timedelta(days=number), **counts)
|
|
102
|
+
for number, counts in sorted(days.items()) if any(counts.values())])
|
|
103
|
+
|
|
104
|
+
|
|
105
|
+
def register_knowledge_statement_days_route(application, store, Actor) -> None:
|
|
106
|
+
@application.post('/v1/knowledge/statement/days', response_model=KnowledgeStatementDays)
|
|
107
|
+
async def read_knowledge_statement_days(request: KnowledgeStatementDaysRequest, actor: Actor):
|
|
108
|
+
space = await personal_reader_space(store, actor, request.personal_space_id)
|
|
109
|
+
return await knowledge_statement_days(store, space, request)
|
|
@@ -6,6 +6,7 @@ from pydantic import (
|
|
|
6
6
|
AliasChoices,
|
|
7
7
|
Field,
|
|
8
8
|
field_validator,
|
|
9
|
+
model_serializer,
|
|
9
10
|
model_validator,
|
|
10
11
|
)
|
|
11
12
|
|
|
@@ -63,6 +64,10 @@ ProjectSourceKind = Literal[
|
|
|
63
64
|
'issue_tracker',
|
|
64
65
|
'other',
|
|
65
66
|
]
|
|
67
|
+
# Whether a source is the project's own or material it refers to (rec#125):
|
|
68
|
+
# only an own repository identifies a checkout as this project. A source saved
|
|
69
|
+
# before roles existed reads as 'own', as every repository source counted then.
|
|
70
|
+
ProjectSourceRole = Literal['own', 'reference']
|
|
66
71
|
AssessmentState = Literal['confirmed', 'inferred']
|
|
67
72
|
AssessmentLabel = Literal[
|
|
68
73
|
'needs_clarification',
|
|
@@ -287,11 +292,21 @@ class PrincipalResult(StrictModel):
|
|
|
287
292
|
class ProjectSource(StrictModel):
|
|
288
293
|
key: str = Field(min_length=1, max_length=128)
|
|
289
294
|
kind: ProjectSourceKind
|
|
295
|
+
role: ProjectSourceRole = 'own'
|
|
290
296
|
title: str = Field(min_length=1, max_length=512)
|
|
291
297
|
uri: str | None = Field(default=None, max_length=2048)
|
|
292
298
|
summary: str | None = Field(default=None, max_length=4096)
|
|
293
299
|
sensitivity: Sensitivity = 'normal'
|
|
294
300
|
|
|
301
|
+
@model_serializer(mode='wrap')
|
|
302
|
+
def _omit_own_role(self, handler):
|
|
303
|
+
# Only 'reference' is written, so a profile this build saves without
|
|
304
|
+
# one still validates on 0.27.0, whose sources forbid unknown fields.
|
|
305
|
+
data = handler(self)
|
|
306
|
+
if isinstance(data, dict) and data.get('role') == 'own':
|
|
307
|
+
data.pop('role', None)
|
|
308
|
+
return data
|
|
309
|
+
|
|
295
310
|
|
|
296
311
|
class AssessmentDimension(StrictModel):
|
|
297
312
|
key: str = Field(min_length=1, max_length=128)
|