shellbrain 0.1.36__tar.gz → 0.1.37__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 (474) hide show
  1. {shellbrain-0.1.36 → shellbrain-0.1.37}/PKG-INFO +34 -8
  2. {shellbrain-0.1.36 → shellbrain-0.1.37}/README.md +33 -7
  3. shellbrain-0.1.37/app/core/entities/snapshots.py +288 -0
  4. shellbrain-0.1.37/app/core/ports/db/snapshots.py +52 -0
  5. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/core/ports/db/unit_of_work.py +2 -0
  6. shellbrain-0.1.37/app/core/ports/local_state/shadow_git.py +27 -0
  7. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/core/use_cases/scenarios/record/execute.py +119 -1
  8. shellbrain-0.1.37/app/core/use_cases/scenarios/record/result.py +59 -0
  9. shellbrain-0.1.37/app/core/use_cases/snapshots/__init__.py +1 -0
  10. shellbrain-0.1.37/app/core/use_cases/snapshots/capture_snapshot/__init__.py +16 -0
  11. shellbrain-0.1.37/app/core/use_cases/snapshots/capture_snapshot/execute.py +152 -0
  12. shellbrain-0.1.37/app/core/use_cases/snapshots/capture_snapshot/request.py +34 -0
  13. shellbrain-0.1.37/app/core/use_cases/snapshots/capture_snapshot/result.py +45 -0
  14. shellbrain-0.1.37/app/core/use_cases/snapshots/code_delta_context/__init__.py +16 -0
  15. shellbrain-0.1.37/app/core/use_cases/snapshots/code_delta_context/execute.py +107 -0
  16. shellbrain-0.1.37/app/core/use_cases/snapshots/code_delta_context/request.py +28 -0
  17. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/entrypoints/cli/handlers/cli_operation.py +6 -0
  18. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/entrypoints/cli/handlers/dependencies.py +2 -0
  19. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/entrypoints/cli/handlers/internal_agent/episodes/events.py +23 -0
  20. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/entrypoints/cli/handlers/internal_agent/scenarios/record.py +2 -0
  21. shellbrain-0.1.37/app/entrypoints/cli/handlers/working_agent/snapshot.py +166 -0
  22. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/entrypoints/cli/operation_command.py +1 -0
  23. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/entrypoints/cli/parser/builder.py +10 -0
  24. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/entrypoints/cli/runner.py +20 -3
  25. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/entrypoints/cli/runtime.py +1 -0
  26. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/infrastructure/db/runtime/models/registry.py +2 -0
  27. shellbrain-0.1.37/app/infrastructure/db/runtime/models/snapshots.py +114 -0
  28. shellbrain-0.1.37/app/infrastructure/db/runtime/repos/relational/snapshots_repo.py +206 -0
  29. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/infrastructure/db/runtime/uow.py +2 -0
  30. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/infrastructure/host_apps/inner_agents/prompt.py +21 -6
  31. shellbrain-0.1.37/app/infrastructure/local_state/shadow_git_store.py +363 -0
  32. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/startup/cli.py +2 -0
  33. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/startup/cli_runtime.py +1 -0
  34. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/startup/operation_dependencies.py +4 -0
  35. shellbrain-0.1.37/app/startup/snapshot_baseline.py +36 -0
  36. shellbrain-0.1.37/migrations/versions/20260526_0036_shadow_snapshots.py +159 -0
  37. {shellbrain-0.1.36 → shellbrain-0.1.37}/onboarding_assets/claude/CLAUDE.md +2 -0
  38. {shellbrain-0.1.36/onboarding_assets/cursor → shellbrain-0.1.37/onboarding_assets/claude}/skills/shellbrain/SKILL.md +18 -0
  39. {shellbrain-0.1.36 → shellbrain-0.1.37}/onboarding_assets/codex/AGENTS.md +2 -0
  40. {shellbrain-0.1.36 → shellbrain-0.1.37}/onboarding_assets/codex/shellbrain/SKILL.md +18 -0
  41. {shellbrain-0.1.36 → shellbrain-0.1.37}/onboarding_assets/codex/shellbrain/references/request-shapes.md +15 -1
  42. {shellbrain-0.1.36 → shellbrain-0.1.37}/onboarding_assets/codex/shellbrain/references/session-workflow.md +8 -0
  43. {shellbrain-0.1.36/onboarding_assets/claude → shellbrain-0.1.37/onboarding_assets/cursor}/skills/shellbrain/SKILL.md +18 -0
  44. {shellbrain-0.1.36 → shellbrain-0.1.37}/pyproject.toml +1 -1
  45. {shellbrain-0.1.36 → shellbrain-0.1.37}/shellbrain.egg-info/PKG-INFO +34 -8
  46. {shellbrain-0.1.36 → shellbrain-0.1.37}/shellbrain.egg-info/SOURCES.txt +17 -0
  47. shellbrain-0.1.36/app/core/use_cases/scenarios/record/result.py +0 -29
  48. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/__init__.py +0 -0
  49. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/__main__.py +0 -0
  50. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/core/__init__.py +0 -0
  51. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/core/entities/__init__.py +0 -0
  52. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/core/entities/admin_errors.py +0 -0
  53. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/core/entities/associations.py +0 -0
  54. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/core/entities/backups.py +0 -0
  55. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/core/entities/concepts.py +0 -0
  56. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/core/entities/episodes.py +0 -0
  57. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/core/entities/evidence.py +0 -0
  58. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/core/entities/guidance.py +0 -0
  59. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/core/entities/identity.py +0 -0
  60. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/core/entities/ids.py +0 -0
  61. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/core/entities/inner_agents.py +0 -0
  62. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/core/entities/knowledge_builder.py +0 -0
  63. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/core/entities/machine_config.py +0 -0
  64. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/core/entities/memories.py +0 -0
  65. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/core/entities/runtime_context.py +0 -0
  66. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/core/entities/scenarios.py +0 -0
  67. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/core/entities/session_state.py +0 -0
  68. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/core/entities/settings.py +0 -0
  69. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/core/entities/structural_memory_relations.py +0 -0
  70. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/core/entities/utility.py +0 -0
  71. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/core/errors.py +0 -0
  72. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/core/policies/__init__.py +0 -0
  73. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/core/policies/concepts/__init__.py +0 -0
  74. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/core/policies/concepts/relation_rules.py +0 -0
  75. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/core/policies/concepts/search_text.py +0 -0
  76. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/core/policies/episodes/__init__.py +0 -0
  77. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/core/policies/episodes/event_content.py +0 -0
  78. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/core/policies/episodes/knowledge_building.py +0 -0
  79. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/core/policies/memories/__init__.py +0 -0
  80. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/core/policies/memories/add_plan.py +0 -0
  81. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/core/policies/memories/link_rules.py +0 -0
  82. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/core/policies/memories/update_plan.py +0 -0
  83. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/core/policies/retrieval/__init__.py +0 -0
  84. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/core/policies/retrieval/bm25.py +0 -0
  85. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/core/policies/retrieval/context_pack.py +0 -0
  86. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/core/policies/retrieval/expansion.py +0 -0
  87. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/core/policies/retrieval/fusion_rrf.py +0 -0
  88. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/core/policies/retrieval/lexical_query.py +0 -0
  89. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/core/policies/retrieval/ontology_semantics.py +0 -0
  90. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/core/policies/retrieval/scoring.py +0 -0
  91. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/core/ports/__init__.py +0 -0
  92. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/core/ports/db/__init__.py +0 -0
  93. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/core/ports/db/concept_repositories.py +0 -0
  94. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/core/ports/db/episode_repositories.py +0 -0
  95. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/core/ports/db/guidance.py +0 -0
  96. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/core/ports/db/knowledge_builder.py +0 -0
  97. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/core/ports/db/memory_repositories.py +0 -0
  98. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/core/ports/db/problem_runs.py +0 -0
  99. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/core/ports/db/retrieval_repositories.py +0 -0
  100. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/core/ports/embeddings/__init__.py +0 -0
  101. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/core/ports/embeddings/provider.py +0 -0
  102. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/core/ports/embeddings/retrieval.py +0 -0
  103. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/core/ports/host_apps/__init__.py +0 -0
  104. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/core/ports/host_apps/inner_agents.py +0 -0
  105. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/core/ports/local_state/__init__.py +0 -0
  106. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/core/ports/local_state/session_state_store.py +0 -0
  107. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/core/ports/reporting/__init__.py +0 -0
  108. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/core/ports/reporting/metrics.py +0 -0
  109. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/core/ports/system/__init__.py +0 -0
  110. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/core/ports/system/clock.py +0 -0
  111. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/core/ports/system/idgen.py +0 -0
  112. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/core/use_cases/__init__.py +0 -0
  113. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/core/use_cases/admin/__init__.py +0 -0
  114. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/core/use_cases/admin/analytics_diagnostics.py +0 -0
  115. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/core/use_cases/admin/backfill_model_usage/__init__.py +0 -0
  116. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/core/use_cases/admin/backfill_model_usage/backfill_model_usage.py +0 -0
  117. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/core/use_cases/admin/backfill_model_usage/request.py +0 -0
  118. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/core/use_cases/admin/backfill_model_usage/result.py +0 -0
  119. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/core/use_cases/admin/create_backup.py +0 -0
  120. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/core/use_cases/admin/diagnose_runtime.py +0 -0
  121. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/core/use_cases/admin/generate_analytics_report.py +0 -0
  122. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/core/use_cases/admin/initialize_runtime.py +0 -0
  123. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/core/use_cases/admin/restore_backup.py +0 -0
  124. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/core/use_cases/admin/verify_backup.py +0 -0
  125. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/core/use_cases/build_guidance.py +0 -0
  126. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/core/use_cases/concepts/__init__.py +0 -0
  127. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/core/use_cases/concepts/add/__init__.py +0 -0
  128. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/core/use_cases/concepts/add/execute.py +0 -0
  129. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/core/use_cases/concepts/add/request.py +0 -0
  130. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/core/use_cases/concepts/add/result.py +0 -0
  131. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/core/use_cases/concepts/containment_checks.py +0 -0
  132. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/core/use_cases/concepts/embeddings.py +0 -0
  133. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/core/use_cases/concepts/reference_checks.py +0 -0
  134. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/core/use_cases/concepts/show/__init__.py +0 -0
  135. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/core/use_cases/concepts/show/execute.py +0 -0
  136. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/core/use_cases/concepts/show/request.py +0 -0
  137. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/core/use_cases/concepts/show/result.py +0 -0
  138. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/core/use_cases/concepts/update/__init__.py +0 -0
  139. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/core/use_cases/concepts/update/execute.py +0 -0
  140. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/core/use_cases/concepts/update/request.py +0 -0
  141. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/core/use_cases/concepts/update/result.py +0 -0
  142. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/core/use_cases/concepts/views.py +0 -0
  143. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/core/use_cases/episodes/__init__.py +0 -0
  144. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/core/use_cases/episodes/events/__init__.py +0 -0
  145. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/core/use_cases/episodes/events/request.py +0 -0
  146. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/core/use_cases/episodes/sync_discovered_host_session.py +0 -0
  147. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/core/use_cases/episodes/sync_episode/__init__.py +0 -0
  148. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/core/use_cases/episodes/sync_episode/request.py +0 -0
  149. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/core/use_cases/episodes/sync_episode/result.py +0 -0
  150. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/core/use_cases/episodes/sync_episode/sync_episode.py +0 -0
  151. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/core/use_cases/knowledge_builder/__init__.py +0 -0
  152. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/core/use_cases/knowledge_builder/build_knowledge/__init__.py +0 -0
  153. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/core/use_cases/knowledge_builder/build_knowledge/execute.py +0 -0
  154. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/core/use_cases/knowledge_builder/build_knowledge/request.py +0 -0
  155. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/core/use_cases/knowledge_builder/build_knowledge/result.py +0 -0
  156. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/core/use_cases/knowledge_builder/teach_knowledge/__init__.py +0 -0
  157. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/core/use_cases/knowledge_builder/teach_knowledge/execute.py +0 -0
  158. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/core/use_cases/knowledge_builder/teach_knowledge/request.py +0 -0
  159. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/core/use_cases/knowledge_builder/teach_knowledge/result.py +0 -0
  160. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/core/use_cases/memories/__init__.py +0 -0
  161. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/core/use_cases/memories/add/__init__.py +0 -0
  162. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/core/use_cases/memories/add/execute.py +0 -0
  163. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/core/use_cases/memories/add/request.py +0 -0
  164. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/core/use_cases/memories/add/result.py +0 -0
  165. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/core/use_cases/memories/effect_plan.py +0 -0
  166. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/core/use_cases/memories/reference_checks.py +0 -0
  167. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/core/use_cases/memories/update/__init__.py +0 -0
  168. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/core/use_cases/memories/update/execute.py +0 -0
  169. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/core/use_cases/memories/update/request.py +0 -0
  170. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/core/use_cases/memories/update/result.py +0 -0
  171. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/core/use_cases/metrics/__init__.py +0 -0
  172. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/core/use_cases/metrics/analyze_agent_behavior.py +0 -0
  173. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/core/use_cases/metrics/build_snapshot.py +0 -0
  174. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/core/use_cases/metrics/generate_dashboard.py +0 -0
  175. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/core/use_cases/plan_execution.py +0 -0
  176. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/core/use_cases/retrieval/__init__.py +0 -0
  177. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/core/use_cases/retrieval/build_context/__init__.py +0 -0
  178. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/core/use_cases/retrieval/build_context/execute.py +0 -0
  179. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/core/use_cases/retrieval/concept_seed_retrieval.py +0 -0
  180. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/core/use_cases/retrieval/context_pack_pipeline.py +0 -0
  181. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/core/use_cases/retrieval/deterministic_graph_recall.py +0 -0
  182. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/core/use_cases/retrieval/expansion.py +0 -0
  183. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/core/use_cases/retrieval/read/__init__.py +0 -0
  184. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/core/use_cases/retrieval/read/execute.py +0 -0
  185. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/core/use_cases/retrieval/read/request.py +0 -0
  186. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/core/use_cases/retrieval/read/result.py +0 -0
  187. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/core/use_cases/retrieval/read_concepts.py +0 -0
  188. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/core/use_cases/retrieval/recall/__init__.py +0 -0
  189. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/core/use_cases/retrieval/recall/execute.py +0 -0
  190. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/core/use_cases/retrieval/recall/request.py +0 -0
  191. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/core/use_cases/retrieval/recall/result.py +0 -0
  192. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/core/use_cases/retrieval/seed_retrieval.py +0 -0
  193. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/core/use_cases/scenarios/__init__.py +0 -0
  194. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/core/use_cases/scenarios/record/__init__.py +0 -0
  195. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/core/use_cases/scenarios/record/request.py +0 -0
  196. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/entrypoints/__init__.py +0 -0
  197. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/entrypoints/cli/__init__.py +0 -0
  198. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/entrypoints/cli/error_responses.py +0 -0
  199. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/entrypoints/cli/handlers/__init__.py +0 -0
  200. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/entrypoints/cli/handlers/human/__init__.py +0 -0
  201. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/entrypoints/cli/handlers/human/admin.py +0 -0
  202. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/entrypoints/cli/handlers/human/admin_dependencies.py +0 -0
  203. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/entrypoints/cli/handlers/human/init.py +0 -0
  204. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/entrypoints/cli/handlers/human/metrics.py +0 -0
  205. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/entrypoints/cli/handlers/human/upgrade.py +0 -0
  206. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/entrypoints/cli/handlers/internal_agent/__init__.py +0 -0
  207. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/entrypoints/cli/handlers/internal_agent/concepts/__init__.py +0 -0
  208. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/entrypoints/cli/handlers/internal_agent/concepts/add.py +0 -0
  209. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/entrypoints/cli/handlers/internal_agent/concepts/show.py +0 -0
  210. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/entrypoints/cli/handlers/internal_agent/concepts/update.py +0 -0
  211. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/entrypoints/cli/handlers/internal_agent/episodes/__init__.py +0 -0
  212. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/entrypoints/cli/handlers/internal_agent/episodes/selection.py +0 -0
  213. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/entrypoints/cli/handlers/internal_agent/episodes/serialization.py +0 -0
  214. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/entrypoints/cli/handlers/internal_agent/memories/__init__.py +0 -0
  215. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/entrypoints/cli/handlers/internal_agent/memories/add.py +0 -0
  216. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/entrypoints/cli/handlers/internal_agent/memories/update.py +0 -0
  217. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/entrypoints/cli/handlers/internal_agent/memories/utility_vote_evidence.py +0 -0
  218. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/entrypoints/cli/handlers/internal_agent/retrieval/__init__.py +0 -0
  219. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/entrypoints/cli/handlers/internal_agent/retrieval/execution.py +0 -0
  220. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/entrypoints/cli/handlers/internal_agent/retrieval/read.py +0 -0
  221. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/entrypoints/cli/handlers/internal_agent/scenarios/__init__.py +0 -0
  222. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/entrypoints/cli/handlers/result_envelopes.py +0 -0
  223. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/entrypoints/cli/handlers/session_state.py +0 -0
  224. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/entrypoints/cli/handlers/working_agent/__init__.py +0 -0
  225. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/entrypoints/cli/handlers/working_agent/recall.py +0 -0
  226. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/entrypoints/cli/handlers/working_agent/teach.py +0 -0
  227. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/entrypoints/cli/main.py +0 -0
  228. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/entrypoints/cli/parser/__init__.py +0 -0
  229. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/entrypoints/cli/presenters/__init__.py +0 -0
  230. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/entrypoints/cli/presenters/init.py +0 -0
  231. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/entrypoints/cli/presenters/json.py +0 -0
  232. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/entrypoints/cli/presenters/metrics.py +0 -0
  233. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/entrypoints/cli/request_parsing/__init__.py +0 -0
  234. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/entrypoints/cli/request_parsing/concepts.py +0 -0
  235. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/entrypoints/cli/request_parsing/episodes.py +0 -0
  236. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/entrypoints/cli/request_parsing/hydration.py +0 -0
  237. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/entrypoints/cli/request_parsing/memories.py +0 -0
  238. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/entrypoints/cli/request_parsing/payload_validation.py +0 -0
  239. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/entrypoints/cli/request_parsing/prepared.py +0 -0
  240. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/entrypoints/cli/request_parsing/retrieval.py +0 -0
  241. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/entrypoints/cli/request_parsing/scenarios.py +0 -0
  242. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/entrypoints/cli/request_parsing/teach.py +0 -0
  243. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/entrypoints/host_hooks/__init__.py +0 -0
  244. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/entrypoints/host_hooks/claude_session_start.py +0 -0
  245. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/entrypoints/host_hooks/cursor_statusline.py +0 -0
  246. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/entrypoints/jobs/__init__.py +0 -0
  247. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/entrypoints/jobs/episode_sync.py +0 -0
  248. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/infrastructure/__init__.py +0 -0
  249. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/infrastructure/db/__init__.py +0 -0
  250. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/infrastructure/db/admin/__init__.py +0 -0
  251. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/infrastructure/db/admin/app_role_safety.py +0 -0
  252. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/infrastructure/db/admin/backups/__init__.py +0 -0
  253. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/infrastructure/db/admin/backups/destructive_guard.py +0 -0
  254. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/infrastructure/db/admin/backups/logical_backup.py +0 -0
  255. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/infrastructure/db/admin/backups/manifest_store.py +0 -0
  256. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/infrastructure/db/admin/backups/restore.py +0 -0
  257. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/infrastructure/db/admin/connection.py +0 -0
  258. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/infrastructure/db/admin/instance_guard.py +0 -0
  259. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/infrastructure/db/admin/migrations.py +0 -0
  260. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/infrastructure/db/admin/privileges.py +0 -0
  261. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/infrastructure/db/admin/provisioning/__init__.py +0 -0
  262. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/infrastructure/db/admin/provisioning/docker_prerequisites.py +0 -0
  263. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/infrastructure/db/admin/provisioning/external_postgres.py +0 -0
  264. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/infrastructure/db/admin/provisioning/init_effects.py +0 -0
  265. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/infrastructure/db/admin/provisioning/managed_local.py +0 -0
  266. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/infrastructure/db/admin/storage_setup.py +0 -0
  267. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/infrastructure/db/runtime/__init__.py +0 -0
  268. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/infrastructure/db/runtime/engine.py +0 -0
  269. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/infrastructure/db/runtime/models/__init__.py +0 -0
  270. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/infrastructure/db/runtime/models/associations.py +0 -0
  271. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/infrastructure/db/runtime/models/concepts.py +0 -0
  272. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/infrastructure/db/runtime/models/episodes.py +0 -0
  273. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/infrastructure/db/runtime/models/evidence.py +0 -0
  274. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/infrastructure/db/runtime/models/experiences.py +0 -0
  275. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/infrastructure/db/runtime/models/instance_metadata.py +0 -0
  276. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/infrastructure/db/runtime/models/knowledge_builder.py +0 -0
  277. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/infrastructure/db/runtime/models/memories.py +0 -0
  278. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/infrastructure/db/runtime/models/metadata.py +0 -0
  279. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/infrastructure/db/runtime/models/problem_runs.py +0 -0
  280. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/infrastructure/db/runtime/models/telemetry.py +0 -0
  281. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/infrastructure/db/runtime/models/utility.py +0 -0
  282. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/infrastructure/db/runtime/models/views.py +0 -0
  283. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/infrastructure/db/runtime/queries/__init__.py +0 -0
  284. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/infrastructure/db/runtime/queries/agent_behavior.py +0 -0
  285. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/infrastructure/db/runtime/queries/analytics.py +0 -0
  286. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/infrastructure/db/runtime/queries/metrics.py +0 -0
  287. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/infrastructure/db/runtime/queries/metrics_adapter.py +0 -0
  288. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/infrastructure/db/runtime/queries/model_usage_backfill.py +0 -0
  289. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/infrastructure/db/runtime/repos/__init__.py +0 -0
  290. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/infrastructure/db/runtime/repos/relational/__init__.py +0 -0
  291. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/infrastructure/db/runtime/repos/relational/associations_repo.py +0 -0
  292. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/infrastructure/db/runtime/repos/relational/concepts_repo.py +0 -0
  293. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/infrastructure/db/runtime/repos/relational/episodes_repo.py +0 -0
  294. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/infrastructure/db/runtime/repos/relational/evidence_repo.py +0 -0
  295. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/infrastructure/db/runtime/repos/relational/experiences_repo.py +0 -0
  296. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/infrastructure/db/runtime/repos/relational/knowledge_builder_repo.py +0 -0
  297. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/infrastructure/db/runtime/repos/relational/memories_repo.py +0 -0
  298. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/infrastructure/db/runtime/repos/relational/problem_runs_repo.py +0 -0
  299. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/infrastructure/db/runtime/repos/relational/read_policy_repo.py +0 -0
  300. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/infrastructure/db/runtime/repos/relational/telemetry_repo.py +0 -0
  301. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/infrastructure/db/runtime/repos/relational/utility_repo.py +0 -0
  302. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/infrastructure/db/runtime/repos/semantic/__init__.py +0 -0
  303. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/infrastructure/db/runtime/repos/semantic/concept_retrieval_repo.py +0 -0
  304. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/infrastructure/db/runtime/repos/semantic/keyword_retrieval_repo.py +0 -0
  305. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/infrastructure/db/runtime/repos/semantic/semantic_retrieval_repo.py +0 -0
  306. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/infrastructure/db/runtime/session.py +0 -0
  307. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/infrastructure/embeddings/__init__.py +0 -0
  308. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/infrastructure/embeddings/local_provider.py +0 -0
  309. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/infrastructure/embeddings/prewarm.py +0 -0
  310. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/infrastructure/embeddings/query_vector_search.py +0 -0
  311. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/infrastructure/host_apps/__init__.py +0 -0
  312. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/infrastructure/host_apps/assets/__init__.py +0 -0
  313. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/infrastructure/host_apps/assets/claude.py +0 -0
  314. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/infrastructure/host_apps/assets/codex.py +0 -0
  315. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/infrastructure/host_apps/assets/cursor.py +0 -0
  316. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/infrastructure/host_apps/assets/cursor_statusline_config.py +0 -0
  317. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/infrastructure/host_apps/assets/inspection.py +0 -0
  318. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/infrastructure/host_apps/assets/managed_markdown.py +0 -0
  319. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/infrastructure/host_apps/assets/managed_tree.py +0 -0
  320. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/infrastructure/host_apps/assets/packaged_assets.py +0 -0
  321. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/infrastructure/host_apps/assets/paths.py +0 -0
  322. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/infrastructure/host_apps/assets/service.py +0 -0
  323. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/infrastructure/host_apps/assets/types.py +0 -0
  324. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/infrastructure/host_apps/identity/__init__.py +0 -0
  325. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/infrastructure/host_apps/identity/claude_hook_install.py +0 -0
  326. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/infrastructure/host_apps/identity/claude_runtime.py +0 -0
  327. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/infrastructure/host_apps/identity/codex_runtime.py +0 -0
  328. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/infrastructure/host_apps/identity/compatibility.py +0 -0
  329. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/infrastructure/host_apps/identity/cursor_statusline.py +0 -0
  330. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/infrastructure/host_apps/identity/resolver.py +0 -0
  331. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/infrastructure/host_apps/inner_agents/__init__.py +0 -0
  332. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/infrastructure/host_apps/inner_agents/codex_cli.py +0 -0
  333. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/infrastructure/host_apps/inner_agents/output_parser.py +0 -0
  334. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/infrastructure/host_apps/transcripts/__init__.py +0 -0
  335. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/infrastructure/host_apps/transcripts/claude_code.py +0 -0
  336. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/infrastructure/host_apps/transcripts/codex.py +0 -0
  337. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/infrastructure/host_apps/transcripts/cursor.py +0 -0
  338. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/infrastructure/host_apps/transcripts/model_usage.py +0 -0
  339. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/infrastructure/host_apps/transcripts/normalization.py +0 -0
  340. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/infrastructure/host_apps/transcripts/session_selection.py +0 -0
  341. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/infrastructure/host_apps/transcripts/source_discovery.py +0 -0
  342. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/infrastructure/host_apps/transcripts/tool_filter.py +0 -0
  343. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/infrastructure/local_state/__init__.py +0 -0
  344. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/infrastructure/local_state/init_lock.py +0 -0
  345. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/infrastructure/local_state/machine_config_store.py +0 -0
  346. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/infrastructure/local_state/operation_registration.py +0 -0
  347. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/infrastructure/local_state/paths.py +0 -0
  348. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/infrastructure/local_state/repo_registration_store.py +0 -0
  349. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/infrastructure/local_state/session_state_file_store.py +0 -0
  350. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/infrastructure/process/__init__.py +0 -0
  351. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/infrastructure/process/episode_sync/__init__.py +0 -0
  352. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/infrastructure/process/episode_sync/autostart.py +0 -0
  353. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/infrastructure/process/episode_sync/launcher.py +0 -0
  354. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/infrastructure/process/episode_sync/lock_file.py +0 -0
  355. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/infrastructure/process/episode_sync/poller.py +0 -0
  356. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/infrastructure/process/episode_sync/status_store.py +0 -0
  357. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/infrastructure/reporting/__init__.py +0 -0
  358. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/infrastructure/reporting/metrics/__init__.py +0 -0
  359. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/infrastructure/reporting/metrics/artifacts.py +0 -0
  360. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/infrastructure/reporting/metrics/browser.py +0 -0
  361. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/infrastructure/reporting/metrics/pager.py +0 -0
  362. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/infrastructure/reporting/metrics/render_html.py +0 -0
  363. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/infrastructure/system/__init__.py +0 -0
  364. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/infrastructure/system/clock.py +0 -0
  365. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/infrastructure/system/id_generator.py +0 -0
  366. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/infrastructure/system/package_upgrade.py +0 -0
  367. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/infrastructure/telemetry/__init__.py +0 -0
  368. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/infrastructure/telemetry/inner_agent_records.py +0 -0
  369. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/infrastructure/telemetry/operation_invocations.py +0 -0
  370. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/infrastructure/telemetry/operation_polling.py +0 -0
  371. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/infrastructure/telemetry/read_records.py +0 -0
  372. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/infrastructure/telemetry/recall_records.py +0 -0
  373. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/infrastructure/telemetry/recorder.py +0 -0
  374. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/infrastructure/telemetry/records.py +0 -0
  375. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/infrastructure/telemetry/sink.py +0 -0
  376. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/infrastructure/telemetry/storage_protocols.py +0 -0
  377. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/infrastructure/telemetry/sync_records.py +0 -0
  378. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/infrastructure/telemetry/write_records.py +0 -0
  379. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/settings/__init__.py +0 -0
  380. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/settings/defaults/create_policy.yaml +0 -0
  381. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/settings/defaults/read_policy.yaml +0 -0
  382. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/settings/defaults/runtime.yaml +0 -0
  383. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/settings/defaults/thresholds.yaml +0 -0
  384. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/settings/defaults/update_policy.yaml +0 -0
  385. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/settings/internal-agents/defaults.yaml +0 -0
  386. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/startup/__init__.py +0 -0
  387. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/startup/admin.py +0 -0
  388. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/startup/admin_db.py +0 -0
  389. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/startup/admin_dependencies.py +0 -0
  390. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/startup/admin_diagnose.py +0 -0
  391. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/startup/analytics.py +0 -0
  392. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/startup/backup.py +0 -0
  393. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/startup/config.py +0 -0
  394. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/startup/create_policy.py +0 -0
  395. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/startup/db.py +0 -0
  396. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/startup/dsn_resolution.py +0 -0
  397. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/startup/embeddings.py +0 -0
  398. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/startup/episode_poller.py +0 -0
  399. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/startup/episode_sync_launcher.py +0 -0
  400. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/startup/host_hooks.py +0 -0
  401. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/startup/internal_agent_config.py +0 -0
  402. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/startup/internal_agents.py +0 -0
  403. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/startup/knowledge_builder.py +0 -0
  404. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/startup/metrics.py +0 -0
  405. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/startup/migrations.py +0 -0
  406. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/startup/model_usage_backfill.py +0 -0
  407. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/startup/read_policy.py +0 -0
  408. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/startup/repo_context.py +0 -0
  409. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/startup/repos.py +0 -0
  410. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/startup/retrieval.py +0 -0
  411. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/startup/runtime_admin.py +0 -0
  412. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/startup/runtime_context.py +0 -0
  413. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/startup/settings.py +0 -0
  414. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/startup/thresholds.py +0 -0
  415. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/startup/update_policy.py +0 -0
  416. {shellbrain-0.1.36 → shellbrain-0.1.37}/app/startup/use_cases.py +0 -0
  417. {shellbrain-0.1.36 → shellbrain-0.1.37}/migrations/__init__.py +0 -0
  418. {shellbrain-0.1.36 → shellbrain-0.1.37}/migrations/_legacy_usage_views.py +0 -0
  419. {shellbrain-0.1.36 → shellbrain-0.1.37}/migrations/_usage_view_sql.py +0 -0
  420. {shellbrain-0.1.36 → shellbrain-0.1.37}/migrations/env.py +0 -0
  421. {shellbrain-0.1.36 → shellbrain-0.1.37}/migrations/versions/20260226_0001_initial_schema.py +0 -0
  422. {shellbrain-0.1.36 → shellbrain-0.1.37}/migrations/versions/20260312_0002_add_hard_invariants.py +0 -0
  423. {shellbrain-0.1.36 → shellbrain-0.1.37}/migrations/versions/20260312_0003_drop_create_confidence.py +0 -0
  424. {shellbrain-0.1.36 → shellbrain-0.1.37}/migrations/versions/20260313_0004_episode_sync_hardening.py +0 -0
  425. {shellbrain-0.1.36 → shellbrain-0.1.37}/migrations/versions/20260313_0005_evidence_episode_event_refs.py +0 -0
  426. {shellbrain-0.1.36 → shellbrain-0.1.37}/migrations/versions/20260318_0006_usage_telemetry_schema.py +0 -0
  427. {shellbrain-0.1.36 → shellbrain-0.1.37}/migrations/versions/20260319_0007_identity_session_guidance.py +0 -0
  428. {shellbrain-0.1.36 → shellbrain-0.1.37}/migrations/versions/20260320_0008_instance_metadata_and_backup_safety.py +0 -0
  429. {shellbrain-0.1.36 → shellbrain-0.1.37}/migrations/versions/20260410_0009_frontier_memory_family.py +0 -0
  430. {shellbrain-0.1.36 → shellbrain-0.1.37}/migrations/versions/20260414_0010_model_usage_telemetry.py +0 -0
  431. {shellbrain-0.1.36 → shellbrain-0.1.37}/migrations/versions/20260414_0011_usage_problem_tokens_multi_solution_metrics.py +0 -0
  432. {shellbrain-0.1.36 → shellbrain-0.1.37}/migrations/versions/20260415_0012_read_pack_cost_and_read_roi.py +0 -0
  433. {shellbrain-0.1.36 → shellbrain-0.1.37}/migrations/versions/20260421_0013_concept_context_graph.py +0 -0
  434. {shellbrain-0.1.36 → shellbrain-0.1.37}/migrations/versions/20260422_0014_concept_read_telemetry.py +0 -0
  435. {shellbrain-0.1.36 → shellbrain-0.1.37}/migrations/versions/20260422_0015_problem_runs.py +0 -0
  436. {shellbrain-0.1.36 → shellbrain-0.1.37}/migrations/versions/20260508_0016_recall_telemetry.py +0 -0
  437. {shellbrain-0.1.36 → shellbrain-0.1.37}/migrations/versions/20260511_0017_inner_agent_invocations.py +0 -0
  438. {shellbrain-0.1.36 → shellbrain-0.1.37}/migrations/versions/20260513_0018_knowledge_build_runs.py +0 -0
  439. {shellbrain-0.1.36 → shellbrain-0.1.37}/migrations/versions/20260515_0019_scenario_records.py +0 -0
  440. {shellbrain-0.1.36 → shellbrain-0.1.37}/migrations/versions/20260516_0020_knowledge_build_observability.py +0 -0
  441. {shellbrain-0.1.36 → shellbrain-0.1.37}/migrations/versions/20260519_0021_knowledge_build_watermark_stable.py +0 -0
  442. {shellbrain-0.1.36 → shellbrain-0.1.37}/migrations/versions/20260519_0022_update_evidence_links.py +0 -0
  443. {shellbrain-0.1.36 → shellbrain-0.1.37}/migrations/versions/20260519_0023_explicit_teach_trigger.py +0 -0
  444. {shellbrain-0.1.36 → shellbrain-0.1.37}/migrations/versions/20260519_0024_read_retrieval_latency_indexes.py +0 -0
  445. {shellbrain-0.1.36 → shellbrain-0.1.37}/migrations/versions/20260519_0025_repair_recall_source_input_section_constraint.py +0 -0
  446. {shellbrain-0.1.36 → shellbrain-0.1.37}/migrations/versions/20260519_0026_repair_knowledge_build_trigger_constraint.py +0 -0
  447. {shellbrain-0.1.36 → shellbrain-0.1.37}/migrations/versions/20260519_0027_concept_embeddings.py +0 -0
  448. {shellbrain-0.1.36 → shellbrain-0.1.37}/migrations/versions/20260520_0028_knowledge_build_lifecycle.py +0 -0
  449. {shellbrain-0.1.36 → shellbrain-0.1.37}/migrations/versions/20260522_0029_remove_frontier_and_memory_anchors.py +0 -0
  450. {shellbrain-0.1.36 → shellbrain-0.1.37}/migrations/versions/20260522_0030_concept_lifecycle_events.py +0 -0
  451. {shellbrain-0.1.36 → shellbrain-0.1.37}/migrations/versions/20260522_0031_unified_evidence_storage.py +0 -0
  452. {shellbrain-0.1.36 → shellbrain-0.1.37}/migrations/versions/20260522_0032_memory_lifecycle_events.py +0 -0
  453. {shellbrain-0.1.36 → shellbrain-0.1.37}/migrations/versions/20260522_0033_concept_memory_role_cleanup.py +0 -0
  454. {shellbrain-0.1.36 → shellbrain-0.1.37}/migrations/versions/20260522_0034_structural_memory_relations.py +0 -0
  455. {shellbrain-0.1.36 → shellbrain-0.1.37}/migrations/versions/20260522_0035_retire_legacy_compatibility_tables.py +0 -0
  456. {shellbrain-0.1.36 → shellbrain-0.1.37}/migrations/versions/__init__.py +0 -0
  457. {shellbrain-0.1.36 → shellbrain-0.1.37}/onboarding_assets/__init__.py +0 -0
  458. {shellbrain-0.1.36 → shellbrain-0.1.37}/onboarding_assets/claude/skills/shellbrain-usage-review/SKILL.md +0 -0
  459. {shellbrain-0.1.36 → shellbrain-0.1.37}/onboarding_assets/codex/clean-architecture/SKILL.md +0 -0
  460. {shellbrain-0.1.36 → shellbrain-0.1.37}/onboarding_assets/codex/clean-code/SKILL.md +0 -0
  461. {shellbrain-0.1.36 → shellbrain-0.1.37}/onboarding_assets/codex/shellbrain/agents/openai.yaml +0 -0
  462. {shellbrain-0.1.36 → shellbrain-0.1.37}/onboarding_assets/codex/shellbrain/assets/shellbrain-large.svg +0 -0
  463. {shellbrain-0.1.36 → shellbrain-0.1.37}/onboarding_assets/codex/shellbrain/assets/shellbrain-small.svg +0 -0
  464. {shellbrain-0.1.36 → shellbrain-0.1.37}/onboarding_assets/codex/shellbrain/assets/shellbrain_logo.png +0 -0
  465. {shellbrain-0.1.36 → shellbrain-0.1.37}/onboarding_assets/codex/shellbrain-usage-review/SKILL.md +0 -0
  466. {shellbrain-0.1.36 → shellbrain-0.1.37}/onboarding_assets/codex/shellbrain-usage-review/agents/openai.yaml +0 -0
  467. {shellbrain-0.1.36 → shellbrain-0.1.37}/onboarding_assets/codex/shellbrain-usage-review/assets/shellbrain-small.svg +0 -0
  468. {shellbrain-0.1.36 → shellbrain-0.1.37}/onboarding_assets/codex/shellbrain-usage-review/assets/shellbrain_logo.png +0 -0
  469. {shellbrain-0.1.36 → shellbrain-0.1.37}/onboarding_assets/cursor/skills/shellbrain-usage-review/SKILL.md +0 -0
  470. {shellbrain-0.1.36 → shellbrain-0.1.37}/setup.cfg +0 -0
  471. {shellbrain-0.1.36 → shellbrain-0.1.37}/shellbrain.egg-info/dependency_links.txt +0 -0
  472. {shellbrain-0.1.36 → shellbrain-0.1.37}/shellbrain.egg-info/entry_points.txt +0 -0
  473. {shellbrain-0.1.36 → shellbrain-0.1.37}/shellbrain.egg-info/requires.txt +0 -0
  474. {shellbrain-0.1.36 → shellbrain-0.1.37}/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.36
