Repository navigation
Add read-only session observations for closing checks - #16
Conversation
|
OpenRouter review posted ( |
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
OpenRouter pull-request review
Verdict: issues
Scope: full-pr (full-pr)
Mode: initial
Commit: 6829ea2589d12392c42eb8beb91f9485d7767ab7
Judge: openai/gpt-5.6-luna
Cost: $0.1718 (lanes $0.1701 + judge $0.0017)
Lanes
openai/gpt-6.1-sol: ok (3 finding(s), 64.6s, 132140+2039 tokens (90589 cached), 4 tool round(s), via Azure, $0.15)z-ai/glm-5.3-flash: ok (2 finding(s), 152.2s, 333847+12404 tokens (288320 cached), 10 tool round(s), via Particle AI, $0.0235)
Findings
🔵 Issue 1 — Overbroad malformed-record guarantee
packages/sessions/README.md:58 · nit · identified by openai/gpt-6.1-sol
A stored session with valid lifecycle timestamps but a missing principalId is returned as live rather than rejected as malformed. The new documentation's blanket promise of null for malformed records therefore overstates the validation hosts can rely on.
sessionCollection.codec.decode converts a missing principal to "", isSessionRecord checks only kind, and isLive validates lifecycle timestamps and expiry. This affects the wording in both packages/sessions/README.md and RELEASE_NOTES.md. Narrow the guarantee to malformed timestamps/lifecycle state, or explicitly implement and test broader record validation.
I checked the decoder, both read implementations, and the new malformed-data tests in packages/sessions/src/index.test.ts; those tests mutate timestamps only. The documented host identity checks remain important, and this finding does not imply that the existing get validation changed.
🔵 Issue 2 — Unqualified physical GET count
RELEASE_NOTES.md:20 · nit · identified by openai/gpt-6.1-sol
When Azure returns a retryable failure or the connection fails transiently, one observation can send multiple physical GET requests. The release notes currently promise exactly one physical GET even in that situation, which can mislead hosts estimating request costs or latency.
observe makes one logical getVersioned call, but the Azure SDK can retry that operation. Qualify the physical-request claim as the initialized, no-retry path; the one-logical-read guarantee can remain unconditional.
I checked freshAzureStore and the physical-request test in packages/sessions/src/index.test.ts. The recorder runs perRetry, and the client does not disable retries, but the test exercises only successful live/dead reads and a missing record against Azurite. It does not establish a physical-request upper bound under transient failures.
🔵 Issue 3 — Overstated activity-read write amplification
docs/PROJECT_PLAN.md:320 · nit · identified by openai/gpt-6.1-sol
Repeated live get calls at the same explicit instant do not each write the idle anchor, contrary to the revised statement that every live get still writes it. This overstates the baseline write cost in the explanation of why hosts should adopt observe.
The get update decider returns action: "keep" when observedNow is no later than the current lastSeenAt. A concurrent touch can also cause that branch. Describe get as attempting a best-effort idle touch rather than always writing the anchor.
I checked the current get implementation and its unchanged guards. observe does avoid the update operation entirely, so its read-only benefit is valid; only the unconditional write claim needs correction.
🔵 Issue 4 — PROJECT_PLAN claims observe addresses a "measured pegma.dev Support Desk need" without any supporting evidence
docs/PROJECT_PLAN.md:321 · nit · identified by z-ai/glm-5.3-flash
A future maintainer reading docs/PROJECT_PLAN.md will believe the observe API was added in response to an actual measurement at pegma.dev, and may treat that as validation of the design (e.g. that closing checks are hot enough to justify avoiding the touch write). No measurement, ticket, or reference exists anywhere in the repository, and the text this PR replaces explicitly framed the question as unresolved: "decide when a consumer measures it". The PR body likewise cites no measurement. If the demand is real, cite its source; otherwise state it as a anticipated need, not a measured one.
🔵 Issue 5 — Root README places the 0.3.0 release note after the 0.2.1 note, reversing chronological order
README.md:32 · nit · identified by z-ai/glm-5.3-flash
README.md now reads: 0.2.1 change paragraph, clock-rollback paragraph, then the new 0.3.0 paragraph, immediately before "Current status". A reader scanning top-down encounters the older release last, the opposite of the newest-first convention RELEASE_NOTES.md follows. Moving the 0.3.0 paragraph above the 0.2.1 paragraph (or folding it into the same slot) keeps the front page consistent as future version notes accrete.
There was a problem hiding this comment.
OpenRouter pull-request review
Verdict: clean
Scope: latest-commit (commit-range)
Mode: verify
Commit: 13724e4171571bd50702f12abaf5c710b76a6a19
Judge: openai/gpt-5.6-luna
Cost: $0.0658 (lanes $0.0657 + judge $0.0001)
Lanes
openai/gpt-6.1-sol: ok (0 finding(s), 16.1s, 41570+474 tokens (26009 cached), 3 tool round(s), via Azure, $0.0509)z-ai/glm-5.3-flash: ok (0 finding(s), 133.8s, 284562+9551 tokens (243200 cached), 13 tool round(s), via River, $0.0148)
Round 2 resolution
- 5 nit finding(s) from earlier rounds retired (severity floor for follow-up rounds is
risk). - Open findings after this round: 0 (0 bug-severity).
No structured findings from the successful lane(s).
Hosts can check a session several times while admitting and committing one request. Calling
getfor every closing check also renews the idle anchor and performs its best-effort storage update. This addsobserve(sessionId, now?)for a fresh liveness check that performs one keyed read and leaves the idle anchor unchanged.The method hashes raw session IDs at the port, uses the existing shared liveness predicate, observes the default clock after the awaited read, and returns a public snapshot or null. Storage read failures propagate. The snapshot does not lock the session; hosts still perform their required closing authority checks.
Existing
get, revocation, sweep and race behavior remains intact. Documentation distinguishes initial admission with an idle touch from read-only closing observations. The synchronized candidate version is0.3.0; runtime dependencies and storage layout are unchanged.Validation: full formatting, types and release checks pass on Node22.18.0 and24.18.0; each ran all122 Memory/Azure tests with zero skips. Coverage includes one actual Azure GET per observation, no mutation, fresh reads, clock/expiry boundaries, malformed data and revocation races. Both normal release packs and clean installed consumer behavior passed, with all seven package members verified. Publication follows review, CI and the existing signed-tag trusted-publisher workflow.