feat(calendar): add durable subscription runtime - #549
Draft
seonghobae wants to merge 116 commits into
Draft
Conversation
seonghobae
marked this pull request as ready for review
August 26, 2026 22:58
seonghobae
marked this pull request as draft
August 27, 2026 03:06
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.
Buyer/security outcome
Refs #413. This bounded stacked child composes the calendar-subscription domain (#539) and durable SQLite persistence (#541) into the production server boundary: operators can create, list, rotate, and revoke reusable project-calendar credentials, and calendar clients can use a project/purpose/audience-bound
subscription=feed URL instead of a general session credential. It also preserves bounded high-frequency usage evidence inherited from #541, malformed-date hardening, RFC 5545 UTF-8 folding, bounded request bodies, and per-client abuse control.This PR does not close #413. Customer management UI, final client migration, PostgreSQL parity, and final retirement of the legacy
token=compatibility path remain later slices.Exact current stack
Fresh state after non-destructive parent reconciliation:
develop:2c328875e00e86537df3e965170be80532571cad;cursor/bc-f7050a51-e6e0-448d-bbfa-39c45a93d707-0fd7@1e491bac2fc42b1f17c93666223ce1da78c6ba61;feat/calendar-subscription-runtime-413@a9743a9a00f54494a12e5f4933519ba26fe1f039;ahead, zero behind, with exact current parent as merge base;ARCHITECTURE.md,CHANGELOG.md,docs/doctoring/calendar-subscription-runtime.md,package.json,server/runtime_app.mjs,server/server.mjs,tests/api/calendar-subscription-body-limit.test.mjs,tests/api/calendar-subscription-rate-limit.test.mjs,tests/api/calendar-subscription-runtime.test.mjs, andtests/unit/coverage-script-contract.test.mjs.The latest parent changes were inherited with two-parent merge commits rather than force-push/rebase. The child preserves #541's bounded usage-retention source, regression and doctoring changes without widening this PR's unique semantic diff.
The PR remains Draft and mechanically mergeable. All current inline review threads are resolved. There is no qualifying independent current-head/last-push approval.
Runtime/security/interoperability contract
PRAGMA foreign_keys = ONbefore schema installation;/api/meself-call;Retry-Afterafter exhaustion;calendar_read, andscopeweave:calendarand cannot authorize JSON APIs, SSE, attachments, another project, or another audience;subscription=mixed with legacytoken=orAuthorizationfails closed;private, no-store,no-referrer, andnosniff;membership_id:token_versionepoch are enforced by the domain plus SQLite atomic use transition;usedrows from accumulating in the durable lifecycle outbox;token=calendar compatibility remains staged and still uses authoritative persisted authentication/session-revocation state;Test-first repair evidence
Earlier current-head review found two coupled runtime defects: calendar-owned routes bypassed the core limiter, while management authentication used an internal
/api/merequest that collapsed clients into the fallbacklocalrate-limit bucket. Registered regression heads failed before production repair. Production repair removed the internal HTTP self-call, uses shared auth/token-version/PAT state directly, and applies per-client limiting to every runtime-owned calendar route. Those review threads remain resolved.The latest parent repair was independently regression-driven: repeated calendar authorizations had produced unbounded usage and audit rows. #541 now bounds recent usage history and prunes transient per-use outbox rows before commit while retaining its rollback-failure contract; this child inherits that exact source and test registration.
Current behavioral evidence
Current-head-associated runs on
a9743a9a00f54494a12e5f4933519ba26fe1f039are terminal success:33124642171— success;unit-and-apijob98699714141andcloud-e2ejob98699713925both passed;33124642201— success;33124642390— success.The unit/API log includes the inherited bounded-retention regression, expiry, index/race/issuance-epoch/rollback tests, runtime calendar management/feed tests, body-limit tests and route rate-limit tests.
These are behavioral evidence only, not merge authority: the Server Tests run actually fetched and checked out GitHub synthetic merge
a453a62d29f3c2a69f59f2acd8977a1c586868c9, not contributor heada9743a9.... ScopeWeave #523 remains the repository-native exact-contributor-head checkout repair; organization-reusable SAST/Security exact-head integrity remains in the existing.githubowner path. No predecessor, synthetic-only, status-only, author-only, model-only, pending, skipped, stale or infrastructure-only evidence is promoted to exact-head merge authority.Exact 100% owned production statement/branch/function/line coverage remains mandatory and must be generated by the applicable coverage gate; ordinary unit/API GREEN does not substitute for that measurement.
Merge gate
Remain Draft. Do not integrate independently of #541/#539/#506. After every parent/base/head movement, reconcile the exact bounded semantic diff non-destructively and regenerate all then-applicable exact-contributor-head repository and organization CI, browser E2E, owned coverage/docstrings, SAST/security/dependency/supply-chain/package/provenance/migration/recovery evidence.
Require zero valid unresolved defects and qualifying independent current-head/last-push approval under live branch protection/rulesets before merge. Pending, queued, skipped-required, cancelled, absent, neutral-required, failed, stale, predecessor, synthetic-only, status-only, author-only, or model-only evidence is non-passing.
Documentation / rollback
docs/doctoring/calendar-subscription-runtime.mdrecords active-PR versus protected-shipped truth, authority/transport boundaries, staged compatibility, RFC 5545 folding/date behavior, recovery/rollback, RED→GREEN evidence and APA 7 references. Rollback must preserve durable subscription lifecycle evidence and must not restore a general session JWT in a calendar URL as the preferred steady state.