Skip to content

Guard final customer confirmation and resolution evidence commits - #62

Merged
FlyOverCoderKY merged 4 commits into
mainfrom
claude/support-final-mutation-guards-20261113
Nov 13, 2026
Merged

FlyOverCoderKY merged 4 commits into
mainfrom
claude/support-final-mutation-guards-20261113

Conversation

@FlyOverCoderKY

Copy link
Copy Markdown
Contributor

Customer success confirmation and resolution-evidence submission can await host product or test verification while the original browser session expires or is revoked. Add optional final mutation guards and abort signals to both operations, so the host can refresh authority after that work and assert it synchronously immediately before the transaction. Each CAS retry obtains a new guard. Accepted-command recovery remains available before obsolete proof or cancellation checks, with current access still required.

The five synchronized package candidates advance to 0.2.10 without changing external dependencies. The release documentation also records the completed 0.2.9 publication and its original evidence assets. Existing two-argument callers remain compatible.

Both actual Node22 and24 passed451 focused Memory/Azurite tests, including86 new guard cases; old source fails the causal race tests. The combined candidate has passed frozen install, full formatting and full types on Node22. Full combined Node22/24 tests, examples, normal five-package packs and clean consumers are running. Merge requires the configured OpenRouter action to report clean for the current head and all required CI/security checks to pass. Public publication and both hosts' final acceptance remain separate gates.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 13, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
🔒 Security Review ✅ Completed 2026-11-13T06:25:29.770639Z 275c062 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@github-actions

github-actions Bot commented Nov 13, 2026 •

Copy link
Copy Markdown

OpenRouter review posted (clean). #62 (review)

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OpenRouter pull-request review

Verdict: partial
Scope: full-pr (full-pr)
Mode: initial
Commit: 275c0624dc3115a22aa2228b9d99638512c7de3f
Judge: openai/gpt-5.6-luna
Cost: $0.2674 (lanes $0.2632 + judge $0.0043) + at least $0.14 (incomplete)

Lanes

  • openai/gpt-6.1-sol: ok (5 finding(s), 140.1s, 348341+4302 tokens (281097 cached), 6 tool round(s), via Azure, $0.26)
  • z-ai/glm-5.3-flash: ok (4 finding(s), 891.2s, 2822760+92794 tokens (2505669 cached), 38 tool round(s), 1 retried request(s), salvaged finish, via OpenInference, at least $0.14 (incomplete))

Warning

The PR head advanced after this review's diff was collected. This review is pinned to commit 275c062 and does not cover the newest push.

Findings

🔴 Issue 1 — Release tests still pin the previous candidate version

tests/release-packages.test.ts:93 · bug · identified by openai/gpt-6.1-sol

pnpm test will fail after this version bump because three release-test assertions still require 0.2.9 while reading the current 0.2.10 manifests and lockfile.

Affected assertions:

  • tests/release-packages.test.ts:93–125 expects all five package versions and internal pins to equal 0.2.9.
  • tests/release-packages.test.ts:248 expects the live application lockfile specifier to equal 0.2.9.
  • tests/release-verification.test.ts:1233 expects releaseVerificationVersion to equal 0.2.9.

I checked test/release-verification-fixtures.ts: releaseVerificationVersion is read from the current contracts manifest, rather than representing an immutable historical fixture. vitest.config.ts includes both test files, and .github/workflows/ci.yml runs the complete suite on Node 22 and 24. Update these current-candidate assertions alongside the version bump.

🔴 Issue 2 — New release receipt fails the formatting gate

docs/RELEASING.md:55 · bug · identified by openai/gpt-6.1-sol

The required formatting step will reject the newly added public-assets table: its header, separator, and data rows use different column widths, rather than Prettier's normalized Markdown-table layout.

For example, the first-column separator is substantially longer than the longest link, and the SHA-256 cells and numeric cells are not padded consistently. Normalize the added table with the repository formatter without changing the recorded asset values.

I checked package.json, .prettierignore, and .github/workflows/ci.yml: CI runs prettier --check . before types and tests, and docs/RELEASING.md is not excluded. This conclusion is based on the source formatting; execution was not available in this review.

🟠 Issue 3 — Proof validity is not closed after the new host wait

