Harden native memory sidecars, signals, cache, and CI - #3
Conversation
Pin actions/checkout v6 to d23441a48e516b6c34aea4fa41551a30e30af803, actions/setup-node v6 to 249970729cb0ef3589644e2896645e5dc5ba9c38, and actions/upload-artifact v7 to 043fb46d1a93c77aae656e7c1c64a875d1fc6a0a. Remove the unbounded npm@latest install from the publish job.
Add test-inclusive TypeScript checks and V8 coverage with floors just below the measured baseline (88.88% statements, 85.97% branches, 91.58% functions, 88.88% lines). Coverage enforcement is not wired into CI until the final failure-injection commit.
Run the OpenClaw compatibility matrix across Ubuntu, macOS, and Windows on Node 22.19.0 and 24.x. Keep new macOS and Windows lanes non-blocking until their first runs establish whether any failures are pre-existing.
Add directional traversal metadata without mutating stored edges, replace quadratic BFS operations, hoist graph extraction regexes, simplify single-hit answer selection, and cache parsed graph materialization by mtime/size/ctime/inode.
Detect 32+ character hex candidates at 3.4 bits per character, retain the 4.0-bit threshold for mixed/base64 candidates, exempt numeric IDs and multi-segment paths, keep slash-bearing AWS-style candidates intact, and widen named credential keys.
Add versioned graph and snapshot sidecars with legacy reads, tolerant graph-line parsing, corrupt snapshot fallback, atomic temporary-file replacement, and workspace-contained write-parent validation. Share graph path, dreaming detection, and host config derivations across modules.
Reject out-of-range fetch starts with the actual line count; mark fetches and search hits truncated; return search tool diagnostics for skipped files and capped queries/results; surface corrupt graph line counts and graph extraction caps.
Recognize only the two current SDK tool conveyance shapes in bounded mode, warn and record a health-visible finding for unknown shapes, preserve enhanced passthrough, and replace broad registration casts with explicit SDK-derived types.
Replace the 512-entry cliff with a 64 MiB true LRU, account raw/redacted line storage, drop retained rawText, validate cache entries with mtime/size/ctime/inode, and signal scans beyond the documented cache envelope.
Add DREAMS.md to private defaults, warn when explicit roots exclude MEMORY.md, document bounded output signals and the 500-file/50-MB scan envelope, explain deterministic graph timestamps, and record all compatibility/security changes under Unreleased with CalVer semantics.
Cover ENOSPC, interrupted rename, EACCES, parallel extracts, and extract-during-query. Enforce measured coverage floors on the canonical CI tuple and install the npm tarball into a scratch project before invoking a bounded tool.
5d49968 to
6c7409b
Compare
REPORT — Full merge sequence (all phases),
|
| PR | Merge commit | First parent | Second parent / merged head |
|---|---|---|---|
| #2 | de224446b392a426a3e88802ab238d2c12692d0d |
becb6fa1e0ca6d0a8238c566de1383aac6afc74b |
4855a15b201e2172b6c4534ea3b72c8f04c68a97 |
| #3 | a206aaa7ea069110a29fb0e441f5626e7c1c9ebc |
de224446b392a426a3e88802ab238d2c12692d0d |
ae61e7eca717bc50b9f6da1ac644ee09adaa72d3 |
| #4 | a9a99438c310f3d1b880e5318cabdb24e9b4fcff |
a206aaa7ea069110a29fb0e441f5626e7c1c9ebc |
fccea364625f9b20d6b2da475b4521961f1b3fb5 |
PR #3 recomputed to exactly the 12 authorized round-2 commits before fixes. PR #4 recomputed to exactly the three authorized round-3 commits (c2dd1eb, 13462e2, e4423da) before its test-only successor. Both merge trees were conflict-free; no rebase, force-push, squash, or history rewrite occurred.
Matrix evidence
Each run used the 12 named tuples: Ubuntu/macOS/Windows × Node 22.19.0/24.x × OpenClaw 2026.6.8/2026.6.9.
PR #3 first runs and finals
- Run
30746220794, head310af48: Ubuntu 4/4 success; macOS 0/4; Windows 0/4. macOS/Windows were non-blocking on this first run. All eight failures were the same false workspace-escape finding caused by canonical path spelling for missing default roots. - Run
30746321594, head112f5be: Ubuntu 4/4 and macOS 4/4 success; Windows 3/4 success. Windows Node22.19.0+ OpenClaw2026.6.9failed withEPERMduring concurrent graph-sidecar replacement. - Run
30746434982, head413d9ea: all 12/12 success, including Windows 4/4. - Blocking final run
30746542275, headae61e7e: all 12/12 success after removing non-blocking semantics. - Post-merge master run
30746645489, mergea206aaa: all 12/12 success.
PR #4 and final master
- PR run
30746766559, headfccea36: all 12/12 success, including the round-3 guard and per-agent override test on macOS/Windows. - Post-merge master run
30746863178, mergea9a9943: all 12/12 success.
GitHub Actions may display the first two PR #3 workflow conclusions as success because macOS/Windows were still continue-on-error; the per-job outcomes above preserve the actual lane results verbatim.
Fix and closure commits
| Commit | Purpose | Evidence |
|---|---|---|
310af48e9a40547185c2b88f78048d20c01e0d79 |
Moved pull_request from invalid permissions placement into the workflow trigger so the hosted matrix could run. |
All subsequent PR matrices instantiated 12 tuples. |
112f5be71e42ce6efc6d430f7b0df2fa0970a7c3 |
Canonicalized missing default roots relative to the real workspace path across macOS/Windows. | macOS 4/4 green on the next run; named symlink/canonicalization test added. |
413d9ea7d03223989df99139b353904453158439 |
Serialized concurrent atomic writes per sidecar path, preserving Windows backup/restore behavior. | Windows 4/4 green on the next and every final run; concurrent-replacement test added. |
ae61e7eca717bc50b9f6da1ac644ee09adaa72d3 |
Removed the macOS/Windows non-blocking guard. | Blocking final PR #3 matrix 12/12 green. |
fccea364625f9b20d6b2da475b4521961f1b3fb5 |
Test-only closure of the delegated per-agent override review item. | Test name: warns and reports health when a per-agent override re-enables host injection; asserts both warning and health finding; full matrix 12/12 green. |
Branch protection
master branch protection is active. strict is false so the audited stacked heads did not require an extra base-merge commit. All 12 exact matrix contexts are required:
build-validate-test (ubuntu-latest, 22.19.0, 2026.6.8)build-validate-test (ubuntu-latest, 22.19.0, 2026.6.9)build-validate-test (ubuntu-latest, 24.x, 2026.6.8)build-validate-test (ubuntu-latest, 24.x, 2026.6.9)build-validate-test (macos-latest, 22.19.0, 2026.6.8)build-validate-test (macos-latest, 22.19.0, 2026.6.9)build-validate-test (macos-latest, 24.x, 2026.6.8)build-validate-test (macos-latest, 24.x, 2026.6.9)build-validate-test (windows-latest, 22.19.0, 2026.6.8)build-validate-test (windows-latest, 22.19.0, 2026.6.9)build-validate-test (windows-latest, 24.x, 2026.6.8)build-validate-test (windows-latest, 24.x, 2026.6.9)
Release-boundary verification
- Remote tag baseline and final state both end at existing
v2026.6.18; no tag was created or pushed by this sequence. Final complete tag-list SHA-256:f07586ea731925638022956eff34afc667620fa90396e5a34f7480e1969aa684. - npm still serves
@ngo-a/native-memory-citations@2026.6.18, the same version recorded before Phase 1; nothing was published. CHANGELOG.mdon finalmasterkeeps all merged work under## [Unreleased]; no new version was stamped.- No ClawHub action, npm publish, deprecation, GHSA action, upstream filing, Notion edit, reporter attribution, or runtime dependency change was performed.
Hard stop / owner-only remainder
The merge sequence is complete and stopped. Remaining owner-only work is unchanged: any later release decision and release steps; the five staged 2026.6.17 steps in their standing order; filing both upstream issues; and the Notion threat-model mapping.
Verification Report: native-memory-citations hardening round 2
Date: 2026-08-01 MDT
Branch:
security/nmc-hardening-r2Base:
security/native-memory-citations-boundary-perf-hardeningat4855a15Head:
6c7409bSummary
Implements the full 12-item hardening round: immutable release pins; OS/Node CI,
typecheck, coverage, failure injection and tarball smoke; stored-orientation graph
traversal and graph caching; charset-aware redaction; versioned atomic sidecars and
write boundaries; explicit output-bound signals; fail-closed tool registration;
64 MiB byte-budget LRU; DREAMS.md default scope; health and documentation updates.
Decision gates
DREAMS.mdto private default roots. Release-note draft:artifacts/handoffs/release-note-draft-nmc-dreams-default.md.artifacts/handoffs/upstream-sdk-registration-issue-draft.md.Required reproductions
charset-aware entropy redaction > redacts all 200...passes.Alice works_at Acme, queried fromAcmedirection: "reverse"; no inverted assertion; regression passes.skippedLines: 1, and warning; regression passes.Additional evidence
memorysymlink outside the workspace before writing; no outside sidecar is created.degraded, includedegradedReason, and expose health state.skippedFileswhile readable hits return.npm pack, install into a scratch project, import packaged entry, register the bounded surface, and invokenative_memory_searchpassed.Test and build evidence
npm run test:typechecknpm testnpm run test:stressnpm run test:coveragenpm run test:packngo-a-native-memory-citations-2026.6.18.tgzin a temporary directory. No version was changed.npm run plugin:build:checkv24.18.1) test typecheck + full Vitestgit diff --checkLocal plugin build output retained pre-existing environment warnings: the project-local OpenClaw CLI is 2026.6.9 while the active host config was written by 2026.7.1-2, plus existing duplicate/missing optional plugin notices. Metadata validation still passed.
CI matrix status
The workflow now defines Ubuntu/macOS/Windows x Node 22.19.0/24.x x OpenClaw 2026.6.8/2026.6.9. Ubuntu behavior was verified locally on the installed Node 22 line and separately with Node 24. macOS and Windows remain explicitly non-blocking because the stacked PR targets a feature branch and this repository's
pull_request.branchesfilter runs only formaster/main; hosted jobs cannot execute until the PR is retargeted after PR #2 merges. No test was silenced.Action pin mapping
actions/checkoutv6 ->d23441a48e516b6c34aea4fa41551a30e30af803actions/setup-nodev6 ->249970729cb0ef3589644e2896645e5dc5ba9c38actions/upload-artifactv7 ->043fb46d1a93c77aae656e7c1c64a875d1fc6a0a6f28659e7bfb5ae21e1bcc2d6896fea9c0a7f698.@v*,@main,@master,@latest) returns no matches.Anchor audit
All quoted production-code anchors were located on the PR #2 base. No work order was stopped for a missing anchor. Two review assertions differed from the base and were handled explicitly:
truncated/cappedoutput fields, so round 2 established the documented naming contract.Scope and owner gates
All 12 listed work orders were implemented. No runtime dependency was added. No version was stamped. No tag, npm/ClawHub publish, deprecation, GHSA, merge, PR #2 rewrite/rebase, or reporter attribution occurred. Out-of-scope review items were not implemented.
Changelog draft (
Unreleased)Changed
direction.full hashes/checksums may now be over-redacted by design.
DREAMS.mdjoins private default roots and enhanced snapshot eligibility.Security
graph lines are counted/skipped, corrupt snapshots warn and degrade to absent.
CI
npm@latestis removed from publishing.artifact smoke coverage are added.