Repository navigation
fix(memory-wiki): preserve human notes on OKF concept re-import - #175707
Conversation
Closes openclaw#175700 OKF bundle re-import fully regenerated concept pages and dropped any human ## Notes block, unlike source sync and ChatGPT import. The rendered page now carries a Notes slot and writeOkfConceptPage preserves the existing human block via preserveHumanNotesBlock, matching the documented 'notes preserved across regeneration' invariant. Regression test: import, add a handwritten note, re-import, assert note survives. Fails on main, passes with this change.
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs real behavior proof before merge. What this changesPreserve marked handwritten Notes when OKF concept pages are regenerated. Example: Import customers.md, add “Keep café 🦞 and $& exactly.” between the human markers, then re-import.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness⛔ Blocked before merge - 2 items remain Keep open: this PR repairs a current-main data-loss path, has maintainer support, and introduces no concrete code defect found in this review. Priority: P0 Before merge
FindingsNone. Tests
Agent review detailsHow this fits togetherThe Memory Wiki plugin imports OKF Markdown bundles into vault concept pages, then compiles indexes and searchable knowledge. flowchart LR
A[OKF bundle] --> B[CLI import]
B --> C[Concept renderer]
D[Existing vault page] --> E[Shared Notes preservation]
C --> E
E --> F[Guarded page writer]
F --> G[Wiki compiler]
Technical reviewBest possible solution: Retain the focused plugin-local repair using the existing Notes parser, strict reader, and guarded writer. Do we have a high-confidence way to reproduce the issue? Current-main source establishes import-edit-reimport data loss: marked Notes make the page differ, then the writer replaces it with slot-free generated content; no target code was executed during this review. Is this the best way to solve the issue? The patch fixes the replacement boundary with existing owners, preserves sibling parsing defaults, and handles the producer-specific code-fence layout without retaining a separate extractor. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 6a649d256b79. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +46, Tests +113, Docs +7. Total +166 across 9 files. Added test files: 0. View PR surface stats
Review metrics
Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. LabelsLabel changes: No label changes. Label justifications:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment HistoryReview history (11 earlier review cycles; latest 8 shown)
Reviewed October 21, 2026, 2:15 AM ET / 06:15 UTC (Revision 12). |
Closes openclaw#175700 Scope human-Notes preservation to the local Notes slot instead of reusing preserveHumanNotesBlock: OKF producer Markdown is unrestricted, so a legacy page with an unmarked producer Notes section must not throw, and literal producer marker examples must not widen the preserved range. Rendered pages now carry a Notes slot; the writer preserves the slot at the end of the page. Regression tests cover the marked-note round trip, the legacy producer Notes page, and a producer body containing a literal human marker.
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
@clawsweeper re-review Released-install compatibility proof update (exact |
|
🦞👀 Re-review progress:
|
…ry-wiki-preserve-okf-notes
Preserve the marked human block before comparing or replacing OKF pages, and propagate existing-page read failures through the shared read owner. Keep marker-free legacy pages importable and document that unmarked text is producer-owned. Replace the separate OKF extractor with the shared Markdown helper and retain focused importer/read-failure regressions. Fixes openclaw#175700 Co-authored-by: YangManBOBO <[email protected]>
…memory-wiki-preserve-okf-notes
|
@clawsweeper re-review Maintainer rewrite on the contributor branch: OKF uses the shared marked-Notes preservation owner and strict existing-page read owner. The separate extractor and redundant test scaffolding are removed; contributor ancestry and credit remain. The contract is marked-block-only: outside text is producer-owned; marker-free legacy pages regenerate with an empty Notes slot. The body records that limitation, focused regressions, lint and fresh review. PR CI is the test gate per maintainer policy; live proof was intentionally skipped. |
|
🦞👀 Re-review progress:
|
|
@clawsweeper re-review Current head: The follow-up preserves complete legacy Notes beneath an unclosed producer fence through the shared Markdown owner. It uses the existing parser, retains the marked-block-only contract, and adds small LF/CRLF and closed-example regressions. Fresh independent Codex review is clean through P2; changed-file lint and formatting pass. The prior review reported no code findings. Its shipped-CLI, latest-stable transition, and local red/green proof requests are intentionally skipped under the maintainer's explicit proof policy: PR CI is the test gate. The earlier head passed CI; the new head requires its own CI result. The body records the final implementation and this proof boundary. |
|
🦞👀 Re-review progress:
|
|
Merged via squash.
|
Fixes #175700
Original contributor: @YangManBOBO. The contributor commits remain in this branch, with verified co-author credit in the maintainer rewrite.
What Problem This Solves
Fixes: Re-importing an OKF bundle silently deletes marked handwritten Notes from imported concept pages, even when the bundle is unchanged.
User Impact
OKF concept pages now include the standard
## Notesslot. Re-import preserves the exact block between<!-- openclaw:human:start -->and<!-- openclaw:human:end -->while refreshing producer content. Existing-page read failures stop the rewrite.Only the marked human block is protected. Text outside it remains producer-owned and can be replaced. Legacy OKF pages without a marked block regenerate with an empty Notes slot; there is no migration refusal or whole-body preservation. Unpaired markers use the shared Notes helper's existing error and recovery instruction.
Why This Change Was Made
The OKF writer previously compared and wrote newly rendered content without preserving Notes, and converted page-read failures into empty content. It now uses the shared Notes-preservation and strict UTF-8/read-retry owners before comparison and writing.
The maintainer rewrite removes the separate OKF extractor. A small producer-Markdown mode in the shared helper excludes frontmatter and fenced marker examples, while source-sync and ChatGPT defaults stay unchanged. A small renderer closes an unterminated producer fence before adding the local slot. Existing paired Notes beneath an old open fence remain visible to the shared marker rules; closed producer examples stay excluded. Apply and ChatGPT import reuse the shared marker constants.
Evidence
Current head:
b145c30e975d2cdee01c772f7318399974bc2758. Exact-head CI passed: 24 successful jobs, no failures. The combined CI/security gate also passed.PR CI is the test gate under maintainer policy. Local tests, typechecks, live Gateway proof, and remote test leases were intentionally skipped; no contributor code was executed locally.
git diff --checkpassed.preserves marked Notes through unchanged and changed re-imports,adds an empty Notes slot when re-importing unmarked legacy content,rejects an unpaired producer-page marker,preserves legacy Notes under an open producer fence,does not preserve a legacy producer's closed Notes example, andleaves OKF concept pages unchanged after a persistent existing-page read failure.Diff versus integrated main: production +72/-26 (net +46), tests +113/-0, docs +7/-0. This reduces the prior PR's net production growth from 98 to 46 lines and its test additions from 271 to 113. Remaining production growth supports the distinct producer layout and safe slot rendering without changing sibling parsing behavior.