@memorax/memorax-code 0.1.1 → 0.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +16 -12
- package/bin/memorax-code-npm-preinstall.mjs +7 -2
- package/bin/memorax-code-opencode.mjs +4 -0
- package/bin/memorax-code-plugin-postinstall.mjs +424 -108
- package/docs/configuration.md +153 -29
- package/docs/troubleshooting.md +93 -7
- package/lib/dsh-plugin-install.mjs +22 -0
- package/lib/memorax-code-adapter-common/src/hooks/capture-cwd-hook.mjs +21 -14
- package/lib/memorax-code-adapter-common/src/hooks/ensure-backend-runner.mjs +26 -7
- package/lib/memorax-code-adapter-common/src/hooks/memory-skill-reminder-hook.mjs +86 -95
- package/lib/memorax-code-adapter-common/src/hooks/memory-skill-reminder-policy.mjs +58 -0
- package/lib/memorax-code-adapter-common/src/repo-memory/repo-memory-auto-build.mjs +38 -0
- package/lib/memorax-code-adapter-common/src/repo-memory/repo-memory-job-supervisor.mjs +1 -1
- package/lib/memorax-code-adapter-common/src/windows-cli-invocation.mjs +13 -1
- package/lib/memorax-code-backend/dist/app/backend-server.js +210 -0
- package/lib/memorax-code-backend/dist/{server-observability.js → app/memory-observability.js} +4 -4
- package/lib/memorax-code-backend/dist/{backend-state.js → app/state.js} +1 -1
- package/lib/memorax-code-backend/dist/{claude-adapter-lifecycle.js → clients/claude/lifecycle.js} +2 -2
- package/lib/memorax-code-backend/dist/{claude-memory-hook-runtime.js → clients/claude/memory-hook-runtime.js} +16 -9
- package/lib/memorax-code-backend/dist/clients/codex/lifecycle.js +131 -0
- package/lib/memorax-code-backend/dist/{codex-memory-hook-runtime.js → clients/codex/memory-hook-runtime.js} +18 -11
- package/lib/memorax-code-backend/dist/{codex-plugin-hooks.js → clients/codex/plugin-hooks.js} +1 -1
- package/lib/memorax-code-backend/dist/{codex-plugin-install.js → clients/codex/plugin-install.js} +6 -6
- package/lib/memorax-code-backend/dist/clients/dsh/lifecycle.js +75 -0
- package/lib/memorax-code-backend/dist/clients/dsh/memory-hook-runtime.js +258 -0
- package/lib/memorax-code-backend/dist/clients/dsh/session-turn.js +249 -0
- package/lib/memorax-code-backend/dist/clients/opencode/lifecycle.js +54 -0
- package/lib/memorax-code-backend/dist/clients/opencode/memory-hook-runtime.js +277 -0
- package/lib/memorax-code-backend/dist/clients/opencode/message-turn.js +78 -0
- package/lib/memorax-code-backend/dist/codex-adapter-lifecycle.js +1 -131
- package/lib/memorax-code-backend/dist/{memorax-code-config.js → config/memorax-code.js} +32 -4
- package/lib/memorax-code-backend/dist/{server-cli.js → entrypoints/backend-cli.js} +157 -34
- package/lib/memorax-code-backend/dist/jsonl-append.js +1 -75
- package/lib/memorax-code-backend/dist/{active-client-selection.js → lifecycle/active-clients.js} +12 -1
- package/lib/memorax-code-backend/dist/{backend-service-cleanup.js → lifecycle/backend/cleanup.js} +1 -1
- package/lib/memorax-code-backend/dist/{backend-service-record.js → lifecycle/backend/record.js} +1 -1
- package/lib/memorax-code-backend/dist/{backend-service-result.js → lifecycle/backend/result.js} +2 -2
- package/lib/memorax-code-backend/dist/{service.js → lifecycle/backend/service.js} +16 -16
- package/lib/memorax-code-backend/dist/{backend-token-record.js → lifecycle/backend/token-record.js} +1 -1
- package/lib/memorax-code-backend/dist/{backend-service-token.js → lifecycle/backend/token.js} +2 -2
- package/lib/memorax-code-backend/dist/lifecycle/client-plugin-removal.js +109 -0
- package/lib/memorax-code-backend/dist/{client-selection.js → lifecycle/client-selection.js} +11 -5
- package/lib/memorax-code-backend/dist/{backend-lifecycle-lock.js → lifecycle/lock.js} +1 -1
- package/lib/memorax-code-backend/dist/{memorax-code-lifecycle.js → lifecycle/orchestrator.js} +325 -39
- package/lib/memorax-code-backend/dist/memorax-cli.js +3 -1
- package/lib/memorax-code-backend/dist/memorax-code.js +1 -1
- package/lib/memorax-code-backend/dist/{automatic-memory-retrieval.js → memory/automatic-retrieval.js} +3 -3
- package/lib/memorax-code-backend/dist/{automatic-memory-writeback.js → memory/automatic-writeback.js} +82 -21
- package/lib/memorax-code-backend/dist/{memory-cli.js → memory/cli.js} +45 -10
- package/lib/memorax-code-backend/dist/{memory-hook-command.js → memory/hook-command.js} +156 -9
- package/lib/memorax-code-backend/dist/memory/observability.js +1 -0
- package/lib/memorax-code-backend/dist/memory/payload-redaction.js +212 -0
- package/lib/memorax-code-backend/dist/{memory-reminder-trace-recorder.js → memory/reminder-trace-recorder.js} +20 -7
- package/lib/memorax-code-backend/dist/{repository-memory-context.js → memory/repository-session.js} +25 -4
- package/lib/memorax-code-backend/dist/{memory-service.js → memory/service.js} +30 -6
- package/lib/memorax-code-backend/dist/{memory-turn-coordinator.js → memory/turn-coordinator.js} +7 -3
- package/lib/memorax-code-backend/dist/{memory-writeback-buffer.js → memory/writeback-buffer.js} +31 -2
- package/lib/memorax-code-backend/dist/{memory-writeback-chunk.js → memory/writeback-chunk.js} +1 -1
- package/lib/memorax-code-backend/dist/{memory-writeback-reconciler.js → memory/writeback-reconciler.js} +6 -6
- package/lib/memorax-code-backend/dist/{memory-writeback-task-projection.js → memory/writeback-task-projection.js} +4 -4
- package/lib/memorax-code-backend/dist/{memorax-adapter.js → provider/memorax/adapter.js} +5 -5
- package/lib/memorax-code-backend/dist/{memorax-config.js → provider/memorax/config.js} +4 -4
- package/lib/memorax-code-backend/dist/{memorax-http.js → provider/memorax/http.js} +1 -1
- package/lib/memorax-code-backend/dist/{repo-memory-readiness.js → repository/readiness.js} +3 -3
- package/lib/memorax-code-backend/dist/{repository-memory-scope.js → repository/scope.js} +81 -33
- package/lib/memorax-code-backend/dist/server.js +3 -212
- package/lib/memorax-code-backend/dist/service-entrypoint.js +1 -1
- package/lib/memorax-code-backend/dist/{debug-log.js → shared/debug-log.js} +1 -1
- package/lib/memorax-code-backend/dist/shared/jsonl-append.js +75 -0
- package/lib/memorax-code-backend/dist/shared/windows-cli-invocation.js +148 -0
- package/lib/memorax-code-backend/dist/{trace-config.js → trace/config.js} +43 -5
- package/lib/memorax-code-backend/dist/{trace-context.js → trace/context.js} +53 -2
- package/lib/memorax-code-backend/dist/{trace-store.js → trace/store.js} +3 -3
- package/lib/memorax-code-backend/dist/{server-health.js → transport/http/health.js} +1 -1
- package/lib/memorax-code-backend/dist/{server-memory-hook.js → transport/http/memory-hook.js} +3 -3
- package/lib/memorax-code-backend/dist/{server-http.js → transport/http/request.js} +1 -1
- package/lib/memorax-code-backend/dist/{claude-local-transcript.js → viewer/history/claude-transcript.js} +3 -3
- package/lib/memorax-code-backend/dist/{memory-viewer-session-title.js → viewer/history/session-title.js} +1 -1
- package/lib/memorax-code-backend/dist/{server-memory-viewer.js → viewer/http/public-routes.js} +25 -14
- package/lib/memorax-code-backend/dist/viewer/model.js +1 -0
- package/lib/memorax-code-backend/dist/{memory-viewer-activity.js → viewer/projection/activity.js} +2 -2
- package/lib/memorax-code-backend/dist/{memory-viewer-history-projection.js → viewer/projection/history.js} +1 -1
- package/lib/memorax-code-backend/dist/{memory-viewer-observability.js → viewer/projection/observability.js} +1 -1
- package/lib/memorax-code-backend/dist/{memory-viewer-user-projection.js → viewer/projection/user.js} +1 -1
- package/lib/memorax-code-backend/dist/{memory-viewer-writeback-status.js → viewer/projection/writeback-status.js} +1 -1
- package/lib/memorax-code-backend/dist/{memory-viewer-store.js → viewer/store.js} +59 -32
- package/lib/memorax-code-backend/dist/viewer/ui/icon.js +1 -0
- package/lib/memorax-code-backend/dist/{memory-viewer-user-html.js → viewer/ui/user-html.js} +14 -12
- package/lib/memorax-code-backend/dist/windows-cli-invocation.js +1 -148
- package/lib/memorax-code-backend/package.json +3 -3
- package/lib/memorax-code-claude-adapter/.claude-plugin/plugin.json +1 -1
- package/lib/memorax-code-claude-adapter/hooks/runtime-shell.json +1 -1
- package/lib/memorax-code-claude-adapter/package.json +1 -1
- package/lib/memorax-code-claude-adapter/runtime-hooks/memory-turn.mjs +5 -0
- package/lib/memorax-code-claude-adapter/skills/memorax-code/SKILL.md +23 -15
- package/lib/memorax-code-claude-adapter/skills/memorax-code/defaults.json +8 -5
- package/lib/memorax-code-claude-adapter/skills/memorax-code/references/memorax-add.md +5 -1
- package/lib/memorax-code-claude-adapter/skills/memorax-code/references/memorax-search.md +40 -10
- package/lib/memorax-code-claude-adapter/skills/memorax-code/references/personal-read.md +1 -1
- package/lib/memorax-code-claude-adapter/skills/memorax-code/references/personal-write.md +33 -13
- package/lib/memorax-code-claude-adapter/skills/memorax-code/references/repo-build.md +62 -13
- package/lib/memorax-code-claude-adapter/skills/memorax-code/references/repo-read.md +11 -4
- package/lib/memorax-code-claude-adapter/skills/memorax-code/references/repo-templates.md +179 -59
- package/lib/memorax-code-claude-adapter/skills/memorax-code/references/repo-update.md +18 -7
- package/lib/memorax-code-claude-adapter/skills/memorax-code/scripts/collect_all.py +122 -39
- package/lib/memorax-code-claude-adapter/skills/memorax-code/scripts/detect_updates.py +73 -10
- package/lib/memorax-code-claude-adapter/skills/memorax-code/scripts/github_resource_facets.py +9 -1
- package/lib/memorax-code-claude-adapter/skills/memorax-code/scripts/gitlab_resource_facets.py +9 -1
- package/lib/memorax-code-claude-adapter/skills/memorax-code/scripts/validate_memory.py +23 -1
- package/lib/memorax-code-claude-adapter/src/plugin-install.mjs +2 -0
- package/lib/memorax-code-claude-marketplace/plugins/memorax-code-claude-adapter/.claude-plugin/plugin.json +1 -1
- package/lib/memorax-code-claude-marketplace/plugins/memorax-code-claude-adapter/hooks/runtime-shell.json +1 -1
- package/lib/memorax-code-claude-marketplace/plugins/memorax-code-claude-adapter/memorax-code-adapter-common/src/hooks/capture-cwd-hook.mjs +21 -14
- package/lib/memorax-code-claude-marketplace/plugins/memorax-code-claude-adapter/memorax-code-adapter-common/src/hooks/ensure-backend-runner.mjs +26 -7
- package/lib/memorax-code-claude-marketplace/plugins/memorax-code-claude-adapter/memorax-code-adapter-common/src/hooks/memory-skill-reminder-hook.mjs +86 -95
- package/lib/memorax-code-claude-marketplace/plugins/memorax-code-claude-adapter/memorax-code-adapter-common/src/hooks/memory-skill-reminder-policy.mjs +58 -0
- package/lib/memorax-code-claude-marketplace/plugins/memorax-code-claude-adapter/memorax-code-adapter-common/src/repo-memory/repo-memory-auto-build.mjs +38 -0
- 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
- package/lib/memorax-code-claude-marketplace/plugins/memorax-code-claude-adapter/memorax-code-adapter-common/src/windows-cli-invocation.mjs +13 -1
- package/lib/memorax-code-claude-marketplace/plugins/memorax-code-claude-adapter/package.json +1 -1
- package/lib/memorax-code-claude-marketplace/plugins/memorax-code-claude-adapter/runtime-hooks/memory-turn.mjs +5 -0
- package/lib/memorax-code-claude-marketplace/plugins/memorax-code-claude-adapter/skills/memorax-code/SKILL.md +23 -15
- package/lib/memorax-code-claude-marketplace/plugins/memorax-code-claude-adapter/skills/memorax-code/defaults.json +8 -5
- package/lib/memorax-code-claude-marketplace/plugins/memorax-code-claude-adapter/skills/memorax-code/references/memorax-add.md +5 -1
- package/lib/memorax-code-claude-marketplace/plugins/memorax-code-claude-adapter/skills/memorax-code/references/memorax-search.md +40 -10
- package/lib/memorax-code-claude-marketplace/plugins/memorax-code-claude-adapter/skills/memorax-code/references/personal-read.md +1 -1
- package/lib/memorax-code-claude-marketplace/plugins/memorax-code-claude-adapter/skills/memorax-code/references/personal-write.md +33 -13
- package/lib/memorax-code-claude-marketplace/plugins/memorax-code-claude-adapter/skills/memorax-code/references/repo-build.md +62 -13
- package/lib/memorax-code-claude-marketplace/plugins/memorax-code-claude-adapter/skills/memorax-code/references/repo-read.md +11 -4
- package/lib/memorax-code-claude-marketplace/plugins/memorax-code-claude-adapter/skills/memorax-code/references/repo-templates.md +179 -59
- package/lib/memorax-code-claude-marketplace/plugins/memorax-code-claude-adapter/skills/memorax-code/references/repo-update.md +18 -7
- package/lib/memorax-code-claude-marketplace/plugins/memorax-code-claude-adapter/skills/memorax-code/scripts/collect_all.py +122 -39
- package/lib/memorax-code-claude-marketplace/plugins/memorax-code-claude-adapter/skills/memorax-code/scripts/detect_updates.py +73 -10
- package/lib/memorax-code-claude-marketplace/plugins/memorax-code-claude-adapter/skills/memorax-code/scripts/github_resource_facets.py +9 -1
- package/lib/memorax-code-claude-marketplace/plugins/memorax-code-claude-adapter/skills/memorax-code/scripts/gitlab_resource_facets.py +9 -1
- package/lib/memorax-code-claude-marketplace/plugins/memorax-code-claude-adapter/skills/memorax-code/scripts/validate_memory.py +23 -1
- package/lib/memorax-code-claude-marketplace/plugins/memorax-code-claude-adapter/src/plugin-install.mjs +2 -0
- package/lib/memorax-code-codex-adapter/.codex-plugin/plugin.json +1 -1
- package/lib/memorax-code-codex-adapter/hooks/runtime-shell.json +1 -1
- package/lib/memorax-code-codex-adapter/package.json +1 -1
- package/lib/memorax-code-codex-adapter/runtime-hooks/memory-skill-reminder.mjs +16 -2
- package/lib/memorax-code-codex-adapter/skills/memorax-code/SKILL.md +23 -15
- package/lib/memorax-code-codex-adapter/skills/memorax-code/defaults.json +8 -5
- package/lib/memorax-code-codex-adapter/skills/memorax-code/references/memorax-add.md +5 -1
- package/lib/memorax-code-codex-adapter/skills/memorax-code/references/memorax-search.md +40 -10
- package/lib/memorax-code-codex-adapter/skills/memorax-code/references/personal-read.md +1 -1
- package/lib/memorax-code-codex-adapter/skills/memorax-code/references/personal-write.md +33 -13
- package/lib/memorax-code-codex-adapter/skills/memorax-code/references/repo-build.md +62 -13
- package/lib/memorax-code-codex-adapter/skills/memorax-code/references/repo-read.md +11 -4
- package/lib/memorax-code-codex-adapter/skills/memorax-code/references/repo-templates.md +179 -59
- package/lib/memorax-code-codex-adapter/skills/memorax-code/references/repo-update.md +18 -7
- package/lib/memorax-code-codex-adapter/skills/memorax-code/scripts/collect_all.py +122 -39
- package/lib/memorax-code-codex-adapter/skills/memorax-code/scripts/detect_updates.py +73 -10
- package/lib/memorax-code-codex-adapter/skills/memorax-code/scripts/github_resource_facets.py +9 -1
- package/lib/memorax-code-codex-adapter/skills/memorax-code/scripts/gitlab_resource_facets.py +9 -1
- package/lib/memorax-code-codex-adapter/skills/memorax-code/scripts/validate_memory.py +23 -1
- package/lib/memorax-code-dsh-adapter/cordis.patch.yml +10 -0
- package/lib/memorax-code-dsh-adapter/hooks/repo-memory-job.mjs +68 -0
- package/lib/memorax-code-dsh-adapter/package.json +69 -0
- package/lib/memorax-code-dsh-adapter/skills/memorax-code/SKILL.md +91 -0
- package/lib/memorax-code-dsh-adapter/skills/memorax-code/agents/claude.yaml +10 -0
- package/lib/memorax-code-dsh-adapter/skills/memorax-code/agents/openai.yaml +7 -0
- package/lib/memorax-code-dsh-adapter/skills/memorax-code/defaults.json +12 -0
- package/lib/memorax-code-dsh-adapter/skills/memorax-code/references/memorax-add.md +86 -0
- package/lib/memorax-code-dsh-adapter/skills/memorax-code/references/memorax-search.md +91 -0
- package/lib/memorax-code-dsh-adapter/skills/memorax-code/references/personal-read.md +46 -0
- package/lib/memorax-code-dsh-adapter/skills/memorax-code/references/personal-write.md +120 -0
- package/lib/memorax-code-dsh-adapter/skills/memorax-code/references/repo-build.md +319 -0
- package/lib/memorax-code-dsh-adapter/skills/memorax-code/references/repo-read.md +103 -0
- package/lib/memorax-code-dsh-adapter/skills/memorax-code/references/repo-templates.md +390 -0
- package/lib/memorax-code-dsh-adapter/skills/memorax-code/references/repo-update.md +127 -0
- package/lib/memorax-code-dsh-adapter/skills/memorax-code/scripts/collect_all.py +579 -0
- package/lib/memorax-code-dsh-adapter/skills/memorax-code/scripts/detect_updates.py +919 -0
- package/lib/memorax-code-dsh-adapter/skills/memorax-code/scripts/git_commit_facets.py +222 -0
- package/lib/memorax-code-dsh-adapter/skills/memorax-code/scripts/github_resource_facets.py +512 -0
- package/lib/memorax-code-dsh-adapter/skills/memorax-code/scripts/gitlab_resource_facets.py +517 -0
- package/lib/memorax-code-dsh-adapter/skills/memorax-code/scripts/prepare_repo_memory.py +411 -0
- package/lib/memorax-code-dsh-adapter/skills/memorax-code/scripts/user_profile_memory.py +528 -0
- package/lib/memorax-code-dsh-adapter/skills/memorax-code/scripts/validate_memory.py +248 -0
- package/lib/memorax-code-dsh-adapter/src/backend-client.mjs +119 -0
- package/lib/memorax-code-dsh-adapter/src/dsh-message.mjs +32 -0
- package/lib/memorax-code-dsh-adapter/src/dsh-version.mjs +18 -0
- package/lib/memorax-code-dsh-adapter/src/http-client.mjs +55 -0
- package/lib/memorax-code-dsh-adapter/src/index.mjs +72 -0
- package/lib/memorax-code-dsh-adapter/src/personal-context-worker.mjs +48 -0
- package/lib/memorax-code-dsh-adapter/src/personal-context.mjs +114 -0
- package/lib/memorax-code-dsh-adapter/src/plugin.mjs +724 -0
- package/lib/memorax-code-dsh-adapter/src/profile-lifecycle.mjs +1289 -0
- package/lib/memorax-code-dsh-adapter/src/protocol.mjs +145 -0
- package/lib/memorax-code-dsh-adapter/src/runtime-state.mjs +132 -0
- package/lib/memorax-code-opencode-adapter/hooks/repo-memory-job.mjs +37 -0
- package/lib/memorax-code-opencode-adapter/package.json +10 -0
- package/lib/memorax-code-opencode-adapter/skills/memorax-code/SKILL.md +91 -0
- package/lib/memorax-code-opencode-adapter/skills/memorax-code/agents/claude.yaml +10 -0
- package/lib/memorax-code-opencode-adapter/skills/memorax-code/agents/openai.yaml +7 -0
- package/lib/memorax-code-opencode-adapter/skills/memorax-code/defaults.json +12 -0
- package/lib/memorax-code-opencode-adapter/skills/memorax-code/references/memorax-add.md +86 -0
- package/lib/memorax-code-opencode-adapter/skills/memorax-code/references/memorax-search.md +91 -0
- package/lib/memorax-code-opencode-adapter/skills/memorax-code/references/personal-read.md +46 -0
- package/lib/memorax-code-opencode-adapter/skills/memorax-code/references/personal-write.md +120 -0
- package/lib/memorax-code-opencode-adapter/skills/memorax-code/references/repo-build.md +319 -0
- package/lib/memorax-code-opencode-adapter/skills/memorax-code/references/repo-read.md +103 -0
- package/lib/memorax-code-opencode-adapter/skills/memorax-code/references/repo-templates.md +390 -0
- package/lib/memorax-code-opencode-adapter/skills/memorax-code/references/repo-update.md +127 -0
- package/lib/memorax-code-opencode-adapter/skills/memorax-code/scripts/collect_all.py +579 -0
- package/lib/memorax-code-opencode-adapter/skills/memorax-code/scripts/detect_updates.py +919 -0
- package/lib/memorax-code-opencode-adapter/skills/memorax-code/scripts/git_commit_facets.py +222 -0
- package/lib/memorax-code-opencode-adapter/skills/memorax-code/scripts/github_resource_facets.py +512 -0
- package/lib/memorax-code-opencode-adapter/skills/memorax-code/scripts/gitlab_resource_facets.py +517 -0
- package/lib/memorax-code-opencode-adapter/skills/memorax-code/scripts/prepare_repo_memory.py +411 -0
- package/lib/memorax-code-opencode-adapter/skills/memorax-code/scripts/user_profile_memory.py +528 -0
- package/lib/memorax-code-opencode-adapter/skills/memorax-code/scripts/validate_memory.py +248 -0
- package/lib/memorax-code-opencode-adapter/src/adapter-paths.mjs +37 -0
- package/lib/memorax-code-opencode-adapter/src/cli.mjs +260 -0
- package/lib/memorax-code-opencode-adapter/src/diagnostics.mjs +31 -0
- package/lib/memorax-code-opencode-adapter/src/plugin-install.mjs +673 -0
- package/lib/memorax-code-opencode-adapter/src/plugin.mjs +536 -0
- package/lib/memorax-code-opencode-adapter/src/repo-memory-server-runner.mjs +207 -0
- package/lib/resolve-claude-command.mjs +154 -1
- package/lib/resolve-codex-command.mjs +56 -1
- package/lib/run-entrypoint.mjs +6 -0
- package/package.json +7 -3
- package/lib/memorax-code-backend/dist/client-plugin-removal.js +0 -67
- /package/lib/memorax-code-backend/dist/{claude-transcript-turn.js → clients/claude/transcript-turn.js} +0 -0
- /package/lib/memorax-code-backend/dist/{codex-effective-prompt.js → clients/codex/effective-prompt.js} +0 -0
- /package/lib/memorax-code-backend/dist/{codex-rollout-turn.js → clients/codex/rollout-turn.js} +0 -0
- /package/lib/memorax-code-backend/dist/{codex-session-turn-index.js → clients/codex/session-turn-index.js} +0 -0
- /package/lib/memorax-code-backend/dist/{codex-workspace-links.js → clients/codex/workspace-links.js} +0 -0
- /package/lib/memorax-code-backend/dist/{backend-env.js → config/backend-env.js} +0 -0
- /package/lib/memorax-code-backend/dist/{proxy-env.js → config/proxy-env.js} +0 -0
- /package/lib/memorax-code-backend/dist/{entrypoint.js → entrypoints/main.js} +0 -0
- /package/lib/memorax-code-backend/dist/{backend-process.js → lifecycle/backend/process.js} +0 -0
- /package/lib/memorax-code-backend/dist/{backend-shutdown-request.js → lifecycle/backend/shutdown-request.js} +0 -0
- /package/lib/memorax-code-backend/dist/{backend-status.js → lifecycle/backend/status.js} +0 -0
- /package/lib/memorax-code-backend/dist/{adapter-lifecycle-participant.js → lifecycle/contracts.js} +0 -0
- /package/lib/memorax-code-backend/dist/{install-watchdog.js → lifecycle/install-watchdog.js} +0 -0
- /package/lib/memorax-code-backend/dist/{memory-observability.js → lifecycle/participant.js} +0 -0
- /package/lib/memorax-code-backend/dist/{memory-project.js → memory/project.js} +0 -0
- /package/lib/memorax-code-backend/dist/{incremental-jsonl-projection.js → shared/incremental-jsonl-projection.js} +0 -0
- /package/lib/memorax-code-backend/dist/{utils.js → shared/record.js} +0 -0
- /package/lib/memorax-code-backend/dist/{server-json.js → transport/http/json.js} +0 -0
- /package/lib/memorax-code-backend/dist/{memory-viewer-data-projection-cache.js → viewer/projection/cache.js} +0 -0
- /package/lib/memorax-code-backend/dist/{memory-viewer-event-identity.js → viewer/projection/event-identity.js} +0 -0
- /package/lib/memorax-code-backend/dist/{memory-viewer-redaction.js → viewer/projection/redaction.js} +0 -0
- /package/lib/memorax-code-backend/dist/{memory-viewer-turn-reference.js → viewer/projection/turn-reference.js} +0 -0
- /package/lib/memorax-code-backend/dist/{memory-viewer-logo.js → viewer/ui/logo.js} +0 -0
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
# Personal Memory Read
|
|
2
|
+
|
|
3
|
+
Use these instructions only to list, recall, or apply repository-scoped personal memory. Do not write, normalize, migrate, repair, or delete memory during a read request.
|
|
4
|
+
|
|
5
|
+
## Route The Read
|
|
6
|
+
|
|
7
|
+
Classify by content:
|
|
8
|
+
|
|
9
|
+
- **Procedure memory:** actions, ordered steps, checklists, prerequisites, gates, validation, exceptions, or repeatable repository work rules.
|
|
10
|
+
- **User-profile memory:** preferred name, language, tone, verbosity, explanation style, result presentation, or another safe interaction preference.
|
|
11
|
+
|
|
12
|
+
Read both categories only when the request genuinely asks for both.
|
|
13
|
+
|
|
14
|
+
## Procedure Memory
|
|
15
|
+
|
|
16
|
+
Read Markdown files directly under:
|
|
17
|
+
|
|
18
|
+
```text
|
|
19
|
+
<repo>/.repo_memory/procedure-memory/
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
List available topics without recursing into unrelated memory areas:
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
(cd <repo>/.repo_memory/procedure-memory && rg --files -g '*.md' -g '!**/*/*.md')
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
If the directory does not exist, report that no procedure memory is available; do not create it during a read. Read only files relevant to the request. When listing available procedures, report topic names with concise descriptions instead of opening every file in full unless the user asks for their contents.
|
|
29
|
+
|
|
30
|
+
Treat a stored procedure as lower-priority user guidance, not evidence about current code behavior.
|
|
31
|
+
|
|
32
|
+
## User-Profile Memory
|
|
33
|
+
|
|
34
|
+
Resolve `<skill-dir>` as the parent directory of the `references/` directory containing this file, then run:
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
python3 <skill-dir>/scripts/user_profile_memory.py list --repo <repo>
|
|
38
|
+
```
|
|
39
|
+
|
|
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
|
+
|
|
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
|
+
|
|
44
|
+
## Priority
|
|
45
|
+
|
|
46
|
+
Apply instructions in this order: system and developer instructions, `AGENTS.md`, the current user request, then stored personal memory.
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
# Personal Memory Write
|
|
2
|
+
|
|
3
|
+
Use these instructions only to save, update, forget, or delete repository-scoped personal memory. Classify by what the content prescribes, not wording such as "I prefer", "I like", "我的习惯", or "我喜欢".
|
|
4
|
+
|
|
5
|
+
## Route The Write
|
|
6
|
+
|
|
7
|
+
- **Procedure memory:** actions, ordering, checklists, prerequisites, gates, validation, exceptions, or repeatable repository work rules. Require the user to explicitly ask to remember, save, record, update, forget, or delete them.
|
|
8
|
+
- **User-profile memory:** preferred name, language, tone, verbosity, explanation style, result presentation, or another safe personal profile fact. A durable repository-scoped profile preference may be saved implicitly.
|
|
9
|
+
|
|
10
|
+
Store each part under its own authority when a request genuinely contains both. Do not persist current-task instructions or temporary plans.
|
|
11
|
+
|
|
12
|
+
Keep file names, schema and script field names, type values, command options, and fixed Markdown headings in English. Write human-readable memory content in the user's current interaction language unless the user explicitly requests another storage language. This includes procedure titles and steps and user-profile descriptions, applicability, and exceptions. Preserve exact code identifiers, commands, paths, API names, and quoted literals without translation.
|
|
13
|
+
|
|
14
|
+
## Procedure Memory
|
|
15
|
+
|
|
16
|
+
Before writing, ensure the repository root `.gitignore` contains `.repo_memory/`. Store each procedure topic in its own concise kebab-case file directly under:
|
|
17
|
+
|
|
18
|
+
```text
|
|
19
|
+
<repo>/.repo_memory/procedure-memory/
|
|
20
|
+
```
|
|
21
|
+
|
|
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
|
+
|
|
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.
|
|
34
|
+
|
|
35
|
+
Use this shape when useful:
|
|
36
|
+
|
|
37
|
+
```markdown
|
|
38
|
+
# Reviewing Code
|
|
39
|
+
|
|
40
|
+
Use when: reviewing changes in this repository.
|
|
41
|
+
|
|
42
|
+
## Procedure
|
|
43
|
+
|
|
44
|
+
1. Review the changes before creating a PR.
|
|
45
|
+
2. Resolve blocking findings.
|
|
46
|
+
3. Create the PR only after review is complete.
|
|
47
|
+
|
|
48
|
+
## Exceptions
|
|
49
|
+
|
|
50
|
+
- Follow a more specific current user instruction first.
|
|
51
|
+
```
|
|
52
|
+
|
|
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.
|
|
54
|
+
|
|
55
|
+
## User-Profile Memory
|
|
56
|
+
|
|
57
|
+
Use only:
|
|
58
|
+
|
|
59
|
+
```text
|
|
60
|
+
<repo>/.repo_memory/user-profile/preferences.md
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
Resolve `<skill-dir>` as the parent directory of the `references/` directory containing this file. The script owns directory creation, `.gitignore` updates, parsing, normalization, locking, duplicate detection, counts, and deterministic rewriting. Do not hand-edit `preferences.md` except when diagnosing a script failure.
|
|
64
|
+
|
|
65
|
+
List existing preferences before adding and perform semantic matching:
|
|
66
|
+
|
|
67
|
+
```bash
|
|
68
|
+
python3 <skill-dir>/scripts/user_profile_memory.py list --repo <repo>
|
|
69
|
+
```
|
|
70
|
+
|
|
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:
|
|
83
|
+
|
|
84
|
+
```bash
|
|
85
|
+
python3 <skill-dir>/scripts/user_profile_memory.py add \
|
|
86
|
+
--repo <repo> \
|
|
87
|
+
--type communication \
|
|
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."
|
|
91
|
+
```
|
|
92
|
+
|
|
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.
|
|
94
|
+
|
|
95
|
+
Update a clearly identified preference in place:
|
|
96
|
+
|
|
97
|
+
```bash
|
|
98
|
+
python3 <skill-dir>/scripts/user_profile_memory.py update \
|
|
99
|
+
--repo <repo> \
|
|
100
|
+
--id <preference-id> \
|
|
101
|
+
--description <current-description> \
|
|
102
|
+
--applies-when <current-scope> \
|
|
103
|
+
--do-not-apply-when <exception>
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
If multiple preferences may match, or it is unclear whether the change is durable, ask the user. Delete only an explicitly identified preference:
|
|
107
|
+
|
|
108
|
+
```bash
|
|
109
|
+
python3 <skill-dir>/scripts/user_profile_memory.py delete \
|
|
110
|
+
--repo <repo> \
|
|
111
|
+
--id <preference-id>
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
For delete-all requests, list active preferences and delete each id. Do not preserve deleted text elsewhere.
|
|
115
|
+
|
|
116
|
+
## Safety And Output
|
|
117
|
+
|
|
118
|
+
Do not store secrets, tokens, credentials, `.env` content, sensitive personal data, repository facts, code history, design rationale, one-off task details, raw transcripts, hidden tests, exact patches, raw diffs, target commits, or unsafe destructive commands.
|
|
119
|
+
|
|
120
|
+
After a successful write, update, or deletion, identify the affected topic or preference briefly and confirm that it is local to the current repository.
|
|
@@ -0,0 +1,319 @@
|
|
|
1
|
+
# Repo Memory Build
|
|
2
|
+
|
|
3
|
+
## Core Principle
|
|
4
|
+
|
|
5
|
+
The agent authors the repo memory. Scripts collect and validate mechanical evidence, but do not replace agent-authored memory.
|
|
6
|
+
|
|
7
|
+
Do not let a script write `PROFILE.md`, `resources/commits.md`, `resources/prs.md`, or `resources/issues.md`. The agent must inspect the local project, understand the code, and author the human-facing memory. Scripts may create deterministic raw evidence only.
|
|
8
|
+
|
|
9
|
+
This is the full-build operation, not the daily reader or incremental updater. Return to `SKILL.md` and use `repo-read.md` for task-time search over existing memory. For latest-change-only updates to an existing `.repo_memory`, use `repo-update.md`. Use this reference for first-time creation, full rebuilds, or full refreshes that recollect raw evidence and rewrite authored memory.
|
|
10
|
+
|
|
11
|
+
## Output Layout
|
|
12
|
+
|
|
13
|
+
The user selects a repository, not a memory directory. Do not ask for a `.repo_memory` path. Create this bundle inside the target repository:
|
|
14
|
+
|
|
15
|
+
```text
|
|
16
|
+
<repo>/.repo_memory/
|
|
17
|
+
├── PROFILE.md
|
|
18
|
+
├── <repo-native-topic>.md conceptual pages
|
|
19
|
+
├── raw/
|
|
20
|
+
│ ├── prepare-report.json
|
|
21
|
+
│ ├── git-commits.json
|
|
22
|
+
│ └── github-facets.json or gitlab-facets.json
|
|
23
|
+
└── resources/
|
|
24
|
+
├── commits.md
|
|
25
|
+
├── prs.md
|
|
26
|
+
└── issues.md
|
|
27
|
+
```
|
|
28
|
+
|
|
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.
|
|
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.
|
|
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
|
+
|
|
58
|
+
## Repository Prerequisite
|
|
59
|
+
|
|
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.
|
|
61
|
+
|
|
62
|
+
If the directory is not a git repository, do not create `.repo_memory/` and do not fabricate a memory bundle from file inspection alone. Stop with a prominent notice:
|
|
63
|
+
|
|
64
|
+
```text
|
|
65
|
+
**Repo Memory Cannot Be Built Yet**
|
|
66
|
+
|
|
67
|
+
> This folder is not a git repository, so repo memory cannot collect local commit history or provider-linked PR/MR/issue evidence.
|
|
68
|
+
|
|
69
|
+
**Next steps**
|
|
70
|
+
- If this is an existing project, open the real cloned repo directory.
|
|
71
|
+
- If this is a new project, run `git init` first, make at least one commit, then rerun the `repo-build` operation.
|
|
72
|
+
- If you only want file inspection, continue by inspecting files without repo memory.
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
## Path Convention
|
|
76
|
+
|
|
77
|
+
`<skill-dir>` means the parent directory of the `references/` directory containing this file. Resolve it before running scripts, for example:
|
|
78
|
+
|
|
79
|
+
```bash
|
|
80
|
+
python3 <skill-dir>/scripts/collect_all.py --repo-path <repo-path> --pretty --progress
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
## Default Settings
|
|
84
|
+
|
|
85
|
+
Default mechanical collection settings are intentionally visible in `<skill-dir>/defaults.json`:
|
|
86
|
+
|
|
87
|
+
```json
|
|
88
|
+
{
|
|
89
|
+
"schema": "repo_memory_builder_defaults.v2",
|
|
90
|
+
"repoHistory": {
|
|
91
|
+
"mode": "provider",
|
|
92
|
+
"limits": {
|
|
93
|
+
"commits": 30,
|
|
94
|
+
"prs": 30,
|
|
95
|
+
"issues": 30
|
|
96
|
+
}
|
|
97
|
+
},
|
|
98
|
+
"summaryChars": 4000
|
|
99
|
+
}
|
|
100
|
+
```
|
|
101
|
+
|
|
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`.
|
|
119
|
+
|
|
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.
|
|
121
|
+
|
|
122
|
+
## User Count Requests
|
|
123
|
+
|
|
124
|
+
If the user mentions how many commits, PRs/MRs, or issues to collect, treat that as a one-run override and pass explicit limit flags to `collect_all.py`. Do not edit `defaults.json` for a one-run request.
|
|
125
|
+
|
|
126
|
+
Examples:
|
|
127
|
+
|
|
128
|
+
- "拉 50 条 commit" means add `--commit-limit 50`.
|
|
129
|
+
- "PR 拉 20 条,issue 拉 30 条" means add `--pr-limit 20 --issue-limit 30`.
|
|
130
|
+
- "commit、PR、issue 都拉 50 条" means add `--commit-limit 50 --pr-limit 50 --issue-limit 50`.
|
|
131
|
+
|
|
132
|
+
Only edit `defaults.json` when the user asks to change defaults for future build runs, for example "以后默认都拉 50 条" or "把 repo memory 的默认 limit 改成 50".
|
|
133
|
+
|
|
134
|
+
## Progress Display
|
|
135
|
+
|
|
136
|
+
Skill instructions cannot render app-native progress components by themselves. For interactive builder runs, prefer `collect_all.py --progress`; it renders a terminal progress bar on stderr while keeping stdout as the final JSON report. Omit `--progress` only for strict machine-only runs that must avoid stderr progress output.
|
|
137
|
+
|
|
138
|
+
The progress bar covers the mechanical collection steps: preparation, local commits, and provider facets. Provider warnings are not terminal notifications; they are returned in the JSON report as structured `notices[]` so the agent can show them as a normal user-visible assistant message. The progress bar does not replace the required provider warning notice, final JSON report review, agent-authored Markdown work, or final validation.
|
|
139
|
+
|
|
140
|
+
## Build Modes
|
|
141
|
+
|
|
142
|
+
Build mode controls only the local project understanding phase. The mechanical collection, authoring, and validation flow stays the same.
|
|
143
|
+
|
|
144
|
+
- Default to lightweight mode when the user does not specify.
|
|
145
|
+
- Use lightweight mode for a quick or docs-only pass. Read root README/high-level docs, repo-local agent instructions such as `AGENTS.md` or `CLAUDE.md`, and clearly linked overview/setup docs. Do not inspect source, manifests, scripts, or CI just to deepen the profile. Mark code-level architecture claims as doc-derived or unverified.
|
|
146
|
+
- Use deep mode only when the user explicitly asks for deep/thorough/full work, or when docs are too thin to produce useful memory. Read docs and agent instructions, then inspect repository structure, module READMEs, representative source and entrypoints, manifests, scripts, and CI before writing `PROFILE.md`.
|
|
147
|
+
- Do not stop to ask for a mode unless the user's request is contradictory.
|
|
148
|
+
|
|
149
|
+
## Tool Roles
|
|
150
|
+
|
|
151
|
+
### `scripts/collect_all.py`
|
|
152
|
+
|
|
153
|
+
Use this as the primary mechanical path. It prepares the workspace, collects local git commit evidence, collects GitHub/GitLab PR/MR/issue evidence when provider auth is ready, and returns a JSON report describing completed steps and outputs. If provider collection fails after preparation reports `provider_evidence_state: "ready"`, the default behavior is to keep local commit evidence, emit a warning notice, and report `steps.provider_facets.degraded_to_local_only: true`. Only `--require-provider` turns this into a hard failure.
|
|
154
|
+
|
|
155
|
+
Default run:
|
|
156
|
+
|
|
157
|
+
```bash
|
|
158
|
+
python3 <skill-dir>/scripts/collect_all.py --repo-path <repo-path> --snapshot-ref HEAD --pretty --progress
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
One-run limit override:
|
|
162
|
+
|
|
163
|
+
```bash
|
|
164
|
+
python3 <skill-dir>/scripts/collect_all.py --repo-path <repo-path> --snapshot-ref HEAD --commit-limit 50 --pr-limit 20 --issue-limit 20 --pretty --progress
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
Full refresh of an existing `.repo_memory` bundle:
|
|
168
|
+
|
|
169
|
+
```bash
|
|
170
|
+
python3 <skill-dir>/scripts/collect_all.py --repo-path <repo-path> --reuse --snapshot-ref HEAD --pretty --progress
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
Local-only memory or hard-required provider evidence:
|
|
174
|
+
|
|
175
|
+
```bash
|
|
176
|
+
python3 <skill-dir>/scripts/collect_all.py --repo-path <repo-path> --snapshot-ref HEAD --skip-provider --pretty --progress
|
|
177
|
+
python3 <skill-dir>/scripts/collect_all.py --repo-path <repo-path> --snapshot-ref HEAD --require-provider --pretty --progress
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
Tell the user before starting long collection steps. After completion, report collected counts from the JSON report: local commits, PRs/MRs, issues, provider state, skipped steps, notices, and output files.
|
|
181
|
+
|
|
182
|
+
#### Final Summary Notices
|
|
183
|
+
|
|
184
|
+
If the final JSON report contains `notices[]`, the final user-facing summary must include those notices explicitly. Include the notice title, message, and next steps, especially `Provider Evidence Unavailable`.
|
|
185
|
+
|
|
186
|
+
Do not silently collapse notices into counts, provider state, or a generic "local-only" sentence. If provider evidence degraded to local-only, say that directly and include the reason from the notice.
|
|
187
|
+
|
|
188
|
+
#### Provider Sandbox and Transport Failures
|
|
189
|
+
|
|
190
|
+
`gh/glab` provider collection needs external network access. If provider stderr or `notices[]` shows `fetch failed`, timeout, DNS, connection, TLS, `ENOTFOUND`, `EAI_AGAIN`, or similar transport text, report provider evidence unavailable and continue local-only unless `--require-provider` was requested.
|
|
191
|
+
|
|
192
|
+
Verify provider authentication in the same normal shell with the command reported by `collect_all.py`; for GitHub Enterprise or self-hosted GitLab this may include `--hostname <host>`. Authenticate with `gh auth login` or `glab auth login` (also host-scoped when prompted), then rerun `collect_all.py`; do not paste tokens into the skill or call provider APIs directly.
|
|
193
|
+
|
|
194
|
+
Do not use a restricted shell sandbox to verify provider/API availability. Verify in a normal shell or approved network-enabled mode. If only restricted shell access is available, report provider evidence unavailable and continue local-only unless `--require-provider` was requested. Do not treat a provider transport failure as empty PR/issue evidence, no PR/issue changes, bad login, or bypass the scripts with direct APIs, browser scraping, copied credentials, or hand-written raw facets.
|
|
195
|
+
|
|
196
|
+
### `scripts/validate_memory.py`
|
|
197
|
+
|
|
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.
|
|
199
|
+
|
|
200
|
+
```bash
|
|
201
|
+
python3 <skill-dir>/scripts/validate_memory.py <repo-path> --pretty
|
|
202
|
+
```
|
|
203
|
+
|
|
204
|
+
### Internal scripts
|
|
205
|
+
|
|
206
|
+
These are invoked by `collect_all.py`. Use them directly only for debugging or narrow recovery:
|
|
207
|
+
|
|
208
|
+
- `prepare_repo_memory.py`: validates the target repo, handles `--reuse`, creates `.repo_memory/{raw,resources}`, updates `.gitignore`, and writes `raw/prepare-report.json`.
|
|
209
|
+
- `git_commit_facets.py`: collects local commit facets from the selected snapshot. It needs only local git history.
|
|
210
|
+
- `github_resource_facets.py` and `gitlab_resource_facets.py`: collect provider PR/MR/issue facets when `prepare-report.json` says the provider is ready. They share the same downstream resource shape; GitLab merge requests are normalized into PR resources.
|
|
211
|
+
|
|
212
|
+
Provider resource facets share this contract: `--snapshot-ref HEAD` filters merged PRs/MRs by merge-commit ancestry against the local snapshot; open and closed-unmerged PRs/MRs are not retained as landed evidence; issues come from the current bounded provider list because issues do not have reliable commit ancestry. For PRs/MRs, `--pr-limit` is the retained count after snapshot filtering.
|
|
213
|
+
|
|
214
|
+
## Agent Workflow
|
|
215
|
+
|
|
216
|
+
Follow this order manually:
|
|
217
|
+
|
|
218
|
+
1. **Collect mechanical evidence**
|
|
219
|
+
- Run `collect_all.py`.
|
|
220
|
+
- Use `--reuse` only for a full refresh/rebuild of an existing `.repo_memory`; for latest-change-only updates, prefer `repo-update.md`.
|
|
221
|
+
- Read the returned JSON report and `.repo_memory/raw/prepare-report.json`.
|
|
222
|
+
- Stop if preparation fails. Do not improvise around git/repo safety checks.
|
|
223
|
+
|
|
224
|
+
2. **Show provider notices**
|
|
225
|
+
- If `notices[]` contains `Provider Evidence Unavailable`, show it as a normal assistant message before continuing and repeat it in the final summary.
|
|
226
|
+
- Render `title` as a bold heading, `message` as body text, `command` as the login command when present, and `next_steps` as recovery steps. Do not show raw JSON or put the notice inside a fenced code block.
|
|
227
|
+
- If `notices[]` is absent, fall back to `raw/prepare-report.json`: when `provider_notice_level` is `warning`, render `provider_notice_markdown` as a normal assistant message.
|
|
228
|
+
- If the user explicitly required PR/MR/issue evidence, run with `--require-provider`, stop after provider failure, and ask them to install/login or fix repository access before rerunning.
|
|
229
|
+
|
|
230
|
+
Use this visible shape:
|
|
231
|
+
|
|
232
|
+
```text
|
|
233
|
+
**Provider Evidence Unavailable**
|
|
234
|
+
|
|
235
|
+
<notice.message>
|
|
236
|
+
|
|
237
|
+
**Next steps for provider evidence**
|
|
238
|
+
Run: `<notice.command>`
|
|
239
|
+
|
|
240
|
+
<notice.next_steps rerun item>
|
|
241
|
+
```
|
|
242
|
+
|
|
243
|
+
3. **Understand the local project**
|
|
244
|
+
- Choose lightweight by default; choose deep only when requested or clearly needed.
|
|
245
|
+
- Form project-level understanding before looking at PR/issue history.
|
|
246
|
+
- Record whether conclusions are doc-derived or code-inspected.
|
|
247
|
+
|
|
248
|
+
4. **Plan and draft the wiki landing page and conceptual pages**
|
|
249
|
+
- Read [repo-templates.md](repo-templates.md) before writing memory files.
|
|
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.
|
|
254
|
+
- Record the selected build mode and avoid overstating code-level claims in lightweight mode.
|
|
255
|
+
|
|
256
|
+
5. **Review raw evidence**
|
|
257
|
+
- Confirm `raw/git-commits.json` exists.
|
|
258
|
+
- When provider evidence is available, confirm the matching provider facets exist.
|
|
259
|
+
- If provider evidence is missing, skipped, or degraded to local-only, keep PR/issue resources explicitly marked unavailable instead of inventing provider evidence.
|
|
260
|
+
|
|
261
|
+
6. **Author human-readable resources**
|
|
262
|
+
- Use the resource templates in [repo-templates.md](repo-templates.md).
|
|
263
|
+
- Read raw facets and write `resources/commits.md`, `resources/prs.md`, and `resources/issues.md` yourself.
|
|
264
|
+
- Keep resources compact. Use one fixed-field section per commit, PR/MR, or issue, separated by `---`; do not use Markdown tables.
|
|
265
|
+
- Every section must include a search-grade `Description`.
|
|
266
|
+
|
|
267
|
+
7. **Finalize and validate**
|
|
268
|
+
- Add final pointers and provider snapshot notes to `PROFILE.md`.
|
|
269
|
+
- Run `validate_memory.py` as the final gate.
|
|
270
|
+
- Fix authored Markdown placeholders, frontmatter counts, or resource mismatches before reporting success.
|
|
271
|
+
|
|
272
|
+
## Refresh/Update Workflow
|
|
273
|
+
|
|
274
|
+
For incremental updates to recent commits, PRs/MRs, or issues in an existing `.repo_memory`, use `repo-update.md`.
|
|
275
|
+
|
|
276
|
+
Use builder refresh only when the user wants a full rebuild/full refresh while preserving the existing memory directory:
|
|
277
|
+
|
|
278
|
+
```bash
|
|
279
|
+
python3 <skill-dir>/scripts/collect_all.py --repo-path <repo-path> --reuse --pretty --progress
|
|
280
|
+
```
|
|
281
|
+
|
|
282
|
+
Then rewrite affected human-authored resources from the new raw evidence. Preserve useful existing notes only when they are still supported by current raw evidence and live repository inspection. Never append or patch raw/provider JSON by hand; rerun the collection scripts instead.
|
|
283
|
+
|
|
284
|
+
## Description Quality Standard
|
|
285
|
+
|
|
286
|
+
`Description` is the main agentic-search surface for `resources/commits.md`, `resources/prs.md`, and `resources/issues.md`. Keep only the core rule here; the full quality standard and section scaffolding live in [repo-templates.md](repo-templates.md).
|
|
287
|
+
|
|
288
|
+
Every description must say what the item explains, when a future agent should open it, which modules/files/commands/config it points to, concrete search cues, and evidence strength. Do not copy raw summaries, headings, or tables into descriptions, and avoid vague descriptions like "fix bug" or "update docs".
|
|
289
|
+
|
|
290
|
+
## Generated Knowledge Contract
|
|
291
|
+
|
|
292
|
+
Generate memory that the `memorax-code` repo-read operation can consume progressively:
|
|
293
|
+
|
|
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.
|
|
297
|
+
- `raw/*.json` contains optional build/debug evidence for deep inspection when compact resources are insufficient.
|
|
298
|
+
|
|
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.
|
|
300
|
+
|
|
301
|
+
## Trust Rules
|
|
302
|
+
|
|
303
|
+
- Local code and targeted verification are stronger evidence than generated memory.
|
|
304
|
+
- Local git commit evidence is checkout history and does not require provider login.
|
|
305
|
+
- GitHub/GitLab PR/issue evidence is historical/contextual, not proof of current checkout behavior.
|
|
306
|
+
- Open PRs are active branch intent, not landed behavior.
|
|
307
|
+
- Closed unmerged PRs are weak or superseded evidence.
|
|
308
|
+
- Merged PRs are useful history but still require current code verification.
|
|
309
|
+
|
|
310
|
+
## Authoring Templates
|
|
311
|
+
|
|
312
|
+
When writing `PROFILE.md`, `resources/commits.md`, `resources/prs.md`, or `resources/issues.md`, read [repo-templates.md](repo-templates.md) and use it as fill-in scaffolding. Remove placeholders from final files and delete sections that are genuinely unavailable.
|
|
313
|
+
|
|
314
|
+
Apply these rules even before loading the templates:
|
|
315
|
+
|
|
316
|
+
- Use fixed-field resource sections separated by `---`; do not use Markdown tables for PRs or issues.
|
|
317
|
+
- Write search-grade `Description` fields that explain what the PR/issue covers, when future agents should open it, affected modules/files/behaviors, concrete search cues, and evidence strength.
|
|
318
|
+
- Do not copy raw summaries or headings into descriptions; synthesize routing cues from raw facets and current project understanding.
|
|
319
|
+
- Do not add persistent `indexes/*.json` files or `index:` frontmatter; search `resources/*.md` directly and open raw JSON only for build/debug evidence.
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
# Repo Memory Read
|
|
2
|
+
|
|
3
|
+
## Role And Demand Gate
|
|
4
|
+
|
|
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
|
+
|
|
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
|
+
|
|
9
|
+
Only a relevant `repo-read` invokes `maintain`. Commit arrival, PR merge, and elapsed time alone do not invoke it. Explicit build, rebuild, or update requests still route through `SKILL.md` to `repo-build.md` or `repo-update.md`.
|
|
10
|
+
|
|
11
|
+
## Repository And Helper
|
|
12
|
+
|
|
13
|
+
Resolve the repository in this order:
|
|
14
|
+
|
|
15
|
+
1. Use the user's explicit local path.
|
|
16
|
+
2. Otherwise use the current workspace Git root.
|
|
17
|
+
3. Infer a named local repo only when the match is unambiguous.
|
|
18
|
+
4. Ask for the path only when multiple repos remain plausible.
|
|
19
|
+
|
|
20
|
+
Derive memory as `<repo>/.repo_memory`; never ask for a memory-directory path. If the target is not inside a Git worktree, skip maintenance and continue from live files.
|
|
21
|
+
|
|
22
|
+
`<skill-dir>` is the parent of this file's `references/` directory. The packaged client helper is:
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
node '<skill-dir>/../../hooks/repo-memory-job.mjs' maintain --repo '<repo>'
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
Use it only when it is a regular file. It validates the generated bundle, evaluates the configured local update policy without provider network access, and atomically selects one outcome:
|
|
29
|
+
|
|
30
|
+
- `bundle_missing` or `bundle_invalid`: start supervised build;
|
|
31
|
+
- a triggered policy decision: start supervised update;
|
|
32
|
+
- `up_to_date`: no-op;
|
|
33
|
+
- `active_job`: deduplicate against the running job.
|
|
34
|
+
|
|
35
|
+
The default policy remains `adaptive(5 commits OR 24 hours)`. A missing or non-ancestor baseline always selects repair-capable update. The helper owns the detailed policy, validation, lock, snapshot, and launcher rules; do not reproduce them in the foreground.
|
|
36
|
+
|
|
37
|
+
## Retrieval
|
|
38
|
+
|
|
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
|
+
|
|
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.
|
|
44
|
+
|
|
45
|
+
```bash
|
|
46
|
+
rg -n '<handle-1>|<handle-2>' \
|
|
47
|
+
.repo_memory/PROFILE.md .repo_memory/*.md .repo_memory/resources
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
Use:
|
|
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;
|
|
54
|
+
- `resources/commits.md` for local history and regressions;
|
|
55
|
+
- `resources/prs.md` for merged or active implementation context;
|
|
56
|
+
- `resources/issues.md` for symptoms, requests, and requirements.
|
|
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
|
+
|
|
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.
|
|
61
|
+
|
|
62
|
+
## Retrieval Budget
|
|
63
|
+
|
|
64
|
+
- Read `PROFILE.md` at most once.
|
|
65
|
+
- Run at most 2 combined `rg` commands.
|
|
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.
|
|
68
|
+
- Open only the matched resource section when `rg` context is insufficient.
|
|
69
|
+
|
|
70
|
+
Do NOT open these unless the user explicitly asks or a compact hit contains only a `facetId`:
|
|
71
|
+
|
|
72
|
+
- `.repo_memory/raw/*.json`;
|
|
73
|
+
- `docs/`, `packages/`, `tests/`, or other live source directories.
|
|
74
|
+
|
|
75
|
+
The live directories restriction applies only during the bounded memory phase. Current implementation claims and code edits still require live-code verification after the maintenance handoff.
|
|
76
|
+
|
|
77
|
+
## Single Maintenance Handoff
|
|
78
|
+
|
|
79
|
+
After the final repo-memory read, run `maintain` as the very next tool action. Do not run it in parallel with a repo-memory read. Do not inspect live code, maintained documentation, Git evidence, run unrelated tools, or answer between them.
|
|
80
|
+
|
|
81
|
+
If no repo-memory read was possible, run it immediately after detecting that state. The same handoff applies when hits already answer the question or the retrieval budget is exhausted.
|
|
82
|
+
|
|
83
|
+
After it returns:
|
|
84
|
+
|
|
85
|
+
- For `up_to_date`, a triggered update, or `active_job`, use consistent hits as best-effort context.
|
|
86
|
+
- For `bundle_missing` or `bundle_invalid`, discard generated hits and continue from live code and maintained documentation.
|
|
87
|
+
- If the helper is unavailable or fails, do not improvise maintenance. Use consistent hits only when they were readable; otherwise use live evidence.
|
|
88
|
+
|
|
89
|
+
Do not read repo memory again after `maintain` returns. Do not wait, poll, retry, or expose the command, decision payload, job id, paths, prompt, final message, or logs. Never replace the packaged helper with a generic subagent.
|
|
90
|
+
|
|
91
|
+
## Answer And Trust Rules
|
|
92
|
+
|
|
93
|
+
Answer history, architecture, and context questions from sufficient memory hits after the handoff. If two bounded searches miss, say what was not found and ask whether to inspect more deeply.
|
|
94
|
+
|
|
95
|
+
Continue into live evidence after the handoff when the user asks about current behavior, requests an edit, or the bundle was unavailable. Keep these distinctions explicit:
|
|
96
|
+
|
|
97
|
+
- live code and targeted verification are stronger than generated memory;
|
|
98
|
+
- tests are stronger than PR or issue summaries;
|
|
99
|
+
- commits and merged PRs are historical evidence, not current-behavior proof;
|
|
100
|
+
- open PRs describe intent;
|
|
101
|
+
- issues describe problem context.
|
|
102
|
+
|
|
103
|
+
Never create, update, delete, or repair repo-memory files in the foreground `repo-read` task.
|