3
+ Version: 0.1.37
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
@@ -57,7 +57,7 @@ Episodic, empirical, conceptual. Three categories, one retrieval surface.
57
57
  - An ontology of problems, solutions, failed tactics, facts, preferences, changes.
58
58
  - This is **case-based reasoning** in a semantic graph.
59
59
 
60
- **Conceptual konwledge** is the _abstractive_ layer.
60
+ **Conceptual knowledge** is the _abstractive_ layer.
61
61
  - A **higher-level concept graph** with claims, relations, and implementations that link back to the concrete layer.
62
62
  - **Progressive disclosure.** agents get oriented first, then ask for depth only where tasks require it.
63
63
 
@@ -72,7 +72,37 @@ The episodic layer is truth. Empirical memory extracts. Concept memory abstracts
72
72
  **Working agents call `shellbrain recall`.** That is the normal interface they have to think about. One command, **one _carefully curated_ compact brief**, with sources cited.
73
73
 
74
74
  ```bash
75
- shellbrain recall --json '{"query":"what context matters for this migration lock timeout?","current_problem":{"goal":"fix the migration hang","surface":"db admin","obstacle":"lock timeout","hypothesis":"none yet"}}'
75
+ shellbrain recall --json '{"query":"What is ShellBrain and how does it help a working coding agent?","current_problem":{"goal":"understand ShellBrain","surface":"README","obstacle":"new readers do not know the product yet","hypothesis":"a real recall brief should show what agents get back"}}'
76
+ ```
77
+
78
+ Response shape:
79
+
80
+ ```json
81
+ {
82
+ "status": "ok",
83
+ "data": {
84
+ "brief": {
85
+ "summary": "...",
86
+ "constraints": ["..."],
87
+ "known_traps": ["..."],
88
+ "prior_cases": ["..."],
89
+ "concept_orientation": ["..."],
90
+ "anchors": ["`README.md`"],
91
+ "conflicts": ["..."],
92
+ "gaps": ["..."],
93
+ "next_checks": ["..."],
94
+ "sources": [
95
+ {
96
+ "kind": "memory",
97
+ "id": "...",
98
+ "section": "direct"
99
+ }
100
+ ]
101
+ },
102
+ "fallback_reason": null
103
+ },
104
+ "errors": []
105
+ }
76
106
  ```
