@memorax/memorax-code 0.1.2 → 0.1.4

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 (242) hide show
  1. package/README.md +16 -12
  2. package/bin/memorax-code-npm-preinstall.mjs +7 -2
  3. package/bin/memorax-code-opencode.mjs +4 -0
  4. package/bin/memorax-code-plugin-postinstall.mjs +342 -93
  5. package/docs/configuration.md +148 -35
  6. package/docs/troubleshooting.md +73 -13
  7. package/lib/dsh-plugin-install.mjs +22 -0
  8. package/lib/memorax-code-adapter-common/src/hooks/capture-cwd-hook.mjs +21 -14
  9. package/lib/memorax-code-adapter-common/src/hooks/ensure-backend-runner.mjs +26 -7
  10. package/lib/memorax-code-adapter-common/src/hooks/memory-skill-reminder-hook.mjs +86 -95
  11. package/lib/memorax-code-adapter-common/src/hooks/memory-skill-reminder-policy.mjs +58 -0
  12. package/lib/memorax-code-adapter-common/src/repo-memory/repo-memory-auto-build.mjs +2 -2
  13. package/lib/memorax-code-adapter-common/src/repo-memory/repo-memory-job-supervisor.mjs +1 -1
  14. package/lib/memorax-code-adapter-common/src/windows-cli-invocation.mjs +13 -1
  15. package/lib/memorax-code-backend/dist/app/backend-server.js +210 -0
  16. package/lib/memorax-code-backend/dist/{server-observability.js → app/memory-observability.js} +4 -4
  17. package/lib/memorax-code-backend/dist/{backend-state.js → app/state.js} +1 -1
  18. package/lib/memorax-code-backend/dist/{claude-adapter-lifecycle.js → clients/claude/lifecycle.js} +2 -2
  19. package/lib/memorax-code-backend/dist/{claude-memory-hook-runtime.js → clients/claude/memory-hook-runtime.js} +7 -7
  20. package/lib/memorax-code-backend/dist/clients/codex/lifecycle.js +131 -0
  21. package/lib/memorax-code-backend/dist/{codex-memory-hook-runtime.js → clients/codex/memory-hook-runtime.js} +9 -9
  22. package/lib/memorax-code-backend/dist/{codex-plugin-hooks.js → clients/codex/plugin-hooks.js} +1 -1
  23. package/lib/memorax-code-backend/dist/{codex-plugin-install.js → clients/codex/plugin-install.js} +6 -6
  24. package/lib/memorax-code-backend/dist/clients/dsh/lifecycle.js +75 -0
  25. package/lib/memorax-code-backend/dist/clients/dsh/memory-hook-runtime.js +258 -0
  26. package/lib/memorax-code-backend/dist/clients/dsh/session-turn.js +249 -0
  27. package/lib/memorax-code-backend/dist/clients/opencode/lifecycle.js +54 -0
  28. package/lib/memorax-code-backend/dist/clients/opencode/memory-hook-runtime.js +277 -0
  29. package/lib/memorax-code-backend/dist/clients/opencode/message-turn.js +78 -0
  30. package/lib/memorax-code-backend/dist/codex-adapter-lifecycle.js +1 -131
  31. package/lib/memorax-code-backend/dist/{memorax-code-config.js → config/memorax-code.js} +32 -4
  32. package/lib/memorax-code-backend/dist/{server-cli.js → entrypoints/backend-cli.js} +137 -37
  33. package/lib/memorax-code-backend/dist/jsonl-append.js +1 -75
  34. package/lib/memorax-code-backend/dist/{active-client-selection.js → lifecycle/active-clients.js} +12 -1
  35. package/lib/memorax-code-backend/dist/{backend-service-cleanup.js → lifecycle/backend/cleanup.js} +1 -1
  36. package/lib/memorax-code-backend/dist/{backend-service-record.js → lifecycle/backend/record.js} +1 -1
  37. package/lib/memorax-code-backend/dist/{backend-service-result.js → lifecycle/backend/result.js} +2 -2
  38. package/lib/memorax-code-backend/dist/{service.js → lifecycle/backend/service.js} +16 -16
  39. package/lib/memorax-code-backend/dist/{backend-token-record.js → lifecycle/backend/token-record.js} +1 -1
  40. package/lib/memorax-code-backend/dist/{backend-service-token.js → lifecycle/backend/token.js} +2 -2
  41. package/lib/memorax-code-backend/dist/lifecycle/client-plugin-removal.js +109 -0
  42. package/lib/memorax-code-backend/dist/{client-selection.js → lifecycle/client-selection.js} +11 -5
  43. package/lib/memorax-code-backend/dist/{backend-lifecycle-lock.js → lifecycle/lock.js} +1 -1
  44. package/lib/memorax-code-backend/dist/{memorax-code-lifecycle.js → lifecycle/orchestrator.js} +325 -39
  45. package/lib/memorax-code-backend/dist/memorax-cli.js +1 -1
  46. package/lib/memorax-code-backend/dist/memorax-code.js +1 -1
  47. package/lib/memorax-code-backend/dist/{automatic-memory-retrieval.js → memory/automatic-retrieval.js} +3 -3
  48. package/lib/memorax-code-backend/dist/{automatic-memory-writeback.js → memory/automatic-writeback.js} +75 -21
  49. package/lib/memorax-code-backend/dist/{memory-cli.js → memory/cli.js} +23 -10
  50. package/lib/memorax-code-backend/dist/{memory-hook-command.js → memory/hook-command.js} +156 -9
  51. package/lib/memorax-code-backend/dist/memory/observability.js +1 -0
  52. package/lib/memorax-code-backend/dist/memory/payload-redaction.js +212 -0
  53. package/lib/memorax-code-backend/dist/{memory-reminder-trace-recorder.js → memory/reminder-trace-recorder.js} +20 -7
  54. package/lib/memorax-code-backend/dist/{repository-memory-context.js → memory/repository-session.js} +2 -2
  55. package/lib/memorax-code-backend/dist/{memory-service.js → memory/service.js} +27 -5
  56. package/lib/memorax-code-backend/dist/{memory-turn-coordinator.js → memory/turn-coordinator.js} +2 -1
  57. package/lib/memorax-code-backend/dist/{memory-writeback-buffer.js → memory/writeback-buffer.js} +3 -3
  58. package/lib/memorax-code-backend/dist/{memory-writeback-chunk.js → memory/writeback-chunk.js} +1 -1
  59. package/lib/memorax-code-backend/dist/{memory-writeback-reconciler.js → memory/writeback-reconciler.js} +6 -6
  60. package/lib/memorax-code-backend/dist/{memory-writeback-task-projection.js → memory/writeback-task-projection.js} +4 -4
  61. package/lib/memorax-code-backend/dist/{memorax-adapter.js → provider/memorax/adapter.js} +5 -5
  62. package/lib/memorax-code-backend/dist/{memorax-config.js → provider/memorax/config.js} +4 -4
  63. package/lib/memorax-code-backend/dist/{memorax-http.js → provider/memorax/http.js} +1 -1
  64. package/lib/memorax-code-backend/dist/{repo-memory-readiness.js → repository/readiness.js} +3 -3
  65. package/lib/memorax-code-backend/dist/server.js +3 -212
  66. package/lib/memorax-code-backend/dist/service-entrypoint.js +1 -1
  67. package/lib/memorax-code-backend/dist/{debug-log.js → shared/debug-log.js} +1 -1
  68. package/lib/memorax-code-backend/dist/shared/jsonl-append.js +75 -0
  69. package/lib/memorax-code-backend/dist/shared/windows-cli-invocation.js +148 -0
  70. package/lib/memorax-code-backend/dist/{trace-config.js → trace/config.js} +43 -5
  71. package/lib/memorax-code-backend/dist/{trace-context.js → trace/context.js} +53 -2
  72. package/lib/memorax-code-backend/dist/{trace-store.js → trace/store.js} +3 -3
  73. package/lib/memorax-code-backend/dist/{server-health.js → transport/http/health.js} +1 -1
  74. package/lib/memorax-code-backend/dist/{server-memory-hook.js → transport/http/memory-hook.js} +3 -3
  75. package/lib/memorax-code-backend/dist/{server-http.js → transport/http/request.js} +1 -1
  76. package/lib/memorax-code-backend/dist/{claude-local-transcript.js → viewer/history/claude-transcript.js} +3 -3
  77. package/lib/memorax-code-backend/dist/{memory-viewer-session-title.js → viewer/history/session-title.js} +1 -1
  78. package/lib/memorax-code-backend/dist/{server-memory-viewer.js → viewer/http/public-routes.js} +15 -15
  79. package/lib/memorax-code-backend/dist/viewer/model.js +1 -0
  80. package/lib/memorax-code-backend/dist/{memory-viewer-activity.js → viewer/projection/activity.js} +2 -2
  81. package/lib/memorax-code-backend/dist/{memory-viewer-history-projection.js → viewer/projection/history.js} +1 -1
  82. package/lib/memorax-code-backend/dist/{memory-viewer-observability.js → viewer/projection/observability.js} +1 -1
  83. package/lib/memorax-code-backend/dist/{memory-viewer-user-projection.js → viewer/projection/user.js} +1 -1
  84. package/lib/memorax-code-backend/dist/{memory-viewer-writeback-status.js → viewer/projection/writeback-status.js} +1 -1
  85. package/lib/memorax-code-backend/dist/{memory-viewer-store.js → viewer/store.js} +59 -32
  86. package/lib/memorax-code-backend/dist/{memory-viewer-user-html.js → viewer/ui/user-html.js} +11 -10
  87. package/lib/memorax-code-backend/dist/windows-cli-invocation.js +1 -148
  88. package/lib/memorax-code-backend/package.json +3 -3
  89. package/lib/memorax-code-claude-adapter/.claude-plugin/plugin.json +1 -1
  90. package/lib/memorax-code-claude-adapter/hooks/runtime-shell.json +1 -1
  91. package/lib/memorax-code-claude-adapter/package.json +1 -1
  92. package/lib/memorax-code-claude-adapter/skills/memorax-code/SKILL.md +11 -2
  93. package/lib/memorax-code-claude-adapter/skills/memorax-code/defaults.json +8 -5
  94. package/lib/memorax-code-claude-adapter/skills/memorax-code/references/memorax-add.md +1 -1
  95. package/lib/memorax-code-claude-adapter/skills/memorax-code/references/memorax-search.md +37 -9
  96. package/lib/memorax-code-claude-adapter/skills/memorax-code/references/personal-read.md +1 -1
  97. package/lib/memorax-code-claude-adapter/skills/memorax-code/references/personal-write.md +33 -13
  98. package/lib/memorax-code-claude-adapter/skills/memorax-code/references/repo-build.md +62 -13
  99. package/lib/memorax-code-claude-adapter/skills/memorax-code/references/repo-read.md +11 -4
  100. package/lib/memorax-code-claude-adapter/skills/memorax-code/references/repo-templates.md +179 -59
  101. package/lib/memorax-code-claude-adapter/skills/memorax-code/references/repo-update.md +18 -7
  102. package/lib/memorax-code-claude-adapter/skills/memorax-code/scripts/collect_all.py +122 -39
  103. package/lib/memorax-code-claude-adapter/skills/memorax-code/scripts/detect_updates.py +73 -10
  104. package/lib/memorax-code-claude-adapter/skills/memorax-code/scripts/github_resource_facets.py +9 -1
  105. package/lib/memorax-code-claude-adapter/skills/memorax-code/scripts/gitlab_resource_facets.py +9 -1
  106. package/lib/memorax-code-claude-adapter/skills/memorax-code/scripts/validate_memory.py +23 -1
  107. package/lib/memorax-code-claude-adapter/src/plugin-install.mjs +1 -0
  108. package/lib/memorax-code-claude-marketplace/plugins/memorax-code-claude-adapter/.claude-plugin/plugin.json +1 -1
  109. package/lib/memorax-code-claude-marketplace/plugins/memorax-code-claude-adapter/hooks/runtime-shell.json +1 -1
  110. package/lib/memorax-code-claude-marketplace/plugins/memorax-code-claude-adapter/memorax-code-adapter-common/src/hooks/capture-cwd-hook.mjs +21 -14
  111. package/lib/memorax-code-claude-marketplace/plugins/memorax-code-claude-adapter/memorax-code-adapter-common/src/hooks/ensure-backend-runner.mjs +26 -7
  112. package/lib/memorax-code-claude-marketplace/plugins/memorax-code-claude-adapter/memorax-code-adapter-common/src/hooks/memory-skill-reminder-hook.mjs +86 -95
  113. package/lib/memorax-code-claude-marketplace/plugins/memorax-code-claude-adapter/memorax-code-adapter-common/src/hooks/memory-skill-reminder-policy.mjs +58 -0
  114. package/lib/memorax-code-claude-marketplace/plugins/memorax-code-claude-adapter/memorax-code-adapter-common/src/repo-memory/repo-memory-auto-build.mjs +2 -2
  115. package/lib/memorax-code-claude-marketplace/plugins/memorax-code-claude-adapter/memorax-code-adapter-common/src/repo-memory/repo-memory-job-supervisor.mjs +1 -1
  116. package/lib/memorax-code-claude-marketplace/plugins/memorax-code-claude-adapter/memorax-code-adapter-common/src/windows-cli-invocation.mjs +13 -1
  117. package/lib/memorax-code-claude-marketplace/plugins/memorax-code-claude-adapter/package.json +1 -1
  118. package/lib/memorax-code-claude-marketplace/plugins/memorax-code-claude-adapter/skills/memorax-code/SKILL.md +11 -2
  119. package/lib/memorax-code-claude-marketplace/plugins/memorax-code-claude-adapter/skills/memorax-code/defaults.json +8 -5
  120. package/lib/memorax-code-claude-marketplace/plugins/memorax-code-claude-adapter/skills/memorax-code/references/memorax-add.md +1 -1
  121. package/lib/memorax-code-claude-marketplace/plugins/memorax-code-claude-adapter/skills/memorax-code/references/memorax-search.md +37 -9
  122. package/lib/memorax-code-claude-marketplace/plugins/memorax-code-claude-adapter/skills/memorax-code/references/personal-read.md +1 -1
  123. package/lib/memorax-code-claude-marketplace/plugins/memorax-code-claude-adapter/skills/memorax-code/references/personal-write.md +33 -13
  124. package/lib/memorax-code-claude-marketplace/plugins/memorax-code-claude-adapter/skills/memorax-code/references/repo-build.md +62 -13
  125. package/lib/memorax-code-claude-marketplace/plugins/memorax-code-claude-adapter/skills/memorax-code/references/repo-read.md +11 -4
  126. package/lib/memorax-code-claude-marketplace/plugins/memorax-code-claude-adapter/skills/memorax-code/references/repo-templates.md +179 -59
  127. package/lib/memorax-code-claude-marketplace/plugins/memorax-code-claude-adapter/skills/memorax-code/references/repo-update.md +18 -7
  128. package/lib/memorax-code-claude-marketplace/plugins/memorax-code-claude-adapter/skills/memorax-code/scripts/collect_all.py +122 -39
  129. package/lib/memorax-code-claude-marketplace/plugins/memorax-code-claude-adapter/skills/memorax-code/scripts/detect_updates.py +73 -10
  130. package/lib/memorax-code-claude-marketplace/plugins/memorax-code-claude-adapter/skills/memorax-code/scripts/github_resource_facets.py +9 -1
  131. package/lib/memorax-code-claude-marketplace/plugins/memorax-code-claude-adapter/skills/memorax-code/scripts/gitlab_resource_facets.py +9 -1
  132. package/lib/memorax-code-claude-marketplace/plugins/memorax-code-claude-adapter/skills/memorax-code/scripts/validate_memory.py +23 -1
  133. package/lib/memorax-code-claude-marketplace/plugins/memorax-code-claude-adapter/src/plugin-install.mjs +1 -0
  134. package/lib/memorax-code-codex-adapter/.codex-plugin/plugin.json +1 -1
  135. package/lib/memorax-code-codex-adapter/hooks/runtime-shell.json +1 -1
  136. package/lib/memorax-code-codex-adapter/package.json +1 -1
  137. package/lib/memorax-code-codex-adapter/runtime-hooks/memory-skill-reminder.mjs +10 -2
  138. package/lib/memorax-code-codex-adapter/skills/memorax-code/SKILL.md +11 -2
  139. package/lib/memorax-code-codex-adapter/skills/memorax-code/defaults.json +8 -5
  140. package/lib/memorax-code-codex-adapter/skills/memorax-code/references/memorax-add.md +1 -1
  141. package/lib/memorax-code-codex-adapter/skills/memorax-code/references/memorax-search.md +37 -9
  142. package/lib/memorax-code-codex-adapter/skills/memorax-code/references/personal-read.md +1 -1
  143. package/lib/memorax-code-codex-adapter/skills/memorax-code/references/personal-write.md +33 -13
  144. package/lib/memorax-code-codex-adapter/skills/memorax-code/references/repo-build.md +62 -13
  145. package/lib/memorax-code-codex-adapter/skills/memorax-code/references/repo-read.md +11 -4
  146. package/lib/memorax-code-codex-adapter/skills/memorax-code/references/repo-templates.md +179 -59
  147. package/lib/memorax-code-codex-adapter/skills/memorax-code/references/repo-update.md +18 -7
  148. package/lib/memorax-code-codex-adapter/skills/memorax-code/scripts/collect_all.py +122 -39
  149. package/lib/memorax-code-codex-adapter/skills/memorax-code/scripts/detect_updates.py +73 -10
  150. package/lib/memorax-code-codex-adapter/skills/memorax-code/scripts/github_resource_facets.py +9 -1
  151. package/lib/memorax-code-codex-adapter/skills/memorax-code/scripts/gitlab_resource_facets.py +9 -1
  152. package/lib/memorax-code-codex-adapter/skills/memorax-code/scripts/validate_memory.py +23 -1
  153. package/lib/memorax-code-dsh-adapter/cordis.patch.yml +10 -0
  154. package/lib/memorax-code-dsh-adapter/hooks/repo-memory-job.mjs +68 -0
  155. package/lib/memorax-code-dsh-adapter/package.json +69 -0
  156. package/lib/memorax-code-dsh-adapter/skills/memorax-code/SKILL.md +91 -0
  157. package/lib/memorax-code-dsh-adapter/skills/memorax-code/agents/claude.yaml +10 -0
  158. package/lib/memorax-code-dsh-adapter/skills/memorax-code/agents/openai.yaml +7 -0
  159. package/lib/memorax-code-dsh-adapter/skills/memorax-code/defaults.json +12 -0
  160. package/lib/memorax-code-dsh-adapter/skills/memorax-code/references/memorax-add.md +86 -0
  161. package/lib/memorax-code-dsh-adapter/skills/memorax-code/references/memorax-search.md +91 -0
  162. package/lib/memorax-code-dsh-adapter/skills/memorax-code/references/personal-read.md +46 -0
  163. package/lib/memorax-code-dsh-adapter/skills/memorax-code/references/personal-write.md +120 -0
  164. package/lib/memorax-code-dsh-adapter/skills/memorax-code/references/repo-build.md +319 -0
  165. package/lib/memorax-code-dsh-adapter/skills/memorax-code/references/repo-read.md +103 -0
  166. package/lib/memorax-code-dsh-adapter/skills/memorax-code/references/repo-templates.md +390 -0
  167. package/lib/memorax-code-dsh-adapter/skills/memorax-code/references/repo-update.md +127 -0
  168. package/lib/memorax-code-dsh-adapter/skills/memorax-code/scripts/collect_all.py +579 -0
  169. package/lib/memorax-code-dsh-adapter/skills/memorax-code/scripts/detect_updates.py +919 -0
  170. package/lib/memorax-code-dsh-adapter/skills/memorax-code/scripts/git_commit_facets.py +222 -0
  171. package/lib/memorax-code-dsh-adapter/skills/memorax-code/scripts/github_resource_facets.py +512 -0
  172. package/lib/memorax-code-dsh-adapter/skills/memorax-code/scripts/gitlab_resource_facets.py +517 -0
  173. package/lib/memorax-code-dsh-adapter/skills/memorax-code/scripts/prepare_repo_memory.py +411 -0
  174. package/lib/memorax-code-dsh-adapter/skills/memorax-code/scripts/user_profile_memory.py +528 -0
  175. package/lib/memorax-code-dsh-adapter/skills/memorax-code/scripts/validate_memory.py +248 -0
  176. package/lib/memorax-code-dsh-adapter/src/backend-client.mjs +119 -0
  177. package/lib/memorax-code-dsh-adapter/src/dsh-message.mjs +32 -0
  178. package/lib/memorax-code-dsh-adapter/src/dsh-version.mjs +18 -0
  179. package/lib/memorax-code-dsh-adapter/src/http-client.mjs +55 -0
  180. package/lib/memorax-code-dsh-adapter/src/index.mjs +72 -0
  181. package/lib/memorax-code-dsh-adapter/src/personal-context-worker.mjs +48 -0
  182. package/lib/memorax-code-dsh-adapter/src/personal-context.mjs +114 -0
  183. package/lib/memorax-code-dsh-adapter/src/plugin.mjs +724 -0
  184. package/lib/memorax-code-dsh-adapter/src/profile-lifecycle.mjs +1358 -0
  185. package/lib/memorax-code-dsh-adapter/src/protocol.mjs +145 -0
  186. package/lib/memorax-code-dsh-adapter/src/runtime-state.mjs +132 -0
  187. package/lib/memorax-code-opencode-adapter/hooks/repo-memory-job.mjs +37 -0
  188. package/lib/memorax-code-opencode-adapter/package.json +10 -0
  189. package/lib/memorax-code-opencode-adapter/skills/memorax-code/SKILL.md +91 -0
  190. package/lib/memorax-code-opencode-adapter/skills/memorax-code/agents/claude.yaml +10 -0
  191. package/lib/memorax-code-opencode-adapter/skills/memorax-code/agents/openai.yaml +7 -0
  192. package/lib/memorax-code-opencode-adapter/skills/memorax-code/defaults.json +12 -0
  193. package/lib/memorax-code-opencode-adapter/skills/memorax-code/references/memorax-add.md +86 -0
  194. package/lib/memorax-code-opencode-adapter/skills/memorax-code/references/memorax-search.md +91 -0
  195. package/lib/memorax-code-opencode-adapter/skills/memorax-code/references/personal-read.md +46 -0
  196. package/lib/memorax-code-opencode-adapter/skills/memorax-code/references/personal-write.md +120 -0
  197. package/lib/memorax-code-opencode-adapter/skills/memorax-code/references/repo-build.md +319 -0
  198. package/lib/memorax-code-opencode-adapter/skills/memorax-code/references/repo-read.md +103 -0
  199. package/lib/memorax-code-opencode-adapter/skills/memorax-code/references/repo-templates.md +390 -0
  200. package/lib/memorax-code-opencode-adapter/skills/memorax-code/references/repo-update.md +127 -0
  201. package/lib/memorax-code-opencode-adapter/skills/memorax-code/scripts/collect_all.py +579 -0
  202. package/lib/memorax-code-opencode-adapter/skills/memorax-code/scripts/detect_updates.py +919 -0
  203. package/lib/memorax-code-opencode-adapter/skills/memorax-code/scripts/git_commit_facets.py +222 -0
  204. package/lib/memorax-code-opencode-adapter/skills/memorax-code/scripts/github_resource_facets.py +512 -0
  205. package/lib/memorax-code-opencode-adapter/skills/memorax-code/scripts/gitlab_resource_facets.py +517 -0
  206. package/lib/memorax-code-opencode-adapter/skills/memorax-code/scripts/prepare_repo_memory.py +411 -0
  207. package/lib/memorax-code-opencode-adapter/skills/memorax-code/scripts/user_profile_memory.py +528 -0
  208. package/lib/memorax-code-opencode-adapter/skills/memorax-code/scripts/validate_memory.py +248 -0
  209. package/lib/memorax-code-opencode-adapter/src/adapter-paths.mjs +37 -0
  210. package/lib/memorax-code-opencode-adapter/src/cli.mjs +260 -0
  211. package/lib/memorax-code-opencode-adapter/src/diagnostics.mjs +31 -0
  212. package/lib/memorax-code-opencode-adapter/src/plugin-install.mjs +673 -0
  213. package/lib/memorax-code-opencode-adapter/src/plugin.mjs +539 -0
  214. package/lib/memorax-code-opencode-adapter/src/repo-memory-server-runner.mjs +442 -0
  215. package/lib/run-entrypoint.mjs +6 -0
  216. package/package.json +7 -3
  217. package/lib/memorax-code-backend/dist/client-plugin-removal.js +0 -67
  218. /package/lib/memorax-code-backend/dist/{claude-transcript-turn.js → clients/claude/transcript-turn.js} +0 -0
  219. /package/lib/memorax-code-backend/dist/{codex-effective-prompt.js → clients/codex/effective-prompt.js} +0 -0
  220. /package/lib/memorax-code-backend/dist/{codex-rollout-turn.js → clients/codex/rollout-turn.js} +0 -0
  221. /package/lib/memorax-code-backend/dist/{codex-session-turn-index.js → clients/codex/session-turn-index.js} +0 -0
  222. /package/lib/memorax-code-backend/dist/{codex-workspace-links.js → clients/codex/workspace-links.js} +0 -0
  223. /package/lib/memorax-code-backend/dist/{backend-env.js → config/backend-env.js} +0 -0
  224. /package/lib/memorax-code-backend/dist/{proxy-env.js → config/proxy-env.js} +0 -0
  225. /package/lib/memorax-code-backend/dist/{entrypoint.js → entrypoints/main.js} +0 -0
  226. /package/lib/memorax-code-backend/dist/{backend-process.js → lifecycle/backend/process.js} +0 -0
  227. /package/lib/memorax-code-backend/dist/{backend-shutdown-request.js → lifecycle/backend/shutdown-request.js} +0 -0
  228. /package/lib/memorax-code-backend/dist/{backend-status.js → lifecycle/backend/status.js} +0 -0
  229. /package/lib/memorax-code-backend/dist/{adapter-lifecycle-participant.js → lifecycle/contracts.js} +0 -0
  230. /package/lib/memorax-code-backend/dist/{install-watchdog.js → lifecycle/install-watchdog.js} +0 -0
  231. /package/lib/memorax-code-backend/dist/{memory-observability.js → lifecycle/participant.js} +0 -0
  232. /package/lib/memorax-code-backend/dist/{memory-project.js → memory/project.js} +0 -0
  233. /package/lib/memorax-code-backend/dist/{repository-memory-scope.js → repository/scope.js} +0 -0
  234. /package/lib/memorax-code-backend/dist/{incremental-jsonl-projection.js → shared/incremental-jsonl-projection.js} +0 -0
  235. /package/lib/memorax-code-backend/dist/{utils.js → shared/record.js} +0 -0
  236. /package/lib/memorax-code-backend/dist/{server-json.js → transport/http/json.js} +0 -0
  237. /package/lib/memorax-code-backend/dist/{memory-viewer-data-projection-cache.js → viewer/projection/cache.js} +0 -0
  238. /package/lib/memorax-code-backend/dist/{memory-viewer-event-identity.js → viewer/projection/event-identity.js} +0 -0
  239. /package/lib/memorax-code-backend/dist/{memory-viewer-redaction.js → viewer/projection/redaction.js} +0 -0
  240. /package/lib/memorax-code-backend/dist/{memory-viewer-turn-reference.js → viewer/projection/turn-reference.js} +0 -0
  241. /package/lib/memorax-code-backend/dist/{memory-viewer-icon.js → viewer/ui/icon.js} +0 -0
  242. /package/lib/memorax-code-backend/dist/{memory-viewer-logo.js → viewer/ui/logo.js} +0 -0
