Skip to content

docs(events): freeze Events v1 - #693

Merged
JuroOravec merged 5 commits into
mainfrom
docs/freeze-events-v1
Nov 15, 2026
Merged

JuroOravec merged 5 commits into
mainfrom
docs/freeze-events-v1

Conversation

@JuroOravec

@JuroOravec JuroOravec commented Nov 15, 2026 •

Copy link
Copy Markdown
Member

Part of #624 (Citry 1.0.0). Decision 1: Events v1 is frozen. Docs and docstrings only; no behavior change.

What changed

  • packages/protocol/events/v1/spec.md
    • "Versioning" now gives the 1.x rule. citry-events/1 is frozen. A 1.x server accepts every valid /1 call. Any change, even an addition, needs citry-events/2, because a v1 reader rejects unknown fields. Servers keep accepting /1 until at least one minor release after /2 arrives, so a rolling deploy works. The section also says what happens in the other direction (protocol_mismatch), and that the inside of a vue-prepared/1 prepared object is not covered.
    • "HTTP adapters" lists every method the per-handler route accepts, which the code allows (handlers.py:81); the spec showed only GET|POST. It also lists the request headers the routes read (X-Citry-Events, the three X-Citry-Vue-* headers, the CSRF token header) and the same-origin rule. All of these are part of the frozen contract for a custom transport.
  • packages/protocol/events/v1/README.md: says v1 is frozen, and the section on changing the protocol now matches that.
  • docs/design/events.md: the status line and section 4.5 say v1 is frozen.
  • docs/design/public_api_1_0_0_audit.md
    • New sections 4.10 (browser JavaScript API) and 4.11 (HTTP routes), modelled on section 3.1 of the 0.6.0 audit. Each row names the source, where it is documented, and whether 1.x covers it.
    • Question 1.4 q7 is ticked "keep", and the 4.2 row is updated to match.
    • Section 5 drops the two rows this PR covers.
  • docs_site/content/reference/browser-apis.md, "Custom event transports": says what stays the same for a custom transport in 1.x. It also marks the server-side EventsDispatcher route as experimental, and corrects two claims:
    • A missing Vue header answers handler_error; the specific message is only in the server log.
    • EventsDispatcher() cannot answer Citry's own pages with a render.
  • EventsDispatcher and TransportContext docstrings: an Experimental: section, and the dispatcher's render limit.

No changelog entry. The public surface and behavior do not change. The user-facing promise about stability belongs on the "Versioning and support" page and in the 1.0.0 release notes.

Questions for the maintainer

  1. Prepared renders during a 1.x rolling deploy. A vue-prepared/1 render carries a helper contract hash that the browser checks against its own (_vue/client.js:1462). So a page from an older 1.x release cannot apply a render from a newer server whose helpers changed. The call fails, and no reload prompt appears. The spec now says so. Should the rolling-deploy test (decision 10) cover a 1.x upgrade that changes the helpers? Should the browser offer a reload, as it does for stale_state?

Maintainer decisions recorded here

  • EventsDispatcher and TransportContext are experimental for 1.x. Each has an Experimental: docstring section, and the audit (1.4 q7 and the 4.2 row) and browser-apis.md say the same. The citry-events/1 wire format and the browser transport API (Citry.events.registerTransport) stay covered. The reason: running calls from server code has almost no docs, and EventsDispatcher() with no arguments cannot produce the Vue render form. A probe confirmed this. Called with a client that asks for vue-prepared/1, as Citry's browser code does, a render answered handler_error ("no configured renderer was advertised"). The constructor arguments are unchanged.

  • A 1.x release may refuse a citry-events/1 input that earlier releases accepted when a security fix needs it, and its changelog says so. This is one sentence in the spec's Versioning section.

  • Rolling deploys are promised only between 1.x releases. A deploy from 0.x to 1.0.0 starts fresh. The spec says so, and the question about hashed runtime URLs is dropped.

