refactor(memory-wiki): store import runs in sqlite#91108
Conversation
|
Codex review: needs real behavior proof before merge. Reviewed June 7, 2026, 3:46 AM ET / 07:46 UTC. Summary PR surface: Source +581, Tests +161. Total +742 across 8 files. Reproducibility: yes. from source inspection: create a legacy JSON record, leave an incomplete SQLite meta row for the same run id, then rerun doctor migration. The migration filters the legacy record out by run id and archives the JSON, so the complete path metadata is lost from the canonical state. Review metrics: 1 noteworthy metric.
Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Proof guidance:
Risk before merge
Maintainer options:
Next step before merge
Security Review findings
Review detailsBest possible solution: Merge only after the migration retry path repairs incomplete SQLite rows from legacy JSON and maintainers accept the upgrade/cap behavior with real import, migration, and rollback proof. Do we have a high-confidence way to reproduce the issue? Yes, from source inspection: create a legacy JSON record, leave an incomplete SQLite meta row for the same run id, then rerun doctor migration. The migration filters the legacy record out by run id and archives the JSON, so the complete path metadata is lost from the canonical state. Is this the best way to solve the issue? No, not yet: SQLite plugin state plus doctor migration is the right direction, but the retry path must treat incomplete existing rows as repairable from legacy JSON before archiving. Real upgraded-vault proof is also still required before merge. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model gpt-5.5, reasoning high; reviewed against ebabf5022ffb. Label changesLabel justifications:
Evidence reviewedPR surface: Source +581, Tests +161. Total +742 across 8 files. View PR surface stats
What I checked:
Likely related people:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. How this review workflow works
|
c485d50 to
2a1e1a1
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2a1e1a1a84
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| } | ||
| const existingRecords = await listMemoryWikiImportRunRecords(vaultRoot, store); | ||
| const existingRunIds = new Set(existingRecords.map((record) => record.runId)); | ||
| const importedRecords = records.filter((record) => !existingRunIds.has(record.runId)); |
There was a problem hiding this comment.
Re-import legacy runs when state is incomplete
If openclaw doctor --fix is interrupted or a store write fails after the meta row is registered but before all path rows are written, the legacy JSON remains on disk but this retry path treats the run id as already migrated. Because writeMemoryWikiImportRunRecord writes the meta row before the path rows, a later retry will skip the JSON here and then archive it, permanently losing the created/updated path metadata needed for accurate listing and rollback. Prefer replacing/repairing from the legacy record unless the existing state is proven complete.
Useful? React with 👍 / 👎.
c47ea4f to
1ce6307
Compare
|
Land-ready proof for Summary:
Local proof:
CI:
|
Summary
.openclaw-wiki/import-runs/*.jsoninto SQLite plugin state..openclaw-wiki/import-runs/<runId>/snapshots/as explicit vault artifacts.Verification
git diff --checknode scripts/run-oxlint.mjs --tsconfig config/tsconfig/oxlint.extensions.json extensions/memory-wiki/src/import-runs-state.ts extensions/memory-wiki/src/chatgpt-import.ts extensions/memory-wiki/src/import-runs.ts extensions/memory-wiki/index.ts extensions/memory-wiki/doctor-contract-api.ts extensions/memory-wiki/doctor-contract-api.test.ts extensions/memory-wiki/src/cli.test.ts extensions/memory-wiki/src/import-runs.test.tspnpm tsgo:extensionsnode scripts/run-vitest.mjs extensions/memory-wiki/doctor-contract-api.test.ts extensions/memory-wiki/src/cli.test.ts extensions/memory-wiki/src/import-runs.test.ts extensions/memory-wiki/src/gateway.test.ts extensions/memory-wiki/index.test.ts.agents/skills/autoreview/scripts/autoreview --mode local=> clean, no accepted/actionable findings.