@@ -39,7 +39,7 @@ python3 <skill-dir>/scripts/user_profile_memory.py list --repo <repo>
39
39
 
40
40
  Use only active preferences returned by the script. If the preferences file does not exist, report that no user-profile memory is available; the list operation does not create it.
41
41
 
42
- Mention only preferences relevant to the current request unless the user explicitly asks to list all of them. Stored preferences describe how Codex should interact with the user; they are not repository facts.
42
+ Mention only preferences relevant to the current request unless the user explicitly asks to list all of them. Stored preferences describe how the coding agent should interact with the user; they are not repository facts.
43
43
 
44
44
  ## Priority
45
45
 
@@ -21,27 +21,36 @@ Before writing, ensure the repository root `.gitignore` contains `.repo_memory/`
21
21
 
22
22
  Do not create a global procedures file, index, event log, generated metadata, or version history. Do not edit `.repo_memory/PROFILE.md`, `.repo_memory/resources/`, `.repo_memory/raw/`, or `.repo_memory/user-profile/`.
23
23
 
24
- Choose the closest existing topic file. Update it when the user refines the same procedure; create a new file only for a distinct topic. Remove superseded wording rather than preserving old versions.
24
+ Choose the closest existing topic file before writing:
25
+
26
+ - New topic: create a file.
27
+ - Addition or refinement to the same topic: update the existing file.
28
+ - A new rule directly conflicts with or replaces an old rule: update the existing file and remove the superseded content.
29
+ - An old rule references a command, file, or workflow that no longer exists: update the invalid part; delete the file if the entire procedure is obsolete.
30
+ - Equivalent content: do not add a duplicate.
31
+ - If it is unclear whether the change is durable or only applies to the current task: ask the user.
32
+
33
+ Do not modify existing memory because of a one-time instruction for the current task. Do not scan or clean up unrelated topics.
25
34
 
