Repository navigation
refactor(plugin-sdk): isolate core session state from plugin mutations - #107795
zhangguiping-xydt wants to merge 6 commits into
Conversation
e53c00b to
b2beb28
Compare
b2beb28 to
7f3ad02
Compare
|
Codex review: needs real behavior proof before merge. Reviewed July 16, 2026, 7:51 PM ET / 23:51 UTC. Summary PR surface: Source +463, Tests +1031, Docs +5, Generated 0, Other +1. Total +1500 across 27 files. Reproducibility: yes. at source level: current Review metrics: 1 noteworthy metric.
Stored data model Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Proof guidance:
Risk before merge
Maintainer options:
Next step before merge
Maintainer decision needed
Security Review findings
Review detailsBest possible solution: Keep one canonical projection/reconciliation owner, preserve the shipped ACP getter identity by hardening its public method outputs or stage the facade through an explicitly approved compatibility path, then rebase and provide redacted installed-plugin proof. Do we have a high-confidence way to reproduce the issue? Yes, at source level: current Is this the best way to solve the issue? Not yet. Centralizing projection is the right architectural direction, but immediately replacing a shipped class-identity contract is not the safest upgrade path without explicit owner approval or a design that preserves identity while hardening outputs. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 7a589567681b. Label changesLabel justifications:
Evidence reviewedPR surface: Source +463, Tests +1031, Docs +5, Generated 0, Other +1. Total +1500 across 27 files. View PR surface stats
What I checked:
Likely related people:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. How this review workflow works
Review history (7 earlier review cycles)
|
2c22c8d to
89d8b6e
Compare
89d8b6e to
0e96f8b
Compare
0e96f8b to
add6832
Compare
add6832 to
9462fa3
Compare
What Problem This Solves
Fixes an isolation gap where core-owned restart-recovery coordination could be exposed, overwritten, or lost through Plugin SDK session APIs.
Upstream now persists channel-turn recovery fields under the
restartRecovery*namespace. This PR keeps those shipped fields, as well as the later split series'mainRestartRecoveryaggregate, out of plugin reads, callback inputs, replacements, ACP resolution, and injected runtime surfaces.The repair also addresses two earlier review findings: an identity-preserving whole-store key move could silently drop private recovery state, and the ACP SDK declared that it returned the internal
AcpSessionManagerclass even though the runtime object was already a restricted facade.Why This Change Was Made
Plugin-visible session rows now pass through one projection/reconciliation owner. The public
SessionEntrytype omitsmainRestartRecoveryand the completerestartRecovery*namespace, matching runtime behavior.Private recovery state is retained for same-key updates and for a unique one-to-one
sessionIdkey move. It is not copied when the source or destination mapping is ambiguous, and it is cleared when the effective session identity changes. FuturerestartRecovery*plugin extension slots are reserved before a new core field can collide with them.The ACP getter returns an explicit
AcpSessionManagerFacadeinterface. The runtime object remains stable, frozen, null-prototype, and limited to bound public methods, so plugins cannot reach the internal manager constructor or bypass session projection.Compatibility note: released
v2026.7.1-beta.5/v2026.7.1and the frozen PR #96230 returned the real manager class. This PR intentionally does not preserveinstanceof, prototype, or constructor identity because exposing the internal constructor would reopen the private-session-state escape path. The SDK catalog documents that contract for maintainer review.User Impact
Plugin authors continue to use the same session and ACP methods, while current and future core restart-recovery coordination remains private and survives valid session-key moves.
Plugins that relied on
getAcpSessionManager()being an actual internal class instance must migrate to the structuralAcpSessionManagerFacadecontract. No session schema, storage format, ACP method behavior, retry budget, or productionmainRestartRecoverywriter is added by this PR.Evidence
SessionEntryandAcpSessionManagerFacade; nomainRestartRecoveryorrestartRecovery*declaration remains in the generated SDK baseline.ff1687e04f11df6c35002c4531cdafba6a845f8f.AcpSessionManagerFacadeis the sole additional export, for a passing budget of 7,992.edc24088387a8d573798233979a71f3b40a24ac9confirms that its whole-store implementation lacked cross-key recovery transfer and its ACP SDK returned the internal class directly.mainRestartRecoveryproducers. Existing upstreamrestartRecovery*writers remain unchanged and now sit behind the Plugin SDK projection boundary.Protected local TypeScript validation could not be recorded because this machine cannot attest the required cgroup limits; the guard stopped before execution and was not bypassed. GitHub CI remains the authoritative protected typecheck/build lane.
Per maintainer-requested workflow for this split, the final audit is a complete code-diff/source review rather than a separate automated final-review pass.