shellbrain 0.1.30__tar.gz → 0.1.32__tar.gz

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 (446) hide show
  1. {shellbrain-0.1.30 → shellbrain-0.1.32}/PKG-INFO +1 -1
  2. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/core/entities/inner_agents.py +4 -1
  3. shellbrain-0.1.32/app/core/policies/concepts/search_text.py +124 -0
  4. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/core/policies/retrieval/bm25.py +16 -10
  5. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/core/policies/retrieval/fusion_rrf.py +5 -4
  6. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/core/ports/db/concept_repositories.py +10 -2
  7. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/core/ports/db/retrieval_repositories.py +29 -0
  8. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/core/ports/db/unit_of_work.py +4 -0
  9. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/core/ports/host_apps/inner_agents.py +3 -2
  10. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/core/use_cases/concepts/add/execute.py +13 -0
  11. shellbrain-0.1.32/app/core/use_cases/concepts/embeddings.py +40 -0
  12. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/core/use_cases/concepts/update/execute.py +56 -6
  13. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/core/use_cases/retrieval/build_context/execute.py +173 -268
  14. shellbrain-0.1.32/app/core/use_cases/retrieval/concept_seed_retrieval.py +136 -0
  15. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/core/use_cases/retrieval/context_pack_pipeline.py +4 -0
  16. shellbrain-0.1.32/app/core/use_cases/retrieval/deterministic_graph_recall.py +1449 -0
  17. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/core/use_cases/retrieval/read/execute.py +21 -0
  18. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/core/use_cases/retrieval/read_concepts.py +84 -21
  19. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/core/use_cases/retrieval/recall/execute.py +0 -3
  20. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/core/use_cases/retrieval/seed_retrieval.py +11 -9
  21. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/entrypoints/cli/handlers/internal_agent/concepts/add.py +10 -1
  22. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/entrypoints/cli/handlers/internal_agent/concepts/update.py +8 -1
  23. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/entrypoints/cli/handlers/internal_agent/retrieval/execution.py +0 -1
  24. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/entrypoints/cli/runner.py +5 -0
  25. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/infrastructure/db/runtime/models/concepts.py +38 -0
  26. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/infrastructure/db/runtime/repos/relational/concepts_repo.py +33 -64
  27. shellbrain-0.1.32/app/infrastructure/db/runtime/repos/semantic/concept_retrieval_repo.py +290 -0
  28. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/infrastructure/db/runtime/uow.py +6 -0
  29. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/infrastructure/host_apps/inner_agents/codex_cli.py +150 -86
  30. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/infrastructure/host_apps/inner_agents/prompt.py +189 -1
  31. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/settings/internal-agents/defaults.yaml +1 -1
  32. shellbrain-0.1.32/migrations/versions/20260519_0027_concept_embeddings.py +42 -0
  33. {shellbrain-0.1.30 → shellbrain-0.1.32}/pyproject.toml +1 -1
  34. {shellbrain-0.1.30 → shellbrain-0.1.32}/shellbrain.egg-info/PKG-INFO +1 -1
  35. {shellbrain-0.1.30 → shellbrain-0.1.32}/shellbrain.egg-info/SOURCES.txt +6 -1
  36. shellbrain-0.1.30/app/core/policies/concepts/search.py +0 -90
  37. {shellbrain-0.1.30 → shellbrain-0.1.32}/README.md +0 -0
  38. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/__init__.py +0 -0
  39. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/__main__.py +0 -0
  40. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/core/__init__.py +0 -0
  41. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/core/entities/__init__.py +0 -0
  42. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/core/entities/admin_errors.py +0 -0
  43. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/core/entities/associations.py +0 -0
  44. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/core/entities/backups.py +0 -0
  45. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/core/entities/concepts.py +0 -0
  46. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/core/entities/episodes.py +0 -0
  47. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/core/entities/evidence.py +0 -0
  48. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/core/entities/facts.py +0 -0
  49. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/core/entities/guidance.py +0 -0
  50. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/core/entities/identity.py +0 -0
  51. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/core/entities/ids.py +0 -0
  52. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/core/entities/knowledge_builder.py +0 -0
  53. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/core/entities/machine_config.py +0 -0
  54. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/core/entities/memories.py +0 -0
  55. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/core/entities/runtime_context.py +0 -0
  56. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/core/entities/scenarios.py +0 -0
  57. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/core/entities/session_state.py +0 -0
  58. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/core/entities/settings.py +0 -0
  59. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/core/entities/utility.py +0 -0
  60. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/core/errors.py +0 -0
  61. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/core/policies/__init__.py +0 -0
  62. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/core/policies/concepts/__init__.py +0 -0
  63. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/core/policies/concepts/relation_rules.py +0 -0
  64. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/core/policies/episodes/__init__.py +0 -0
  65. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/core/policies/episodes/event_content.py +0 -0
  66. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/core/policies/episodes/knowledge_building.py +0 -0
  67. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/core/policies/memories/__init__.py +0 -0
  68. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/core/policies/memories/add_plan.py +0 -0
  69. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/core/policies/memories/link_rules.py +0 -0
  70. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/core/policies/memories/update_plan.py +0 -0
  71. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/core/policies/retrieval/__init__.py +0 -0
  72. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/core/policies/retrieval/context_pack.py +0 -0
  73. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/core/policies/retrieval/expansion.py +0 -0
  74. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/core/policies/retrieval/lexical_query.py +0 -0
  75. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/core/policies/retrieval/scoring.py +0 -0
  76. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/core/ports/__init__.py +0 -0
  77. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/core/ports/db/__init__.py +0 -0
  78. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/core/ports/db/episode_repositories.py +0 -0
  79. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/core/ports/db/guidance.py +0 -0
  80. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/core/ports/db/knowledge_builder.py +0 -0
  81. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/core/ports/db/memory_repositories.py +0 -0
  82. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/core/ports/db/problem_runs.py +0 -0
  83. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/core/ports/embeddings/__init__.py +0 -0
  84. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/core/ports/embeddings/provider.py +0 -0
  85. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/core/ports/embeddings/retrieval.py +0 -0
  86. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/core/ports/host_apps/__init__.py +0 -0
  87. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/core/ports/local_state/__init__.py +0 -0
  88. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/core/ports/local_state/session_state_store.py +0 -0
  89. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/core/ports/reporting/__init__.py +0 -0
  90. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/core/ports/reporting/metrics.py +0 -0
  91. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/core/ports/system/__init__.py +0 -0
  92. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/core/ports/system/clock.py +0 -0
  93. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/core/ports/system/idgen.py +0 -0
  94. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/core/use_cases/__init__.py +0 -0
  95. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/core/use_cases/admin/__init__.py +0 -0
  96. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/core/use_cases/admin/analytics_diagnostics.py +0 -0
  97. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/core/use_cases/admin/backfill_model_usage/__init__.py +0 -0
  98. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/core/use_cases/admin/backfill_model_usage/backfill_model_usage.py +0 -0
  99. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/core/use_cases/admin/backfill_model_usage/request.py +0 -0
  100. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/core/use_cases/admin/backfill_model_usage/result.py +0 -0
  101. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/core/use_cases/admin/create_backup.py +0 -0
  102. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/core/use_cases/admin/diagnose_runtime.py +0 -0
  103. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/core/use_cases/admin/generate_analytics_report.py +0 -0
  104. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/core/use_cases/admin/initialize_runtime.py +0 -0
  105. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/core/use_cases/admin/restore_backup.py +0 -0
  106. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/core/use_cases/admin/verify_backup.py +0 -0
  107. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/core/use_cases/build_guidance.py +0 -0
  108. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/core/use_cases/concepts/__init__.py +0 -0
  109. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/core/use_cases/concepts/add/__init__.py +0 -0
  110. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/core/use_cases/concepts/add/request.py +0 -0
  111. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/core/use_cases/concepts/add/result.py +0 -0
  112. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/core/use_cases/concepts/containment_checks.py +0 -0
  113. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/core/use_cases/concepts/reference_checks.py +0 -0
  114. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/core/use_cases/concepts/show/__init__.py +0 -0
  115. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/core/use_cases/concepts/show/execute.py +0 -0
  116. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/core/use_cases/concepts/show/request.py +0 -0
  117. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/core/use_cases/concepts/show/result.py +0 -0
  118. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/core/use_cases/concepts/update/__init__.py +0 -0
  119. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/core/use_cases/concepts/update/request.py +0 -0
  120. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/core/use_cases/concepts/update/result.py +0 -0
  121. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/core/use_cases/concepts/views.py +0 -0
  122. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/core/use_cases/episodes/__init__.py +0 -0
  123. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/core/use_cases/episodes/events/__init__.py +0 -0
  124. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/core/use_cases/episodes/events/request.py +0 -0
  125. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/core/use_cases/episodes/sync_discovered_host_session.py +0 -0
  126. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/core/use_cases/episodes/sync_episode/__init__.py +0 -0
  127. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/core/use_cases/episodes/sync_episode/request.py +0 -0
  128. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/core/use_cases/episodes/sync_episode/result.py +0 -0
  129. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/core/use_cases/episodes/sync_episode/sync_episode.py +0 -0
  130. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/core/use_cases/knowledge_builder/__init__.py +0 -0
  131. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/core/use_cases/knowledge_builder/build_knowledge/__init__.py +0 -0
  132. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/core/use_cases/knowledge_builder/build_knowledge/execute.py +0 -0
  133. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/core/use_cases/knowledge_builder/build_knowledge/request.py +0 -0
  134. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/core/use_cases/knowledge_builder/build_knowledge/result.py +0 -0
  135. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/core/use_cases/knowledge_builder/teach_knowledge/__init__.py +0 -0
  136. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/core/use_cases/knowledge_builder/teach_knowledge/execute.py +0 -0
  137. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/core/use_cases/knowledge_builder/teach_knowledge/request.py +0 -0
  138. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/core/use_cases/knowledge_builder/teach_knowledge/result.py +0 -0
  139. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/core/use_cases/memories/__init__.py +0 -0
  140. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/core/use_cases/memories/add/__init__.py +0 -0
  141. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/core/use_cases/memories/add/execute.py +0 -0
  142. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/core/use_cases/memories/add/request.py +0 -0
  143. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/core/use_cases/memories/add/result.py +0 -0
  144. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/core/use_cases/memories/effect_plan.py +0 -0
  145. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/core/use_cases/memories/reference_checks.py +0 -0
  146. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/core/use_cases/memories/update/__init__.py +0 -0
  147. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/core/use_cases/memories/update/execute.py +0 -0
  148. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/core/use_cases/memories/update/request.py +0 -0
  149. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/core/use_cases/memories/update/result.py +0 -0
  150. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/core/use_cases/metrics/__init__.py +0 -0
  151. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/core/use_cases/metrics/analyze_agent_behavior.py +0 -0
  152. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/core/use_cases/metrics/build_snapshot.py +0 -0
  153. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/core/use_cases/metrics/generate_dashboard.py +0 -0
  154. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/core/use_cases/plan_execution.py +0 -0
  155. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/core/use_cases/retrieval/__init__.py +0 -0
  156. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/core/use_cases/retrieval/build_context/__init__.py +0 -0
  157. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/core/use_cases/retrieval/expansion.py +0 -0
  158. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/core/use_cases/retrieval/read/__init__.py +0 -0
  159. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/core/use_cases/retrieval/read/request.py +0 -0
  160. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/core/use_cases/retrieval/read/result.py +0 -0
  161. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/core/use_cases/retrieval/recall/__init__.py +0 -0
  162. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/core/use_cases/retrieval/recall/request.py +0 -0
  163. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/core/use_cases/retrieval/recall/result.py +0 -0
  164. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/core/use_cases/scenarios/__init__.py +0 -0
  165. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/core/use_cases/scenarios/record/__init__.py +0 -0
  166. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/core/use_cases/scenarios/record/execute.py +0 -0
  167. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/core/use_cases/scenarios/record/request.py +0 -0
  168. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/core/use_cases/scenarios/record/result.py +0 -0
  169. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/entrypoints/__init__.py +0 -0
  170. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/entrypoints/cli/__init__.py +0 -0
  171. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/entrypoints/cli/error_responses.py +0 -0
  172. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/entrypoints/cli/handlers/__init__.py +0 -0
  173. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/entrypoints/cli/handlers/cli_operation.py +0 -0
  174. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/entrypoints/cli/handlers/dependencies.py +0 -0
  175. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/entrypoints/cli/handlers/human/__init__.py +0 -0
  176. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/entrypoints/cli/handlers/human/admin.py +0 -0
  177. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/entrypoints/cli/handlers/human/admin_dependencies.py +0 -0
  178. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/entrypoints/cli/handlers/human/init.py +0 -0
  179. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/entrypoints/cli/handlers/human/metrics.py +0 -0
  180. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/entrypoints/cli/handlers/human/upgrade.py +0 -0
  181. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/entrypoints/cli/handlers/internal_agent/__init__.py +0 -0
  182. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/entrypoints/cli/handlers/internal_agent/concepts/__init__.py +0 -0
  183. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/entrypoints/cli/handlers/internal_agent/concepts/show.py +0 -0
  184. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/entrypoints/cli/handlers/internal_agent/episodes/__init__.py +0 -0
  185. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/entrypoints/cli/handlers/internal_agent/episodes/events.py +0 -0
  186. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/entrypoints/cli/handlers/internal_agent/episodes/selection.py +0 -0
  187. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/entrypoints/cli/handlers/internal_agent/episodes/serialization.py +0 -0
  188. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/entrypoints/cli/handlers/internal_agent/memories/__init__.py +0 -0
  189. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/entrypoints/cli/handlers/internal_agent/memories/add.py +0 -0
  190. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/entrypoints/cli/handlers/internal_agent/memories/update.py +0 -0
  191. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/entrypoints/cli/handlers/internal_agent/memories/utility_vote_evidence.py +0 -0
  192. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/entrypoints/cli/handlers/internal_agent/retrieval/__init__.py +0 -0
  193. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/entrypoints/cli/handlers/internal_agent/retrieval/read.py +0 -0
  194. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/entrypoints/cli/handlers/internal_agent/scenarios/__init__.py +0 -0
  195. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/entrypoints/cli/handlers/internal_agent/scenarios/record.py +0 -0
  196. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/entrypoints/cli/handlers/result_envelopes.py +0 -0
  197. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/entrypoints/cli/handlers/session_state.py +0 -0
  198. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/entrypoints/cli/handlers/working_agent/__init__.py +0 -0
  199. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/entrypoints/cli/handlers/working_agent/recall.py +0 -0
  200. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/entrypoints/cli/handlers/working_agent/teach.py +0 -0
  201. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/entrypoints/cli/main.py +0 -0
  202. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/entrypoints/cli/operation_command.py +0 -0
  203. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/entrypoints/cli/parser/__init__.py +0 -0
  204. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/entrypoints/cli/parser/builder.py +0 -0
  205. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/entrypoints/cli/presenters/__init__.py +0 -0
  206. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/entrypoints/cli/presenters/init.py +0 -0
  207. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/entrypoints/cli/presenters/json.py +0 -0
  208. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/entrypoints/cli/presenters/metrics.py +0 -0
  209. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/entrypoints/cli/request_parsing/__init__.py +0 -0
  210. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/entrypoints/cli/request_parsing/concepts.py +0 -0
  211. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/entrypoints/cli/request_parsing/episodes.py +0 -0
  212. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/entrypoints/cli/request_parsing/hydration.py +0 -0
  213. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/entrypoints/cli/request_parsing/memories.py +0 -0
  214. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/entrypoints/cli/request_parsing/payload_validation.py +0 -0
  215. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/entrypoints/cli/request_parsing/prepared.py +0 -0
  216. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/entrypoints/cli/request_parsing/retrieval.py +0 -0
  217. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/entrypoints/cli/request_parsing/scenarios.py +0 -0
  218. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/entrypoints/cli/request_parsing/teach.py +0 -0
  219. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/entrypoints/cli/runtime.py +0 -0
  220. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/entrypoints/host_hooks/__init__.py +0 -0
  221. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/entrypoints/host_hooks/claude_session_start.py +0 -0
  222. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/entrypoints/host_hooks/cursor_statusline.py +0 -0
  223. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/entrypoints/jobs/__init__.py +0 -0
  224. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/entrypoints/jobs/episode_sync.py +0 -0
  225. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/infrastructure/__init__.py +0 -0
  226. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/infrastructure/db/__init__.py +0 -0
  227. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/infrastructure/db/admin/__init__.py +0 -0
  228. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/infrastructure/db/admin/app_role_safety.py +0 -0
  229. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/infrastructure/db/admin/backups/__init__.py +0 -0
  230. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/infrastructure/db/admin/backups/destructive_guard.py +0 -0
  231. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/infrastructure/db/admin/backups/logical_backup.py +0 -0
  232. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/infrastructure/db/admin/backups/manifest_store.py +0 -0
  233. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/infrastructure/db/admin/backups/restore.py +0 -0
  234. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/infrastructure/db/admin/connection.py +0 -0
  235. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/infrastructure/db/admin/instance_guard.py +0 -0
  236. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/infrastructure/db/admin/migrations.py +0 -0
  237. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/infrastructure/db/admin/privileges.py +0 -0
  238. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/infrastructure/db/admin/provisioning/__init__.py +0 -0
  239. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/infrastructure/db/admin/provisioning/docker_prerequisites.py +0 -0
  240. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/infrastructure/db/admin/provisioning/external_postgres.py +0 -0
  241. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/infrastructure/db/admin/provisioning/init_effects.py +0 -0
  242. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/infrastructure/db/admin/provisioning/managed_local.py +0 -0
  243. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/infrastructure/db/admin/storage_setup.py +0 -0
  244. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/infrastructure/db/runtime/__init__.py +0 -0
  245. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/infrastructure/db/runtime/engine.py +0 -0
  246. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/infrastructure/db/runtime/models/__init__.py +0 -0
  247. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/infrastructure/db/runtime/models/associations.py +0 -0
  248. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/infrastructure/db/runtime/models/episodes.py +0 -0
  249. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/infrastructure/db/runtime/models/evidence.py +0 -0
  250. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/infrastructure/db/runtime/models/experiences.py +0 -0
  251. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/infrastructure/db/runtime/models/instance_metadata.py +0 -0
  252. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/infrastructure/db/runtime/models/knowledge_builder.py +0 -0
  253. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/infrastructure/db/runtime/models/memories.py +0 -0
  254. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/infrastructure/db/runtime/models/metadata.py +0 -0
  255. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/infrastructure/db/runtime/models/problem_runs.py +0 -0
  256. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/infrastructure/db/runtime/models/registry.py +0 -0
  257. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/infrastructure/db/runtime/models/telemetry.py +0 -0
  258. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/infrastructure/db/runtime/models/utility.py +0 -0
  259. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/infrastructure/db/runtime/models/views.py +0 -0
  260. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/infrastructure/db/runtime/queries/__init__.py +0 -0
  261. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/infrastructure/db/runtime/queries/agent_behavior.py +0 -0
  262. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/infrastructure/db/runtime/queries/analytics.py +0 -0
  263. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/infrastructure/db/runtime/queries/metrics.py +0 -0
  264. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/infrastructure/db/runtime/queries/metrics_adapter.py +0 -0
  265. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/infrastructure/db/runtime/queries/model_usage_backfill.py +0 -0
  266. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/infrastructure/db/runtime/repos/__init__.py +0 -0
  267. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/infrastructure/db/runtime/repos/relational/__init__.py +0 -0
  268. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/infrastructure/db/runtime/repos/relational/associations_repo.py +0 -0
  269. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/infrastructure/db/runtime/repos/relational/episodes_repo.py +0 -0
  270. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/infrastructure/db/runtime/repos/relational/evidence_repo.py +0 -0
  271. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/infrastructure/db/runtime/repos/relational/experiences_repo.py +0 -0
  272. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/infrastructure/db/runtime/repos/relational/knowledge_builder_repo.py +0 -0
  273. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/infrastructure/db/runtime/repos/relational/memories_repo.py +0 -0
  274. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/infrastructure/db/runtime/repos/relational/problem_runs_repo.py +0 -0
  275. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/infrastructure/db/runtime/repos/relational/read_policy_repo.py +0 -0
  276. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/infrastructure/db/runtime/repos/relational/telemetry_repo.py +0 -0
  277. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/infrastructure/db/runtime/repos/relational/utility_repo.py +0 -0
  278. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/infrastructure/db/runtime/repos/semantic/__init__.py +0 -0
  279. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/infrastructure/db/runtime/repos/semantic/keyword_retrieval_repo.py +0 -0
  280. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/infrastructure/db/runtime/repos/semantic/semantic_retrieval_repo.py +0 -0
  281. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/infrastructure/db/runtime/session.py +0 -0
  282. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/infrastructure/embeddings/__init__.py +0 -0
  283. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/infrastructure/embeddings/local_provider.py +0 -0
  284. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/infrastructure/embeddings/prewarm.py +0 -0
  285. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/infrastructure/embeddings/query_vector_search.py +0 -0
  286. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/infrastructure/host_apps/__init__.py +0 -0
  287. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/infrastructure/host_apps/assets/__init__.py +0 -0
  288. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/infrastructure/host_apps/assets/claude.py +0 -0
  289. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/infrastructure/host_apps/assets/codex.py +0 -0
  290. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/infrastructure/host_apps/assets/cursor.py +0 -0
  291. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/infrastructure/host_apps/assets/cursor_statusline_config.py +0 -0
  292. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/infrastructure/host_apps/assets/inspection.py +0 -0
  293. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/infrastructure/host_apps/assets/managed_markdown.py +0 -0
  294. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/infrastructure/host_apps/assets/managed_tree.py +0 -0
  295. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/infrastructure/host_apps/assets/packaged_assets.py +0 -0
  296. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/infrastructure/host_apps/assets/paths.py +0 -0
  297. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/infrastructure/host_apps/assets/service.py +0 -0
  298. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/infrastructure/host_apps/assets/types.py +0 -0
  299. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/infrastructure/host_apps/identity/__init__.py +0 -0
  300. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/infrastructure/host_apps/identity/claude_hook_install.py +0 -0
  301. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/infrastructure/host_apps/identity/claude_runtime.py +0 -0
  302. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/infrastructure/host_apps/identity/codex_runtime.py +0 -0
  303. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/infrastructure/host_apps/identity/compatibility.py +0 -0
  304. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/infrastructure/host_apps/identity/cursor_statusline.py +0 -0
  305. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/infrastructure/host_apps/identity/resolver.py +0 -0
  306. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/infrastructure/host_apps/inner_agents/__init__.py +0 -0
  307. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/infrastructure/host_apps/inner_agents/output_parser.py +0 -0
  308. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/infrastructure/host_apps/transcripts/__init__.py +0 -0
  309. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/infrastructure/host_apps/transcripts/claude_code.py +0 -0
  310. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/infrastructure/host_apps/transcripts/codex.py +0 -0
  311. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/infrastructure/host_apps/transcripts/cursor.py +0 -0
  312. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/infrastructure/host_apps/transcripts/model_usage.py +0 -0
  313. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/infrastructure/host_apps/transcripts/normalization.py +0 -0
  314. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/infrastructure/host_apps/transcripts/session_selection.py +0 -0
  315. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/infrastructure/host_apps/transcripts/source_discovery.py +0 -0
  316. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/infrastructure/host_apps/transcripts/tool_filter.py +0 -0
  317. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/infrastructure/local_state/__init__.py +0 -0
  318. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/infrastructure/local_state/init_lock.py +0 -0
  319. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/infrastructure/local_state/machine_config_store.py +0 -0
  320. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/infrastructure/local_state/operation_registration.py +0 -0
  321. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/infrastructure/local_state/paths.py +0 -0
  322. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/infrastructure/local_state/repo_registration_store.py +0 -0
  323. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/infrastructure/local_state/session_state_file_store.py +0 -0
  324. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/infrastructure/process/__init__.py +0 -0
  325. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/infrastructure/process/episode_sync/__init__.py +0 -0
  326. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/infrastructure/process/episode_sync/autostart.py +0 -0
  327. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/infrastructure/process/episode_sync/launcher.py +0 -0
  328. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/infrastructure/process/episode_sync/lock_file.py +0 -0
  329. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/infrastructure/process/episode_sync/poller.py +0 -0
  330. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/infrastructure/process/episode_sync/status_store.py +0 -0
  331. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/infrastructure/reporting/__init__.py +0 -0
  332. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/infrastructure/reporting/metrics/__init__.py +0 -0
  333. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/infrastructure/reporting/metrics/artifacts.py +0 -0
  334. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/infrastructure/reporting/metrics/browser.py +0 -0
  335. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/infrastructure/reporting/metrics/pager.py +0 -0
  336. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/infrastructure/reporting/metrics/render_html.py +0 -0
  337. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/infrastructure/system/__init__.py +0 -0
  338. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/infrastructure/system/clock.py +0 -0
  339. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/infrastructure/system/id_generator.py +0 -0
  340. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/infrastructure/system/package_upgrade.py +0 -0
  341. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/infrastructure/telemetry/__init__.py +0 -0
  342. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/infrastructure/telemetry/inner_agent_records.py +0 -0
  343. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/infrastructure/telemetry/operation_invocations.py +0 -0
  344. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/infrastructure/telemetry/operation_polling.py +0 -0
  345. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/infrastructure/telemetry/read_records.py +0 -0
  346. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/infrastructure/telemetry/recall_records.py +0 -0
  347. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/infrastructure/telemetry/recorder.py +0 -0
  348. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/infrastructure/telemetry/records.py +0 -0
  349. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/infrastructure/telemetry/sink.py +0 -0
  350. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/infrastructure/telemetry/storage_protocols.py +0 -0
  351. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/infrastructure/telemetry/sync_records.py +0 -0
  352. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/infrastructure/telemetry/write_records.py +0 -0
  353. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/settings/__init__.py +0 -0
  354. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/settings/defaults/create_policy.yaml +0 -0
  355. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/settings/defaults/read_policy.yaml +0 -0
  356. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/settings/defaults/runtime.yaml +0 -0
  357. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/settings/defaults/thresholds.yaml +0 -0
  358. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/settings/defaults/update_policy.yaml +0 -0
  359. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/startup/__init__.py +0 -0
  360. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/startup/admin.py +0 -0
  361. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/startup/admin_db.py +0 -0
  362. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/startup/admin_dependencies.py +0 -0
  363. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/startup/admin_diagnose.py +0 -0
  364. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/startup/analytics.py +0 -0
  365. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/startup/backup.py +0 -0
  366. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/startup/cli.py +0 -0
  367. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/startup/cli_runtime.py +0 -0
  368. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/startup/config.py +0 -0
  369. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/startup/create_policy.py +0 -0
  370. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/startup/db.py +0 -0
  371. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/startup/dsn_resolution.py +0 -0
  372. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/startup/embeddings.py +0 -0
  373. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/startup/episode_poller.py +0 -0
  374. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/startup/episode_sync_launcher.py +0 -0
  375. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/startup/host_hooks.py +0 -0
  376. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/startup/internal_agent_config.py +0 -0
  377. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/startup/internal_agents.py +0 -0
  378. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/startup/knowledge_builder.py +0 -0
  379. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/startup/metrics.py +0 -0
  380. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/startup/migrations.py +0 -0
  381. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/startup/model_usage_backfill.py +0 -0
  382. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/startup/operation_dependencies.py +0 -0
  383. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/startup/read_policy.py +0 -0
  384. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/startup/repo_context.py +0 -0
  385. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/startup/repos.py +0 -0
  386. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/startup/retrieval.py +0 -0
  387. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/startup/runtime_admin.py +0 -0
  388. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/startup/runtime_context.py +0 -0
  389. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/startup/settings.py +0 -0
  390. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/startup/thresholds.py +0 -0
  391. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/startup/update_policy.py +0 -0
  392. {shellbrain-0.1.30 → shellbrain-0.1.32}/app/startup/use_cases.py +0 -0
  393. {shellbrain-0.1.30 → shellbrain-0.1.32}/migrations/__init__.py +0 -0
  394. {shellbrain-0.1.30 → shellbrain-0.1.32}/migrations/env.py +0 -0
  395. {shellbrain-0.1.30 → shellbrain-0.1.32}/migrations/versions/20260226_0001_initial_schema.py +0 -0
  396. {shellbrain-0.1.30 → shellbrain-0.1.32}/migrations/versions/20260312_0002_add_hard_invariants.py +0 -0
  397. {shellbrain-0.1.30 → shellbrain-0.1.32}/migrations/versions/20260312_0003_drop_create_confidence.py +0 -0
  398. {shellbrain-0.1.30 → shellbrain-0.1.32}/migrations/versions/20260313_0004_episode_sync_hardening.py +0 -0
  399. {shellbrain-0.1.30 → shellbrain-0.1.32}/migrations/versions/20260313_0005_evidence_episode_event_refs.py +0 -0
  400. {shellbrain-0.1.30 → shellbrain-0.1.32}/migrations/versions/20260318_0006_usage_telemetry_schema.py +0 -0
  401. {shellbrain-0.1.30 → shellbrain-0.1.32}/migrations/versions/20260319_0007_identity_session_guidance.py +0 -0
  402. {shellbrain-0.1.30 → shellbrain-0.1.32}/migrations/versions/20260320_0008_instance_metadata_and_backup_safety.py +0 -0
  403. {shellbrain-0.1.30 → shellbrain-0.1.32}/migrations/versions/20260410_0009_frontier_memory_family.py +0 -0
  404. {shellbrain-0.1.30 → shellbrain-0.1.32}/migrations/versions/20260414_0010_model_usage_telemetry.py +0 -0
  405. {shellbrain-0.1.30 → shellbrain-0.1.32}/migrations/versions/20260414_0011_usage_problem_tokens_multi_solution_metrics.py +0 -0
  406. {shellbrain-0.1.30 → shellbrain-0.1.32}/migrations/versions/20260415_0012_read_pack_cost_and_read_roi.py +0 -0
  407. {shellbrain-0.1.30 → shellbrain-0.1.32}/migrations/versions/20260421_0013_concept_context_graph.py +0 -0
  408. {shellbrain-0.1.30 → shellbrain-0.1.32}/migrations/versions/20260422_0014_concept_read_telemetry.py +0 -0
  409. {shellbrain-0.1.30 → shellbrain-0.1.32}/migrations/versions/20260422_0015_problem_runs.py +0 -0
  410. {shellbrain-0.1.30 → shellbrain-0.1.32}/migrations/versions/20260508_0016_recall_telemetry.py +0 -0
  411. {shellbrain-0.1.30 → shellbrain-0.1.32}/migrations/versions/20260511_0017_inner_agent_invocations.py +0 -0
  412. {shellbrain-0.1.30 → shellbrain-0.1.32}/migrations/versions/20260513_0018_knowledge_build_runs.py +0 -0
  413. {shellbrain-0.1.30 → shellbrain-0.1.32}/migrations/versions/20260515_0019_scenario_records.py +0 -0
  414. {shellbrain-0.1.30 → shellbrain-0.1.32}/migrations/versions/20260516_0020_knowledge_build_observability.py +0 -0
  415. {shellbrain-0.1.30 → shellbrain-0.1.32}/migrations/versions/20260519_0021_knowledge_build_watermark_stable.py +0 -0
  416. {shellbrain-0.1.30 → shellbrain-0.1.32}/migrations/versions/20260519_0022_update_evidence_links.py +0 -0
  417. {shellbrain-0.1.30 → shellbrain-0.1.32}/migrations/versions/20260519_0023_explicit_teach_trigger.py +0 -0
  418. {shellbrain-0.1.30 → shellbrain-0.1.32}/migrations/versions/20260519_0024_read_retrieval_latency_indexes.py +0 -0
  419. {shellbrain-0.1.30 → shellbrain-0.1.32}/migrations/versions/20260519_0025_repair_recall_source_input_section_constraint.py +0 -0
  420. {shellbrain-0.1.30 → shellbrain-0.1.32}/migrations/versions/20260519_0026_repair_knowledge_build_trigger_constraint.py +0 -0
  421. {shellbrain-0.1.30 → shellbrain-0.1.32}/migrations/versions/__init__.py +0 -0
  422. {shellbrain-0.1.30 → shellbrain-0.1.32}/onboarding_assets/__init__.py +0 -0
  423. {shellbrain-0.1.30 → shellbrain-0.1.32}/onboarding_assets/claude/CLAUDE.md +0 -0
  424. {shellbrain-0.1.30 → shellbrain-0.1.32}/onboarding_assets/claude/skills/shellbrain/SKILL.md +0 -0
  425. {shellbrain-0.1.30 → shellbrain-0.1.32}/onboarding_assets/claude/skills/shellbrain-usage-review/SKILL.md +0 -0
  426. {shellbrain-0.1.30 → shellbrain-0.1.32}/onboarding_assets/codex/AGENTS.md +0 -0
  427. {shellbrain-0.1.30 → shellbrain-0.1.32}/onboarding_assets/codex/clean-architecture/SKILL.md +0 -0
  428. {shellbrain-0.1.30 → shellbrain-0.1.32}/onboarding_assets/codex/clean-code/SKILL.md +0 -0
  429. {shellbrain-0.1.30 → shellbrain-0.1.32}/onboarding_assets/codex/shellbrain/SKILL.md +0 -0
  430. {shellbrain-0.1.30 → shellbrain-0.1.32}/onboarding_assets/codex/shellbrain/agents/openai.yaml +0 -0
  431. {shellbrain-0.1.30 → shellbrain-0.1.32}/onboarding_assets/codex/shellbrain/assets/shellbrain-large.svg +0 -0
  432. {shellbrain-0.1.30 → shellbrain-0.1.32}/onboarding_assets/codex/shellbrain/assets/shellbrain-small.svg +0 -0
  433. {shellbrain-0.1.30 → shellbrain-0.1.32}/onboarding_assets/codex/shellbrain/assets/shellbrain_logo.png +0 -0
  434. {shellbrain-0.1.30 → shellbrain-0.1.32}/onboarding_assets/codex/shellbrain/references/request-shapes.md +0 -0
  435. {shellbrain-0.1.30 → shellbrain-0.1.32}/onboarding_assets/codex/shellbrain/references/session-workflow.md +0 -0
  436. {shellbrain-0.1.30 → shellbrain-0.1.32}/onboarding_assets/codex/shellbrain-usage-review/SKILL.md +0 -0
  437. {shellbrain-0.1.30 → shellbrain-0.1.32}/onboarding_assets/codex/shellbrain-usage-review/agents/openai.yaml +0 -0
  438. {shellbrain-0.1.30 → shellbrain-0.1.32}/onboarding_assets/codex/shellbrain-usage-review/assets/shellbrain-small.svg +0 -0
  439. {shellbrain-0.1.30 → shellbrain-0.1.32}/onboarding_assets/codex/shellbrain-usage-review/assets/shellbrain_logo.png +0 -0
  440. {shellbrain-0.1.30 → shellbrain-0.1.32}/onboarding_assets/cursor/skills/shellbrain/SKILL.md +0 -0
  441. {shellbrain-0.1.30 → shellbrain-0.1.32}/onboarding_assets/cursor/skills/shellbrain-usage-review/SKILL.md +0 -0
  442. {shellbrain-0.1.30 → shellbrain-0.1.32}/setup.cfg +0 -0
  443. {shellbrain-0.1.30 → shellbrain-0.1.32}/shellbrain.egg-info/dependency_links.txt +0 -0
  444. {shellbrain-0.1.30 → shellbrain-0.1.32}/shellbrain.egg-info/entry_points.txt +0 -0
  445. {shellbrain-0.1.30 → shellbrain-0.1.32}/shellbrain.egg-info/requires.txt +0 -0
  446. {shellbrain-0.1.30 → shellbrain-0.1.32}/shellbrain.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: shellbrain