26
35
  Use this shape when useful:
27
36
 
28
37
  ```markdown
29
- # 代码审查
38
+ # Reviewing Code
30
39
 
31
- Use when: 审查当前仓库中的代码变更时。
40
+ Use when: reviewing changes in this repository.
32
41
 
33
42
  ## Procedure
34
43
 
35
- 1. 创建 PR 前先审查变更。
36
- 2. 解决阻塞性问题。
37
- 3. 审查完成后再创建 PR
44
+ 1. Review the changes before creating a PR.
45
+ 2. Resolve blocking findings.
46
+ 3. Create the PR only after review is complete.
38
47
 
39
48
  ## Exceptions
40
49
 
41
- - 优先遵循用户当前提出的更具体指令。
50
+ - Follow a more specific current user instruction first.
42
51
  ```
43
52
 
44
- Delete only the topic file or section the user explicitly identifies. Do not retain deleted text in tombstones, backups, inactive entries, or history files.
53
+ Delete only the topic file, section, or step the user explicitly identifies, and preserve unrelated content. Do not retain deleted text in tombstones, backups, inactive entries, or history files. Apply the same rule to superseded text.
45
54
 
46
55
  ## User-Profile Memory
47
56
 
@@ -59,15 +68,26 @@ List existing preferences before adding and perform semantic matching:
59
68
  python3 <skill-dir>/scripts/user_profile_memory.py list --repo <repo>
