Repository navigation
docs(plans): every entry names a revoke page, and only a 2xx on a held token is a revoke (TASK-172) - #2037
Merged
Conversation
…d token is a revoke (TASK-172) A removal that cannot revoke at the vendor now finishes and hands the person the entry's page, so every entry names one, an endpoint entry included. Only a 2xx on a token we hold counts as revoked: invalid_grant also means "issued to another client", and a cimd client id moves with the API host. §10.5 gains the mark, so a failure after the provider revoke leaves a row the retry can finish. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
samxu01
pushed a commit
that referenced
this pull request
Sep 30, 2026
…voke that takes Removing a hosted Connection is the one sequence with a vendor step, and its order is load-bearing: grants, row, provider, mark, material, delete. Grants first because the granter's own revoke resolves ownership through `findConnection`, so a deleted row orphans them (TASK-145); row second because the broker refuses a row carrying `revokedAt` from that instant; provider third while the material is still there; then the mark; material and delete last so a failed vendor revoke leaves a row a retry can finish. The mark is the fold's centre. A result code dies with the request and a retry reads only the row, so a provider revoke that took and a step 4/5 that failed used to strand the row: the retry found a dead reference and answered `provider_revoke_failed` forever (Vera 75638, measured). The mark is written BEFORE any material goes, is server-owned so a PATCH cannot write it, and a retry that finds it skips the vendor. A failure after it returns `provider_revoked_removal_incomplete`, which says the revoke happened so the retry does not call the vendor again. Only a 2xx on a token we hold counts as revoked (Wren 75660). The `invalid_grant` arm is dropped: RFC 7009 answers a token already gone with 200, while RFC 6749 §5.2 also gives `invalid_grant` for a token "issued to another client" — and our CIMD client id is rebuilt from the API host at call time (`resolvedClientId`), so after a host move a LIVE token answers it. Counting it deletes the material and records a revoke that never happened. The material read discriminates on the error's `code`, never its class: only `connector_secret_not_found` means we hold nothing to revoke, and that case finishes and hands the person the page. `connector_secret_configuration_invalid` and `connector_secret_key_missing` keep the row, or one misconfigured key ring would delete every hosted row that day while recording the vendor revoke as done (Vera 75662). Nothing is ever sent as `token: ""` — the token is the refresh reference or the access one, and a blank or absent secret means send nothing, finish, and hand over the page. Per #2037 the entry's `revoke` is now a `page` always and an `endpoint` only when the AS advertises one, so every refusal and every success carries a `revokeAt`; both URLs are checked, not just the first (the two-key shape used to be refused outright, which is why that loop could not run before). A page-only entry still calls no vendor. Evidence: 20-mutant ledger, 20 killed, 0 survivors, 0 named-arm misses, no site mismatches, all pristine copies restored (baseline 50 passed). Touched suites 55/55; neighbourhood 24 suites / 289 tests / 0 failed. eslint finding multisets identical to the branch base on all five pre-existing files (+0/-0). tsc clean on every touched file.
samxu01
pushed a commit
that referenced
this pull request
Sep 30, 2026
…voke that takes Removing a hosted Connection is the one sequence with a vendor step, and its order is load-bearing: grants, row, provider, mark, material, delete. Grants first because the granter's own revoke resolves ownership through `findConnection`, so a deleted row orphans them (TASK-145); row second because the broker refuses a row carrying `revokedAt` from that instant; provider third while the material is still there; then the mark; material and delete last so a failed vendor revoke leaves a row a retry can finish. The mark is the fold's centre. A result code dies with the request and a retry reads only the row, so a provider revoke that took and a step 4/5 that failed used to strand the row: the retry found a dead reference and answered `provider_revoke_failed` forever (Vera 75638, measured). The mark is written BEFORE any material goes, is server-owned so a PATCH cannot write it, and a retry that finds it skips the vendor. A failure after it returns `provider_revoked_removal_incomplete`, which says the revoke happened so the retry does not call the vendor again. Only a 2xx on a token we hold counts as revoked (Wren 75660). The `invalid_grant` arm is dropped: RFC 7009 answers a token already gone with 200, while RFC 6749 §5.2 also gives `invalid_grant` for a token "issued to another client" — and our CIMD client id is rebuilt from the API host at call time (`resolvedClientId`), so after a host move a LIVE token answers it. Counting it deletes the material and records a revoke that never happened. The material read discriminates on the error's `code`, never its class: only `connector_secret_not_found` means we hold nothing to revoke, and that case finishes and hands the person the page. `connector_secret_configuration_invalid` and `connector_secret_key_missing` keep the row, or one misconfigured key ring would delete every hosted row that day while recording the vendor revoke as done (Vera 75662). Nothing is ever sent as `token: ""` — the token is the refresh reference or the access one, and a blank or absent secret means send nothing, finish, and hand over the page. The token is the one the ROW NAMES, and there is no fallback past a missing one (Wren 75713): a named refresh reference is sent, otherwise the access token, and a not-found read of the named one sends nothing and finishes with the page. A fallback would try to revoke a grant we may still hold — RFC 7009 §2.1 makes an access-token revoke a MAY, so the refresh token can survive it. The arm that says so counts the reads, because its mock throws for every reference and a fallback would otherwise look identical. Per #2037 the entry's `revoke` is now a `page` always and an `endpoint` only when the AS advertises one, so every refusal and every success carries a `revokeAt`; both URLs are checked, not just the first (the two-key shape used to be refused outright, which is why that loop could not run before). A page-only entry still calls no vendor. Evidence: 21-mutant ledger, 21 killed, 0 survivors, 0 named-arm misses, no site mismatches, all pristine copies restored (baseline 50 passed). Touched suites 55/55; neighbourhood 24 suites / 289 tests / 0 failed. eslint finding multisets identical to the branch base on all five pre-existing files and both test files (+0/-0). tsc clean on every touched file.
samxu01
pushed a commit
that referenced
this pull request
Sep 30, 2026
…voke that takes Removing a hosted Connection is the one sequence with a vendor step, and its order is load-bearing: grants, row, provider, mark, material, delete. Grants first because the granter's own revoke resolves ownership through `findConnection`, so a deleted row orphans them (TASK-145); row second because the broker refuses a row carrying `revokedAt` from that instant; provider third while the material is still there; then the mark; material and delete last so a failed vendor revoke leaves a row a retry can finish. The mark is the fold's centre. A result code dies with the request and a retry reads only the row, so a provider revoke that took and a step 4/5 that failed used to strand the row: the retry found a dead reference and answered `provider_revoke_failed` forever (Vera 75638, measured). The mark is written BEFORE any material goes, is server-owned so a PATCH cannot write it, and a retry that finds it skips the vendor. A failure after it returns `provider_revoked_removal_incomplete`, which says the revoke happened so the retry does not call the vendor again. Only a 2xx on a token we hold counts as revoked (Wren 75660). The `invalid_grant` arm is dropped: RFC 7009 answers a token already gone with 200, while RFC 6749 §5.2 also gives `invalid_grant` for a token "issued to another client" — and our CIMD client id is rebuilt from the API host at call time (`resolvedClientId`), so after a host move a LIVE token answers it. Counting it deletes the material and records a revoke that never happened. The material read discriminates on the error's `code`, never its class: only `connector_secret_not_found` means we hold nothing to revoke, and that case finishes and hands the person the page. `connector_secret_configuration_invalid` and `connector_secret_key_missing` keep the row, or one misconfigured key ring would delete every hosted row that day while recording the vendor revoke as done (Vera 75662). Nothing is ever sent as `token: ""` — the token is the refresh reference or the access one, and a blank or absent secret means send nothing, finish, and hand over the page. The mark's OWN comment was wrong about why a PATCH cannot write it, and the fix is a measurement rather than a rewording. `stripServerOwnedConfig` is defined at `routes/integrations.ts:65` and called on the PATCH body at `:750`, and the write loop at `:757` iterates `Object.keys(incoming)`, where `incoming = relay.next` is that stripped copy — so a server-owned key never reaches the loop at all. The explicit refusals (`linkedUserId`, `botToken`) are a different mechanism that covers two keys; the strip is what covers the rest, the mark included. Both comments now name that mechanism and the sites, and `integrations.serverOwnedConfig.test.js` pins it: a PATCH supplying the mark does not write it, while `liveRelay` in the same body is written, which is the acceptance control that makes the absence evidence about the strip rather than a request that never reached a write. (`chatId` was the wrong control — it is on the list too.) The token is the one the ROW NAMES, and there is no fallback past a missing one (Wren 75713): a named refresh reference is sent, otherwise the access token, and a not-found read of the named one sends nothing and finishes with the page. A fallback would try to revoke a grant we may still hold — RFC 7009 §2.1 makes an access-token revoke a MAY, so the refresh token can survive it. The arm that says so counts the reads, because its mock throws for every reference and a fallback would otherwise look identical. Per #2037 the entry's `revoke` is now a `page` always and an `endpoint` only when the AS advertises one, so every refusal and every success carries a `revokeAt`; both URLs are checked, not just the first (the two-key shape used to be refused outright, which is why that loop could not run before). A page-only entry still calls no vendor. Evidence: 22-mutant ledger, 22 killed, 0 survivors, 0 named-arm misses, no site mismatches, all pristine copies restored (baseline 52 passed). M22 removes the strip from the PATCH call site and dies on the new arm, which is what makes "a PATCH cannot write it" measured. Touched suites 57/57; neighbourhood 25 suites / 291 tests / 0 failed. eslint finding multisets identical to the branch base on all five pre-existing source files and both pre-existing test files (+0/-0); the one new .js suite adds 8 findings, all of them the `import/no-unresolved` + `import/extensions` pair for each of its four relative `.ts` requires, which is ambient for a new file in `backend/__tests__` (the resolver's `files: ['**/*.ts']` override). tsc clean on every touched file.
lilyshen0722
added a commit
to thantiklermcirony/commonly
that referenced
this pull request
Oct 9, 2026
…voke that takes (Team-Commonly#2035) Removing a hosted Connection is the one sequence with a vendor step, and its order is load-bearing: grants, row, provider, mark, material, delete. Grants first because the granter's own revoke resolves ownership through `findConnection`, so a deleted row orphans them (TASK-145); row second because the broker refuses a row carrying `revokedAt` from that instant; provider third while the material is still there; then the mark; material and delete last so a failed vendor revoke leaves a row a retry can finish. The mark is the fold's centre. A result code dies with the request and a retry reads only the row, so a provider revoke that took and a step 4/5 that failed used to strand the row: the retry found a dead reference and answered `provider_revoke_failed` forever (Vera 75638, measured). The mark is written BEFORE any material goes, is server-owned so a PATCH cannot write it, and a retry that finds it skips the vendor. A failure after it returns `provider_revoked_removal_incomplete`, which says the revoke happened so the retry does not call the vendor again. Only a 2xx on a token we hold counts as revoked (Wren 75660). The `invalid_grant` arm is dropped: RFC 7009 answers a token already gone with 200, while RFC 6749 §5.2 also gives `invalid_grant` for a token "issued to another client" — and our CIMD client id is rebuilt from the API host at call time (`resolvedClientId`), so after a host move a LIVE token answers it. Counting it deletes the material and records a revoke that never happened. The material read discriminates on the error's `code`, never its class: only `connector_secret_not_found` means we hold nothing to revoke, and that case finishes and hands the person the page. `connector_secret_configuration_invalid` and `connector_secret_key_missing` keep the row, or one misconfigured key ring would delete every hosted row that day while recording the vendor revoke as done (Vera 75662). Nothing is ever sent as `token: ""` — the token is the refresh reference or the access one, and a blank or absent secret means send nothing, finish, and hand over the page. The mark's OWN comment was wrong about why a PATCH cannot write it, and the fix is a measurement rather than a rewording. `stripServerOwnedConfig` is defined at `routes/integrations.ts:65` and called on the PATCH body at `:750`, and the write loop at `:757` iterates `Object.keys(incoming)`, where `incoming = relay.next` is that stripped copy — so a server-owned key never reaches the loop at all. The explicit refusals (`linkedUserId`, `botToken`) are a different mechanism that covers two keys; the strip is what covers the rest, the mark included. Both comments now name that mechanism and the sites, and `integrations.serverOwnedConfig.test.js` pins it: a PATCH supplying the mark does not write it, while `liveRelay` in the same body is written, which is the acceptance control that makes the absence evidence about the strip rather than a request that never reached a write. (`chatId` was the wrong control — it is on the list too.) The token is the one the ROW NAMES, and there is no fallback past a missing one (Wren 75713): a named refresh reference is sent, otherwise the access token, and a not-found read of the named one sends nothing and finishes with the page. A fallback would try to revoke a grant we may still hold — RFC 7009 §2.1 makes an access-token revoke a MAY, so the refresh token can survive it. The arm that says so counts the reads, because its mock throws for every reference and a fallback would otherwise look identical. Per Team-Commonly#2037 the entry's `revoke` is now a `page` always and an `endpoint` only when the AS advertises one, so every refusal and every success carries a `revokeAt`; both URLs are checked, not just the first (the two-key shape used to be refused outright, which is why that loop could not run before). A page-only entry still calls no vendor. Evidence: 22-mutant ledger, 22 killed, 0 survivors, 0 named-arm misses, no site mismatches, all pristine copies restored (baseline 52 passed). M22 removes the strip from the PATCH call site and dies on the new arm, which is what makes "a PATCH cannot write it" measured. Touched suites 57/57; neighbourhood 25 suites / 291 tests / 0 failed. eslint finding multisets identical to the branch base on all five pre-existing source files and both pre-existing test files (+0/-0); the one new .js suite adds 8 findings, all of them the `import/no-unresolved` + `import/extensions` pair for each of its four relative `.ts` requires, which is ambient for a new file in `backend/__tests__` (the resolver's `files: ['**/*.ts']` override). tsc clean on every touched file.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Amends the hosted-MCP plan's removal (§3, §9, §10 steps 6–7) and §10.5 of the tools-catalogue plan, from review of the first removal build.
page, where a person revokes by hand. An entry whose AS advertises an RFC 7009 endpoint names that as well. When a removal cannot revoke at the vendor, because the entry has no endpoint or the token's secret is not found, it finishes and returns the page asrevokeAt. It no longer keeps a row whose retry can never succeed.invalid_grantis a refusal. RFC 7009 answers an already-gone token with 200. RFC 6749 §5.2 also givesinvalid_grantfor a token issued to another client, and a CIMD client id moves with the API host. This replaces a test imported from §10.5 that countedinvalid_grantas revoked.Docs only. Gate: Rhea.
🤖 Generated with Claude Code