Repository navigation
Complete staff-reviewed support knowledge and release workflows - #69
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: partial
Scope: full-pr (full-pr)
Mode: initial
Commit: 5744fb0d963c9e8ed17bb683aad30d2c342ac53d
Judge: openai/gpt-5.6-luna (repaired(canonical+4): source coverage preserved before publication cap)
Cost: $3.5917 (lanes $3.5852 + judge $0.0065) + at least $0.45 (incomplete)
Lanes
openai/gpt-6.1-sol: ok (6 finding(s), 157.8s, 1552889+5898 tokens (814283 cached), 4 tool round(s), via Azure, $3.59)z-ai/glm-5.3-flash: ok (8 finding(s), 747.4s, 15263724+81702 tokens (14280704 cached), 45 tool round(s), 1 retried request(s), salvaged finish, via CoreWeave, at least $0.45 (incomplete))
This is a partial review. The embedded diff was truncated. It must not be treated as a clean review.
The diff is 1649.3 KB against a 1024 KB embed budget (max_diff_kb). Diff-budget triage embedded 1005.1 KB; 17 file(s) kept only a stub — diff header, +/- counts, and a first-hunk reference, with no reviewable hunks: pnpm-lock.yaml, public/staff-support-followup.js, src/support-success-evidence.test.ts, worker/src/index.ts, worker/src/support-engineering-acceptance.test.ts, worker/src/support-engineering-driver-fixtures.ts, worker/src/support-engineering-driver.test.ts, worker/src/support-engineering-github.test.ts, worker/src/support-engineering-production.test.ts, worker/src/support-engineering-production.ts, worker/src/support-independent-checks.test.ts, worker/src/support-learning-driver.test.ts, worker/src/support-learning-production-composition.test.ts, worker/src/support-learning-root-integration.test.ts, worker/src/support-learning-test-receipts.test.ts (+2 more). Each stubbed file's content may be available through the read-only tools, but stub accounting does not establish readable content or full coverage. This review is a partial verdict and must not be treated as clean.
Warning
z-ai/glm-5.3-flash: coverage claims 1 finding(s) in 'docs/KNOWLEDGE_COMPOSITION.md' but 0 were reported
Warning
z-ai/glm-5.3-flash: coverage claims 2 finding(s) in 'docs/SUPPORT_ENGINEERING.md' but 1 were reported
Warning
z-ai/glm-5.3-flash: coverage claims 2 finding(s) in 'docs/SUPPORT_RELEASE_FOLLOWUP.md' but 1 were reported
Warning
z-ai/glm-5.3-flash: coverage claims 1 finding(s) in 'public/staff-support-review-inbox.js' but 0 were reported
Findings
🔴 Issue 1 — Retest preparation blocked by unrelated ticket revisions
worker/src/support-release-followup-retests.ts:356 · bug · identified by openai/gpt-6.1-sol
After staff adds an internal note or changes assignment on a prepared or delivered ticket, a new retest association fails with HTTP 409 even though the retained Work, release and retest request are unchanged. The browser cannot repair this by submitting the current ticket revision: that would fail the separate immutable Work revision comparison.
workFacts() requires both ticket.ticket.revision and the Work's accepted/delivered revision to equal expectedTicketRevision. The controller deliberately submits the immutable Work revision, so these requirements become mutually exclusive after an unrelated ticket update.
I checked public/staff-support-followup.js and src/support-release-retest-ui.test.ts. The latter explicitly expects preparation to remain possible when the current ticket revision advances to 20, but uses synthetic preparation responses and therefore does not exercise this backend rejection. Preserve current ticket authorization without requiring its mutable revision to equal the historical retest binding.
🔴 Issue 2 — Review inbox stranded by queue refresh
public/staff-support.js:155 · bug · identified by openai/gpt-6.1-sol
If staff refreshes or filters the support queue while an inbox request is awaiting a response, the inbox can remain permanently busy with both pagination controls disabled. Even a completed inbox page becomes inert after a queue refresh because its ticket buttons retain the old queue generation.
capture() binds inbox operations to queueGeneration, and refreshQueue() increments that generation without calling reviewInbox.clear(). The inbox's finally block resets busy only when its captured view remains current, so an invalidated in-flight scan never resets its internal state.
I checked public/staff-support-review-inbox.js, the integration in public/staff-support.js, and src/support-review-inbox.test.ts. The invalidation test explicitly calls panel.clear(), unlike the actual queue-refresh path. Clear or explicitly invalidate the inbox whenever the queue generation changes.
🔴 Issue 3 — Docs claim current stored policy is pegma.dev-policy-7 while the code ships pegma.dev-policy-8, and the customer defaults list omits the new permission
docs/SUPPORT_COMPOSITION.md:86 · bug · identified by z-ai/glm-5.3-flash
An operator reading the authorization docs to determine the deployed stored-role policy gets the wrong version identity and an incomplete customer permission list. worker/src/support-access.ts:126 sets version: 'pegma.dev-policy-8', with its own comment documenting that version 7 added the release-follow-up grants and version 8 added the authenticated owner success confirmation. The docs edited in this same PR still say version 7 is current:
docs/SUPPORT_COMPOSITION.md:86— "Policy version:pegma.dev-policy-7".docs/SUPPORT_COMPOSITION.md:318— "Current policypegma.dev-policy-7retains those grants...".docs/KNOWLEDGE_COMPOSITION.md:226— "Current policypegma.dev-policy-7retains them...".docs/SUPPORT_ENGINEERING.md:25— "pegma.dev-policy-7, retains these five human engineering permissions".
Additionally, docs/SUPPORT_COMPOSITION.md (lines ~80–84) lists exactly four customer defaults permissions (create, read.own, reply.own, request_person.own) and was not updated for the new supportPermissions.confirmSuccess default that version 8 grants to every authenticated account (SUPPORT_CUSTOMER_PERMISSIONS in worker/src/support-access.ts). So the security documentation understates the shipped default authorization surface.
The mismatch is introduced by this PR: the diff shows these doc lines being edited (6 → 7) in the same change that bumps the code to 8. A grep for pegma.dev-policy- across the repo finds only these doc references plus the code site; no test pins the version string, so the drift will not fail CI. Repair is on the doc side (state version 8 and add the new customer default), or the code must revert to 7 if confirmSuccess was meant to ship separately.
🔴 Issue 4 — User-visible mojibake shipped in the staff learning panel and review inbox scripts
public/staff-support-learning.js:341 · bug · identified by z-ai/glm-5.3-flash
Staff see corrupted characters in the support UI on ordinary use:
public/staff-support-learning.js:341—notice('Reading current learning source…')renders as garbage instead of "Reading current learning source…" on every learning refresh.public/staff-support-learning.js:357and:398— the·separators in the "Source … · resolution cycle …" and "Work … · status · stage" status lines are mojibake (·), shown every time a source or work read completes.public/staff-support-review-inbox.js:133— every review-inbox row label rendersitem.ticketId + ' · ' + item.labelwith a corrupted middle dot.
The same PR's public/staff-support-followup.js uses a correct · (retest request option label), which shows these are accidental encoding corruption introduced while editing these files, not a project-wide style. Fix by restoring the intended UTF-8 characters (…, ·).
🔴 Issue 5 — Retained success-confirmation packet with a mismatched or malformed owner permanently breaks the customer ticket page
public/feedback-ticket.js:304 · bug · identified by z-ai/glm-5.3-flash
A customer who once had an unresolved "Confirm this solved my issue" packet can no longer load the ticket at all in that browser tab. public/feedback-ticket.js:275 calls restoreSuccess(next) inside readViewer on every ticket read; restoreSuccess (lines 304–326) throws invalid_pending_confirmation when the stored packet's subject does not match the current session subject, or when any stored key/shape is invalid (including JSON.parse failures on corrupted storage). The throw has no status, so failure() in loadTicket shows the generic "Could not confirm the ticket read result" message — and the bad sessionStorage entry is never removed (clearSuccess is not called on this path), so every reload throws again.
Concrete scenario: user A starts a confirmation, the ACK is lost (packet saved under pegma.support.success.v1:<A>:<ticket>), A signs out; user B opens the same ticket URL in the same tab — the packet's subject no longer matches and the page is stuck until site data is cleared.
The parallel personPacket logic handles exactly this case gracefully (if (personPacket !== null && next.subject !== personPacket.subject) { personPacket = null; ... }), so the intended pattern exists; the success path should clear or ignore the non-owned/malformed packet instead of throwing past it.
🟠 Issue 6 — Release epochs can miss concurrent withdrawal and republication
worker/src/support-release-followup-releases.ts:87 · risk · identified by openai/gpt-6.1-sol
Concurrent signed withdrawal and republication deliveries can restore identical release facts without advancing the release epoch, allowing an old deployed-fix mapping to become current again.
The webhook first changes the release projection and then calls recordSupportFollowupRelease(). That function rereads the latest projection rather than recording the transition that the delivery accepted. If republication restores the active projection before the withdrawal's journal read, both journal calls can see the original active fingerprint and return the old epoch. The journal's CAS protects competing journal updates, but not the intervening projection transitions.
I checked the webhook call site, reconciliation call site, recordSupportFollowupRelease(), and the sequential withdrawal/republication cases in the mapping and root tests. Those tests await each event before sending the next and do not cover this interleaving. Record accepted projection transitions durably or atomically with their journal changes; a latest-state refresh alone cannot guarantee the documented republication fence.
🟠 Issue 7 — Successful-test submission lacks a late browser commit fence
worker/src/support-learning.ts:459 · risk · identified by openai/gpt-6.1-sol
If the original browser session is destroyed while a successful-test receipt is being verified against Knowledge Base evidence, the Support evidence mutation may commit before the handler's final browser check rejects its acknowledgement.
submitSuccessfulTest() invokes submitResolutionEvidence(current, packet) without a late browser guard. The receipt verifier refreshes principal permissions through resolvePrincipal, not the original cookie session. Consequently, a session-only revocation during its asynchronous report/proof reads is not detected by that verifier. A final HTTP authority check can withhold the ACK but cannot prevent the earlier mutation.
I checked support-learning.ts, support-learning-handlers.ts, support-learning-test-receipts.ts, and the new authority tests. The body-race tests cover revocation before domain execution, while the committed-ACK test expressly permits post-commit denial. The installed SDK implementation was not available to inspect, so an undocumented SDK session-aware safeguard remains a proof gap; the supplied call and verifier ports do not expose one. Pass the original browser's late guard through the actual evidence commit path.
🟠 Issue 8 — Follow-up panel observe acceptance requires result.headGeneration, a field pinned by no test and appearing nowhere else in the repo
public/staff-support-followup.js:535 · risk · identified by z-ai/glm-5.3-flash
If the SDK 0.2.9 observeEngineeringFollowup result does not include a numeric headGeneration, every staff "Verify trusted release input" through the panel is rejected with unconfirmed_exact_command after the real work was already created, and the retained packet then cannot settle (each exact retry replays the same observe and re-fails the same predicate). public/staff-support-followup.js:535 requires Number.isSafeInteger(value.result.headGeneration) for observe; a repo-wide grep finds headGeneration only on this one line — no worker source, fixture, or test asserts it.
The other ack() branches were exercised against the real handler in this PR's UI tests (post, retest, retest-receipt, mapping verify), but the success paths for observe, reassess, reject, retry, and abandon through the panel are not (the UI suite only covers observe's local-validation refusal; the raw-HTTP tests assert only outcome/workId/status via toMatchObject, which does not pin headGeneration or workGeneration presence for the panel's exact-key checks).
Proof gap: node_modules is absent from this checkout, so the published SDK's result shape could not be read directly; the finding stands as a verification gap — add one panel-driven successful observe/reassess/reject/retry/abandon case, or confirm each ack() field against the 0.2.9 DTOs.
🔵 Issue 9 — Current composition documentation has stale version contracts
docs/SUPPORT_COMPOSITION.md:86 · nit · identified by openai/gpt-6.1-sol
An operator following the current composition guides will qualify or reproduce a different dependency/policy graph from the one this PR actually installs.
The mismatches include:
docs/SUPPORT_COMPOSITION.mdstill lists Support Desk packages at0.2.7and identifies the current policy as version 7.docs/KNOWLEDGE_COMPOSITION.mdidentifies the current policy as version 7.docs/SUPPORT_ENGINEERING.mdsays this assembly uses exact Support Desk0.2.8and policy version 7.docs/SUPPORT_RELEASE_FOLLOWUP.mddescribes the installed packs as unpublished development packs.README.mdstill identifies the account composition's Sessions package as0.2.1.
I compared these statements with package.json, pnpm-lock.yaml, and support-access.ts: the installed versions are Support Desk 0.2.9, Knowledge Base 0.1.8, Sessions 0.3.0, and policy pegma.dev-policy-8. Update current-graph statements while retaining clearly labelled historical qualification evidence.
🔵 Issue 10 — Mojibake in staff labels and documentation
public/staff-support-learning.js:341 · nit · identified by openai/gpt-6.1-sol
Staff using the learning and engineering-review panels see corrupted punctuation in ordinary status text and ticket labels, and the release-follow-up guide renders the public-fact range incorrectly.
Affected strings include:
- The learning source-loading ellipsis and Source/Work separators in
public/staff-support-learning.js. - The ticket-label separator rendered as
·inpublic/staff-support-review-inbox.js. - The
1–4public-fact range indocs/SUPPORT_RELEASE_FOLLOWUP.md. - Corrupted arrows and dashes in comments in
worker/src/support-api.ts.
These are literal source strings, not a response-decoding issue. I checked the actual scripts and their tests; the tests do not assert the intended punctuation. Restore the original UTF-8 characters or use plain ASCII.
🔵 Issue 11 — docs/SUPPORT_ENGINEERING.md pins wrong package versions: Support Desk 0.2.8 (tree installs 0.2.9) and Sessions 0.2.1 (tree installs 0.3.0)
docs/SUPPORT_ENGINEERING.md:7 · nit · identified by z-ai/glm-5.3-flash
An operator following the engineering guide's explicit pin gets a different package set than the verified tree:
docs/SUPPORT_ENGINEERING.md:7— "the five published Support Desk packages at exact version0.2.8", edited in this PR from 0.2.7, whilepackage.jsonand the lockfile install0.2.9and the Worker health endpoint advertises@pegma/support-desk-application@0.2.9.docs/SUPPORT_ENGINEERING.md:306— "The current source selects the verified [Sessions0.2.1release]", while this PR bumps@pegma/sessionsto0.3.0(also advertised in the health check).
The PR title/body themselves say "verified public Support Desk0.2.9", confirming 0.2.8 is a doc-only error. Update both references.
🔵 Issue 12 — Mojibake introduced into source comments and a published doc
worker/src/support-api.ts:144 · nit · identified by z-ai/glm-5.3-flash
Non-ASCII characters were corrupted while editing these files in this PR (the pre-image had correct —/⇒/…):
worker/src/support-api.ts:144-145——and⇒replace—and⇒in the roleStore doc comment.worker/src/support-api.ts:174—Fail OPEN —.worker/src/support-api.ts:788—session — never taken from the request body.worker/src/support-api.ts:790—/api/support/admin/….worker/src/support-api.ts:1213and:1310—change_priority —and(Task 10) —.docs/SUPPORT_RELEASE_FOLLOWUP.md:102— "Public facts have 1–4 unique references" should read "1–4"; this one is in a published developer doc, not just a comment.
Cosmetic but it makes the docs/comments look broken and is trivially fixable by restoring the intended UTF-8 characters.
🔵 Issue 13 — EVAL_NPM not updated for the @pegma/sessions 0.3.0 bump, contradicting the eval's own documented invariant
evals/assembly-eval.test.ts:45 · nit · identified by z-ai/glm-5.3-flash
evals/assembly-eval.test.ts:45 still records '@pegma/sessions': '0.2.1', but this PR bumps @pegma/sessions to 0.3.0 in package.json, the lockfile, src/data/recipe-backlog.ts, and the health endpoint. The test's own comment states "Current CI-executed recipe dependencies match their root-resolved imports", which this now violates: the compiled catalog will display the sessions component's npm version as 0.2.1 while the site's own recipes install 0.3.0. The eval still passes (the lookup only feeds the published/latest display), so the stale value silently ships misleading catalog data. Update the record to 0.3.0 alongside the other bumped pins.
🔵 Issue 14 — Docs overstate the follow-up mutation response envelope for mapping and retest-receipt operations
docs/SUPPORT_RELEASE_FOLLOWUP.md:64 · nit · identified by z-ai/glm-5.3-flash
docs/SUPPORT_RELEASE_FOLLOWUP.md:64 says "Mutation responses contain result, commandId, operation and the current csrfToken." That is true for observe/reassess/post/reject/retry/abandon (worker/src/support-release-followup-handlers.ts returns {result, commandId, operation, csrfToken}), but the mapping mutations (verify-mapping, withdraw-mapping) and retest-receipt return only {result, csrfToken} — no top-level commandId or operation (the commandId is inside result). A client implementing against the blanket sentence will look up the wrong fields. Scope the sentence to the work-command mutations or note the two exceptions.
There was a problem hiding this comment.
OpenRouter pull-request review
Verdict: partial
Scope: full-pr (full-pr)
Mode: initial
Commit: e6f9f4d3bf1cc9122d2d85a6c6717dd0b2aa8efb
Judge: skipped (one successful review lane; no merge needed)
Cost: $3.8291
Lanes
openai/gpt-6.1-sol: ok (7 finding(s), 130.8s, 1847685+5364 tokens (1094685 cached), 5 tool round(s), via Azure, $3.75)z-ai/glm-5.3-flash: failed-open ($0.0821 spent) — coverage does not account for 125 diff file(s): evals/assembly-eval.test.ts, package.json, pnpm-lock.yaml, public/feedback-ticket.js, public/staff-knowledge.js
This is a partial review. The embedded diff was truncated. It must not be treated as a clean review.
The diff is 1649.5 KB against a 1024 KB embed budget (max_diff_kb). Diff-budget triage embedded 1005.2 KB; 17 file(s) kept only a stub — diff header, +/- counts, and a first-hunk reference, with no reviewable hunks: pnpm-lock.yaml, public/staff-support-followup.js, src/support-success-evidence.test.ts, worker/src/index.ts, worker/src/support-engineering-acceptance.test.ts, worker/src/support-engineering-driver-fixtures.ts, worker/src/support-engineering-driver.test.ts, worker/src/support-engineering-github.test.ts, worker/src/support-engineering-production.test.ts, worker/src/support-engineering-production.ts, worker/src/support-independent-checks.test.ts, worker/src/support-learning-driver.test.ts, worker/src/support-learning-production-composition.test.ts, worker/src/support-learning-root-integration.test.ts, worker/src/support-learning-test-receipts.test.ts (+2 more). Each stubbed file's content may be available through the read-only tools, but stub accounting does not establish readable content or full coverage. This review is a partial verdict and must not be treated as clean.
Findings
🔴 Issue 1 — Review inbox remains disabled after queue refresh
public/staff-support.js:155 · bug · identified by openai/gpt-6.1-sol
Refreshing or filtering the staff queue while an inbox scan is in flight leaves both inbox buttons disabled until the whole page is reloaded. Refreshing after a completed scan also leaves stale private inbox rows displayed, with ticket buttons that no longer respond.
refreshQueue() increments queueGeneration, invalidating the inbox's captured current() predicate, but does not call reviewInbox.clear(). The inbox's finally block resets busy and enables its controls only when that predicate still holds.
I checked the integration in public/staff-support.js and the standalone cases in src/support-review-inbox.test.ts. hideAll() clears the inbox, but a successful ordinary filter/refresh does not use that path; the standalone tests explicitly call clear() and therefore do not cover this integration failure.
🔴 Issue 2 — Paid bootstrap cannot recover from receipt-key availability changes
worker/src/index.ts:742 · bug · identified by openai/gpt-6.1-sol
If the receipt key is missing or temporarily unavailable when a valid paid profile is first loaded, subsequently installing the key does not enable processing in the same Worker environment. Likewise, replacing a previously selected key permanently disables the cached bundle until another profile or flag changes.
prepareDefault() caches the bootstrap promise using a signature that includes configuration and flags but neither receipt-key availability nor key identity. The bootstrap resolves receiptKey once; currentKey() can invalidate that captured key but cannot acquire a new one. A subsequent request with only a changed key returns the old promise.
I checked createSupportReceiptKeyProvider() and the bootstrap tests. Their replacement case verifies revocation, but not recovery through the registered cached Worker. Refresh the bootstrap selection on key changes, or make key acquisition refreshable while preserving the versioned operator-key contract.
🔴 Issue 3 — Retest association rejects unrelated ticket revisions
worker/src/support-release-followup-retests.ts:344 · bug · identified by openai/gpt-6.1-sol
After a staff note, assignment change, or later conversation update increments the ticket revision, staff cannot associate a new report with an otherwise valid retained or delivered follow-up. Reloading cannot repair this: the browser deliberately submits the immutable accepted/delivered work revision, while the server also requires that value to equal the current ticket revision.
workFacts() requires both ticket.ticket.revision and the work's accepted/delivered revision to equal expectedTicketRevision. These are different fences once unrelated ticket changes occur.
I checked the browser packet construction and src/support-release-retest-ui.test.ts, which explicitly expects work revisions 9/10 to remain usable when the current ticket revision is 20. Those cases use synthetic preparation responses; the real backend tests do not exercise that state. Separate the current-ticket observation fence from the immutable work binding rather than requiring their revisions to coincide.
🟠 Issue 4 — Release epoch journal loses withdrawal transitions
worker/src/support-release-followup-releases.ts:87 · risk · identified by openai/gpt-6.1-sol
An unpublish followed quickly by an identical republication can leave an old mapping current again if republication updates the release projection before the unpublish handler records its journal entry. The journal reads the latest projection rather than the authenticated transition that triggered it, so both handlers can see the original active fingerprint and leave the epoch unchanged.
Projection updates and recordSupportFollowupRelease() are separate operations. Its CAS protects only the observation row, not the release version or the withdrawal transition. The same gap exists when journal persistence fails after projection deletion and a later republication precedes recovery.
I checked the webhook call site, reconciliation call site, and mapping tests. The tests serialize deletion, journal recording, and republication, so they do not falsify this interleaving. Preserve withdrawal/replacement epochs atomically with the projection or journal the verified transition durably before allowing it to be overwritten.
🔵 Issue 5 — Current composition documentation names obsolete dependency and policy versions
docs/SUPPORT_COMPOSITION.md:86 · nit · identified by openai/gpt-6.1-sol
Operators following the current composition documentation are directed to a different SDK graph and policy version than this commit actually installs, making configuration and qualification evidence difficult to reproduce.
Affected current-state descriptions include:
README.md: Sessions0.2.1instead of0.3.0.docs/SUPPORT_COMPOSITION.md,docs/SUPPORT_LEARNING.md, anddocs/SUPPORT_ASSISTANT_STAGE.md: Support0.2.7and older KB selections.docs/KNOWLEDGE_COMPOSITION.md: the older Support/KB graph.docs/SUPPORT_ENGINEERING.md: Support0.2.8instead of0.2.9.docs/SUPPORT_COMPOSITION.md,docs/KNOWLEDGE_COMPOSITION.md, anddocs/SUPPORT_ENGINEERING.md: current policy 7 instead of the implementedpegma.dev-policy-8.docs/SUPPORT_RELEASE_FOLLOWUP.md: calls the installed graph unpublished development packs, although the manifest and lockfile select registry versions.
I compared these descriptions with package.json, the lockfile importer, and worker/src/support-access.ts. Historical checkpoints can retain their old versions, but paragraphs explicitly describing the current host should be aligned with this tree.
🔵 Issue 6 — Corrupt pending confirmation storage prevents ticket access
public/feedback-ticket.js:313 · nit · identified by openai/gpt-6.1-sol
A malformed pending-confirmation entry in session storage prevents the customer from loading the ticket on every subsequent reload in that tab. The UI provides no way to discard or repair the entry.
restoreSuccess() catches storage-access failures but performs both JSON.parse() calls and structural validation outside that catch. Every session read repeats the same failure before assigning the viewer, so ordinary reads and replies remain unavailable even though server authentication succeeds.
I checked the retained-command browser tests in src/support-success-evidence.test.ts: they cover valid persistence and ownership but not malformed stored data. Handle invalid entries explicitly, with a visible recovery action that does not silently replace a possibly sent command.
🔵 Issue 7 — Corrupted UTF-8 display text
public/staff-support-learning.js:341 · nit · identified by openai/gpt-6.1-sol
Staff see mojibake in learning status messages and engineering inbox labels, and the new follow-up guide displays a corrupted numeric range.
Affected strings include:
public/staff-support-learning.js: the loading ellipsis and source/work separators.public/staff-support-review-inbox.js: the ticket-label separator·.docs/SUPPORT_RELEASE_FOLLOWUP.md: the public-facts range1–4.worker/src/support-api.ts: multiple comments whose punctuation was corrupted by the same encoding conversion.
These are literal source strings, so neither text-only rendering nor Markdown repairs them. Restore the intended Unicode punctuation and retain UTF-8 encoding.
There was a problem hiding this comment.
OpenRouter pull-request review
Verdict: issues
Scope: full-pr (full-pr)
Mode: initial
Commit: 4d212bbf286bc2fdbf6c687e533a30f8f2453f6e
Judge: openai/gpt-5.6-luna
Cost: $3.2541 (lanes $3.2492 + judge $0.0049) + at least $0.39 (incomplete)
Lanes
openai/gpt-6.1-sol: ok (8 finding(s), 161.9s, 3172833+6770 tokens (2710804 cached), 6 tool round(s), via Azure, $3.25)z-ai/glm-5.3-flash: ok (3 finding(s), 831.6s, 6432643+90231 tokens (4942656 cached), 12 tool round(s), 1 retried request(s), salvaged finish, via Together, at least $0.39 (incomplete))
Warning
z-ai/glm-5.3-flash: coverage claims 0 finding(s) in 'public/staff-support-ticket.js' but 1 were reported
Findings
🟠 Issue 1 — Missing late browser fence for customer success
worker/src/support-api.ts:925 · risk · identified by openai/gpt-6.1-sol
If the owner logs out, loses current Identity access, or changes credentials while confirmCustomerSuccess awaits storage or the optional product-context resolver, the success confirmation can still commit. The subsequent browser.current() only withholds the response; it does not prevent the mutation or the creation of eligible learning work.
The route passes a captured AccessContext but no request cancellation or late browser commit guard. This differs from the successful-test and release-follow-up mutation paths, which explicitly supply late guards.
I checked supportHumanBrowser, the call in support-api.ts, and support-success-evidence.test.ts. The tests cover ownership, CSRF, stale messages and replay, but not browser revocation inside this SDK call. The installed SDK implementation is not available in the tracked checkout; however, the call supplies no capability through which it could reobserve this browser session.
🟠 Issue 2 — Premature closure of learning report verification
worker/src/support-learning-test-receipts.ts:917 · risk · identified by openai/gpt-6.1-sol
A confirmed report can be reset, rejected, or have its evidence revoked during the final supportFacts/product-context await, yet the successful-test verifier can return the previously qualified report as valid and allow new resolution evidence to commit.
qualify() consumes the KB observation confirmation before returning. verify() then awaits another complete Support/product observation and current actor resolution without confirming the report again. Its final comparisons concern the saved fingerprint and Support facts, not the current KB report. The later learning mutation guard rechecks browser authority, not KB proof.
I checked the paired-observation implementation, submitSuccessfulEvidence, and the receipt tests. Existing cases change KB state before or during qualification and change browser authority during later proof work, but do not revoke the report during the closing product await. The release-follow-up retest path already demonstrates a deferred, operation-local confirmation capability that avoids closing the KB observation this early.
🔴 Issue 3 — Invalid restored confirmations permanently block customer controls
public/feedback-ticket.js:365 · bug · identified by openai/gpt-6.1-sol
A saved confirmation whose commandId is 36 hyphens, or whose message ID contains a prohibited control character, is restored as pending. Every retry then receives HTTP 400, while replies and human-support requests remain disabled with no way to discard the invalid packet through the UI. Reloading restores the same blockage.
The restoration regex accepts any 36 characters from [0-9a-f-], whereas the server's clientCommand() requires an actual version-4 UUID. The restored message ID is checked only for length, whereas the server uses boundedString. The error path retains successPacket on 400.
I checked restoreSuccess, failure, the server parser, and the invalid-session-storage cases in src/support-success-evidence.test.ts. Those tests do not include these values. Validate restored packets against the actual server grammar before making them pending.
🟠 Issue 4 — Default mapping proofs indefinitely renew stale deployment facts
worker/src/support-release-followup-mapping.ts:629 · risk · identified by openai/gpt-6.1-sol
After staff records a closed issue and deployed fix, reopening the GitHub issue or rolling back the deployment without changing the release tag does not invalidate the default follow-up proof. New work and customer posting can continue using the obsolete facts until somebody explicitly updates or withdraws the mapping.
The default verifier derives issueHead.state and deployment state exclusively from head.packet. Each read issues a fresh five-minute attestation for that retained packet. It checks current roles, repository policy, mapping rows and release epochs, but never observes current remote issue or deployment state and never expires the original staff verification.
I checked the default bootstrap, facts(), release projection/reconciliation, and mapping/root tests. Reopen/rollback tests either replace an injected proof context or explicitly write a rollback mapping; they do not establish detection of a real external change. This is narrower than the documented current-head/reopened-issue protection. Add current evidence observation or an explicit bounded verification-renewal contract, and document any remaining manual disclosure boundary.
🟠 Issue 5 — Unbounded retention of retest preparation records
worker/src/support-release-followup-retests.ts:142 · risk · identified by openai/gpt-6.1-sol
Repeated retest preparations, including preparations that are abandoned before submitting a result, permanently accumulate receipt/intent and Audit rows containing actor IDs, report coordinates, KB receipt references and work bindings. Expired receipts remain stored indefinitely, and there is no per-ticket preparation capacity bound.
validUntil restricts verification but does not implement storage retention. The new maintenance lane cleans pegma.support-learning-test-bindings.v1; independent-check cleanup also does not touch pegma.support-followup-retest-receipts.v1.
I searched all references to supportFollowupRetestReceipts and its collection name and checked support-maintenance.ts, the registered cleanup composition, and retest tests. Only preparation, verification and tests reference this collection. Preserve minimal exact-command tombstones where needed, but define bounded retention/redaction for the larger historical records rather than retaining every preparation forever.
🟠 Issue 6 — Delayed cancellation of follow-up driver awaits
worker/src/support-release-followup-driver.ts:147 · risk · identified by openai/gpt-6.1-sol
Cancelling a follow-up driver invocation while a Store read or injected runtime promise never settles leaves runTick() pending until its 25-second timer expires. A caller cannot promptly stop the invocation, unlike the engineering and learning drivers.
The parent abort listener only aborts the controller. within() races work against a deadline promise that is rejected only by the timer, so cancellation cannot settle the race unless the underlying operation independently honors the signal. Store reads receive no signal at all.
I compared all three drivers and checked the follow-up driver/invocation-phase tests. They cover OFF behavior and continuation ownership, but not cancellation during a nonsettling read. Reject the stop promise on parent cancellation as the sibling drivers do.
🔵 Issue 7 — Incorrect OFF-mode release projection description
docs/SUPPORT_RELEASE_FOLLOWUP.md:90 · nit · identified by openai/gpt-6.1-sol
An operator estimating database work with follow-up disabled is told that OFF preserves the old projection I/O, but the implementation now reads and conditionally transacts the release epoch journal for every projection writer even while OFF.
applyReleaseProjection, authoritative refresh and deletion all call updateSupportFollowupRelease unconditionally. The followupTracking callbacks are compatibility parameters rather than active gates. The new release tests explicitly require OFF withdrawal/republication to advance epochs.
I checked the webhook, reconciliation, projection helper and OFF-transition test. Update this paragraph to describe unconditional epoch fencing and its I/O cost; do not restore the obsolete OFF behavior and thereby weaken the epoch protection.
🔵 Issue 8 — Conflicting current policy revision
docs/SUPPORT_COMPOSITION.md:467 · nit · identified by openai/gpt-6.1-sol
A reader following the engineering composition section is told that the current policy is version 7, while the authorization section and actual policy identify version 8. This creates ambiguity when verifying which customer and staff grants a deployment should expose.
Version 7 is the historical release-follow-up addition; version 8 adds owner success confirmation and retains those grants.
I checked PEGMA_ACCESS_POLICY, the authorization section of this document and its linked package/policy documentation. Label version 7 as historical here or refer to the current version-8 policy.
🔵 Issue 9 — Follow-up doc claims "OFF preserves the old projection I/O" but the epoch journal is written for every release projection change regardless of the flag
docs/SUPPORT_RELEASE_FOLLOWUP.md:92 · nit · identified by z-ai/glm-5.3-flash
An operator running with PEGMA_SUPPORT_RELEASE_FOLLOWUP_ENABLED off (the checked-in default) plans release-webhook/reconciliation D1 write budgets from docs/SUPPORT_RELEASE_FOLLOWUP.md, which states "OFF preserves the old projection I/O". In reality every projection change now performs an additional epoch-journal read plus a conditional epoch write: applyReleaseProjection, applyAuthoritativeCurrentRelease, touchCurrentReleaseObservedAt and clearCurrentRelease in worker/src/release-projection.ts all route through updateSupportFollowupRelease, which reads and transactionally writes the followup-epoch:<repositoryId> observation row unconditionally (no flag input exists on that path).
The code itself acknowledges this: worker/src/github-release-webhook.ts documents its new followupTracking option as "Compatibility setting; projection epochs also fence changes while OFF", and worker/src/release-reconciliation.ts accepts the same option. Neither implementation ever reads it — the option is dead, and the doc sentence is false.
What I checked: grepped production writers of componentReleaseCollection() (only point get reads remain outside release-projection.ts), read worker/src/releases-api.ts (public reads use per-repository keys and never touch epoch rows), and read worker/src/support-release-followup-releases.ts to confirm the journal write happens on every changed/synced projection write with no OFF branch. Repair: correct the doc sentence (the behavior appears intentional per the code comment), or actually gate the journal on followupTracking — either way the doc and the dead option currently disagree.
🟠 Issue 10 — Retest association silently requires the learning Source testEvidence governance configuration and fails as a misleading 409 followup_retest_changed
worker/src/support-release-followup-bootstrap.ts:33 · risk · identified by z-ai/glm-5.3-flash
An operator enables PEGMA_SUPPORT_RELEASE_FOLLOWUP_ENABLED (and optionally processing), staff verifies a mapping and prepares work, then submits retest-receipt with a genuinely confirmed KB report — and gets HTTP 409 followup_retest_changed even though nothing changed. The cause is configuration, not data: createSupportFollowupGovernanceAccess in worker/src/support-release-followup-bootstrap.ts returns undefined unless SUPPORT_LEARNING_SOURCE_CONFIGURATION_JSON contains a testEvidence block, and index.ts's readGovernance closure then resolves null for every collection; reportFacts in worker/src/support-release-followup-retests.ts maps a missing governance policy (qualifyGovernance && !policy) to ApiError(409, 'followup_retest_changed'). The error code claims the report/work "changed", so the operator cannot distinguish a configuration gap from a real conflict, and nothing surfaces the prerequisite.
The prerequisite is real in every path, paid or not: createSupportReleaseFollowupBootstrap always passes the host-supplied readGovernance into createSupportFollowupRetests, and reportFacts requires the policy on every prepare. All retest fixtures and D1 tests in this PR set SUPPORT_LEARNING_SOURCE_CONFIGURATION_JSON with testEvidence and the article's collection inside collectionIds, which is why the dependency never surfaces in tests.
What I checked: grepped all of docs/ for testEvidence (no matches); docs/SUPPORT_RELEASE_FOLLOWUP.md §Retest report association and §Composition only say "The existing scoped governance reader is reused without new grants" and never state that the Source testEvidence configuration plus collection scope is required. The behavior is fail-closed (no incorrect acceptance), so this is an operability/documentation defect rather than an authorization hole. Repair: document the prerequisite in SUPPORT_RELEASE_FOLLOWUP.md, and/or return a distinct 503 followup_retest_unavailable (or similar) when the governance reader itself is unconfigured, reserving 409 for genuine report/work conflicts.
🔵 Issue 11 — Staff ticket page always renders the Release follow-up panel with no capability hint, so with the shipped default flag the panel is dead on every ticket
public/staff-support-ticket.js:923 · nit · identified by z-ai/glm-5.3-flash
With the checked-in default PEGMA_SUPPORT_RELEASE_FOLLOWUP_ENABLED: "false" (worker/wrangler.jsonc), follow-up routes return 404 before any Store work — yet every staff ticket view still shows the full "Release follow-up" form panel. syncExtensions in public/staff-support-ticket.js calls followup.showTicket(...) on every successful load, and showTicket sets root.hidden = false, so the panel with its mapping/retest/post controls appears enabled. Clicking any control passes the panel's local authority() (the admin ticket read succeeds), then the follow-up route 404s and the status degrades to "Follow-up is unavailable. Check current access and retry the read." — repeated for every button, with no indication that the feature is disabled for this deployment.
The neighboring surface solves this exact problem: the engineering panel is gated by the engineeringEnabled boolean in the staff ticket detail (syncExtensions hides it when false, and requireEngineeringAdmission throws without it), and this PR adds learningTestReceiptEnabled as a new detail hint in worker/src/support-api.ts. No equivalent release-follow-up hint was added: validateView in the page accepts optional capability booleans, but none exists for follow-up, so the page cannot distinguish "feature off" from "staff must retry".
What I checked: the follow-up route 404 path in worker/src/index.ts/createSupportRequestHandler (flag off ⇒ 404 before Store init), the unconditional showTicket call in the page wiring, and the staff detail DTO hints in worker/src/support-api.ts (only learningTestReceiptEnabled added). Repair: add a releaseFollowupEnabled-style detail hint next to engineeringEnabled and hide/suspend the panel when it is false, matching the engineering-panel pattern.
There was a problem hiding this comment.
OpenRouter pull-request review
Verdict: issues
Scope: latest-commit (commit-range)
Mode: verify
Commit: 78ad1807d3e2fa8da1dacb0afcfd6ee6b8366575
Judge: openai/gpt-5.6-luna
Cost: $0.3846 (lanes $0.3837 + judge $0.0009)
Lanes
openai/gpt-6.1-sol: ok (2 finding(s), 84.2s, 513023+2974 tokens (446134 cached), 8 tool round(s), via Azure, $0.27)z-ai/glm-5.3-flash: ok (0 finding(s), 250.3s, 2183457+43487 tokens (1927296 cached), 24 tool round(s), via Mistral, $0.12)
Round 2 resolution
- ✅
r1-3fixed correctly — Invalid restored confirmations permanently block customer controls: Restoration now enforces the server's UUID-v4 shape and rejects prohibited message-ID control characters. The browser tests cover malformed retained packets across reloads and verify that reply and human-support controls remain usable. - ✅
r1-1fixed correctly — Missing late browser fence for customer success: The customer-success route now passes request cancellation and a late verifyBeforeCommit guard that refreshes the original browser authority and supplies its synchronous assertion. Added tests check session, Identity, credential and cancellation changes during storage and product-context awaits without mutations. ⚠️ r1-2fixed incorrectly — Premature closure of learning report verification: The request-local scope defers report confirmation until after Support/product reads and the browser guard, addressing the originally identified await locations. However, qualified.confirm() consumes observations.confirm() concurrently with another readGovernance() in Promise.all. If report confirmation finishes first, the report can be reset, rejected or revoked while the governance read remains …- ✅
r1-4fixed correctly — Default mapping proofs indefinitely renew stale deployment facts: Default proofs no longer renew indefinitely: verification is bounded to one hour from the original staff command, attestations cannot extend beyond that deadline, and accepted-command replay does not renew it. Tests exercise expiry and explicit renewal. The documented default intentionally relies on staff updates rather than polling external issue or deployment systems within that bounded window. - ✅
r1-5fixed correctly — Unbounded retention of retest preparation records: Retest intents now expire, receipt/intent payloads are redacted to minimal command tombstones after bounded retention, and aged Audit rows are deleted. The existing nonpaid maintenance lane invokes a separate four-row cursor sweep, including legacy records. Atomic lifetime admission capacity bounds new per-ticket preparation history. - ✅
r1-6fixed correctly — Delayed cancellation of follow-up driver awaits: Parent cancellation now rejects the promise raced by within(), promptly settling non-cooperative Store/runtime awaits. Currentness is rechecked before starting queued work, and tests verify prompt settlement without advancing the deadline timer or allowing late continuation writes. - ✅
r1-10fixed correctly — Retest association silently requires the learning SourcetestEvidencegovernance configuration and fails as a misleading 409followup_retest_changed: The scoped testEvidence governance prerequisite is explicitly documented, including Knowledge enablement and collection scope. Missing governance now returns HTTP 503 followup_retest_unavailable rather than a misleading data-conflict 409, with tests confirming no association is written. - 4 nit finding(s) from earlier rounds retired (severity floor for follow-up rounds is
risk). - Open findings after this round: 3 (1 bug-severity).
Findings
🔴 Issue 1 — Terminal retest refusals leave the staff panel permanently pending
public/staff-support-followup.js:311 · bug · identified by openai/gpt-6.1-sol
An abandoned preparation that expires after five minutes now returns HTTP 410 on every exact retry. The staff panel treats that response as an unknown acknowledgement, disables local discard, and retains the pending command. Reaching the new lifetime preparation capacity similarly produces a permanent HTTP 429 refusal that the panel cannot discard.
public/staff-support-followup.js only recognizes 400, 409 and 413 as definite rejections in ownedRequest(). Neither newly introduced response is recognized. hasPending() consequently remains true, and the parent ticket page also blocks ordinary mutations while that packet is pending. Reloading the ticket does not clear the panel's owner closure.
I checked the actual page transport, discard guard and preparation retry path. The transport forwards these HTTP statuses, but no handler clears their pending state. Add explicit handling for terminal preparation expiry and capacity refusals, preserving unknown-ACK safety where appropriate; capacity errors currently cannot be distinguished from transient quota errors because the page transport drops the response error code.
🟠 Issue 2 — Unversioned fingerprint changes invalidate previously prepared receipts
worker/src/support-release-followup-retests.ts:655 · risk · identified by openai/gpt-6.1-sol
A still-valid receipt prepared before this commit fails verification after deployment even when its report, policy, product and authority are unchanged. Exact preparation replay returns the retained receipt rather than replacing it, so retrying the original preparation cannot repair the failure.
Both receipt mechanisms change their persisted fingerprint calculation without a version discriminator or migration:
worker/src/support-release-followup-retests.tsaddspolicyHashto the report fingerprint, then compares it directly with the old storedreportFingerprint.worker/src/support-learning-test-receipts.tschanges the hashed governance snapshot to includevalidationPolicy, likewise comparing it directly with existing references.
I checked the legacy receipt fallback and replay paths. The retest fallback test removes readHint from a newly generated receipt, so it retains the new fingerprint and does not test a genuine pre-commit receipt. Current trust should still be checked, but compatibility needs an explicit fingerprint version or a deliberate invalidation/repreparation path rather than reporting unchanged historical receipts as conflicts.
There was a problem hiding this comment.
OpenRouter pull-request review
Verdict: clean
Scope: latest-commit (commit-range)
Mode: verify
Commit: 4f2489c22cc406a08c625985959310366b13ace4
Judge: openai/gpt-5.6-luna
Cost: $0.1812 (lanes $0.1811 + judge $0.0001)
Lanes
openai/gpt-6.1-sol: ok (0 finding(s), 40.0s, 153222+1519 tokens (115692 cached), 5 tool round(s), via Azure, $0.13)z-ai/glm-5.3-flash: ok (0 finding(s), 275.0s, 1216780+21404 tokens (1093632 cached), 30 tool round(s), via River, $0.0485)
Round 3 resolution
- ✅
r2-1fixed correctly — Terminal retest refusals leave the staff panel permanently pending: The ticket transport now preserves bounded error codes for HTTP 410 and 429. The follow-up panel recognizes the exact expiry and capacity codes as terminal preparation refusals, permits explicit local discard, and avoids a capacity-refusal cooldown. Added panel and real-controller tests cover recovery and unblocking ordinary writes. Earlier unknown acknowledgements and result-send refusals remain … - ✅
r1-2fixed correctly — Premature closure of learning report verification: Preparation and verification retain the report confirmation capability until closing Support/product and actor reads finish. The latest change also completes final governance reads before consuming that capability; the legacy path finishes governance/reviewer reads before closing its KB observation and rereading the report. Production submission wiring defers confirmation until after the final hum… - 🤝
r2-2disputed — Unversioned fingerprint changes invalidate previously prepared receipts: The fixing agent provides a technically justified initial-release rebuttal: both receipt stores and their creators were introduced within this unmerged PR, so the earlier fingerprint format was not a released persistence contract. No new evidence establishes deployed receipts requiring migration. The retained initial namespaces therefore do not establish the reported upgrade regression. - Open findings after this round: 0 (0 bug-severity).
No structured findings from the successful lane(s).
There was a problem hiding this comment.
OpenRouter pull-request review
Verdict: clean
Scope: latest-commit (commit-range)
Mode: verify
Commit: fe9035c2a2be047cffd8f5ee6b973d7c1dcbce84
Judge: openai/gpt-5.6-luna
Cost: $0.1191 (lanes $0.1190 + judge $0.0001)
Lanes
openai/gpt-6.1-sol: ok (0 finding(s), 18.5s, 62267+664 tokens (45095 cached), 4 tool round(s), via Azure, $0.0595)z-ai/glm-5.3-flash: ok (0 finding(s), 660.7s, 1268727+59349 tokens (1162420 cached), 30 tool round(s), via OpenInference, $0.0595)
Round 4 resolution
- No prior findings were open.
- Open findings after this round: 0 (0 bug-severity).
No structured findings from the successful lane(s).
Staff can attach confirmed Knowledge Base test reports to support resolutions, review engineering work, and prepare approved customer updates after verifying a deployed fix. This connects the staff queue, private evidence, repository mappings and retest controls to durable learning, engineering processing and resumable release follow-up, with retry-safe command recovery and fresh authorization before changes commit.
The host selects verified public Support Desk 0.2.10, Knowledge Base 0.1.8 and Sessions 0.3.0. Initial browser admission retains its session-activity touch; closing checks use fresh read-only observations with current identity and role checks. Customer AI remains disabled. Knowledge publication, issue export and customer updates require staff approval.
The public-package checkpoint passed its frozen install, all 335 SDK and 7 Sessions members, installed dependency/class graph and Node 22 Worker types. The complete ordinary, Native D1, Bench Ticket and build matrices on Node 22 and 24 remain required, alongside the current-head configured OpenRouter review and CI. The isolated full Node 24 diagnostic passed all 256 Native tests without skips or a reproduced 401; it does not replace final public-package qualification or establish the historical failure's cause.
The existing main deployment publishes the Worker before Pages. Actual client, provider/privacy, complete support-workflow and supervised-pilot acceptance remain separate rollout gates.