60
69
  ```
61
70
 
62
- If equivalent content exists, do not add it again. Update the matching id when an existing entry expresses the same preference differently. Add only a genuinely new preference:
71
+ Handle the semantic match before writing:
72
+
73
+ - New preference: add a new preference.
74
+ - Equivalent content: do not add a duplicate.
75
+ - Addition or refinement to the same preference: update the existing preference.
76
+ - A new preference directly conflicts with or replaces an old preference in the same scope: update the existing id and remove the superseded content.
77
+ - The user explicitly says a preference no longer applies: delete that preference.
78
+ - Its `Applies when` environment, tool, or workflow no longer exists: update the scope; delete it if the entire preference is obsolete.
79
+
80
+ Do not modify or delete existing preferences because of a one-time instruction for the current task. Do not scan or clean up unrelated preferences.
81
+
82
+ Use the matching id for updates. Add only a genuinely new preference:
63
83
 
64
84
  ```bash
65
85
  python3 <skill-dir>/scripts/user_profile_memory.py add \
66
86
  --repo <repo> \
67
87
  --type communication \
68
- --description "用户希望在当前仓库中使用简洁的中文回答。" \
69
- --applies-when "回答当前仓库相关问题时。" \
70
- --do-not-apply-when "用户明确要求使用其他语言或格式。"
88
+ --description "User prefers concise Chinese answers for this repository." \
89
+ --applies-when "Answering questions in this repository." \
90
+ --do-not-apply-when "The user explicitly requests another language or format."
71
91
  ```
72
92
 
73
93
  Allowed script types are `communication`, `workflow`, `environment`, and `profile`. These type names do not expand this authority: never use `workflow` or `environment` to store an executable repository procedure.
@@ -83,7 +103,7 @@ python3 <skill-dir>/scripts/user_profile_memory.py update \
83
103
  --do-not-apply-when <exception>
84
104
  ```
85
105
 
86
- If multiple preferences may match, ask the user to choose before updating. Delete only an explicitly identified preference:
106
+ If multiple preferences may match, or it is unclear whether the change is durable, ask the user. Delete only an explicitly identified preference:
87
107
 
88
108
  ```bash
89
109
  python3 <skill-dir>/scripts/user_profile_memory.py delete \
@@ -15,6 +15,7 @@ The user selects a repository, not a memory directory. Do not ask for a `.repo_m
15
15
  ```text
16
16
  <repo>/.repo_memory/
17
17
  ├── PROFILE.md
18
+ ├── <repo-native-topic>.md conceptual pages
18
19
  ├── raw/
19
20
  │ ├── prepare-report.json
20
21
  │ ├── git-commits.json
@@ -25,10 +26,35 @@ The user selects a repository, not a memory directory. Do not ask for a `.repo_m
25
26
  └── issues.md