Review

  • Independent technical and prose review. It checked every inventory row against the code. These findings were folded in:

    • The overlap rule contradicted the freeze. It now says /2 may be added in 1.x, every 1.x release keeps /1, and dropping /1 comes at 2.0.0 or later.
    • The promise was too broad for vue-prepared/1 contents. That part is now excluded.
    • The bridge limit above.
    • Section 4.5 of events.md was stale.
    • The header table claims were too broad or imprecise: which renderer needs the Vue headers, that X-Citry-Events takes any value, and the conditions for the CSRF header.
    • Row citations and paths, and a "this change corrects" phrase.
  • docs-cold-reader. Folded in:

    • The window wording and coined terms ("server bridge", "the window").
    • The <method> default and the 405.
    • The README line that said there was "no installed-base compatibility need".
    • The structure of the browser-apis paragraph.

    Not taken: renaming existing spec headings. They are unchanged, and the README and design doc link to their anchors.

  • Focused re-review of the fixes. Folded in:

    • The revision belongs to the app, not the component.
    • "Plain HTML" became "HTML that Citry's browser code does not accept".
    • X-Citry-Events added to the list of things that stay the same.
    • Every place that promises the freeze now states the security exception.
    • Several wording fixes.

Checks

  • python3 packages/protocol/events/v1/validate.py: OK (22 exchanges, 9 descriptors, 7 manifests).
  • test_events_protocol_package.py and test_events_protocol_runtime.py: 132 passed.
  • scripts/validate.py: all validators passed.
  • ruff check and ruff format --check on dispatcher.py: clean.
  • I did not run the fast gate. Its Rust phases were skipped because disk space on the shared machine was low, and the change is docs only.

🤖 Generated with Claude Code

JuroOravec and others added 5 commits November 15, 2026 11:48
citry-events/1 is frozen for all of Citry 1.x. The spec's Versioning
section states the 1.x rule and how /2 keeps accepting /1 during a
rolling deploy; the HTTP adapters section now lists every per-handler
method and the request headers the transport reads. The 1.0.0 audit
gains the browser JavaScript and HTTP route inventory and settles
question 7 (EventsDispatcher and TransportContext stay stable).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The citry-events/1 wire format stays frozen for 1.x; the Python classes
for running calls from server code are experimental, since that path has
almost no docs and a dispatcher built with no arguments cannot produce
the Vue render form Citry's browser code asks for.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@JuroOravec
JuroOravec merged commit f6b2b17 into main Nov 15, 2026
23 of 32 checks passed
@JuroOravec
JuroOravec deleted the docs/freeze-events-v1 branch November 15, 2026 11:43
JuroOravec added a commit that referenced this pull request Nov 15, 2026
Write the page for readers already on 1.x, reorder it from the most
common questions (pinning, supported versions, Python and browsers,
deprecations) to the detailed coverage lists, turn enumerations into
sub-lists, and mark the nav entry for review. Align the security-fix
wording with the merged Events spec (#693) and list EventsDispatcher and
TransportContext as experimental.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
JuroOravec added a commit that referenced this pull request Nov 15, 2026
* docs: add the Versioning and support page

Add docs_site/content/about/versioning.md, which states the Citry 1.x
promise: what an upgrade may and may not change, the experimental
features, new check rules, deprecations (a deprecated name warns for the
rest of 1.x and is removed only in 2.0.0), supported versions, rolling
deploys, the frozen citry-events/1 protocol, citry-lsp compatibility,
the 24-hour State token default, and the Python and browser policy.

Link it from the nav, README.md and SECURITY.md, and list every
published package in the SECURITY.md supported-versions table. Add sms:
to the allowed link schemes in security.md, update the
CitryDeprecationWarning docstring to the new deprecation window, say in
template-linting.md that only most rules have a rule_* setting, and fix
the citry/__init__.py comment that called every _ name internal.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* docs: make the Versioning page concise and 1.x-first

Write the page for readers already on 1.x, reorder it from the most
common questions (pinning, supported versions, Python and browsers,
deprecations) to the detailed coverage lists, turn enumerations into
sub-lists, and mark the nav entry for review. Align the security-fix
wording with the merged Events spec (#693) and list EventsDispatcher and
TransportContext as experimental.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* docs: say an old page reloads once during a 1.x rolling deploy

Align the Versioning page with the C6 and C7 behavior: a page that gets
a State token, render or fragment it cannot read reloads once.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>
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