3
- Version: 0.1.30
3
+ Version: 0.1.32
4
4
  Summary: Repo-scoped Shellbrain CLI with explicit evidence-backed writes.
5
5
  Requires-Python: >=3.11
6
6
  Description-Content-Type: text/markdown
@@ -14,6 +14,9 @@ class _StrictModel(BaseModel):
14
14
  InnerAgentName = Literal["build_context", "build_knowledge", "teach"]
15
15
  InnerAgentProviderName = str
16
16
  InnerAgentReasoningLevel = Literal["none", "minimal", "low", "medium", "high", "xhigh"]
17
+ BuildContextStrategy = Literal[
18
+ "deterministic_synthesis", "deterministic_only", "autonomous"
19
+ ]
17
20
  TokenCaptureQuality = Literal["exact", "estimated"]
18
21
  InnerAgentRunStatus = Literal[
19
22
  "ok",
@@ -28,12 +31,12 @@ InnerAgentRunStatus = Literal[
28
31
  class BuildContextSettings(_StrictModel):
29
32
  """Typed model/runtime settings for the build_context recall agent."""
30
33
 
34
+ strategy: BuildContextStrategy = "deterministic_synthesis"
31
35
  provider: InnerAgentProviderName = Field(min_length=1)
32
36
  model: str = Field(min_length=1)
33
37
  reasoning: InnerAgentReasoningLevel
34
38
  timeout_seconds: int = Field(ge=1, le=600)
35
39
  max_private_reads: int = Field(default=0, ge=0, le=10)
36
- max_candidate_tokens: int = Field(ge=1, le=200_000)
37
40
  max_brief_tokens: int | None = Field(default=None, ge=1, le=100_000)
38
41
 
39
42
 
@@ -0,0 +1,124 @@
1
+ """Pure concept aggregate text rendering for retrieval embeddings."""
2
+
3
+ from __future__ import annotations
4
+
5
+ from typing import Any
6
+
7
+ from app.core.entities.concepts import (
8
+ Anchor,
9
+ Concept,
10
+ ConceptClaim,
11
+ ConceptGrounding,
12
+ ConceptLifecycleStatus,
13
+ ConceptMemoryLink,
14
+ ConceptRelation,
15
+ )
16
+
17
+
18
+ def build_concept_embedding_text(bundle: dict[str, Any]) -> str:
19
+ """Render one concept bundle into deterministic aggregate retrieval text."""
20
+
21
+ concept: Concept = bundle["concept"]
22
+ parts: list[str] = [
23
+ concept.slug,
24
+ concept.name,
25
+ concept.kind.value,
26
+ ]
27
+ if concept.scope_note:
28
+ parts.append(concept.scope_note)
29
+ parts.extend(
30
+ alias.alias
31
+ for alias in sorted(
32
+ bundle.get("aliases", ()), key=lambda item: item.normalized_alias
33
+ )
34
+ )
35
+ parts.extend(_claim_parts(bundle.get("claims", ())))
36
+ parts.extend(_relation_parts(bundle.get("relations", ()), concept_id=concept.id))
37
+ parts.extend(_grounding_parts(bundle.get("groundings", ()), bundle.get("anchors", ())))
38
+ parts.extend(_memory_link_parts(bundle.get("memory_links", ())))
39
+ return " ".join(_clean_parts(parts))
40
+
41
+
42
+ def _claim_parts(claims: list[ConceptClaim]) -> list[str]:
43
+ parts: list[str] = []
44
+ for claim in sorted(claims, key=lambda item: (item.claim_type.value, item.text)):
45
+ if claim.lifecycle.status is not ConceptLifecycleStatus.ACTIVE:
46
+ continue
47
+ parts.extend((claim.claim_type.value, claim.text))
48
+ return parts
49
+
50
+
51
+ def _relation_parts(
52
+ relations: list[ConceptRelation], *, concept_id: str
53
+ ) -> list[str]:
54
+ parts: list[str] = []
55
+ for relation in sorted(
56
+ relations,
57
+ key=lambda item: (
58
+ item.predicate.value,
59
+ item.subject_concept_id,
60
+ item.object_concept_id,
61
+ ),
62
+ ):
63
+ if relation.lifecycle.status is not ConceptLifecycleStatus.ACTIVE:
64
+ continue
65
+ neighbor_id = (
66
+ relation.object_concept_id
67
+ if relation.subject_concept_id == concept_id
68
+ else relation.subject_concept_id
69
+ )
70
+ parts.extend((relation.predicate.value, neighbor_id))
71
+ return parts
72
+
73
+
74
+ def _grounding_parts(
75
+ groundings: list[ConceptGrounding], anchors: list[Anchor]
76
+ ) -> list[str]:
77
+ anchor_by_id = {anchor.id: anchor for anchor in anchors}
78
+ parts: list[str] = []
79
+ for grounding in sorted(
80
+ groundings, key=lambda item: (item.role.value, item.anchor_id)
81
+ ):
82
+ if grounding.lifecycle.status is not ConceptLifecycleStatus.ACTIVE:
83
+ continue
84
+ anchor = anchor_by_id.get(grounding.anchor_id)
85
+ parts.append(grounding.role.value)
86
+ if anchor is not None:
87
+ parts.append(anchor.kind.value)
88
+ parts.extend(_locator_scalars(anchor.locator_json))
89
+ return parts
90
+
91
+
92
+ def _memory_link_parts(memory_links: list[ConceptMemoryLink]) -> list[str]:
93
+ parts: list[str] = []
94
+ for link in sorted(memory_links, key=lambda item: (item.role.value, item.memory_id)):
95
+ if link.lifecycle.status is not ConceptLifecycleStatus.ACTIVE:
96
+ continue
97
+ parts.extend((link.role.value, link.memory_id))
98
+ return parts
99
+
100
+
101
+ def _locator_scalars(value: object) -> tuple[str, ...]:
102
+ scalars: list[str] = []
103
+
104
+ def _walk(item: object) -> None:
105
+ if isinstance(item, dict):
106
+ for key in sorted(item):
107
+ _walk(item[key])
108
+ return
109
+ if isinstance(item, (list, tuple)):
110
+ for nested in item:
111
+ _walk(nested)
112
+ return
113
+ if item is None or isinstance(item, bool):
114
+ return
115
+ text = str(item).strip()
116
+ if text:
117
+ scalars.append(text)
118
+
119
+ _walk(value)
120
+ return tuple(scalars)
121
+
122
+
123
+ def _clean_parts(parts: list[str]) -> tuple[str, ...]:
124
+ return tuple(part.strip() for part in parts if part and part.strip())
@@ -20,7 +20,7 @@ _COVERAGE_THRESHOLD_BY_MODE = {
20
20
  class BM25Document:
21
21
  """Normalized document representation used for BM25 scoring."""
22
22
 
23
- memory_id: str
23
+ document_id: str
24
24
  terms: tuple[str, ...]
25
25
 
26
26
 
@@ -28,7 +28,7 @@ class BM25Document:
28
28
  class BM25ScoredDocument:
29
29
  """Scored lexical candidate with query-coverage metadata."""
30
30
 
31
- memory_id: str
31
+ document_id: str
32
32
  score: float
33
33
  coverage: float
34
34
 
@@ -47,7 +47,7 @@ def score_documents(
47
47
  return []
48
48
 
49
49
  term_frequencies = {
50
- document.memory_id: Counter(document.terms) for document in documents
50
+ document.document_id: Counter(document.terms) for document in documents
51
51
  }
52
52
  corpus_size = len(documents)
53
53
  average_length = sum(len(document.terms) for document in documents) / corpus_size
@@ -59,7 +59,7 @@ def score_documents(
59
59
  sum(
60
60
  1
61
61
  for document in documents
62
- if term in term_frequencies[document.memory_id]
62
+ if term in term_frequencies[document.document_id]
63
63
  ),
64
64
  corpus_size,
65
65
  )
@@ -71,7 +71,7 @@ def score_documents(
71
71
 
72
72
  scored: list[BM25ScoredDocument] = []
73
73
  for document in documents:
74
- frequencies = term_frequencies[document.memory_id]
74
+ frequencies = term_frequencies[document.document_id]
75
75
  matched_terms = tuple(
76
76
  term for term in normalized_query_terms if term in frequencies
77
77
  )
@@ -93,30 +93,36 @@ def score_documents(
93
93
  if score > 0.0:
94
94
  scored.append(
95
95
  BM25ScoredDocument(
96
- memory_id=document.memory_id,
96
+ document_id=document.document_id,
97
97
  score=score,
98
98
  coverage=matched_query_weight / total_query_weight,
99
99
  )
100
100
  )
101
101
 
102
- return sorted(scored, key=lambda item: (-item.score, item.memory_id))
102
+ return sorted(scored, key=lambda item: (-item.score, item.document_id))
103
103
 
104
104
 
105
105
  def admit_scored_documents(
106
106
  scored_documents: Sequence[BM25ScoredDocument],
107
107
  *,
108
108
  mode: Literal["ambient", "targeted"],
109
+ output_id_key: Literal["memory_id", "concept_id"] = "memory_id",
110
+ coverage_threshold: float | None = None,
109
111
  ) -> list[dict[str, object]]:
110
112
  """Apply the mode-aware weighted query-coverage gate to scored lexical candidates."""
111
113
 
112
- threshold = _COVERAGE_THRESHOLD_BY_MODE[mode]
114
+ threshold = (
115
+ float(coverage_threshold)
116
+ if coverage_threshold is not None
117
+ else _COVERAGE_THRESHOLD_BY_MODE[mode]
118
+ )
113
119
  admitted = [
114
- {"memory_id": document.memory_id, "score": document.score}
120
+ {output_id_key: document.document_id, "score": document.score}
115
121
  for document in scored_documents
116
122
  if document.coverage >= threshold
117
123
  ]
118
124
  return sorted(
119
- admitted, key=lambda item: (-float(item["score"]), str(item["memory_id"]))
125
+ admitted, key=lambda item: (-float(item["score"]), str(item[output_id_key]))
120
126
  )
121
127
 
122
128
 
@@ -10,6 +10,7 @@ def fuse_with_rrf(
10
10
  keyword: list[dict[str, Any]],
11
11
  *,
12
12
  retrieval_defaults: Mapping[str, float] | None = None,
13
+ id_key: str = "memory_id",
13
14
  ) -> list[dict[str, Any]]:
14
15
  """This function merges lane candidates using reciprocal-rank fusion."""
15
16
 
@@ -25,11 +26,11 @@ def fuse_with_rrf(
25
26
 
26
27
  for lane_name, candidates in (("semantic", semantic), ("keyword", keyword)):
27
28
  for rank, candidate in enumerate(candidates, start=1):
28
- memory_id = candidate["memory_id"]
29
+ item_id = candidate[id_key]
29
30
  entry = fused.setdefault(
30
- memory_id,
31
+ item_id,
31
32
  {
32
- "memory_id": memory_id,
33
+ id_key: item_id,
33
34
  "rrf_score": 0.0,
34
35
  "rank_semantic": None,
35
36
  "rank_keyword": None,
@@ -40,5 +41,5 @@ def fuse_with_rrf(
40
41
 
41
42
  return sorted(
42
43
  fused.values(),
43
- key=lambda item: (-float(item["rrf_score"]), str(item["memory_id"])),
44
+ key=lambda item: (-float(item["rrf_score"]), str(item[id_key])),
44
45
  )
@@ -85,5 +85,13 @@ class IConceptsRepo(ABC):
85
85
  """This method returns concept-link matches for displayed memory ids."""
86
86
 
87
87
  @abstractmethod
88
- def list_concept_search_rows(self, *, repo_id: str) -> Sequence[dict[str, Any]]:
89
- """This method returns active concept text rows for query matching."""
88
+ def upsert_embedding(
89
+ self,
90
+ *,
91
+ concept_id: str,
92
+ repo_id: str,
93
+ model: str,
94
+ vector: Sequence[float],
95
+ source_hash: str,
96
+ ) -> None:
97
+ """This method inserts or updates one aggregate concept embedding."""
@@ -49,6 +49,35 @@ class IKeywordRetrievalRepo(ABC):
49
49
  """This method returns visible text rows for lexical ranking."""
50
50
 
51
51
 
52
+ class IConceptSemanticRetrievalRepo(ABC):
53
+ """This interface defines semantic-lane retrieval against concept embeddings."""
54
+
55
+ @abstractmethod
56
+ def query_concepts_semantic(
57
+ self,
58
+ *,
59
+ repo_id: str,
60
+ query_vector: Sequence[float],
61
+ limit: int,
62
+ query_model: str | None = None,
63
+ ) -> Sequence[dict[str, Any]]:
64
+ """This method returns concept semantic retrieval candidates with scores."""
65
+
66
+
67
+ class IConceptKeywordRetrievalRepo(ABC):
68
+ """This interface defines concept keyword-lane corpus access."""
69
+
70
+ @abstractmethod
71
+ def list_concept_keyword_corpus(
72
+ self,
73
+ *,
74
+ repo_id: str,
75
+ query_terms: Sequence[str] | None = None,
76
+ candidate_limit: int | None = None,
77
+ ) -> Sequence[dict[str, Any]]:
78
+ """This method returns active concept text rows for lexical ranking."""
79
+
80
+
52
81
  class IReadPolicyRepo(ABC):
53
82
  """This interface defines read-path visibility and explicit expansion queries."""
54
83
 
@@ -17,6 +17,8 @@ from app.core.ports.db.memory_repositories import (
17
17
  from app.core.ports.db.problem_runs import IProblemRunsRepo
18
18
  from app.core.ports.embeddings.retrieval import IVectorSearch
19
19
  from app.core.ports.db.retrieval_repositories import (
20
+ IConceptKeywordRetrievalRepo,
21
+ IConceptSemanticRetrievalRepo,
20
22
  IKeywordRetrievalRepo,
21
23
  IReadPolicyRepo,
22
24
  ISemanticRetrievalRepo,
@@ -35,6 +37,8 @@ class IUnitOfWork(ABC):
35
37
  evidence: IEvidenceRepo
36
38
  semantic_retrieval: ISemanticRetrievalRepo
37
39
  keyword_retrieval: IKeywordRetrievalRepo
40
+ concept_semantic_retrieval: IConceptSemanticRetrievalRepo
41
+ concept_keyword_retrieval: IConceptKeywordRetrievalRepo
38
42
  read_policy: IReadPolicyRepo
39
43
  guidance: IPendingUtilityCandidatesRepo
40
44
  knowledge_build_runs: IKnowledgeBuildRunsRepo
@@ -24,7 +24,7 @@ class _StrictModel(BaseModel):
24
24
 
25
25
 
26
26
  class InnerAgentRunRequest(_StrictModel):
27
- """One autonomous read-only inner-agent synthesis request."""
27
+ """One build_context inner-agent request."""
28
28
 
29
29
  agent_name: InnerAgentName
30
30
  provider: InnerAgentProviderName = Field(min_length=1)
@@ -32,11 +32,12 @@ class InnerAgentRunRequest(_StrictModel):
32
32
  reasoning: InnerAgentReasoningLevel
33
33
  timeout_seconds: int = Field(ge=1, le=600)
34
34
  max_private_reads: int = Field(default=0, ge=0, le=10)
35
- max_candidate_tokens: int = Field(ge=1, le=200_000)
36
35
  max_brief_tokens: int | None = Field(default=None, ge=1, le=100_000)
37
36
  query: str = Field(min_length=1)
38
37
  current_problem: dict[str, str]
39
38
  repo_root: str | None = None
39
+ synthesis_only: bool = False
40
+ deterministic_pack: dict[str, Any] | None = None
40
41
 
41
42
 
42
43
  class InnerAgentRunResult(_StrictModel):
@@ -6,8 +6,10 @@ from typing import Any
6
6
 
7
7
  from app.core.errors import DomainValidationError, ErrorCode, ErrorDetail
8
8
  from app.core.entities.concepts import Concept, ConceptKind, ConceptStatus
9
+ from app.core.ports.embeddings.provider import IEmbeddingProvider
9
10
  from app.core.ports.system.idgen import IIdGenerator
10
11
  from app.core.ports.db.unit_of_work import IUnitOfWork
12
+ from app.core.use_cases.concepts.embeddings import upsert_concept_embeddings
11
13
  from app.core.use_cases.concepts.add.request import ConceptAddRequest
12
14
  from app.core.use_cases.concepts.add.result import ConceptAddResult
13
15
  from app.core.use_cases.concepts.reference_checks import require_missing_concept
@@ -18,6 +20,8 @@ def add_concepts(
18
20
  uow: IUnitOfWork,
19
21
  *,
20
22
  id_generator: IIdGenerator,
23
+ embedding_provider: IEmbeddingProvider | None = None,
24
+ embedding_model: str | None = None,
21
25
  ) -> ConceptAddResult:
22
26
  """Create concept containers, failing when any target concept already exists."""
23
27
 
@@ -39,6 +43,7 @@ def add_concepts(
39
43
  seen_slugs.add(normalized_slug)
40
44
 
41
45
  results: list[dict[str, Any]] = []
46
+ concept_ids: list[str] = []
42
47
  for action, normalized_slug in zip(request.actions, normalized_slugs, strict=True):
43
48
  concept = uow.concepts.add_concept(
44
49
  Concept(
@@ -52,8 +57,16 @@ def add_concepts(
52
57
  ),
53
58
  aliases=action.aliases,
54
59
  )
60
+ concept_ids.append(concept.id)
55
61
  results.append(
56
62
  {"type": action.type, "concept_id": concept.id, "slug": concept.slug}
57
63
  )
64
+ upsert_concept_embeddings(
65
+ repo_id=request.repo_id,
66
+ concept_ids=concept_ids,
67
+ uow=uow,
68
+ embedding_provider=embedding_provider,
69
+ embedding_model=embedding_model,
70
+ )
58
71
 
59
72
  return ConceptAddResult(added_count=len(results), results=results)
@@ -0,0 +1,40 @@
1
+ """Concept aggregate embedding maintenance helpers."""
2
+
3
+ from __future__ import annotations
4
+
5
+ import hashlib
6
+ from collections.abc import Sequence
7
+
8
+ from app.core.ports.db.unit_of_work import IUnitOfWork
9
+ from app.core.ports.embeddings.provider import IEmbeddingProvider
10
+ from app.core.policies.concepts.search_text import build_concept_embedding_text
11
+
12
+
13
+ def upsert_concept_embeddings(
14
+ *,
15
+ repo_id: str,
16
+ concept_ids: Sequence[str],
17
+ uow: IUnitOfWork,
18
+ embedding_provider: IEmbeddingProvider | None,
19
+ embedding_model: str | None,
20
+ ) -> int:
21
+ """Refresh aggregate concept embeddings for touched concepts when enabled."""
22
+
23
+ if embedding_provider is None or embedding_model is None:
24
+ return 0
25
+ updated = 0
26
+ for concept_id in dict.fromkeys(str(value) for value in concept_ids):
27
+ bundle = uow.concepts.get_concept_bundle(repo_id=repo_id, concept_ref=concept_id)
28
+ if bundle is None:
29
+ continue
30
+ text = build_concept_embedding_text(bundle)
31
+ source_hash = hashlib.sha256(text.encode("utf-8")).hexdigest()
32
+ uow.concepts.upsert_embedding(
33
+ concept_id=concept_id,
34
+ repo_id=repo_id,
35
+ model=embedding_model,
36
+ vector=embedding_provider.embed(text),
37
+ source_hash=source_hash,
38
+ )
39
+ updated += 1
40
+ return updated
@@ -38,8 +38,10 @@ from app.core.entities.concepts import (
38
38
  ConceptSourceKind,
39
39
  ConceptStatus,
40
40
  )
41
+ from app.core.ports.embeddings.provider import IEmbeddingProvider
41
42
  from app.core.ports.system.idgen import IIdGenerator
42
43
  from app.core.ports.db.unit_of_work import IUnitOfWork
44
+ from app.core.use_cases.concepts.embeddings import upsert_concept_embeddings
43
45
  from app.core.policies.concepts.relation_rules import validate_relation_shape
44
46
  from app.core.use_cases.concepts.containment_checks import validate_contains_relation
45
47
  from app.core.use_cases.concepts.reference_checks import (
@@ -57,23 +59,43 @@ def update_concepts(
57
59
  uow: IUnitOfWork,
58
60
  *,
59
61
  id_generator: IIdGenerator,
62
+ embedding_provider: IEmbeddingProvider | None = None,
63
+ embedding_model: str | None = None,
60
64
  ) -> ConceptUpdateResult:
61
65
  """Update existing concepts and truth-bearing graph records."""
62
66
 
63
67
  results: list[dict[str, Any]] = []
68
+ touched_concept_ids: set[str] = set()
64
69
  for action in request.actions:
65
70
  try:
66
71
  if isinstance(action, UpdateConceptAction):
67
- results.append(_update_concept(request.repo_id, action, uow))
72
+ results.append(
73
+ _update_concept(
74
+ request.repo_id,
75
+ action,
76
+ uow,
77
+ touched_concept_ids=touched_concept_ids,
78
+ )
79
+ )
68
80
  elif isinstance(action, AddRelationAction):
69
81
  results.append(
70
82
  _add_relation(
71
- request.repo_id, action, uow, id_generator=id_generator
83
+ request.repo_id,
84
+ action,
85
+ uow,
86
+ id_generator=id_generator,
87
+ touched_concept_ids=touched_concept_ids,
72
88
  )
73
89
  )
74
90
  elif isinstance(action, AddClaimAction):
75
91
  results.append(
76
- _add_claim(request.repo_id, action, uow, id_generator=id_generator)
92
+ _add_claim(
93
+ request.repo_id,
94
+ action,
95
+ uow,
96
+ id_generator=id_generator,
97
+ touched_concept_ids=touched_concept_ids,
98
+ )
77
99
  )
78
100
  elif isinstance(action, EnsureAnchorAction):
79
101
  results.append(
@@ -84,13 +106,21 @@ def update_concepts(
84
106
  elif isinstance(action, AddGroundingAction):
85
107
  results.append(
86
108
  _add_grounding(
87
- request.repo_id, action, uow, id_generator=id_generator
109
+ request.repo_id,
110
+ action,
111
+ uow,
112
+ id_generator=id_generator,
113
+ touched_concept_ids=touched_concept_ids,
88
114
  )
89
115
  )
90
116
  elif isinstance(action, LinkMemoryAction):
91
117
  results.append(
92
118
  _link_memory(
93
- request.repo_id, action, uow, id_generator=id_generator
119
+ request.repo_id,
120
+ action,
121
+ uow,
122
+ id_generator=id_generator,
123
+ touched_concept_ids=touched_concept_ids,
94
124
  )
95
125
  )
96
126
  else: # pragma: no cover - discriminated contract should make this impossible.
@@ -109,13 +139,25 @@ def update_concepts(
109
139
  raise DomainValidationError(
110
140
  [ErrorDetail(code=ErrorCode.SEMANTIC_ERROR, message=str(exc))]
111
141
  ) from exc
142
+ upsert_concept_embeddings(
143
+ repo_id=request.repo_id,
144
+ concept_ids=tuple(sorted(touched_concept_ids)),
145
+ uow=uow,
146
+ embedding_provider=embedding_provider,
147
+ embedding_model=embedding_model,
148
+ )
112
149
  return ConceptUpdateResult(updated_count=len(results), results=results)
113
150
 
114
151
 
115
152
  def _update_concept(
116
- repo_id: str, action: UpdateConceptAction, uow: IUnitOfWork
153
+ repo_id: str,
154
+ action: UpdateConceptAction,
155
+ uow: IUnitOfWork,
156
+ *,
157
+ touched_concept_ids: set[str],
117
158
  ) -> dict[str, Any]:
118
159
  existing = require_concept(repo_id, action.concept, uow)
160
+ touched_concept_ids.add(existing.id)
119
161
  concept = Concept(
120
162
  id=existing.id,
121
163
  repo_id=existing.repo_id,
@@ -141,9 +183,11 @@ def _add_relation(
141
183
  uow: IUnitOfWork,
142
184
  *,
143
185
  id_generator: IIdGenerator,
186
+ touched_concept_ids: set[str],
144
187
  ) -> dict[str, Any]:
145
188
  subject = require_concept(repo_id, action.subject, uow)
146
189
  object_concept = require_concept(repo_id, action.object, uow)
190
+ touched_concept_ids.update((subject.id, object_concept.id))
147
191
  predicate = ConceptRelationPredicate(action.predicate)
148
192
  validate_relation_shape(
149
193
  subject=subject, predicate=predicate, object_concept=object_concept
@@ -182,8 +226,10 @@ def _add_claim(
182
226
  uow: IUnitOfWork,
183
227
  *,
184
228
  id_generator: IIdGenerator,
229
+ touched_concept_ids: set[str],
185
230
  ) -> dict[str, Any]:
186
231
  concept = require_concept(repo_id, action.concept, uow)
232
+ touched_concept_ids.add(concept.id)
187
233
  claim = uow.concepts.add_claim(
188
234
  ConceptClaim(
189
235
  id=id_generator.new_id(),
@@ -229,8 +275,10 @@ def _add_grounding(
229
275
  uow: IUnitOfWork,
230
276
  *,
231
277
  id_generator: IIdGenerator,
278
+ touched_concept_ids: set[str],
232
279
  ) -> dict[str, Any]:
233
280
  concept = require_concept(repo_id, action.concept, uow)
281
+ touched_concept_ids.add(concept.id)
234
282
  if action.anchor.id:
235
283
  anchor = require_anchor(repo_id, action.anchor.id, uow)
236
284
  else:
@@ -265,9 +313,11 @@ def _link_memory(
265
313
  uow: IUnitOfWork,
266
314
  *,
267
315
  id_generator: IIdGenerator,
316
+ touched_concept_ids: set[str],
268
317
  ) -> dict[str, Any]:
269
318
  concept = require_concept(repo_id, action.concept, uow)
270
319
  memory = require_visible_memory(repo_id, action.memory_id, uow)
320
+ touched_concept_ids.add(concept.id)
271
321
  memory_link = uow.concepts.add_memory_link(
272
322
  ConceptMemoryLink(
273
323
  id=id_generator.new_id(),