# 2026-03-27 21:35 Asia/Taipei — Checkpoint

Repo focus:
- primary: `openclaw-mem`
- companion: `delirium-to-weiji`

## Verdict
The Wei Ji automation line is **product-landed but not yet fully deployment-proven**.

What is true right now:
1. Wei Ji wrapper/contract side is landed, pushed, and documented.
2. `openclaw-mem-engine` memory-store preflight code is landed, pushed, and documented.
3. Host config is installed and currently set back to the intended safe posture:
   - `enabled=true`
   - `failMode=open`
   - `failOnQueued=false`
   - `failOnRejected=false`
4. Gateway registration logs show `weijiMemoryPreflight=advisory|open|cmd=uv`.
5. Helper-level live subprocess contract to Wei Ji is verified.
6. **But live `memory_store` tool calls still did not block under enforced test posture**, including from a fresh session.

So the real remaining blocker is:

> **deployment/source-of-execution proof** — the live `memory_store` execution path still does not behave like the patched implementation, even though config/load-path/registration look correct.

## Landed receipts

### `delirium-to-weiji`
- `54e13d2` — thin OpenClaw wrapper commands
- `80da082` — OpenClaw memory-intent adapter for Wei Ji preflight
- `c6fbb73` — memory-intent schema card
- `c3be873` — existing skill/docs updated to note the live memory-store automation lane

### `openclaw-mem`
- `9d6fde4` — `feat(mem-engine): add wei ji memory-store preflight`
  - helper module: `extensions/openclaw-mem-engine/weiJiMemoryPreflight.js`
  - helper tests: `extensions/openclaw-mem-engine/weiJiMemoryPreflight.test.mjs`
  - `memory_store` pre-write hook code in `extensions/openclaw-mem-engine/index.ts`
  - plugin schema/UI hints in `extensions/openclaw-mem-engine/openclaw.plugin.json`
  - docs:
    - `extensions/openclaw-mem-engine/README.md`
    - `docs/mem-engine.md`
    - `docs/2026-03-27_sakura-weiji-hook-automation-blade-map.md`
    - `docs/2026-03-27_sakura-weiji-hook-automation-closure.md`

## Skill decision
Do **not** add a second Wei Ji automation skill.

Standing decision:
- keep the existing `openclaw-wei-ji` skill as the authority surface for manual/ad hoc usage
- document the memory-store live automation lane there
- do not create a duplicative runtime skill

## Verified facts

### Wrapper / helper side
- `node --test extensions/openclaw-mem-engine/weiJiMemoryPreflight.test.mjs` -> **5 passed**
- helper live subprocess smoke against real Wei Ji wrapper succeeded:
  - `allowed=true`
  - `blocked=false`
  - `decision=allow`
  - `mode=advisory`
  - `wrapperExitCode=0`
  - `runtimeFailed=false`
- stricter helper smoke (`failMode=closed`, `failOnQueued=true`) also behaved correctly at helper level:
  - `allowed=false`
  - `blocked=true`
  - `decision=block`
  - `wrapperExitCode=40`
  - `wrapperFailReason=memory_write_queued_for_review`

### Host config / runtime-facing receipts
Current host config in `/root/.openclaw/openclaw.json`:
```jsonc
"weijiMemoryPreflight": {
  "enabled": true,
  "command": "uv",
  "commandArgs": [
    "run",
    "--project",
    "/root/.openclaw/workspace/delirium-to-weiji",
    "weiji-memory-preflight"
  ],
  "dbPath": "/root/.openclaw/workspace/delirium-to-weiji/.state/d2w/verdicts.sqlite3",
  "timeoutMs": 12000,
  "failMode": "open",
  "failOnQueued": false,
  "failOnRejected": false
}
```

Gateway status currently reports:
- `RPC probe: ok`
- plugin registration line includes `weijiMemoryPreflight=advisory|open|cmd=uv`

## What was disproven
Two hypotheses were explicitly tested and falsified:

1. **"Only this old chat session is stale."**
   - false
   - a fresh session test still stored memory instead of blocking

2. **"The feature is missing because config/load path are obviously wrong."**
   - not supported by current evidence
   - load paths include:
     - `/root/.openclaw/workspace/openclaw-mem/extensions/openclaw-mem-engine`
   - config entry is present and registration logs reflect the new gate settings

## Most likely remaining blocker
The most likely remaining explanation is:
- the live `memory_store` execution path is not actually invoking the patched implementation that current workspace source suggests,
- or some shadow/prebuilt/alternate handler is servicing `memory_store` while still advertising the same plugin/backend label.

## Next exact move after restart
CK said he may manually restart the real serving process.

After that restart, do this exact proof sequence:

### 1) Temporary strict proof config
Set:
- `failMode=closed`
- `failOnQueued=true`
- `failOnRejected=false`

Restart the real serving process.

### 2) Fresh-session proof
From a fresh session, call `memory_store` with obviously review-worthy content.
Expected result **if live deployment is truly correct**:
- no memory id returned
- tool text like: `Memory write held by Wei Ji preflight policy. No memory was stored.`
- `details.error = "weiji_memory_preflight_blocked"`

### 3) Immediate rollback to safe posture
Restore:
- `failMode=open`
- `failOnQueued=false`
- `failOnRejected=false`

Restart again.

## Suggested query path if it still fails after real restart
If strict proof still does not block after CK restarts the real serving process, next investigation should be query-first and surgical:
1. identify the actual runtime source/execution path for live `memory_store`
2. compare workspace source vs loaded implementation
3. determine whether `memory_store` is being serviced by:
   - a shadow implementation,
   - stale build/install artifact,
   - alternate plugin/backend registration layer,
   - or another process than the one being restarted

## Hygiene / cleanup status
- temporary test memories from prior enforcement experiments were deleted
- host config is already restored to safe advisory posture
- repos were clean at checkpoint (except `delirium-to-weiji/.state/`, expected local state)

## Topology statement
- changed already: Wei Ji wrapper surface, existing skill docs, `openclaw-mem-engine` pre-write hook code, host config gate
- unchanged: checkpoint/closeout automation remains deferred; no new persistence lane; no auto-approval path