77
107
 
78
108
  **Working agents focus on only their work.**
@@ -113,8 +143,4 @@ Use Shellbrain in your agent of choice. Then, just work normally.
113
143
 
114
144
  - [shellbrain.ai/humans](https://shellbrain.ai/humans/) — install, upgrade, getting started
115
145
  - [shellbrain.ai/agents](https://shellbrain.ai/agents/) — agent workflow and write discipline
116
- - [shellbrain.ai/recall](https://shellbrain.ai/recall/) — retrieval pipeline
117
- - [shellbrain.ai/memory/episodic](https://shellbrain.ai/memory/episodic/) — transcript evidence
118
- - [shellbrain.ai/memory/semantic](https://shellbrain.ai/memory/semantic/) — facts, preferences, changes
119
- - [shellbrain.ai/memory/procedural](https://shellbrain.ai/memory/procedural/) — problems, solutions, failed tactics
120
- - [shellbrain.ai/memory/associative](https://shellbrain.ai/memory/associative/) — explicit links and semantic neighbors
146
+ - [shellbrain.ai/architecture](https://shellbrain.ai/architecture/) — memory model, storage, and boundaries
@@ -43,7 +43,7 @@ Episodic, empirical, conceptual. Three categories, one retrieval surface.
43
43
  - An ontology of problems, solutions, failed tactics, facts, preferences, changes.
44
44
  - This is **case-based reasoning** in a semantic graph.
45
45
 
46
- **Conceptual konwledge** is the _abstractive_ layer.
46
+ **Conceptual knowledge** is the _abstractive_ layer.
47
47
  - A **higher-level concept graph** with claims, relations, and implementations that link back to the concrete layer.
48
48
  - **Progressive disclosure.** agents get oriented first, then ask for depth only where tasks require it.
49
49
 
@@ -58,7 +58,37 @@ The episodic layer is truth. Empirical memory extracts. Concept memory abstracts
58
58
  **Working agents call `shellbrain recall`.** That is the normal interface they have to think about. One command, **one _carefully curated_ compact brief**, with sources cited.
59
59
 
60
60
  ```bash
61
- shellbrain recall --json '{"query":"what context matters for this migration lock timeout?","current_problem":{"goal":"fix the migration hang","surface":"db admin","obstacle":"lock timeout","hypothesis":"none yet"}}'
61
+ shellbrain recall --json '{"query":"What is ShellBrain and how does it help a working coding agent?","current_problem":{"goal":"understand ShellBrain","surface":"README","obstacle":"new readers do not know the product yet","hypothesis":"a real recall brief should show what agents get back"}}'
62
+ ```
63
+
64
+ Response shape:
65
+
66
+ ```json
67
+ {
68
+ "status": "ok",
69
+ "data": {
70
+ "brief": {
71
+ "summary": "...",
72
+ "constraints": ["..."],
73
+ "known_traps": ["..."],
74
+ "prior_cases": ["..."],
75
+ "concept_orientation": ["..."],
76
+ "anchors": ["`README.md`"],
77
+ "conflicts": ["..."],
78
+ "gaps": ["..."],
79
+ "next_checks": ["..."],
80
+ "sources": [
81
+ {
82
+ "kind": "memory",
83
+ "id": "...",
84
+ "section": "direct"
85
+ }
86
+ ]
87
+ },
88
+ "fallback_reason": null
89
+ },
90
+ "errors": []
91
+ }
62
92
  ```
63
93
 
64
94
  **Working agents focus on only their work.**
@@ -99,8 +129,4 @@ Use Shellbrain in your agent of choice. Then, just work normally.
99
129
 
100
130
  - [shellbrain.ai/humans](https://shellbrain.ai/humans/) — install, upgrade, getting started
101
131
  - [shellbrain.ai/agents](https://shellbrain.ai/agents/) — agent workflow and write discipline
102
- - [shellbrain.ai/recall](https://shellbrain.ai/recall/) — retrieval pipeline
103
- - [shellbrain.ai/memory/episodic](https://shellbrain.ai/memory/episodic/) — transcript evidence
104
- - [shellbrain.ai/memory/semantic](https://shellbrain.ai/memory/semantic/) — facts, preferences, changes
105
- - [shellbrain.ai/memory/procedural](https://shellbrain.ai/memory/procedural/) — problems, solutions, failed tactics
106
- - [shellbrain.ai/memory/associative](https://shellbrain.ai/memory/associative/) — explicit links and semantic neighbors
132
+ - [shellbrain.ai/architecture](https://shellbrain.ai/architecture/) — memory model, storage, and boundaries
@@ -0,0 +1,288 @@
1
+ """Entities for repo-local shadow snapshots and solution deltas."""
2
+
3
+ from __future__ import annotations
4
+
5
+ from dataclasses import dataclass
6
+ from datetime import datetime
7
+ from enum import Enum
8
+
9
+
10
+ class SnapshotCaptureStatus(str, Enum):
11
+ """Public result states for `shellbrain snapshot`."""
12
+
13
+ CREATED = "created"
14
+ NOOP = "noop"
15
+ BASELINE_ONLY = "baseline_only"
16
+
17
+
18
+ class ShadowSnapshotReason(str, Enum):
19
+ """Why one shadow snapshot row exists."""
20
+
21
+ BASELINE = "baseline"
22
+ CLOSEOUT = "closeout"
23
+ BASELINE_ONLY = "baseline_only"
24
+
25
+
26
+ class ShadowGitPathChangeStatus(str, Enum):
27
+ """Path-level change statuses reported by shadow Git diffs."""
28
+
29
+ ADDED = "added"
30
+ MODIFIED = "modified"
31
+ DELETED = "deleted"
32
+ RENAMED = "renamed"
33
+
34
+
35
+ class CodeDeltaContextStatus(str, Enum):
36
+ """Public availability states for code-delta context."""
37
+
38
+ AVAILABLE = "available"
39
+ UNAVAILABLE = "unavailable"
40
+
41
+
42
+ class CodeDeltaUnavailableReason(str, Enum):
43
+ """Expected reasons an event window cannot expose code-delta context."""
44
+
45
+ MISSING_BASE_SNAPSHOT = "missing_base_snapshot"
46
+ MISSING_FINAL_SNAPSHOT = "missing_final_snapshot"
47
+ BASE_AND_FINAL_SNAPSHOT_MATCH = "base_and_final_snapshot_match"
48
+ BASELINE_ONLY_BASE_SNAPSHOT = "baseline_only_base_snapshot"
49
+ BASELINE_ONLY_FINAL_SNAPSHOT = "baseline_only_final_snapshot"
50
+ EMPTY_DELTA = "empty_delta"
51
+
52
+
53
+ @dataclass(frozen=True, kw_only=True)
54
+ class ShadowGitPathChange:
55
+ """One path-level change between two shadow Git commits."""
56
+
57
+ status: ShadowGitPathChangeStatus
58
+ path: str
59
+ old_path: str | None = None
60
+
61
+ def __post_init__(self) -> None:
62
+ """Keep path-change status and rename metadata honest."""
63
+
64
+ if not isinstance(self.status, ShadowGitPathChangeStatus):
65
+ raise ValueError("status must be a ShadowGitPathChangeStatus")
66
+ if not isinstance(self.path, str) or not self.path.strip():
67
+ raise ValueError("path must be a non-empty string")
68
+ if self.status is ShadowGitPathChangeStatus.RENAMED:
69
+ if not isinstance(self.old_path, str) or not self.old_path.strip():
70
+ raise ValueError("old_path is required for renamed paths")
71
+ elif self.old_path is not None:
72
+ raise ValueError("old_path is valid only for renamed paths")
73
+
74
+ def to_response_data(self) -> dict[str, str]:
75
+ """Return the stable JSON payload for one path change."""
76
+
77
+ data = {"status": self.status.value, "path": self.path}
78
+ if self.old_path is not None:
79
+ data["old_path"] = self.old_path
80
+ return data
81
+
82
+
83
+ @dataclass(frozen=True, kw_only=True)
84
+ class ShadowSnapshot:
85
+ """One captured repo state stored in repo-local shadow Git."""
86
+
87
+ id: str
88
+ repo_id: str
89
+ repo_root: str
90
+ shadow_commit_sha: str
91
+ changed_paths: tuple[str, ...]
92
+ reason: ShadowSnapshotReason
93
+ parent_shadow_commit_sha: str | None = None
94
+ episode_id: str | None = None
95
+ captured_after_event_seq: int | None = None
96
+ operation_invocation_id: str | None = None
97
+ created_at: datetime | None = None
98
+
99
+ def __post_init__(self) -> None:
100
+ """Reject malformed snapshot identity before persistence."""
101
+
102
+ for field_name in ("id", "repo_id", "repo_root", "shadow_commit_sha"):
103
+ value = getattr(self, field_name)
104
+ if not isinstance(value, str) or not value.strip():
105
+ raise ValueError(f"{field_name} must be a non-empty string")
106
+ if not isinstance(self.reason, ShadowSnapshotReason):
107
+ raise ValueError("reason must be a ShadowSnapshotReason")
108
+ if (
109
+ self.captured_after_event_seq is not None
110
+ and self.captured_after_event_seq < 0
111
+ ):
112
+ raise ValueError("captured_after_event_seq must be non-negative")
113
+
114
+
115
+ @dataclass(frozen=True, kw_only=True)
116
+ class SolutionDelta:
117
+ """Patch identity linking one solved problem run to concrete code evidence."""
118
+
119
+ id: str
120
+ problem_run_id: str
121
+ repo_id: str
122
+ repo_root: str
123
+ base_snapshot_id: str
124
+ final_snapshot_id: str
125
+ patch_sha: str
126
+ changed_paths: tuple[str, ...]
127
+ episode_id: str | None = None
128
+ created_at: datetime | None = None
129
+
130
+ def __post_init__(self) -> None:
131
+ """Reject invalid delta identity before persistence."""
132
+
133
+ for field_name in (
134
+ "id",
135
+ "problem_run_id",
136
+ "repo_id",
137
+ "repo_root",
138
+ "base_snapshot_id",
139
+ "final_snapshot_id",
140
+ "patch_sha",
141
+ ):
142
+ value = getattr(self, field_name)
143
+ if not isinstance(value, str) or not value.strip():
144
+ raise ValueError(f"{field_name} must be a non-empty string")
145
+ if self.base_snapshot_id == self.final_snapshot_id:
146
+ raise ValueError("solution delta requires distinct snapshots")
147
+
148
+
149
+ @dataclass(frozen=True, kw_only=True)
150
+ class ShadowGitCaptureRequest:
151
+ """Core request passed to the shadow Git storage port."""
152
+
153
+ snapshot_id: str
154
+ repo_id: str
155
+ repo_root: str
156
+ reason: ShadowSnapshotReason
157
+ episode_id: str | None = None
158
+ captured_after_event_seq: int | None = None
159
+ operation_invocation_id: str | None = None
160
+
161
+
162
+ class ShadowGitCaptureState(str, Enum):
163
+ """Storage-level capture result states."""
164
+
165
+ CREATED = "created"
166
+ NOOP = "noop"
167
+
168
+
169
+ @dataclass(frozen=True, kw_only=True)
170
+ class ShadowGitCaptureResult:
171
+ """Result returned by the shadow Git storage port."""
172
+
173
+ state: ShadowGitCaptureState
174
+ shadow_commit_sha: str | None
175
+ parent_shadow_commit_sha: str | None
176
+ changed_paths: tuple[str, ...]
177
+ tree_sha: str | None = None
178
+
179
+
180
+ @dataclass(frozen=True, kw_only=True)
181
+ class ShadowGitDiffResult:
182
+ """Patch identity returned by the shadow Git storage port."""
183
+
184
+ patch_sha: str
185
+ path_changes: tuple[ShadowGitPathChange, ...]
186
+
187
+ def __post_init__(self) -> None:
188
+ """Reject malformed patch identity before core code trusts it."""
189
+
190
+ if not isinstance(self.patch_sha, str) or not self.patch_sha.strip():
191
+ raise ValueError("patch_sha must be a non-empty string")
192
+ for change in self.path_changes:
193
+ if not isinstance(change, ShadowGitPathChange):
194
+ raise ValueError(
195
+ "path_changes must contain ShadowGitPathChange values"
196
+ )
197
+
198
+ @property
199
+ def changed_paths(self) -> tuple[str, ...]:
200
+ """Return changed final paths for existing callers and public payloads."""
201
+
202
+ return tuple(change.path for change in self.path_changes)
203
+
204
+
205
+ @dataclass(frozen=True, kw_only=True)
206
+ class AvailableCodeDeltaContext:
207
+ """Compact code-delta evidence for one bounded event window."""
208
+
209
+ base_snapshot_id: str
210
+ final_snapshot_id: str
211
+ base_shadow_commit_sha: str
212
+ final_shadow_commit_sha: str
213
+ patch_sha: str
214
+ path_changes: tuple[ShadowGitPathChange, ...]
215
+ status: CodeDeltaContextStatus = CodeDeltaContextStatus.AVAILABLE
216
+
217
+ def __post_init__(self) -> None:
218
+ """Reject invalid available-context states."""
219
+
220
+ if self.status is not CodeDeltaContextStatus.AVAILABLE:
221
+ raise ValueError("available code delta context requires available status")
222
+ for field_name in (
223
+ "base_snapshot_id",
224
+ "final_snapshot_id",
225
+ "base_shadow_commit_sha",
226
+ "final_shadow_commit_sha",
227
+ "patch_sha",
228
+ ):
229
+ value = getattr(self, field_name)
230
+ if not isinstance(value, str) or not value.strip():
231
+ raise ValueError(f"{field_name} must be a non-empty string")
232
+ if self.base_snapshot_id == self.final_snapshot_id:
233
+ raise ValueError("code delta context requires distinct snapshots")
234
+ if not self.path_changes:
235
+ raise ValueError("available code delta context requires path changes")
236
+ for change in self.path_changes:
237
+ if not isinstance(change, ShadowGitPathChange):
238
+ raise ValueError(
239
+ "path_changes must contain ShadowGitPathChange values"
240
+ )
241
+
242
+ @property
243
+ def changed_paths(self) -> tuple[str, ...]:
244
+ """Return changed final paths for compact consumers."""
245
+
246
+ return tuple(change.path for change in self.path_changes)
247
+
248
+ def to_response_data(self) -> dict[str, object]:
249
+ """Return the stable JSON payload for bounded events."""
250
+
251
+ return {
252
+ "status": self.status.value,
253
+ "base_snapshot_id": self.base_snapshot_id,
254
+ "final_snapshot_id": self.final_snapshot_id,
255
+ "base_shadow_commit_sha": self.base_shadow_commit_sha,
256
+ "final_shadow_commit_sha": self.final_shadow_commit_sha,
257
+ "patch_sha": self.patch_sha,
258
+ "path_changes": [
259
+ change.to_response_data() for change in self.path_changes
260
+ ],
261
+ "changed_paths": list(self.changed_paths),
262
+ }
263
+
264
+
265
+ @dataclass(frozen=True, kw_only=True)
266
+ class UnavailableCodeDeltaContext:
267
+ """Expected absence of code-delta evidence for one event window."""
268
+
269
+ reason: CodeDeltaUnavailableReason
270
+ status: CodeDeltaContextStatus = CodeDeltaContextStatus.UNAVAILABLE
271
+
272
+ def __post_init__(self) -> None:
273
+ """Reject unavailable-context states without a typed reason."""
274
+
275
+ if self.status is not CodeDeltaContextStatus.UNAVAILABLE:
276
+ raise ValueError(
277
+ "unavailable code delta context requires unavailable status"
278
+ )
279
+ if not isinstance(self.reason, CodeDeltaUnavailableReason):
280
+ raise ValueError("reason must be a CodeDeltaUnavailableReason")
281
+
282
+ def to_response_data(self) -> dict[str, str]:
283
+ """Return the stable JSON payload for bounded events."""
284
+
285
+ return {"status": self.status.value, "reason": self.reason.value}
286
+
287
+
288
+ CodeDeltaContext = AvailableCodeDeltaContext | UnavailableCodeDeltaContext
@@ -0,0 +1,52 @@
1
+ """Persistence ports for shadow snapshots and solution deltas."""
2
+
3
+ from __future__ import annotations
4
+
5
+ from abc import ABC, abstractmethod
6
+
7
+ from app.core.entities.snapshots import ShadowSnapshot, SolutionDelta
8
+
9
+
10
+ class ISnapshotsRepo(ABC):
11
+ """Persistence behavior for code-evidence snapshots."""
12
+
13
+ @abstractmethod
14
+ def latest_snapshot(self, *, repo_id: str, repo_root: str) -> ShadowSnapshot | None:
15
+ """Return the newest shadow snapshot for one repo root."""
16
+
17
+ @abstractmethod
18
+ def latest_snapshot_at_or_before_event(
19
+ self,
20
+ *,
21
+ repo_id: str,
22
+ repo_root: str,
23
+ episode_id: str,
24
+ event_seq: int,
25
+ ) -> ShadowSnapshot | None:
26
+ """Return the latest valid base snapshot for an episode event boundary."""
27
+
28
+ @abstractmethod
29
+ def latest_snapshot_in_event_window(
30
+ self,
31
+ *,
32
+ repo_id: str,
33
+ repo_root: str,
34
+ episode_id: str,
35
+ opened_event_seq: int,
36
+ closed_event_seq: int,
37
+ ) -> ShadowSnapshot | None:
38
+ """Return the latest valid final snapshot captured in a scenario window."""
39
+
40
+ @abstractmethod
41
+ def get_solution_delta_for_problem_run(
42
+ self, *, problem_run_id: str
43
+ ) -> SolutionDelta | None:
44
+ """Return an existing delta for one problem run."""
45
+
46
+ @abstractmethod
47
+ def add_snapshot(self, snapshot: ShadowSnapshot) -> None:
48
+ """Persist one shadow snapshot metadata row."""
49
+
50
+ @abstractmethod
51
+ def add_solution_delta(self, delta: SolutionDelta) -> None:
52
+ """Persist one solution delta metadata row."""
@@ -15,6 +15,7 @@ from app.core.ports.db.memory_repositories import (
15
15
  IUtilityRepo,
16
16
  )
17
17
  from app.core.ports.db.problem_runs import IProblemRunsRepo
18
+ from app.core.ports.db.snapshots import ISnapshotsRepo
18
19
  from app.core.ports.embeddings.retrieval import IVectorSearch
19
20
  from app.core.ports.db.retrieval_repositories import (
20
21
  IConceptKeywordRetrievalRepo,
@@ -43,6 +44,7 @@ class IUnitOfWork(ABC):
43
44
  guidance: IPendingUtilityCandidatesRepo
44
45
  knowledge_build_runs: IKnowledgeBuildRunsRepo
45
46
  problem_runs: IProblemRunsRepo
47
+ snapshots: ISnapshotsRepo
46
48
  vector_search: IVectorSearch | None
47
49
 
48
50
  @abstractmethod
@@ -0,0 +1,27 @@
1
+ """Core-owned port for repo-local shadow Git storage."""
2
+
3
+ from __future__ import annotations
4
+
5
+ from abc import ABC, abstractmethod
6
+
7
+ from app.core.entities.snapshots import (
8
+ ShadowGitCaptureRequest,
9
+ ShadowGitCaptureResult,
10
+ ShadowGitDiffResult,
11
+ )
12
+
13
+
14
+ class IShadowGitStore(ABC):
15
+ """Filesystem/Git behavior needed by snapshot use cases."""
16
+
17
+ @abstractmethod
18
+ def capture_snapshot(
19
+ self, request: ShadowGitCaptureRequest
20
+ ) -> ShadowGitCaptureResult:
21
+ """Capture the current repo tree into shadow Git."""
22
+
23
+ @abstractmethod
24
+ def diff_snapshot_pair(
25
+ self, *, repo_root: str, base_commit_sha: str, final_commit_sha: str
26
+ ) -> ShadowGitDiffResult:
27
+ """Return a stable patch hash and changed paths for two shadow commits."""
@@ -6,13 +6,26 @@ from app.core.entities.episodes import Episode, EpisodeEvent
6
6
  from app.core.entities.memories import Memory, MemoryKind
7
7
  from app.core.entities.scenarios import (
8
8
  ProblemRun,
9
+ ScenarioOutcome,
9
10
  outcome_to_problem_run_status,
10
11
  )
12
+ from app.core.entities.snapshots import (
13
+ AvailableCodeDeltaContext,
14
+ SolutionDelta,
15
+ UnavailableCodeDeltaContext,
16
+ )
11
17
  from app.core.errors import DomainValidationError, ErrorCode, ErrorDetail
12
18
  from app.core.ports.db.unit_of_work import IUnitOfWork
19
+ from app.core.ports.local_state.shadow_git import IShadowGitStore
13
20
  from app.core.ports.system.idgen import IIdGenerator
14
21
  from app.core.use_cases.scenarios.record.request import ScenarioRecordRequest
15
- from app.core.use_cases.scenarios.record.result import ScenarioRecordResult
22
+ from app.core.use_cases.scenarios.record.result import (
23
+ ScenarioRecordResult,
24
+ SolutionDeltaRecordResult,
25
+ )
26
+ from app.core.use_cases.snapshots.code_delta_context import (
27
+ build_code_delta_context_from_snapshots,
28
+ )
16
29
 
17
30
 
18
31
  _BUILD_KNOWLEDGE_ACTOR = "build_knowledge"
@@ -22,7 +35,9 @@ def execute_record_scenario(
22
35
  request: ScenarioRecordRequest,
23
36
  uow: IUnitOfWork,
24
37
  *,
38
+ repo_root: str,
25
39
  id_generator: IIdGenerator,
40
+ shadow_git_store: IShadowGitStore,
26
41
  ) -> ScenarioRecordResult:
27
42
  """Validate references and persist one scenario run window."""
28
43
 
@@ -55,6 +70,7 @@ def execute_record_scenario(
55
70
  scenario_id=existing.id,
56
71
  outcome=scenario.outcome,
57
72
  created=False,
73
+ solution_delta=_existing_solution_delta_result(existing.id, uow),
58
74
  )
59
75
  raise DomainValidationError(
60
76
  [
@@ -84,10 +100,112 @@ def execute_record_scenario(
84
100
  solution_memory_id=solution_memory.id if solution_memory else None,
85
101
  )
86
102
  uow.problem_runs.add(run)
103
+ solution_delta_result = _attach_solution_delta(
104
+ request=request,
105
+ run=run,
106
+ repo_root=repo_root,
107
+ opened_event=opened_event,
108
+ closed_event=closed_event,
109
+ uow=uow,
110
+ id_generator=id_generator,
111
+ shadow_git_store=shadow_git_store,
112
+ )
87
113
  return ScenarioRecordResult(
88
114
  scenario_id=run.id,
89
115
  outcome=scenario.outcome,
90
116
  created=True,
117
+ solution_delta=solution_delta_result,
118
+ )
119
+
120
+
121
+ def _existing_solution_delta_result(
122
+ problem_run_id: str, uow: IUnitOfWork
123
+ ) -> SolutionDeltaRecordResult:
124
+ """Return replay metadata for a previously attached solution delta."""
125
+
126
+ existing_delta = uow.snapshots.get_solution_delta_for_problem_run(
127
+ problem_run_id=problem_run_id
128
+ )
129
+ if existing_delta is None:
130
+ return SolutionDeltaRecordResult(
131
+ status="skipped", reason="existing_problem_run_has_no_solution_delta"
132
+ )
133
+ return SolutionDeltaRecordResult(
134
+ status="exists",
135
+ solution_delta_id=existing_delta.id,
136
+ base_snapshot_id=existing_delta.base_snapshot_id,
137
+ final_snapshot_id=existing_delta.final_snapshot_id,
138
+ patch_sha=existing_delta.patch_sha,
139
+ changed_paths=existing_delta.changed_paths,
140
+ )
141
+
142
+
143
+ def _attach_solution_delta(
144
+ *,
145
+ request: ScenarioRecordRequest,
146
+ run: ProblemRun,
147
+ repo_root: str,
148
+ opened_event: EpisodeEvent,
149
+ closed_event: EpisodeEvent,
150
+ uow: IUnitOfWork,
151
+ id_generator: IIdGenerator,
152
+ shadow_git_store: IShadowGitStore,
153
+ ) -> SolutionDeltaRecordResult:
154
+ """Attach a patch-backed delta when a solved run has valid snapshots."""
155
+
156
+ if request.scenario.outcome is not ScenarioOutcome.SOLVED:
157
+ return SolutionDeltaRecordResult(status="skipped", reason="outcome_not_solved")
158
+
159
+ base_snapshot = uow.snapshots.latest_snapshot_at_or_before_event(
160
+ repo_id=request.repo_id,
161
+ repo_root=repo_root,
162
+ episode_id=request.scenario.episode_id,
163
+ event_seq=opened_event.seq,
164
+ )
165
+ if base_snapshot is None:
166
+ return SolutionDeltaRecordResult(status="skipped", reason="missing_base_snapshot")
167
+ final_snapshot = uow.snapshots.latest_snapshot_in_event_window(
168
+ repo_id=request.repo_id,
169
+ repo_root=repo_root,
170
+ episode_id=request.scenario.episode_id,
171
+ opened_event_seq=opened_event.seq,
172
+ closed_event_seq=closed_event.seq,
173
+ )
174
+ if final_snapshot is None:
175
+ return SolutionDeltaRecordResult(
176
+ status="skipped", reason="missing_final_snapshot"
177
+ )
178
+ code_delta_context = build_code_delta_context_from_snapshots(
179
+ repo_root=repo_root,
180
+ base_snapshot=base_snapshot,
181
+ final_snapshot=final_snapshot,
182
+ baseline_only_base_event_seq=opened_event.seq - 1,
183
+ shadow_git_store=shadow_git_store,
184
+ )
185
+ if isinstance(code_delta_context, UnavailableCodeDeltaContext):
186
+ return SolutionDeltaRecordResult(
187
+ status="skipped", reason=code_delta_context.reason.value
188
+ )
189
+ assert isinstance(code_delta_context, AvailableCodeDeltaContext)
190
+ delta = SolutionDelta(
191
+ id=id_generator.new_id(),
192
+ problem_run_id=run.id,
193
+ repo_id=request.repo_id,
194
+ repo_root=repo_root,
195
+ episode_id=request.scenario.episode_id,
196
+ base_snapshot_id=code_delta_context.base_snapshot_id,
197
+ final_snapshot_id=code_delta_context.final_snapshot_id,
198
+ patch_sha=code_delta_context.patch_sha,
199
+ changed_paths=code_delta_context.changed_paths,
200
+ )
201
+ uow.snapshots.add_solution_delta(delta)
202
+ return SolutionDeltaRecordResult(
203
+ status="created",
204
+ solution_delta_id=delta.id,
205
+ base_snapshot_id=delta.base_snapshot_id,
206
+ final_snapshot_id=delta.final_snapshot_id,
207
+ patch_sha=delta.patch_sha,
208
+ changed_paths=delta.changed_paths,
91
209
  )
92
210
 
93
211