packages/application/src/resolution-learning.ts:1063 · risk · identified by openai/gpt-6.1-sol

A host guard can wait until the verified product or test attestation expires, then return a valid authority assertion, and the SDK will still commit an eligible learning source and work row using the expired proof.

Both new entry points have this gap:

  • submitResolutionEvidence captures now before product/test verification, checks validity against that timestamp, builds its plan, and then awaits the potentially unbounded mutation.verify() without rechecking the proof interval.
  • confirmCustomerSuccess obtains its learning plan through customerConfirmation, which checks product validity against the earlier ticket.updatedAt; its new final guard can likewise outlive that validity interval. Human confirmation should remain possible, but expired trust should not create eligible learning.

A concrete fixture scenario is to advance the clock by more than the attestation's 60-second lifetime inside verifyBeforeCommit, then return () => true. The final checks cover authority and cancellation, not product/test expiry.

I checked evidencePlan, context, customerConfirmation, the existing evidence suite, and both new guard suites. Existing tests cover initially expired trust and browser-deadline expiry, but not product/test expiry during the added guard wait. The strongest counterevidence is the existing use of a captured acceptedAt; however, the transaction has not been accepted at that point, and the documented contract says expired trust holds new learning. Close the validity boundary without putting asynchronous SDK work after the final host check.

🔵 Issue 4 — Linked adoption guides retain contradictory release coordinates

packages/ai/README.md:9 · nit · identified by openai/gpt-6.1-sol

A host following the updated README into the package and composition guides receives conflicting instructions about the current source version, internal dependency pin, and whether the 0.2.9/KB 0.1.8 graph is published.

Affected guides include:

  • packages/ai/README.md:3–13 calls the local source 0.2.9 and explicitly claims its internal application pin is 0.2.9, although the changed manifest pins 0.2.10; lines 39–43 still identify 0.2.8/KB 0.1.6 as current.
  • examples/ai/README.md:8–12,54–57 describes the example as a 0.2.9 source consumer and says the KB 0.1.8 graph remains development-only.
  • docs/HOST_COMPOSITION.md:15–40 still calls 0.2.8 current and 0.2.9 unpublished.
  • docs/AI_OPERATIONS.md:4–21 gives the same obsolete current/publication status.

These are current adoption statements, not clearly labeled historical receipts. Update them to distinguish prepared 0.2.10 source from the newly recorded verified 0.2.9 publication.

I read these guides and compared their claims with the changed manifests and docs/RELEASING.md. Historical version references can remain; the problem is the contradictory current-state guidance and incorrect installed-source coordinate.

🔵 Issue 5 — Human mutation errors are labeled as engineering failures

packages/application/src/index.ts:6997 · nit · identified by openai/gpt-6.1-sol

A cancelled customer-success confirmation or resolution-evidence submission now throws an error whose message is Engineering mutation aborted; invalid options and malformed final assertions likewise report engineering-specific failures. Host logs and surfaced diagnostics therefore identify the wrong workflow for these new public APIs.

Both entry points reuse engineeringMutationBoundary, whose validation labels and error messages are hard-coded to engineering. Reuse the implementation with neutral terminology or an operation-specific diagnostic label while preserving error classes and AbortError behavior.

I checked the helper and both new test suites. The tests assert the abort name and a generic proof-message substring, so they do not catch this misleading operation naming.

🔵 Issue 6 — Broken upgrade-guidance anchor: RELEASE_NOTES still links UPGRADING.md#unpublished-029-engineering-worker-observations

docs/RELEASE_NOTES.md · nit · identified by z-ai/glm-5.3-flash