26
27
  ```
27
28
 
28
- Script-generated artifacts: `raw/prepare-report.json`, `raw/git-commits.json`, and optional `raw/github-facets.json` or `raw/gitlab-facets.json`. Agent-authored durable artifacts: `PROFILE.md`, `resources/commits.md`, `resources/prs.md`, and `resources/issues.md`.
29
+ Script-generated artifacts: `raw/prepare-report.json`, `raw/git-commits.json`, and optional `raw/github-facets.json` or `raw/gitlab-facets.json`. Agent-authored durable artifacts: `PROFILE.md`, repository-native supporting conceptual pages when the repository has enough surface area, `resources/commits.md`, `resources/prs.md`, and `resources/issues.md`. Temporary planning artifact `.repo_memory/_plan.md` is allowed during drafting but must be removed before final validation.
29
30
 
30
31
  User-managed sidecars may coexist under `.repo_memory/procedure-memory/` and `.repo_memory/user-profile/`. Builder scripts preserve them and exclude them from bundle validation; this skill must not create, edit, or summarize their contents as repo-memory evidence.
31
32
 
33
+ ## Wiki-Style Output Contract
34
+
35
+ MemoraX repo memory is a wiki-style repository memory backed by raw mechanical evidence. The primary user-facing product is a readable wiki, not a dense schema dump or a history table.
36
+
37
+ - `PROFILE.md` is the only fixed conceptual wiki file and the wiki landing page: project identity, what the repo contains, how it works, first-use path, Major Areas, Supporting Pages, provider context, and evidence inspected.
38
+ - Do not assume fixed supporting page names. Decide supporting pages and filenames from the repository itself after discovery.
39
+ - For very small repositories, `PROFILE.md` plus 1-2 supporting pages is enough. For most repositories, generate 3-7 Markdown pages total, including `PROFILE.md`. Only exceed 7 pages when the repository clearly has multiple substantial, independent areas that would become confusing if merged.
40
+ - Every durable supporting conceptual page must include frontmatter with `schema: "repo_memory_wiki_page.v0.1"` so validation can scan it.
41
+ - Supporting pages explain concepts, workflows, system areas, change surfaces, setup, verification, and agent routing cautions. They must link claims to inspected docs/source and use conservative wording when lightweight mode did not inspect source.
42
+ - resources/*.md remain compact historical routing cards for commits, PRs/MRs, and issues. They should not be the main architecture explanation.
43
+ - Keep raw JSON as debug evidence only. Do not ask future agents to read raw facets unless compact pages and resources are insufficient.
44
+
45
+ ## Conceptual Page Planning
46
+
47
+ After discovery and before final wiki writing, create a temporary planning artifact at `.repo_memory/_plan.md`. Keep it compact. Use it to outline intended final pages, each page purpose, source evidence, page boundaries, canonical homes for overlapping concepts, remaining questions, weak evidence, and paths that must be verified before final writing.
48
+
49
+ - Remove `.repo_memory/_plan.md` before final validation; it is not part of the durable repo memory bundle.
50
+ - Organize pages like human documentation, not a raw file inventory. Use human documentation titles. Do not title pages or headings after source paths, and do not mirror the source tree.
51
+ - Create a page only when a future human or agent needs a canonical explanation for a concept, workflow, system area, or change surface. A page is a durable orientation artifact, not a parking place for exploration facts.
52
+ - Merge rather than split when two pages would repeat the same workflow, types, or source paths; when one page would only explain a subset of another page; or when the distinction is based on source directory layout rather than reader task or concept.
53
+ - Split rather than merge when one page would mix unrelated reader tasks; when a concept has its own workflow, data model, risks, and source-backed change guidance; or when a page would become too long to navigate.
54
+ - Prefer headings inside broader pages before creating many small pages. Avoid thin pages and stub-like pages.
55
+
56
+ Natural documentation domains are candidates, not a required checklist: architecture, workflows, data model, integrations, operations, testing/evaluation, and extension points. In `_plan.md`, decide which candidates were selected, merged, or skipped and why. Generic names such as `architecture.md`, `runtime-flow.md`, and `developer-workflow.md` are fallback names only when repository vocabulary gives no stronger topic.
57
+
32
58
  ## Repository Prerequisite
33
59
 
34
60
  The selected target must be a local git repository: either the directory contains `.git/` or is inside a git worktree. A GitHub/GitLab remote is optional; local-only git repositories are supported.
@@ -60,19 +86,38 @@ Default mechanical collection settings are intentionally visible in `<skill-dir>
60
86
 
61
87
  ```json
62
88
  {
63
- "schema": "repo_memory_builder_defaults.v1",
64
- "limits": {
65
- "commits": 30,
66
- "prs": 30,
67
- "issues": 30
89
+ "schema": "repo_memory_builder_defaults.v2",
90
+ "repoHistory": {
91
+ "mode": "provider",
92
+ "limits": {
93
+ "commits": 30,
94
+ "prs": 30,
95
+ "issues": 30
96
+ }
68
97
  },
69
98
  "summaryChars": 4000
70
99
  }
71
100
  ```
72
101
 
73
- To change defaults for future builder runs, edit `defaults.json`, not the Python scripts. To override one run, pass `--commit-limit`, `--pr-limit`, `--issue-limit`, or `--summary-chars` to `collect_all.py`.
102
+ To change defaults for future builder runs, edit `defaults.json`, not the Python scripts. To override one run, pass `--history-mode`, `--commit-limit`, `--pr-limit`, `--issue-limit`, or `--summary-chars` to `collect_all.py`.
103
+
104
+ Provider collection is best-effort by default. Use `--history-mode local-only` or `--skip-provider` for an explicit local-only run that does not call GitHub/GitLab, and use `--history-mode provider-required` or `--require-provider` only when the user explicitly requires PR/MR/issue evidence and the run should fail instead of falling back to local-only memory.
105
+
106
+ ## Historical Evidence Policy
107
+
108
+ Historical evidence collection is configurable per run with `--history-mode` and by default with `repoHistory.mode` in `defaults.json`:
109
+
110
+ | Mode | Commits | PRs/MRs and issues | Resource file contract |
111
+ |------|---------|--------------------|------------------------|
112
+ | `--history-mode none` | Disabled | Disabled | Write disabled resource files for commits, PRs/MRs, and issues using `source: "history_disabled"`, `resource_count: 0`, and `raw_source: ""`. |
113
+ | `--history-mode commits-only` | Collected locally | Disabled | Write commit resources from `raw/git-commits.json`; write PR/issue files using `source: "provider_skipped_local_only"`, `resource_count: 0`, and `raw_source: ""`. |
114
+ | `--history-mode local-only` | Collected locally | Disabled | Same as commits-only; use when the user wants local Git history but no provider calls. |
115
+ | `--history-mode provider` | Collected locally | Best-effort | Default. Collect provider facets when ready; if provider evidence is unavailable or fails, continue local-only and mark PR/issue resources unavailable. |
116
+ | `--history-mode provider-required` | Collected locally | Required | Fail the collection if provider facets cannot be collected. Use only when the user explicitly requires PR/MR/issue evidence. |
117
+
118
+ `--skip-provider` is a compatibility alias for `--history-mode local-only`; `--require-provider` is a compatibility alias for `--history-mode provider-required`.
74
119
 
75
- Provider collection is best-effort by default. Use `--skip-provider` for an explicit local-only run that does not call GitHub/GitLab, and use `--require-provider` only when the user explicitly requires PR/MR/issue evidence and the run should fail instead of falling back to local-only memory.
120
+ When history or provider evidence is disabled, skipped, unavailable, or degraded, still create `resources/commits.md`, `resources/prs.md`, and `resources/issues.md`; write disabled resource files for any historical channel that was not collected. The disabled or unavailable resource files tell future agents that the builder intentionally did not collect that evidence. For PR/issue files, do not say that no PRs or issues exist unless provider evidence was actually collected and empty.
76
121
 
77
122
  ## User Count Requests
78
123
 
@@ -150,7 +195,7 @@ Do not use a restricted shell sandbox to verify provider/API availability. Verif
150
195
 
151
196
  ### `scripts/validate_memory.py`
152
197
 
