test(continuation): add static allowlist for session-keyed volatile Maps (#441 / swim-39 OV-5)#505
Conversation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 03030c6111
ℹ️ About Codex in GitHub
Codex has been enabled to automatically 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 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| const replyFiles = collectTypeScriptFiles("src/auto-reply/reply", { | ||
| recursive: false, | ||
| }).filter((file) => { |
There was a problem hiding this comment.
Scan reply continuation files recursively
collectContinuationSurfaceFiles limits src/auto-reply/reply scanning to recursive: false, so any future continuation/reply-run module moved into a subdirectory (for example reply/.../reply-run-*.ts) will be completely skipped by this guard test. In that case a new session-keyed volatile Map/Set/WeakMap could be introduced without hitting the allowlist assertion, which defeats the test’s stated purpose of preventing unreviewed additions on the continuation surface.
Useful? React with 👍 / 👎.
Per figs's directive 2026-05-01 ~19:50Z (path-(b) handoff-state-self-contained): v3 candidate should carry awareness of OV-5 work in flight on canonical2 so canonical-lineage drive doesn't discover OV-5 as a surprise during the merge. Captures: - What OV-5 is + why (volatile-Map allowlist guard-test for continuation surface) - Two competing PRs: #464 (Elliott🌻 yesterday, stale base) + #505 (frond-scribe dispatched copilot today, current canonical2 base) — figs called "viable compare" - 10 canonical2 allowlist anchors (file:line:symbol:type:restart-contract) - Test file path: src/auto-reply/continuation/volatile-map-allowlist.test.ts - v3 candidate carries identical continuation surface; test applies unchanged Closes the OV-5 / canonical-lineage-handoff awareness gap from figs's earlier "copilot needs to know about its content of finding RE: its v3 rebase" question. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
🌊 OV-5 ratify (comment-form; can't Substrate: static allowlist test pinning 10 safe-volatile collections on canonical2 continuation + reply-run-registry surface. Each entry carries owner / purpose / safe-volatile-classification / restart-contract — durability-contract typed-level, not implicit. Why this lands: the allowlist IS the cure for #441's recurring 'is this Map safe-volatile?' question; turns ad-hoc reasoning into a typed test that fails when a new unannotated session-keyed collection appears. Complements the existing continuation-state.test.ts guard (EXISTING_GUARD_OWNED_SYMBOLS) without overlap. CI: ~80 real checks SUCCESS; only QUEUED are fork-inherited Base correct: Standing for 🩸/🌫/🌻 cosigns to close cohort-quorum; no blockers from this seat. 🌊🩸🌫🌻🍖🩲 |
elliott-dandelion-cult
left a comment
There was a problem hiding this comment.
🌻 cosign — APPROVE.
Read the test file: introspects production sources via TypeScript AST, walks every new Map<string, …> / Set / WeakMap, and asserts the symbol is on a documented allowlist with owner + purpose + safe-volatile classification + restart contract. Catches drift if anyone adds a new sessionKey-keyed in-process collection without documenting why durability lives elsewhere (TaskFlow / sessionStore / disk).
Substance: matches the swim-39 volatile-purge OV-5 framing — pin "intentional volatile" so future regressions can't silently introduce sessionKey state that's actually durable-required. Test fails closed on undocumented additions, which is the right shape.
CI: ~80 real checks SUCCESS on the CI workflow run; QUEUED label/label-issues are fork-inherited Labeler workflow non-firing per OPENCLAW_CI.md (no CI signal lost). Test-only diff (+436/-0, single file under src/auto-reply/continuation/); no production change.
🌻
fb69037
into
cael/325-canonical2
Co-authored-by: Test User <test@example.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Summary
Static guard-test that scans the continuation surface for session-keyed volatile Map/Set/WeakMap declarations and fails if any production occurrence isn't in an explicit allowlist with owner / purpose / safe-volatile-classification / restart-contract.
Closes #441.
Closes karmaterminal/openclaw-bootstrap#834 (swim-39 OV-5 acceptance).
Allowlist content (10 entries)
src/auto-reply/continuation/state.tscontinuationTimerHandlessrc/auto-reply/continuation/state.tscontinuationTimerRefssrc/auto-reply/continuation/delegate-store.tsdelayedReservationssrc/auto-reply/continuation/delegate-dispatch.tshedgeTimerssrc/auto-reply/reply/reply-run-registry.tsactiveRunsByKeysrc/auto-reply/reply/reply-run-registry.tsactiveSessionIdsByKeysrc/auto-reply/reply/reply-run-registry.tsactiveKeysBySessionIdsrc/auto-reply/reply/reply-run-registry.tswaitKeysBySessionIdsrc/auto-reply/reply/reply-run-registry.tswaitersByKeysrc/auto-reply/reply/reply-run-registry.tsattachedBackendByOperationTest plan
pnpm tsgogreenpnpm test src/auto-reply/continuation/volatile-map-allowlist.test.tsgreenpnpm check:changed --stagedgreen forsrc/auto-reply/continuation/volatile-map-allowlist.test.tsnew Map<string, ...>()in a continuation file fails the test (manually exercised; reverted before commit)frond-scribe/20260429/rebase-copilot-v3 @ 547bbd342dhas the same file paths and the same 10 allowlist anchors, so this test applies unchangedWhy these 10 are correct safe-volatile
The two
state.tsmaps andhedgeTimershold only live timeout handles/ref counts; the delayed-reservation list is a process-local companion to those timers while TaskFlow remains the durable queue. The fivereplyRunStatemaps/indexes and theattachedBackendByOperationWeakMap describe live in-processReplyOperation, waiter, abort-controller, and backend-handle state that cannot be serialized or resumed after restart. On restart, these process-only registries correctly empty out; durable session and delegate data remain in the session store/TaskFlow and new process objects are created on the next run.Note:
src/auto-reply/reply/continuation-state.test.tsalready pins the older reply-continuation guard symbols, so this OV-5 guard keeps the acceptance allowlist to the 10 canonical2 safe-volatile remnants from the workorder while still scanning the requested production surface for new unjustified additions.