A reader following the 0.2.9 section of docs/RELEASE_NOTES.md — "See the worker observation contract and upgrade guidance" — lands on a missing anchor. The diff removes the only matching UPGRADING.md heading (## Unpublished 0.2.9 KB 0.1.8 alignment) and replaces it with ## 0.2.10 final success and evidence guards (anchor 0210-final-success-and-evidence-guards), and the document title also changes, so the unpublished-029-engineering-worker-observations fragment no longer resolves; the 0.2.9 upgrade guidance is effectively unreachable. Evidence: the UPGRADING.md hunks in this diff replace that exact heading, and no replacement 0.2.9 heading is introduced anywhere in the visible UPGRADING.md hunks. Proof gap: the embedded UPGRADING.md diff is truncated mid-hunk, so I could not rule out an unrelated retained heading with that fragment elsewhere in the file.

🔵 Issue 7 — Released 0.2.9 features still carry stale "candidate"/"source addition" headings and anchors

nit · identified by z-ai/glm-5.3-flash

The diff rewrites body prose to declare these features published and strictly verified (e.g., "The published 0.2.9 OpenRouter controller requires genuine comparison evidence...", "The release adds @​pegma/support-desk-ai/openrouter..."), but the section headings and anchors that readers are sent to still label the same verified published features as candidates: the diff-internal link [worker contract](ENGINEERING_EXPORT.md#candidate-029-worker-observations) and [physical invocation contract](ENGINEERING_FOLLOWUP.md#candidate-029-followup-invocations) resolve to sections still titled "candidate", and RESOLUTION_LEARNING.md keeps its ### Candidate scoped comparison evidence heading (anchor candidate-scoped-comparison-evidence) directly above text now saying "The published 0.2.9 OpenRouter controller...". RELEASE_NOTES.md also keeps ### Staff canned responses (Task 15 source addition) while the same PR changes PROJECT_PLAN.md to say Task 15 is "included in published 0.2.9". A host engineer arriving via the receipt links reads "candidate" headings for features the same documents call published, which undermines the release-status clarity these docs exist to enforce. Evidence: the quoted headings appear unchanged in the surrounding context of the diff hunks; none of the renamed-claim hunks touches them. Proof gap: ENGINEERING_EXPORT.md and ENGINEERING_FOLLOWUP.md are not in this diff, so I could not confirm their headings from the head checkout.

🟠 Issue 8 — Documented 0.2.10 commit-boundary contract cannot be verified against the implementation from this diff

risk · identified by z-ai/glm-5.3-flash

The docs (RESOLUTION_LEARNING.md 0.2.10 section, RELEASE_NOTES.md, UPGRADING.md) make strict, security-relevant guarantees about confirmCustomerSuccess / submitResolutionEvidence: the trusted verifyBeforeCommit callback runs "freshly for each actual conditional-write attempt", "No asynchronous SDK work follows the final awaited host callback", the synchronous literal-true assertion is checked "at the conditional transaction boundary" together with captured actor/grant/permissions and (for customer confirmation) ticket ownership, and aborts before/during proof and guard waits prevent all writes. The changed-path list includes the implementation files that must enforce this (packages/application/src/resolution-learning.ts, resolution-learning-types.ts, packages/application/src/index.ts) and the five package manifests plus pnpm-lock.yaml that must bump every package and internal Support pin to 0.2.10 — but none of their hunks appear in the embedded diff. If the implementation diverges from any single guarantee (e.g., the guard not re-captured before product awaits, the assertion checked after the CAS rather than before it, or a stale 0.2.9 pin left in one manifest so the synchronized-version invariant breaks), hosts relying on the docs would inherit a broken final-authorization boundary with no outward symptom. The new tests (which assert exactly these behaviors on two backends) strongly suggest the implementation matches, but tests only cover the exercised fixture paths. Proof gap: the review lane ended before those files could be opened, so the contract text, the version-bump completeness across all five manifests, and the lockfile consistency remain unchecked against source.

🔵 Issue 9 — No test for abort between the final guard's synchronous assertion and the transaction commit

tests/customer-success-mutation-guard.test.ts · nit · identified by z-ai/glm-5.3-flash

Both new test files pin cancellation "before proof", "during product/receipt", and "during guard", and the event-ordering tests pin that only the synchronous assertion runs between host-ready and transact. The one remaining window — an AbortController firing after the guard's synchronous literal-true assertion has been captured/invoked but immediately before the CAS transaction begins — is never exercised. Concrete failure scenario: a host refreshes session authority via the guard, the user closes the tab at that exact moment, and if the implementation only consults the signal inside the guard wrapper (not at the assertion boundary), the write still commits after an abort the host believes cancelled the mutation. The docs promise "An aborted signal prevents new writes", so this last-mile case is exactly what the guarantee covers. Evidence: grep of the visible test hunks shows abort tests only set the signal before the call or during the product/receipt/gate waits; no test aborts between guard completion and commit. Proof gap: the implementation hunks were unavailable, so the correct behavior at that boundary (and whether a test would pass) could not be confirmed.

Workflow run

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OpenRouter pull-request review

Verdict: issues
Scope: full-pr (full-pr)
Mode: initial
Commit: 3872459c33e7dc1a37e0d8c82d295cf55212168c
Judge: openai/gpt-5.6-luna (repaired(canonical+1): source coverage preserved before publication cap)
Cost: $0.4761 (lanes $0.4707 + judge $0.0054)

Lanes

  • openai/gpt-6.1-sol: ok (4 finding(s), 137.4s, 513635+4425 tokens (438244 cached), 8 tool round(s), via Azure, $0.30)
  • z-ai/glm-5.3-flash: ok (6 finding(s), 615.2s, 3794137+56084 tokens (3601408 cached), 50 tool round(s), via InferenceNet, $0.17)

Warning

z-ai/glm-5.3-flash: coverage claims 1 finding(s) in 'packages/application/src/resolution-learning.ts' but 0 were reported

Warning

z-ai/glm-5.3-flash: coverage claims 1 finding(s) in 'tests/resolution-evidence-mutation-guard.test.ts' but 0 were reported

Findings

🔴 Issue 1 — Original learning attestations can expire during the final guard

packages/application/src/resolution-learning.ts:1066 · bug · identified by openai/gpt-6.1-sol

If product/test verification succeeds and verifyBeforeCommit then waits past an attestation's validUntil, both operations can still commit newly eligible learning Source/Work records using expired proof. A host callback that checks only the current browser session and entitlement, as documented, does not prevent this.

submitResolutionEvidence validates timestamps against now captured before verification, constructs the plan, awaits the new guard, and transacts without checking attestation expiry again. Customer confirmation has the same mechanism: customerConfirmation plans eligibility against ticket.updatedAt before the final host wait. Add a synchronous freshness check after that wait; customer success itself should remain available while expired learning proof is held.

I checked context, evidencePlan, both new guard suites, and the existing evidence suite. Their expiry cases cover already-expired proof or browser deadlines, not product/test expiry during the host callback. The analogous engineering evidence path explicitly checks original product/test expiry after mutation.verify() in engineering-evidence.ts:1285–1297, but neither learning path has that fence.

🟠 Issue 2 — Sibling package READMEs and linked docs still claim an unpublished 0.2.9 candidate, contradicting this PR's 0.2.10 bump and published-0.2.9 narrative

packages/ai/README.md:3 · risk · identified by z-ai/glm-5.3-flash

After this PR, a consumer installing the prepared 0.2.10 tarballs gets package READMEs whose first line says the local source is unpublished 0.2.9, and readers following the PR's newly rewritten links land on sections that state the opposite of what the linking text now claims.

Instances found by grepping the head checkout for unpublished|0.2.9:

  • packages/contracts/README.md:3, packages/templates/README.md:3, packages/core/README.md:3 — "The local synchronized source version is 0.2.9" while the manifest in the same package now reads 0.2.10; packages/core/README.md:6 still calls Task 15 an "unpublished source addition" although the PR's own docs/PROJECT_PLAN.md change says it is "included in published 0.2.9".
  • packages/ai/README.md:9 — "Its internal Support application pin is exact 0.2.9" directly contradicts packages/ai/package.json, which this PR pins to "@​pegma/support-desk-application": "0.2.10"; lines 3, 31, 343–345 and 392 still describe the OpenRouter entry and KB alignment as an unpublished candidate.
  • examples/ai/README.md:8–12 and :56–57 — "from the unpublished 0.2.9 source candidate", "It is not a published Support 0.2.9 consumer qualification", "remains development-only until the SDK candidate is qualified and released".
  • docs/ENGINEERING_EXPORT.md:62 and :105, docs/AI_OPERATIONS.md:20 and :98, docs/HOST_COMPOSITION.md:15, :35–36, :40, :149, :192 — "The unpublished 0.2.9 candidate …" / "The current verified registry tuple is 0.2.8" claims that the PR's changes to README.md, AGENTS.md, docs/RELEASING.md and docs/UPGRADING.md now falsify.
  • The PR's new text links into these stale sections: AGENTS.md, README.md, docs/RELEASE_NOTES.md:61 and docs/UPGRADING.md:107 link ENGINEERING_EXPORT.md#candidate-029-worker-observations, and AGENTS.md links packages/ai/README.md#optional-openrouter-adapter-source-candidate, so the new "published 0.2.9" narrative resolves to "unpublished candidate" prose. docs/HOST_COMPOSITION.md:40 links RELEASING.md#source-version-029, a section this PR retitled to "Historical source preparation for 0.2.9" and explicitly closed.

tests/release-packages.test.ts (lines 167, 385) shows README.md is copied into every release pack, so the stale version/publication claims ship inside the published 0.2.10 artifacts, not just in the repository.

🟠 Issue 3 — New serializeAccessContext import is the first use of that export in the repo against the unchanged @​pegma/authorization-core 0.4.0 pin

packages/application/src/index.ts:28 · risk · identified by z-ai/glm-5.3-flash

If @​pegma/authorization-core@​0.4.0 does not export serializeAccessContext, every call to confirmCustomerSuccess and submitResolutionEvidence — including all pre-existing two-argument calls that the PR promises remain valid — throws TypeError: serializeAccessContext is not a function as soon as the captured fence is built, breaking both entry points at runtime.

Mechanism: packages/application/src/index.ts:28 and packages/application/src/resolution-learning.ts:5 add serializeAccessContext to the existing import from @​pegma/authorization-core; pnpm-lock.yaml:669 resolves exactly @​pegma/authorization-core@​0.4.0, and the PR (and docs/RELEASING.md#source-version-0210) state external dependency selections are unchanged, so no dependency bump accompanies the new API usage. A repo-wide grep shows these two files are the first and only uses of the symbol; hasPermission from the same package was already imported, so package resolution is fine — the new assumption is solely this named export.

Proof gap: node_modules is not present in the review checkout and the lockfile records only name/version/integrity, so I could not confirm the export exists in the pinned 0.4.0. The PR's new guard tests exercise both paths end-to-end and reportedly pass, which would falsify this if true — the fixing agent should confirm the focused tests actually ran against the workspace graph rather than stale link artifacts.

🔵 Issue 4 — Unsynchronized package and adoption documentation

packages/ai/README.md:3 · nit · identified by openai/gpt-6.1-sol

A consumer reading the packed AI package README will be told its version and exact application dependency are 0.2.9, although this PR packages both at 0.2.10. Following the linked adoption guides also produces contradictory instructions about whether 0.2.9/KB 0.1.8 is published and qualified.

The remaining conflicting current-status statements include:

  • packages/ai/README.md:3–13,39–43: old source version, internal pin, and current published tuple.
  • packages/contracts/README.md, packages/core/README.md, and packages/templates/README.md: old local/current registry versions; core also calls Task 15 unpublished.
  • docs/HOST_COMPOSITION.md and docs/AI_OPERATIONS.md: 0.2.8 is current and 0.2.9 still awaits graph qualification.
  • examples/ai/README.md:8–13,54–58: the example still identifies its source as the unpublished 0.2.9 candidate.
  • docs/COLLECTIONS.md, docs/ASSISTANT_COORDINATION.md, docs/ENGINEERING_EXPORT.md, docs/ENGINEERING_FOLLOWUP.md, docs/ARCHITECTURE.md, and docs/BUILDOUT.md: remaining statements that 0.2.8 is current.

I checked these references against the synchronized manifests and the newly added dated release receipt. Preserve historical version statements, but update or explicitly date the remaining current-status claims so the package documentation and host adoption instructions agree.

🔵 Issue 5 — New content does not match the required formatter

tests/resolution-evidence-mutation-guard.test.ts:171 · nit · identified by openai/gpt-6.1-sol

The new test and release-receipt content will require formatting changes before the configured CI formatting gate can pass.

Concrete instances include the unnecessarily multiline caught(f.app.submitResolutionEvidence(access, input)) expression at this location and the unaligned newly added asset table in docs/RELEASING.md:55–62. Prettier collapses the short expression and normalizes Markdown table column widths.

I checked the root format:check script, .editorconfig, .prettierignore, and .github/workflows/ci.yml: CI runs prettier --check ., and neither file is excluded. I could not execute the formatter with the read-only review tools; run the configured formatter over the changed files before submitting the next head.

🔵 Issue 6 — Customer and learning failures carry engineering-only diagnostics

packages/application/src/index.ts:6996 · nit · identified by openai/gpt-6.1-sol

When a customer-success or resolution-evidence caller supplies invalid options, aborts a mutation, or returns a malformed synchronous proof, the resulting diagnostic describes an “Engineering mutation.” This misidentifies the failing operation in host logs and makes troubleshooting the newly exposed APIs unnecessarily confusing.

Both new entry points reuse engineeringMutationBoundary, whose validation labels, AbortError message, and stale-proof conflict message are engineering-specific. Generalize the helper's diagnostic wording or supply an operation label for these new callers.

I checked the shared helper and both new test suites. The tests assert the error name or generic proof text, so they do not detect the incorrect operation label; sharing the implementation itself is otherwise compatible with the new option types.

🔵 Issue 7 — RESOLUTION_LEARNING.md now says staged delivery is published 0.2.9 while its own target heading still says (0.2.9 candidate)

docs/RESOLUTION_LEARNING.md:438 · nit · identified by z-ai/glm-5.3-flash

docs/RESOLUTION_LEARNING.md:31 was edited in this PR to read "Published 0.2.9 adds opt-in staged draft delivery", but the section it links to is still headed "## Opt-in staged draft delivery (0.2.9 candidate)" (line 438). The same file therefore simultaneously declares the feature published and a candidate.

A host following the PR's new published-0.2.9 adoption narrative into the staged-delivery contract — the exact contract docs/UPGRADING.md#unpublished-029-staged-learning-delivery (retitled "Published 0.2.9 staged learning delivery") points to — cannot tell which state governs the feature. Fix: retitle the heading (keeping the anchor) to the published framing used everywhere else in this PR.

🔵 Issue 8 — Customer-success and resolution-evidence guards surface errors labeled "Engineering mutation ..."

packages/application/src/engineering-mutation-guard.ts:12 · nit · identified by z-ai/glm-5.3-flash

A host wiring the new optional guard to confirmCustomerSuccess that passes a misspelled key gets TypeError: Engineering mutation options has an unknown field; a non-AbortSignal signal yields Engineering mutation requires an AbortSignal; and a cancellation during a customer-success confirmation or evidence submission surfaces DOMException: Engineering mutation aborted in host logs. All of these name the engineering feature for operations that have nothing to do with engineering follow-up, so operators grepping logs for the failing feature misroute the incident.

Mechanism: both new call sites (packages/application/src/index.ts:6987 and packages/application/src/resolution-learning.ts:903) reuse the shared engineeringMutationBoundary, whose texts are hard-coded in packages/application/src/engineering-mutation-guard.ts (the "Engineering mutation options" label at line 12, the DOMException around line 19, and the "Engineering mutation proof is not current" conflict around line 46). The new tests only assert the `

🔵 Issue 9 — New post-commit authorize() can turn an already-committed customer confirmation into a thrown error for legacy two-argument callers

packages/application/src/index.ts:7009 · nit · identified by z-ai/glm-5.3-flash

A legacy two-argument confirmCustomerSuccess call commits the confirmation transaction; the host then mutates the AccessContext (for example clears permissions) while the post-commit customerViewAfterChange read is awaited; the newly added authorize() after that read throws SupportDeskAuthorizationError, so the caller receives an error for a mutation that actually committed — and because the documented receipt recovery also requires current permissions, the caller cannot observe the success until access is restored. In 0.2.9 the same call returned the view.

Evidence: in packages/application/src/index.ts, confirmCustomerSuccess now calls authorize() both before and after await customerViewAfterChange(actorId, command.ticketId) (the trailing call is at approximately line 7009). docs/UPGRADING.md still claims "Existing two-argument calls remain valid, with unchanged return types" without flagging this new post-commit fence, so upgrading hosts inherit an undocumented error mode on the otherwise-unchanged happy path.

Counterevidence I checked: the engineering flows already re-check permission(...) after a successful commit (packages/application/src/engineering-evidence.ts, committed branch), so this mirrors established house style, and the docs' "recovery requires current access" wording arguably covers the outcome — treat this as a documentation/behavioral-consistency gap for the compatibility claim rather than a logic error.

🔵 Issue 10 — it.each(["revoked session", "expired entitlement"]) runs identical bodies in both new guard suites, so the second label adds no coverage

tests/customer-success-mutation-guard.test.ts:60 · nit · identified by z-ai/glm-5.3-flash

Both new test files parameterize their flagship refusal test over two host-failure labels but never read the parameter: tests/customer-success-mutation-guard.test.ts:60 and tests/resolution-evidence-mutation-guard.test.ts:86 execute byte-for-byte the same body for "revoked session" and "expired entitlement". The titles therefore claim two distinct host-authority failure modes are pinned while only one scenario exists, and each backend lane (memory and Azurite) pays double execution cost for a duplicate.

This matters because the suite names are the auditable record of what is covered — and the PR advertises the new case count — so a future reader will credit entitlement-expiry coverage that does not exist. Evidence: neither test body branches on the it.each parameter (no reference to the label inside the callbacks), and the analogous tests/engineering-mutation-guard.test.ts does not use this labeling pattern, so it is not inherited house style. Fix: either branch on the label (for example, model entitlement expiry through a distinct trust/product-outcome path) or collapse to a single unparameterized test per file.

Workflow run

Comment thread packages/application/src/index.ts Resolved
Comment thread packages/application/src/index.ts Resolved
Comment thread packages/application/src/index.ts Resolved
@FlyOverCoderKY

Copy link
Copy Markdown
Contributor Author

Addressed review 5887241405 in f7bae28.

  • Findings 1, 6 and 8: learning eligibility now selects precomputed eligible/held actions synchronously after the final host assertion using the original product/test validity intervals. Expired trust cannot create eligible Source/Work; human confirmation and accepted-command recovery remain available. The shared diagnostic wording is neutral, with error classes and AbortError unchanged.
  • Findings 2, 4 and 7: current source/internal pins are documented as candidate 0.2.10, distinct from verified published 0.2.9/KB 0.1.8. Sixteen package/adoption docs are reconciled, with historical receipts and legacy anchors retained. All 240 relative file/fragment links resolve.
  • Finding 9: UPGRADING now explicitly explains that an authority refusal during post-commit view read does not roll back an accepted transaction; exact recovery still requires current access. The fresh authority fence remains enforced.
  • Finding 10: the identical labelled callback-refusal bodies are collapsed into one accurately named scenario per backend. Actual host session/entitlement cases remain in host registered-route tests; the SDK test count does not double-credit identical labels.

Findings 3 and 5 are rebutted by executed evidence:

  • The original public authorization-core 0.4.0 artifact exports serializeAccessContext in dist/index.js line 121 and declares it in dist/index.d.ts line 22. The installed package manifest/JS/declaration are byte-identical to the original registry tarball (SHA-256 1e449abf4815b99984f1991cb03be3a337edd1b092e523723b3eff8ed07625aa), whose SHA-512 matches the lockfile. Actual named ESM imports resolve to a function on Node 22 and 24. No dependency change is necessary.
  • Full pnpm run format:check passed on both actual local Nodes and in both exact-head CI jobs. The current Node 22 job and Node 24 job ran every required step successfully, including the formatter, 4,171 tests, examples, packs and clean consumers. The receipt table and guard tests are included in the formatter scope.

The full local matrix also passed all 4,171 tests across 95 files on each actual Node 22.18.0/24.18.0, with zero skips, plus both examples and normal five-package clean consumers. The new boundary tests cover exact validity endpoints, expiry during the awaited guard and synchronous assertion, actual CAS retries, cancellation and receipt recovery. Current configured OpenRouter review is still running; these results do not replace its required clean verdict. No thread is resolved by this comment.

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OpenRouter pull-request review

Verdict: issues
Scope: latest-commit (commit-range)
Mode: verify
Commit: f7bae28648cb760c6ee69430cdf3cf92b7b612da
Judge: openai/gpt-5.6-luna
Cost: $0.2465 (lanes $0.2464 + judge $0.0001)

Lanes

  • openai/gpt-6.1-sol: ok (0 finding(s), 46.1s, 203678+1607 tokens (158704 cached), 5 tool round(s), via Azure, $0.16)
  • z-ai/glm-5.3-flash: ok (0 finding(s), 616.2s, 2005554+46419 tokens (1788160 cached), 29 tool round(s), via River, $0.0876)

Round 2 resolution

  • ✅ r1-1 fixed correctly — Original learning attestations can expire during the final guard: evidenceCommitPlans now checks the captured product and successful-test timestamps synchronously after the final host assertion. Evidence submission selects matching transaction actions and receipt results; customer confirmation replaces the planned learning actions before transaction handoff. Expired proof no longer creates a newly eligible Source or Work record. Added tests cover expiry during…
  • ⚠️ r1-2 fixed incorrectly — Sibling package READMEs and linked docs still claim an unpublished 0.2.9 candidate, contradicting this PR's 0.2.10 bump and published-0.2.9 narrative: All instances listed in the original finding are fixed, and the cross-references check out — but one same-mechanism doc was missed.

Verified fixed:

  • packages/contracts/README.md:3, packages/templates/README.md:3, packages/core/README.md:3, packages/core/README.md:7, and packages/ai/README.md:3 now describe unpublished 0.2.10 with published 0.2.9, and all five package.json manifes…
  • ❌ r1-3 not fixed — New serializeAccessContext import is the first use of that export in the repo against the unchanged @​pegma/authorization-core 0.4.0 pin: Both entry points still import and unconditionally call serializeAccessContext, and the Authorization Core pin remains 0.4.0; no effective compatibility fix or export-specific evidence landed in the latest diff.

The normal build and public-entry tests would detect a missing export, and Vitest does not substitute a mock dependency. However, the inert checkout contains neither the dependency im…

  • 7 nit finding(s) from earlier rounds retired (severity floor for follow-up rounds is risk).
  • Open findings after this round: 2 (0 bug-severity).

No structured findings from the successful lane(s).

Workflow run

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OpenRouter pull-request review

Verdict: clean
Scope: latest-commit (commit-range)
Mode: verify
Commit: 6d7702f6a995e49430d3552ece61a4f7a85ec6e4
Judge: openai/gpt-5.6-luna
Cost: $0.0730 (lanes $0.0729 + judge $0.0001)

Lanes

  • openai/gpt-6.1-sol: ok (0 finding(s), 29.7s, 48704+869 tokens (32031 cached), 3 tool round(s), via Azure, $0.0589)
  • z-ai/glm-5.3-flash: ok (0 finding(s), 92.2s, 192735+13071 tokens (161280 cached), 7 tool round(s), via InferenceNet, $0.0140)

Round 3 resolution

  • ✅ r1-2 fixed correctly — Sibling package READMEs and linked docs still claim an unpublished 0.2.9 candidate, contradicting this PR's 0.2.10 bump and published-0.2.9 narrative: The sibling package READMEs now identify the unpublished source candidate as 0.2.10 and distinguish it from verified published 0.2.9. The linked upgrade, release, engineering, and host-composition documentation is consistent with that distinction. The latest change reconciles the canned-response section in docs/MVP_SPEC.md while preserving its legacy anchor. Searches of documentation, tests,…
  • 🤝 r1-3 disputed — New serializeAccessContext import is the first use of that export in the repo against the unchanged @​pegma/authorization-core 0.4.0 pin: The fixing agent provides a specific technical rebuttal: the original public @​pegma/authorization-core@​0.4.0 artifact exports and declares serializeAccessContext, and named ESM imports and packed consumers passed on Node 22 and 24. The new compatibility note records the artifact coordinates, hashes, and CI evidence; its SHA-512 matches the committed lockfile, and the application retains the ex…
  • Open findings after this round: 0 (0 bug-severity).

No structured findings from the successful lane(s).

Workflow run

@FlyOverCoderKY
FlyOverCoderKY merged commit 0563bd5 into main Nov 13, 2026
5 checks passed
@FlyOverCoderKY
FlyOverCoderKY deleted the claude/support-final-mutation-guards-20261113 branch November 13, 2026 07:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant