# OpenClaw Patch Mapping Matrix ## Purpose Map the current runtime patch behaviors in `openclawtest` to the repo-side modules that should eventually own them. This is the bridge between PoC patching and plugin-oriented implementation. ## Matrix | Current runtime behavior | Current patched file | Intended repo-side owner | Current repo status | Notes | |---|---|---|---|---| | Default reply-end button injection | `send-sxDwUGaO.js` | `src/runtime/openclaw-telegram-poc.ts` + `src/telegram/reply-decorator.ts` + `src/runtime/openclaw-telegram-bridge.ts` | strong | Default buttons now exist as Telegram helper and bridge helper; tested repo-side | | Callback data parsing (`rec:continue`, `rec:stop`) | `bot-Ce301bOE.js` | `src/core/callback-contract.ts` + `src/telegram/callback-handler.ts` | strong | Parsing and normalization logic exist and are tested | | Resolved button state UI (`✅` / `⏹`) | `bot-Ce301bOE.js` | `src/runtime/openclaw-telegram-poc.ts` + `src/runtime/openclaw-telegram-bridge.ts` + `src/runtime/openclaw-telegram-callback-actions.ts` | strong | Helper chain now owns the resolved-button model | | Acknowledgement reply text | `bot-Ce301bOE.js` | `src/runtime/openclaw-telegram-poc.ts` + `src/runtime/openclaw-telegram-bridge.ts` + `src/runtime/openclaw-telegram-callback-actions.ts` | strong | Ack text now has explicit repo-side helper ownership and tests | | State file persistence (`reply-end-controls.json`) | `bot-Ce301bOE.js` | `src/core/store.ts` + `src/adapters/openclaw-state-file.ts` | strong | Store and adapter helpers exist and have tests; runtime patch still writes directly instead of delegating | | Stop-state inbound behavior injection | `bot-Ce301bOE.js` | `src/runtime/openclaw-telegram-poc.ts` + `src/core/policy.ts` + `src/runtime/openclaw-telegram-bridge.ts` | good | Policy behavior now has repo-side helper coverage; runtime still injects literal text inline | | Callback debug logging | `bot-Ce301bOE.js` | future adapter/runtime diagnostics module | missing | Still PoC-only runtime instrumentation with no clean repo-side abstraction yet | ## Immediate migration priority The best first migration target is: ### Priority 1 Move button construction and acknowledgement text to repo-owned helper use. Why: - smallest patch surface - easiest to verify - repo-side helper and bridge now both exist ### Priority 2 Move state persistence to explicit adapter helper use. Why: - store code already exists - adapter bridge already exists - removes fragile duplicated inline state-writing logic ### Priority 3 Move stop-state behavior out of large inline injected strings into clearer policy-driven adapter logic. Why: - highest behavior importance - also highest risk if changed too early ## Current assessment The repo now contains meaningful building blocks for the future pluginized path, including tested core/store/helper/bridge/callback-resolution modules, but the live OpenClaw runtime still contains direct inline patch logic. That means pluginization has started, but the current implementation is still in a hybrid state.