153
- Use this as the final gate after authoring `PROFILE.md` and `resources/*.md`. It accepts either the repository root or the memory root, validates required files, JSON parseability, frontmatter counts, placeholder removal, and provider raw/resource consistency.
198
+ Use this as the final gate after authoring `PROFILE.md`, supporting conceptual pages, and `resources/*.md`. It accepts either the repository root or the memory root, validates required files, JSON parseability, frontmatter counts, placeholder removal, and provider raw/resource consistency.
154
199
 
155
200
  ```bash
156
201
  python3 <skill-dir>/scripts/validate_memory.py <repo-path> --pretty
@@ -200,9 +245,12 @@ Run: `<notice.command>`
200
245
  - Form project-level understanding before looking at PR/issue history.
201
246
  - Record whether conclusions are doc-derived or code-inspected.
202
247
 
203
- 4. **Draft `PROFILE.md`**
248
+ 4. **Plan and draft the wiki landing page and conceptual pages**
204
249
  - Read [repo-templates.md](repo-templates.md) before writing memory files.
205
- - Include repo identity, checkout state, evidence inspected, agent consumption rules, module map, verification gates, architecture boundaries, resource pointers, and retrieval flow.
250
+ - Create `.repo_memory/_plan.md` after discovery and before final wiki writing. Use it to cluster repository-native conceptual areas, page purposes, evidence, boundaries, canonical homes, merge/split decisions, weak evidence, and path verification needs.
251
+ - Write `PROFILE.md` as the wiki landing page with repo identity, checkout state, what the repo contains, how it works, first-use path, Major Areas, Supporting Pages, provider context, and evidence inspected.
252
+ - Create repository-native supporting conceptual pages from the plan. Cover only concepts, workflows, system areas, or change surfaces with enough evidence to deserve canonical pages.
253
+ - Remove `.repo_memory/_plan.md` before final validation.
206
254
  - Record the selected build mode and avoid overstating code-level claims in lightweight mode.
207
255
 
208
256
  5. **Review raw evidence**
@@ -243,8 +291,9 @@ Every description must say what the item explains, when a future agent should op
243
291
 
244
292
  Generate memory that the `memorax-code` repo-read operation can consume progressively:
245
293
 
246
- - `PROFILE.md` is the stable entry point and should summarize identity, evidence, architecture, verification gates, and resource pointers.
247
- - `resources/*.md` are compact human-readable routing resources with search-grade descriptions.
294
+ - `PROFILE.md` is the stable wiki landing page and should summarize identity, evidence, major areas, supporting pages, verification gates, and resource pointers.
295
+ - Supporting conceptual pages are repository-native canonical homes for concepts, workflows, system areas, and change surfaces selected through temporary planning.
296
+ - `resources/*.md` are compact historical routing cards with search-grade descriptions.
248
297
  - `raw/*.json` contains optional build/debug evidence for deep inspection when compact resources are insufficient.
249
298
 
250
299
  Do not duplicate the daily retrieval workflow here. The `repo-read` operation owns trigger timing, silent background-maintenance handoff, and task-specific search behavior.
@@ -2,7 +2,7 @@
2
2
 
3
3
  ## Role And Demand Gate
4
4
 
5
- Use existing `.repo_memory/` as a routing layer for repository identity, architecture, history, PR/issue context, remembered fixes, and cross-module search. Live code and tests remain authoritative.
5
+ Use existing `.repo_memory/` as wiki-style repo memory for repository identity, architecture, history, PR/issue context, remembered fixes, and cross-module search. Live code and tests remain authoritative.
6
6
 
7
7
  Select this reference for broad repo introduction, history, architecture background, cross-module routing, PR/issue context, design rationale, or stale-memory awareness. Skip this reference for narrow tasks with a clear live-code target.
8
8
 
@@ -36,21 +36,27 @@ The default policy remains `adaptive(5 commits OR 24 hours)`. A missing or non-a
36
36
 
37
37
  ## Retrieval
38
38
 
39
- If `.repo_memory/PROFILE.md` is a readable regular file, read it once. Treat its descriptions as routing cues, not proof.
39
+ If `.repo_memory/PROFILE.md` is a readable regular file, read `PROFILE.md` as the wiki landing page once. Treat its descriptions as routing cues, not proof.
40
40
 
41
- Search `PROFILE.md` and `.repo_memory/resources/` with a combined query built from the user's strongest handles: path, basename, symbol, command, PR/issue number, error text, module, branch, environment variable, or config key.
41
+ Extract task-relevant links from `Major Areas` and `Supporting Pages`. Do not assume fixed page names; use `PROFILE.md` links and headings to find the repository-native canonical homes for the user's task. Open at most 2-4 relevant conceptual pages from `.repo_memory/*.md` before searching historical resources.
42
+
43
+ Search `PROFILE.md`, `.repo_memory/*.md`, and `.repo_memory/resources/` with a combined query built from the user's strongest handles: path, basename, symbol, command, PR/issue number, error text, module, branch, environment variable, or config key.
42
44
 
43
45
  ```bash
44
46
  rg -n '<handle-1>|<handle-2>' \
45
- .repo_memory/PROFILE.md .repo_memory/resources
47
+ .repo_memory/PROFILE.md .repo_memory/*.md .repo_memory/resources
46
48
  ```
47
49
 
48
50
  Use:
49
51
 
52
+ - conceptual `.repo_memory/*.md` pages for repository-native canonical homes, workflows, system areas, change surfaces, and verification routing;
53
+ - resources/*.md for historical routing cards;
50
54
  - `resources/commits.md` for local history and regressions;
51
55
  - `resources/prs.md` for merged or active implementation context;
52
56
  - `resources/issues.md` for symptoms, requests, and requirements.
53
57
 
58
+ Disabled and unavailable historical resource files are collection state, not repository state. If a resource frontmatter uses `source: "history_disabled"`, `source: "provider_skipped_local_only"`, or `source: "provider_unavailable"` with `resource_count: 0`, do not conclude that there are no commits, PRs, MRs, or issues. Treat the channel as intentionally uncollected or unavailable; answer from available memory only. Ask whether to rebuild with provider history when that context matters.
59
+
54
60
  If a read is missing, unreadable, or structurally mixed, discard conclusions that depend only on the bundle. Do not repair it in the foreground.
55
61
 
56
62
  ## Retrieval Budget
@@ -58,6 +64,7 @@ If a read is missing, unreadable, or structurally mixed, discard conclusions tha
58
64
  - Read `PROFILE.md` at most once.
59
65
  - Run at most 2 combined `rg` commands.
60
66
  - Stop repo-memory retrieval as soon as the hits are sufficient.
67
+ - Open at most 2-4 relevant conceptual pages total during the bounded memory phase.
61
68
  - Open only the matched resource section when `rg` context is insufficient.
62
69
 
63
70
  Do NOT open these unless the user explicitly asks or a compact hit contains only a `facetId`:
@@ -4,11 +4,13 @@ Use these templates as fill-in scaffolds. Replace all bracketed placeholders wit
4
4
 
5
5
  ### `.repo_memory/PROFILE.md`
6
6
 
7
+ `PROFILE.md` is the only fixed conceptual wiki file. It is a wiki landing page, not a dense resource index. It should read like a wiki-style repository memory home page: concise project identity, first-use path, major areas, supporting pages, and historical/provider pointers. Keep MemoraX frontmatter so the validator and maintenance hooks can still trust the bundle.
8
+
7
9
  ```markdown
8
10
  ---
9
- schema: "repo_memory_profile.v0.1"
10
- layout: "profile_with_progressive_resources.v0.1"
11
- disclosure_model: "progressive"
11
+ schema: "repo_memory_profile.v0.2"
12
+ layout: "wiki_landing_page.v0.1"
13
+ disclosure_model: "progressive_wiki"
12
14
  repo_name: "[repo name]"
13
15
  repo_owner: "[owner or empty]"
14
16
  repo_full_name: "[owner/name or empty]"
@@ -32,91 +34,146 @@ raw:
32
34
  provider_facets: "raw/github-facets.json|raw/gitlab-facets.json|"
33
35
  ---
34
36
 
35
- # [Repo Name] Repo Memory Profile
37
+ # [Repo Name] Repository Wiki
38
+
39
+ [One short paragraph explaining what this repository is, who uses it, and the primary runtime/package/product surface. Ground this in inspected docs or source.]
40
+
41
+ - Repository: `[owner/name or local repo]`
42
+ - Local HEAD when prepared: `[sha]` on `[branch]`
43
+ - Build mode: `[lightweight|deep]`; working tree was `[clean/dirty + explanation]`
44
+ - License: `[license if known]`
45
+
46
+ ## What This Repo Contains
47
+
48
+ | Area | What it does |
49
+ |------|--------------|
50
+ | `[repo-native product/module/workflow name]` (`path/`) | [Plain-language responsibility and primary entrypoint.] |
51
+ | `[repo-native product/module/workflow name]` (`path/`) | [Plain-language responsibility and primary entrypoint.] |
52
+
53
+ ## How It Works
54
+
55
+ [Five to ten sentences describing the main runtime/build/request/data flow. Link to supporting pages instead of explaining every detail here. Use conservative wording when lightweight mode did not inspect representative source.]
56
+
57
+ ## First-Use Path
58
+
59
+ ```bash
60
+ [install or setup command]
61
+ [one fast verification or smoke command]
62
+ ```
63
+
64
+ [Explain the shortest safe path a future agent should use to orient, build, test, or run the project.]
65
+
66
+ ## Major Areas
67
+
68
+ Choose these rows from `.repo_memory/_plan.md` after clustering inspected docs/source paths. Do not assume fixed page names; generic names are fallback names only when repository vocabulary gives no stronger topic.
69
+
70
+ | Area | Page | What It Covers |
71
+ |------|------|----------------|
72
+ | `[repo-native area name]` | [`[human page title]`](./repo-native-topic.md) | [What task cluster this page routes and why it is a canonical home.] |
73
+ | `[repo-native area name]` | [`[human page title]`](./repo-native-topic.md) | [What task cluster this page routes and why it is a canonical home.] |
74
+
75
+ ## Supporting Pages
36
76
 
37
- ## Identity And Checkout
77
+ - [`[human page title]`](./repo-native-topic.md) - open when [task cue, change surface, workflow, or risk].
78
+ - [`[human page title]`](./another-repo-native-topic.md) - open when [task cue, change surface, workflow, or risk].
79
+
80
+ ## Agent Consumption Rules
81
+
82
+ 1. Read this file first, then open only the supporting page relevant to the task. Memory is a map, not proof.
83
+ 2. Verify current behavior against live source, configs, tests, or executable checks before editing or making strong claims.
84
+ 3. Treat commits, PRs/MRs, and issues as historical routing context; they do not prove current checkout behavior.
85
+ 4. Prefer source paths and commands linked from supporting pages over broad repository scanning.
86
+
87
+ ## Coding Memory Boundary
38
88
 
39
- - Repository: `[owner/name]` at `[absolute path]`.
40
- - Local HEAD when prepared: `[sha]` on `[branch]`.
41
- - Prepared at: `[timestamp]`; working tree was `[clean/dirty + explanation]`.
42
- - License: `[license if known]`.
43
- - Primary purpose: [1-3 sentences explaining what this project does, based on docs and code].
89
+ This repo memory is a cold-start repository map presented as a repository wiki. Use it for module routing, architecture boundaries, verification gates, historical PR/issue context, and repository-specific conventions.
90
+
91
+ Runtime coding memory is narrower and should take precedence when it matches the current repo, module, API, behavior, lifecycle surface, ownership boundary, or failure mode. Use runtime coding memory for verified repair invariants, failed-attempt evidence, mutable-state ownership, callback/hook boundaries, adapter behavior, validation contracts, and other task-learned engineering lessons.
92
+
93
+ Do not treat repo memory, commits, PRs, or issues as implementation recipes. They are routing evidence and historical context. Always verify current behavior against live source and focused checks before editing.
94
+
95
+ ## Provider Context
96
+
97
+ - [Historical commits](./resources/commits.md) - local checkout history and regression routing.
98
+ - [Historical PRs/MRs](./resources/prs.md) - implementation context from provider facets when available.
99
+ - [Historical issues](./resources/issues.md) - user/request/problem context when available.
100
+ - Raw local commit facets: `./raw/git-commits.json`.
101
+ - Raw code-host facets: `./raw/github-facets.json` or `./raw/gitlab-facets.json` when present.
44
102
 
45
103
  ## Evidence Inspected
46
104
 
47
- - Build mode: `[lightweight|deep]`.
48
105
  - Root docs and agent instructions: `[README/docs/AGENTS.md/CLAUDE.md or similar files inspected]`.
49
106
  - Module docs: `[module README/docs inspected]`.
50
107
  - Representative source: `[important source/entrypoint files inspected, or 'not inspected in lightweight mode']`.
51
108
  - Manifests/scripts/CI: `[manifests, scripts, workflows inspected, or 'not inspected in lightweight mode']`.
52
109
  - Local commit snapshot: `[raw/git-commits.json status and count]`.
53
110
  - Historical code-host snapshot: `[raw/github-facets.json or raw/gitlab-facets.json status and counts]`.
111
+ ```
54
112
 
55
- ## Agent Consumption Rules
113
+ ### `.repo_memory/_plan.md`
56
114
 
57
- 1. Read this file first, then inspect the live code path you plan to edit. Memory is an index, not proof.
58
- 2. [Repo-specific safety or ownership rule].
59
- 3. [Repo-specific preferred extension pattern].
60
- 4. Treat PR/issue resources as historical/contextual; verify current behavior in code and tests.
115
+ Create this temporary planning artifact after discovery and before final wiki writing. Use it to cluster repository concepts and choose natural page boundaries. Remove `_plan.md` before final validation; it is not part of the durable bundle.
61
116
 
62
- ## Coding Memory Boundary
117
+ ```markdown
118
+ # Repo Memory Wiki Plan
119
+
120
+ ## Candidate Domains Considered
121
+
122
+ - [selected, merged, or skipped candidate domain] - [source evidence and decision].
63
123
 
64
- This repo memory is a cold-start repository map. Use it for module routing,
65
- historical PR/issue context, architecture boundaries, verification gates, and
66
- repository-specific conventions.
124
+ ## Intended Final Pages
67
125
 
68
- Runtime coding memory is narrower and should take precedence when it matches
69
- the current repo, module, API, behavior, lifecycle surface, ownership boundary,
70
- or failure mode. Use runtime coding memory for verified repair invariants,
71
- failed-attempt evidence, mutable-state ownership, callback/hook boundaries,
72
- adapter behavior, validation contracts, and other task-learned engineering
73
- lessons.
126
+ | Page | Purpose | Source evidence | Boundary |
127
+ |------|---------|-----------------|----------|
128
+ | `repo-native-topic.md` | [Future-agent task this page routes.] | [Docs/source/tests/scripts inspected.] | [What belongs here and what belongs elsewhere.] |
74
129
 
75
- Do not treat repo memory, commits, PRs, or issues as implementation recipes.
76
- They are routing evidence and historical context. Always verify current
77
- behavior against live source and focused checks before editing.
130
+ ## Canonical Homes And Overlaps
78
131
 
79
- ## Architecture Map
132
+ - [Overlapping concept] belongs in `[page]`; link from `[other page]` instead of duplicating because [reason].
133
+
134
+ ## Weak Evidence And Verification Needs
135
+
136
+ - [Claim/path/command] needs [specific verification] before final writing, or should be omitted.
137
+ ```
138
+
139
+ ### `.repo_memory/<repo-native-topic>.md`
140
+
141
+ Create supporting conceptual pages after clustering inspected evidence. Name pages from repository vocabulary, not from this template. Use lowercase kebab-case filenames derived from product surfaces, runtime components, commands, protocols, adapters, workflows, data models, operations, or other durable repository concepts. Generic names are fallback names only when repository vocabulary gives no stronger topic. Every conceptual page must include frontmatter so validation can scan it.
142
+
143
+ ```markdown
144
+ ---
145
+ schema: "repo_memory_wiki_page.v0.1"
146
+ page_type: "architecture|workflow|data-model|integration|operation|testing|extension|domain"
147
+ generated_at: "[ISO timestamp]"
148
+ source_profile: "PROFILE.md"
149
+ trust_state: "draft_wiki_page"
150
+ ---
80
151
 
81
- - `[module/path]`: [What it does, important entrypoints, how it relates to other modules].
82
- - `[module/path]`: [What it does, important entrypoints, how it relates to other modules].
152
+ # [Human Documentation Title]
83
153
 
84
- ## Runtime Flow
154
+ ## Purpose
85
155
 
86
- - [Main runtime/request/training/build flow].
87
- - [How modules communicate or hand off data].
88
- - [Where state, artifacts, configs, or generated outputs live].
156
+ [Explain which future tasks should open this page and what decisions it helps route.]
89
157
 
90
- ## Verification Gates
158
+ ## Key Paths
91
159
 
92
- - [Documentation-only verification].
93
- - [Syntax/static checks].
94
- - [Unit/smoke/integration checks].
95
- - [Expensive or environment-dependent checks and required services].
160
+ | Path | Responsibility | When to inspect |
161
+ |------|----------------|-----------------|
162
+ | `path/to/file-or-dir` | [What it owns.] | [Task cue, symbol, command, or failure mode.] |
96
163
 
97
- ## Resource Pointers
164
+ ## Flow Or Boundaries
98
165
 
99
- - Commit resource: `.repo_memory/resources/commits.md`.
100
- - PR resource: `.repo_memory/resources/prs.md`.
101
- - Issue resource: `.repo_memory/resources/issues.md`.
102
- - Raw local commit facets: `.repo_memory/raw/git-commits.json`.
103
- - Raw code-host facets: `.repo_memory/raw/github-facets.json` or `.repo_memory/raw/gitlab-facets.json`.
104
- - Mechanical preparation facts: `.repo_memory/raw/prepare-report.json`.
166
+ [Explain the concept, lifecycle, dependency direction, or ownership boundary. Prefer short paragraphs and bullets over exhaustive API reference.]
105
167
 
106
- ## Code Host Snapshot Notes
168
+ ## Verification
107
169
 
108
- - [Major merged PR themes].
109
- - [Recent local commit themes].
110
- - [Open PR themes and warning that they are not landed behavior].
111
- - [Issue clusters / user pain points].
170
+ - [Fast command or source check relevant to this page.]
171
+ - [Expensive or environment-dependent check, or say none identified.]
112
172
 
113
- ## Retrieval Flow
173
+ ## Agent Notes
114
174
 
115
- 1. Start here for module ownership, boundaries, and verification gates.
116
- 2. Open the relevant module docs/source entrypoints for the target path.
117
- 3. Search `resources/*.md` by module, file, symbol, branch, SHA, PR/MR number, or issue number when historical context matters.
118
- 4. Open matched `resources/*.md` sections for compact human-readable commit/PR/issue routing.
119
- 5. Use `raw/git-commits.json`, `raw/github-facets.json`, or `raw/gitlab-facets.json` only when compact resources are insufficient or a matched section points to a raw facet.
175
+ - Treat this page as routing context and verify current behavior in live source before editing.
176
+ - [One repo-specific caution, extension rule, or likely pitfall.]
120
177
  ```
121
178
 
122
179
  ### `.repo_memory/resources/commits.md`
@@ -141,6 +198,7 @@ Source: `.repo_memory/raw/git-commits.json`. Treat commits as local checkout his
141
198
  ## Commit [short_sha]: [title]
142
199
 
143
200
  - SHA: `[full sha]`
201
+ - Evidence status: [One short sentence describing local-history evidence strength and whether current source was verified.]
144
202
  - Author: `[author name]`
145
203
  - Authored: `[ISO timestamp]`
146
204
  - Modules: `[semantic modules for human routing]`
@@ -157,6 +215,7 @@ Source: `.repo_memory/raw/git-commits.json`. Treat commits as local checkout his
157
215
  ## Commit [short_sha]: [title]
158
216
 
159
217
  - SHA: `...`
218
+ - Evidence status: ...
160
219
  - Author: `...`
161
220
  - Authored: `...`
162
221
  - Modules: `...`
@@ -169,6 +228,24 @@ Source: `.repo_memory/raw/git-commits.json`. Treat commits as local checkout his
169
228
  - Raw lookup: `facetId=commit.abc1234`
170
229
  ```
171
230
 
231
+ When commit history is disabled by policy, still write a disabled resource file:
232
+
233
+ ```markdown
234
+ ---
235
+ schema: "repo_memory_commit_resource.v0.1"
236
+ repo_full_name: "[owner/name or local repo name]"
237
+ generated_at: "[ISO timestamp]"
238
+ source: "history_disabled"
239
+ resource_count: 0
240
+ trust_state: "disabled_by_policy"
241
+ raw_source: ""
242
+ ---
243
+
244
+ # Commit Resource Snapshot
245
+
246
+ No commit evidence was collected because historical evidence was disabled for this build. This is a collection-policy statement, not proof that the repository has no commits.
247
+ ```
248
+
172
249
  ### `.repo_memory/resources/prs.md`
173
250
 
174
251
  Use fixed-field sections, not Markdown tables. Every GitHub PR or GitLab MR needs a search-grade `Description` following the standard in `SKILL.md`. Do not paste the full raw summary; full raw summaries stay in `../raw/github-facets.json` or `../raw/gitlab-facets.json`.
@@ -191,6 +268,7 @@ Source: `.repo_memory/raw/github-facets.json` or `.repo_memory/raw/gitlab-facets
191
268
  ## PR/MR #[number]: [title]
192
269
 
193
270
  - State: `MERGED|OPEN|CLOSED` [include draft if applicable]
271
+ - Evidence status: [One short sentence describing historical/current relevance and whether current source was verified.]
194
272
  - Branch: `base <- head`
195
273
  - Modules: `[semantic modules for human routing]`
196
274
  - Path modules: `[path prefixes from raw facets or current inspection]`
@@ -208,6 +286,7 @@ Source: `.repo_memory/raw/github-facets.json` or `.repo_memory/raw/gitlab-facets
208
286
  ## PR/MR #[number]: [title]
209
287
 
210
288
  - State: `...`
289
+ - Evidence status: ...
211
290
  - Branch: `...`
212
291
  - Modules: `...`
213
292
  - Path modules: `...`
@@ -243,6 +322,7 @@ Source: `.repo_memory/raw/github-facets.json` or `.repo_memory/raw/gitlab-facets
243
322
  ## Issue #[number]: [title]
244
323
 
245
324
  - State: `OPEN|CLOSED`
325
+ - Evidence status: [One short sentence describing issue evidence strength, relevance, and whether current source was verified.]
246
326
  - Modules: `[semantic modules for human routing]`
247
327
  - Path modules: `[path prefixes from linked PR facets or current inspection, or -]`
248
328
  - Description: [2-4 search-grade sentences: what user problem/request this issue explains, when future agents should open it, affected behavior/modules, symptoms/errors, search cues, and evidence strength]
@@ -268,3 +348,43 @@ Source: `.repo_memory/raw/github-facets.json` or `.repo_memory/raw/gitlab-facets
268
348
  - URL: ...
269
349
  - Raw lookup: `facetId=issue.123`
270
350
  ```
351
+
352
+ ### Disabled Or Unavailable Resource Files
353
+
354
+ Use this pattern when historical evidence or provider evidence was intentionally not collected, unavailable, or degraded to local-only. Keep `resource_count: 0` and `raw_source: ""`; do not fabricate PRs, MRs, issues, or raw provider evidence. Use `source: "history_disabled"` when the entire history channel is disabled, `source: "provider_skipped_local_only"` when provider collection was skipped for a local-only build, and `source: "provider_unavailable"` when provider collection could not be completed.
355
+
356
+ For PR/MR resources:
357
+
358
+ ```markdown
359
+ ---
360
+ schema: "repo_memory_pr_resource.v0.1"
361
+ repo_full_name: "[owner/name or local repo name]"
362
+ generated_at: "[ISO timestamp]"
363
+ source: "provider_skipped_local_only|provider_unavailable|history_disabled"
364
+ resource_count: 0
365
+ trust_state: "unavailable_local_only|disabled_by_policy"
366
+ raw_source: ""
367
+ ---
368
+
369
+ # Pull Request Resource Snapshot
370
+
371
+ No provider evidence was collected for PRs/MRs in this build. This means PR/MR history is unavailable in the memory bundle; it does not mean the repository has no PRs or MRs.
372
+ ```
373
+
374
+ For issue resources:
375
+
376
+ ```markdown
377
+ ---
378
+ schema: "repo_memory_issue_resource.v0.1"
379
+ repo_full_name: "[owner/name or local repo name]"
380
+ generated_at: "[ISO timestamp]"
381
+ source: "provider_skipped_local_only|provider_unavailable|history_disabled"
382
+ resource_count: 0
383
+ trust_state: "unavailable_local_only|disabled_by_policy"
384
+ raw_source: ""
385
+ ---
386
+
387
+ # Issue Resource Snapshot
388
+
389
+ No provider evidence was collected for issues in this build. This means issue history is unavailable in the memory bundle; it does not mean the repository has no issues.
390
+ ```