Skip to content

feat(connections): TickTick on Crew-owned OAuth (DCR), served to expiry without refresh - #34213

Merged
KiroCrewCaptain merged 1 commit into
mainfrom
feat/ticktick-crew-oauth
Nov 10, 2026
Merged

KiroCrewCaptain merged 1 commit into
mainfrom
feat/ticktick-crew-oauth

Conversation

@iamwhatever

Copy link
Copy Markdown
Contributor

Problem / Motivation

Goal: With the Crew sign-in feature preview on, a chat on a bridged harness (every harness except kiro-cli) can use the TickTick Connection through Crew-owned OAuth, on the same generic DCR engine the six DCR cards use (#33077). TickTick's launch gate passed in #30763 and its registry entry already says dcr: true, pkce: true. This is RFC rfc-crew-owned-oauth.md step 4c ("launch-gated DCR cards, each as its launch gate passes").

Why it matters

Without Crew custody TickTick only works where the harness runs its own DCR sign-in. kiro-cli does; most other harnesses do not.

Not a goal

  • kiro-cli sessions keep TickTick's native path (unchanged: serves_backend never bridges kiro-cli).
  • No hidden card (launch-gated or vendor-pending) is added.
  • No registry change: the entry already carries the scopes, the committed issuer and the manual revoke page.

Live discovery (curl, 2026-11-09 23:40Z, no sign-in)

Check Answer
POST https://mcp.ticktick.com unauthenticated 401, WWW-Authenticate: Bearer ... resource_metadata="https://mcp.ticktick.com/.well-known/oauth-protected-resource"
Protected-resource metadata (RFC 9728) 200: authorization_servers: ["https://ticktick.com/"], scopes_supported: [tasks:write, tasks:read]
AS metadata https://ticktick.com/.well-known/oauth-authorization-server (RFC 8414) 200: issuer https://ticktick.com (= committed l0_expectations.authorization_server), registration_endpoint https://api.ticktick.com/oauth/register, code_challenge_methods_supported [plain, S256], token_endpoint_auth_methods_supported [none, client_secret_basic], authorization_response_iss_parameter_supported: true, grant_types_supported: [authorization_code], revocation_endpoint https://api.ticktick.com/oauth/token (the token URL)
DCR (RFC 7591) POST /oauth/register, token_endpoint_auth_method: none, loopback redirect 200, public client issued; it echoes grant_types [refresh_token, authorization_code]
Refresh token None issued. AS lists only authorization_code; the real grant walked in #30763 step 8 had expires_in: 15551999 (180 days) and no refresh_token
Revoke: RFC 7009 form (token, token_type_hint, client_id) to the advertised revocation_endpoint 401 (Tomcat "Unauthorized" page), so no working upstream revoke

What changed (motivation → approach → change)

  • crew_oauth.DCR_SLUGS gains ticktick. The engine needs no provider data: endpoints, scopes and auth method come from discovery.
  • A pair with no refresh token is served up to its recorded expiry. Tokens.expiring drops the 120 s refresh skew for it, since there is nothing to renew early.
  • At expiry, such a pair is dropped (compare-and-set on the revision read) and the call answers needs_auth. The card then reads Not connected and offers Connect again; the proxy returns its usual 409 needs_auth "reconnect it on the Connections page". The registered client is kept, so reconnecting adds no new client. A forced call (vendor 401) before expiry still answers needs_auth and keeps the pair, as today.
  • Revoke: the existing best-effort RFC 7009 call answers 401 at TickTick, so Disconnect reports upstreamRevoked: false, deletes locally and keeps the card's manual revoke link (Settings → Integrations → kiro → UnLink). No special case: Notion and Linear also advertise their token URL as revocation_endpoint and do revoke there, so a generic "skip when equal" rule would break them.
  • Docs: docs/system-specs/modules/connections.md (seven DCR cards, TickTick's no-refresh and revoke behaviour) and src/kiro_crew/docs/configuration.md (card list).

Per-OS before / after

OS Before After
Linux / macOS TickTick signs in inside the harness, where the harness can With the preview on and a bridged harness: Crew's DCR sign-in on 127.0.0.1:48100, same as the six DCR cards
Windows Same as above Same listener and bridge path as the six DCR cards. No Windows-only code
Preview off, or kiro-cli sessions (any OS) unchanged unchanged

Manual test (owner)

Settings > Feature previews: turn on Crew sign-in; chats on a bridged harness.

  1. Connections → TickTick → Connect. Consent page shows the app; Allow. Card turns Connected.
  2. New chat: call list_projects (or ticktick_list_projects). Expect a result, no second sign-in.
  3. Disconnect: card goes to Connect; Settings → Integrations at TickTick still lists the kiro row (unlink it by hand, as the card says).

Backwards compatibility

Compatible. Preview off or kiro-cli: nothing changes. The skew change only touches pairs with no refresh token. The six DCR cards and GitHub, Asana, Google normally store a refresh token, so their timing is unchanged. A stored pair with no refresh token and a recorded expiry is now used for its last 120 s instead of answering needs_auth, and is deleted once expired instead of staying as an unusable "Connected" entry.

Tests

test/test_crew_oauth_dcr.py:

  • test_a_ticktick_grant_without_refresh_is_served_to_its_expiry: 60 s before expiry the access token is served and the token endpoint is never called (fails without the skew change).
  • test_an_expired_ticktick_grant_is_needs_auth_and_reads_not_connected: at expiry needs_auth, no token call, holds_grant False, client kept (fails without the delete).
  • test_a_ticktick_disconnect_whose_revoke_is_refused_deletes_locally: revoke answered 401 → {"removed": True, "revoked": False}.
  • TickTick's live authorization_endpoint added to the banner-gate parametrize.

Local: test_crew_oauth_dcr.py, test_crew_oauth_mvp_flows.py, test_crew_oauth_mvp.py, test_crew_oauth_google_asana.py, test_connections_disconnect_crew_oauth.py, test_configuration_doc_facts.py: all pass.

Known limit: a real sign-in and tool call on the bridged path were not run here (no TickTick account in this run); the manual test above covers it.

@iamwhatever
iamwhatever requested review from a team and KiroCrewCaptain as code owners November 9, 2026 23:49
@iamwhatever
iamwhatever requested a review from buluoray November 9, 2026 23:49
@iamwhatever
iamwhatever force-pushed the feat/ticktick-crew-oauth branch from c938ff7 to 47e2914 Compare November 10, 2026 00:06
@github-actions github-actions Bot added readiness: action required A blocking check or review needs attention merge conflict Branch has merge conflicts with its base — author must resolve before merge labels Nov 10, 2026
@iamwhatever
iamwhatever force-pushed the feat/ticktick-crew-oauth branch from 47e2914 to 799d38b Compare November 10, 2026 03:42
@github-actions github-actions Bot added readiness: checking Automated validation is still running and removed readiness: action required A blocking check or review needs attention labels Nov 10, 2026
@github-actions

Copy link
Copy Markdown
Contributor

UX Review (Opus 5.5) — ⏭️ skipped

Revision 799d38b713341641e29cc93bc6b0f8aa6b523503 touches no user-facing surface (no changes under website/ or committed screenshots), so the UX review was skipped. Does not block merge.

@github-actions

Copy link
Copy Markdown
Contributor

Design Review (Opus 5.5) — ✅ PASS

Design-level review of 799d38b713341641e29cc93bc6b0f8aa6b523503 — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS does not.

Design-Verdict: PASS

Nothing blocks: this adds one slug to an existing seam, and the no-refresh expiry change is limited to pairs without a refresh token, as the description says.

Notes

  • An expired pair is only dropped inside _refresh, which runs when a tool call reaches it. A card nobody calls after the 180 days keeps showing Connected until the next call fails with needs_auth. If the card should reflect expiry on its own, have holds_grant treat an expired, unrenewable pair as absent.

[DESIGN-REVIEWED] 799d38b

Description read

[DESCRIPTION-READ] af068960d363997d9491a6b3e104a12526331c9c356596236e7cfb902bb87191

That sha256 names everything this verdict read: the PR description, plus the 1 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with .github/scripts/pr-description-capture.sh over the same inputs; if it differs, the description or that evidence changed after this verdict was formed and any finding drawn from either is unproven.

@github-actions

Copy link
Copy Markdown
Contributor

First Principles Review (Opus 5.5) — ✅ PASS

Premise-level review of 799d38b713341641e29cc93bc6b0f8aa6b523503 — why this exists and whether the shipped surface is the smallest honest version. Updated in place on each push. A BLOCK verdict blocks PR readiness; PASS does not.

First-Principles-Verdict: PASS

Nothing blocks. TickTick goes behind the crew_oauth preview, which is off by default. That keeps it out of product-shape territory even though rfc-crew-owned-oauth.md is still draft on the base.

Notes

  • Item 2 — rides along: the stated harm is that a 180-day token becomes needs_auth 120 s early, about once every six months. Nobody would notice. The PR also changes Tokens.expiring for every pair that has no refresh token, not just TickTick's, so a shared method changes to save two minutes. Subtraction: revert the skew = _REFRESH_SKEW_SECS if self.refresh else 0.0 hunk and delete test_a_ticktick_grant_without_refresh_is_served_to_its_expiry. Item 3 still drops the pair at expiry minus the skew.

What this change ships

Inventory (4 items) — 3 justified

Intent: let bridged-harness chats use TickTick through Crew-held OAuth when the preview is on. This is an ADDITION.

  1. With the preview on, TickTick's Connect card uses Crew's own sign-in (DCR, Dynamic Client Registration) on bridged harnesses — justified
  2. A grant with no refresh token is now served through its last 120 s before expiry — rides along: negligible harm, and it changes a method every provider's tokens use
  3. When an expired grant that cannot be renewed is used, it is deleted, so the card reads Not connected — justified
  4. The spec and configuration docs now list seven DCR cards and describe TickTick's behaviour — justified

[FIRST-PRINCIPLES-REVIEWED] 799d38b

Description read

[DESCRIPTION-READ] 2327dae9c8e415f0b0849f29f319489f3c040cb8657ee322f67c74cc9e300b25

That sha256 names the PR description this verdict read. Recompute it with .github/scripts/pr-description-capture.sh; if it differs, the description changed after this verdict was formed and any finding drawn from the description is unproven.

@github-actions

Copy link
Copy Markdown
Contributor

Opus 5.5 Review — ✅ no blocking findings

Reviewed 799d38b713341641e29cc93bc6b0f8aa6b523503 — this comment is updated in place on each push.

Review details

No findings.

[OPUS-REVIEWED] 799d38b

Verdict parsed from the review's SHA-scoped output markers for commit 799d38b713341641e29cc93bc6b0f8aa6b523503.

False positive or not applicable? A repository writer can comment:
/ai-review override fable 799d38b713341641e29cc93bc6b0f8aa6b523503 false-positive: <reason, 20 to 500 characters>

@github-actions

Copy link
Copy Markdown
Contributor

GPT 6.1 Review — ✅ no blocking findings

GPT 6.1 completed its review of 799d38b713341641e29cc93bc6b0f8aa6b523503 and found no blocking issues.

This comment is updated in place on each push.

Review details

No findings.
[GPT-REVIEWED] 799d38b

False positive or not applicable? A repository writer can comment:
/ai-review override gpt 799d38b713341641e29cc93bc6b0f8aa6b523503 false-positive: <reason, 20 to 500 characters>

@github-actions github-actions Bot added readiness: action required A blocking check or review needs attention and removed merge conflict Branch has merge conflicts with its base — author must resolve before merge readiness: checking Automated validation is still running labels Nov 10, 2026
@iamwhatever

Copy link
Copy Markdown
Contributor Author

Dispositions for the two advisory notes on 799d38b713 (both lanes PASS; no code change):

First Principles, item 2 (revert the no-refresh skew in Tokens.expiring): kept. The work item's owner ruling requires a no-refresh grant to be served up to its recorded expiry and never marked dead before it. Without the change, a pair with no refresh token answers needs_auth 120 s early and is deleted then, which contradicts that ruling. Scope: the change only reads self.refresh, so every pair that holds a refresh token (GitHub, Asana, Google, the six DCR cards) keeps the 120 s skew unchanged; only pairs with nothing to renew lose it. test_a_ticktick_grant_without_refresh_is_served_to_its_expiry pins it.

Design note (an unused expired card keeps reading Connected until the next call): accepted as a known limit, not fixed here. holds_grant is a vault-presence check shared by every Crew-held slug and by routing (routed_slug); making it parse and judge expiry changes that contract for all providers, beyond this PR's goal. The first call after expiry drops the pair, answers the proxy's usual 409 needs_auth, and the card then offers Connect. The same holds on kiro-cli's native path for TickTick today. A follow-up can make status expiry-aware for all no-refresh providers if wanted.

@github-actions github-actions Bot added readiness: passed Eligible automated validation passed for the current revision and removed readiness: action required A blocking check or review needs attention labels Nov 10, 2026
@KiroCrewCaptain
KiroCrewCaptain enabled auto-merge (squash) November 10, 2026 06:40

@KiroCrewCaptain KiroCrewCaptain left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Approving. On this head the review checked that ticktick joins DCR_SLUGS and so runs through the same routing, refresh, revoke and SUPPORTED_SLUGS seams as the six existing DCR cards, with no TickTick-specific path. The review ran the 15 test files that cover crew_oauth at this head (734 passed). It then mutated each production hunk: dropping the expiry delete, putting the skew back for no-refresh pairs, and removing the slug each turn a new test red. The spec and configuration docs are updated in the same commit.

Done well: the expiry drop is a revision-guarded delete_if inside the existing per-slug refresh lock. It keeps the registered DCR client, and the tests drive it on the injected ManualClock with the boundary set exactly at expiry.

Security: the consent URL is already on the exfil OAuth allowlist on main, and the registry entry already has dcr, pkce and launch_gate_passed set. Every pair with a refresh token still uses the 120 s skew, so its behaviour does not change. The only new vault write is the deletion of an expired no-refresh pair. That deletion is revision-guarded, so a concurrent sign-in is never removed. Revoke sends the token only to the vendor's own authorization server. All of this sits behind the off-by-default crew_oauth preview.

Optional:

  • Add a test for an unexpired TickTick pair with access_token("ticktick", force=True). It should assert needs_auth, assert the pair is still held, and assert no token call was made. Today the review can make the _refresh delete unconditional and every test stays green, so nothing checks the body's claim that a vendor 401 before expiry keeps the pair.
  • In connections.md near line 1364, say the pair is dropped "on the first call after expiry". An expired card that nobody calls still reads Connected until then. Also, the drop only happens if TickTick's token answer carries expires_in, and no live sign-in has checked that yet.
  • The docstring at test_crew_oauth_dcr.py:631 still says "six" live authorize endpoints. The list now has seven.

@KiroCrewCaptain
KiroCrewCaptain merged commit 554ce34 into main Nov 10, 2026
101 of 102 checks passed
@KiroCrewCaptain
KiroCrewCaptain deleted the feat/ticktick-crew-oauth branch November 10, 2026 06:41
@github-actions github-actions Bot removed the readiness: passed Eligible automated validation passed for the current revision label Nov 10, 2026
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.

2 participants