Skip to content

docs(plugin-hono-server, hono): say which 304 answers carry Vary, and that the hosted door leaves compression to the platform - #33452

Queued
objectstack-fleet[bot] wants to merge 2 commits into
mainfrom
claude/area-A5-32565
Queued

objectstack-fleet[bot] wants to merge 2 commits into
mainfrom
claude/area-A5-32565

Conversation

@objectstack-fleet

@objectstack-fleet objectstack-fleet Bot commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor

Requested by Elon · project thread
Fixes #32565
Fixes #32536

Clause-②: no
Metadata-protocol: none

Seat: domain:server#5 · os-elon-musk · session_016WV4cxHwXNcGcAHNerZsom (area-lease pilot #33059, area A5).

维护者速读

  • 改了什么:文档改为如实描述压缩中间件对 304 的 Vary 行为;并写明托管入口(createHonoApp)不压缩、由平台或 CDN 负责。代码零行为变化,只改注释与文档,加一个 304 测试。
  • 为什么改:README 和协议文档说"所有 304 都带 Vary: Accept-Encoding",实际只有自带可压缩 Content-Type 的 304 才带(控制台静态文件的 304 不带);托管入口谁负责压缩此前无文档,裁决 Y′ 要求写明。
  • 风险与回滚:风险极低,运行时代码未动;回滚即 revert 本 PR。
  • 先看:packages/plugins/plugin-hono-server/src/response-compression.test.ts(新 304 用例,钉住两种 304 形态);packages/adapters/hono/README.md(托管入口规则);content/docs/deployment/production-readiness.mdx(新节)。
  • 两分钟验证:pnpm --filter @objectstack/plugin-hono-server exec vitest run src/response-compression.test.ts,预期 25 个用例全绿。
  • 需要你做的:无,席位落地。

What changes

#32565 (304 and Vary). Route chosen: make the docs say what the server does, and pin it. The middleware decides from the answer it is handed (variesByEncoding reads the answer's own Content-Type); it cannot see the 200 a 304 stands for. Measured on this branch with two 304 shapes over a real socket:

  • the Console's stable-file shape (new Response(null, { status: 304, headers: { etag, cache-control } }), packages/cli/src/utils/console.ts): no Content-Type, no Vary;
  • the dispatcher's shape (res.status(304) then res.json(undefined), which is how packages/runtime/src/dispatcher-plugin.ts writes the translation bundle's body-less 304): Hono's c.json stamps Content-Type: application/json, so this 304 does carry Vary: Accept-Encoding. The card's premise holds for the Console producer only; the i18n producer already gets the Vary on the self-hosted door.

Why not the code fix: the middleware cannot tell which route would encode its 200, so "add Vary to a bare 304" would mean adding it to every bare 304, including ones for images and other types this server never encodes. A cache refreshing a stored answer from a 304 copies the 304's header fields onto it, so that would add a Vary the stored answer never had. Docs that say exactly what happens is the smaller honest change; nothing is wrong in a cache today because a 304 without Vary leaves the stored Vary in place.

Edited: the ## Vary and ETag paragraph of the module docblock and the comment on the early return in response-compression.ts (no code line changed); the plugin README; content/docs/protocol/kernel/http-protocol.mdx.

#32536 (hosted door). Ruling Y′ (comment 6813607394 on #32155, item 3) records that createHonoApp does not compress and that the platform or CDN does. Premise re-checked on origin/main ba35dfd7: git grep -n "Content-Encoding\|compress" -- packages/adapters/hono/src answers exit 1 (no hits), and git grep -n -i "vary\|accept-encoding" -- packages/adapters/hono/src answers exit 1 too. Written down in packages/adapters/hono/README.md (new section) and content/docs/deployment/production-readiness.mdx (new section, a table of which door compresses), with a cross-link from the protocol page. Both say to check the host compresses, to fix it at the host rather than in the app, and to keep the ETag unchanged (saves compare it strongly as If-Match).

Changeset: .changeset/32565-compression-vary-304-hosted-door.md, patch for @objectstack/plugin-hono-server and @objectstack/hono (their READMEs ship in the tarball).

Tests

  • New case in response-compression.test.ts: a 304 carries Vary: Accept-Encoding only when it carries a compressible Content-Type, and is never encoded. Both producer shapes above, raw HTTP through node:http.
  • No ablation: the diff changes no tested behaviour (the new case pins existing behaviour; the code edits are comments).

Acceptance notes

Verification

Readings below were taken at head 91ade098 (tests) and the derived gate run named in the report comment.

plugin-hono-server test + typecheck

bash scripts/pm/os-verify-lock.sh -c "pnpm --filter @objectstack/plugin-hono-server test && pnpm --filter @objectstack/plugin-hono-server typecheck": Test Files 42 passed (42), Tests 548 passed (548); typecheck tsc --noEmit both programs clean, check:test-typecheck: OK; VERDICT command-exit 0.

🤖 Generated with Claude Code

Claim records: #32565 comment 6884374681 · #32536 comment 6884780070 (branch claude/area-A5-32565).

… that the hosted door leaves compression to the platform

Claude-Session: https://claude.ai/code/session_016WV4cxHwXNcGcAHNerZsom
Co-authored-by: Claude <noreply@anthropic.com>
@github-actions github-actions Bot added size/m documentation Improvements or additions to documentation tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface labels Nov 14, 2026
@github-actions

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

1 anchor(s) derived from 2 changed package(s); no hand-written page names any of them. ⚠️ 2 changed file(s) yielded no anchor (packages/adapters/hono/README.md, packages/plugins/plugin-hono-server/README.md), so the pages documenting them are NOT COVERED by this run — this is not a clean bill of health for those files.

What this run could not see
  • 2 changed file(s) yielded no anchor (packages/adapters/hono/README.md, packages/plugins/plugin-hono-server/README.md) — pages documenting those are invisible to this run
  • the SDK route bridge reached 65 of 247 client-bound route-ledger rows — the other 182 have no registrar path: tail to select them, so pages documenting THEIR client methods cannot appear above, on this or any run. Of those 182: 0 are remediable by widening that discovery convention (an in-repo file declares the path; the convention did not scan it); 59 are structural — on a ledger where NOT ONE row is declared in-repo, so no discovery change reaches them at any price; 123 are undecided (no in-repo declaration, on a ledger that has other in-repo registrars — absence and an unreadable spelling are not distinguishable here). The rows themselves: node scripts/docs-audit/affected-docs.mjs --bridge-coverage
  • a page that states a rule by its inputs shares no identifier with the emitter that implements the rule, so an emitter-only diff cannot list it — not on this run and not on any run. Measured on fix(driver-sql): emit varchar(maxLength) for a text field a declared index keys on #11430: content/docs/protocol/objectql/types.mdx documents the text-family column mapping by the ObjectQL type names it maps FROM (text / textarea / html) while the diff changed createColumn; it went unlisted, and it was the page that diff falsified, in four places. No shared token exists to detect this on, so a rule your change carries has to be re-read by hand in the pages that restate it.
  • a key NAME is not a key, so the hand re-read the line above prescribes can land on the wrong schema. The same spelling is authorable on one governed type and a [REMOVED] tombstone on another for each of active, aria, joins, objects, template, tools and version (censused on [finding] tools is a key on BOTH AgentSchema (tombstoned, dead) and SkillSchema (live, cloud-attested), so a name-based search attributes skill examples to the agent key — it produced a false stop-the-line alarm on PR #19059 #19093 over the liveness ledger's governed types, top-level keys); nothing in a search result distinguishes the two, so a grep hit on a LIVE example reads as evidence about the DEAD key. Measured on fix(spec): the agent.tools liveness row says dead — it claimed live on a key the schema tombstoned #19059: content/docs/ai/agents.mdx was reported as contradicting the agent.tools tombstone over its tools: example at :161, which is inside the defineSkill({ block opened at :155 — the page was already correct. Settle ownership by PARSING the value against both schemas, never by the name: that literal PASSES SkillSchema, and as an AgentSchema it FAILS at tools with the tombstone prescription. ⛔ These names are not the whole class — a key retired through a .strict() guidance map leaves no tombstone in the walked shape and none of them here (tool.category, live as AIToolDefinition.category).

Coarse fallback — 13 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): node scripts/docs-audit/affected-docs.mjs --json 19cc8976bfc88e6314e0e9d41be012a1035279e9 → packageMentionDocs.

Which tree this was computed on

This run read content/docs from 1806c968f3153a04ce74f616e69af9860df09568 — the merge of head 91ade0988b78f83483694d2f2cbed673b334218e into base 19cc8976bfc88e6314e0e9d41be012a1035279e9, which is what actions/checkout gives a pull_request run. Not the PR head.

A worktree cut from an older main holds a different content/docs, so re-deriving there can legitimately return a different list — that is a different tree, not a wrong row. To answer on the same tree:

# while this PR is open — GitHub drops the merge commit once it closes
git fetch origin 1806c968f3153a04ce74f616e69af9860df09568 && git checkout 1806c968f3153a04ce74f616e69af9860df09568
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 19cc8976bfc88e6314e0e9d41be012a1035279e9 91ade0988b78f83483694d2f2cbed673b334218e && git checkout -B drift-repro 19cc8976bfc88e6314e0e9d41be012a1035279e9 && git merge --no-ff 91ade0988b78f83483694d2f2cbed673b334218e

node scripts/docs-audit/affected-docs.mjs --json 19cc8976bfc88e6314e0e9d41be012a1035279e9

⚠️ That checkout carried uncommitted changes, so the commit above does not fully identify what was read.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

domain:server#5 · os-elon-musk · session_016WV4cxHwXNcGcAHNerZsom

ACCEPT · area A5 · head 91ade09 · 2026-11-14T22:15Z

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review November 14, 2026 22:16
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Nov 14, 2026
Any commits made after this event will not be merged.
@github-actions

Copy link
Copy Markdown
Contributor

⛔ merge queue 构建失败 — 先分诊,再决定要不要重排

队列构建 43649385454 红了。队列跑的是全量套件(PR 侧 CI 只跑 affected 子集),
所以失败的测试可能在本 PR 没碰过的包里 —— 那不是重排能修的。每次盲目重排都会让排在后面的所有 PR 重建一轮。

分类:failure —— 按下面的日志分诊。

失败的 job(日志抽取,best effort):

  • Test Core (8/8) — 失败步骤: Run this shard's tests

    @objectstack/plugin-approvals:test:  FAIL  src/action-page-member.integration.test.ts > [#22578] handleActionPage — the ADR-0043 action page from a Request > GET renders the confirm page for a live to
      ↳ 失败原因: @objectstack/plugin-approvals:test: Error: Test timed out in 5000ms.
    

↳ 失败原因 是判读的关键:超时(Test timed out in … / Hook timed out in …)多半是负载/时序,不是本 PR 的回归;
断言(AssertionError: …)才指向真实的行为改变。两者的 FAIL 行长得一模一样,只有这一行能区分。

⚠️ 断言这一侧有一类例外,判据是断言在测什么,不是它是不是 AssertionError。 断言的对象是产品行为(一个值、一个形状、一次拒收)⇒ 照上面读:真实的行为改变,去查,⛔ 不要重排掉;
断言的对象是这次实验自身的有效性前提(跑完的耗时、负载下的先后、任何只在时间预算内才成立的条件)⇒ 它跟超时是同一类,同样对负载敏感,重排一次是合法的判别手段。
识别是机械的:断言的消息或它比较的值本身点名了一段时长、一个时间戳、一个耗时计数。实测过的一对 —— AssertionError: SecurityPlugin.init() ran: expected false to be true 测的是产品行为(真回归);
AssertionError: this run took over a second, so second-precision stamps could have differed too: expected 1006 to be less than 1000 测的是实验前提:它守护的那条不变式当时是绿的,同一个 head 原样重排一次即成功。
穿着 AssertionError 外衣的时间测量,仍然是时间测量。(⛔ 这只改「怎么读一次红」,不改「哪些测试可以重排」——后者由别处管。)

跨 PR 相同签名(24h,按失败测试文件聚合):

历史信号:

  • 本 PR 过去 24h 无队列失败记录(首次)。
  • 过去 24h 队列共有 20 个失败构建(不含本次)。

分诊清单:

  1. 失败测试在本 PR 改动的包里 → 真回归,修 PR。
  2. 失败测试与本 PR 无关 → 看上面的「跨 PR 相同签名」;已有汇总 issue ⇒ flaky/环境问题实锤,去那张 issue 上谈,修好前重排只会再烧一轮全队列。
  3. 两者都不是 → 可能与同组 PR 语义冲突;等前面的 PR 落地或失败出队后再重排一次即可,不要连续重排。

Generated by Claude Code · merge-queue-triage workflow (#4859)

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

domain:server#5 · os-elon-musk · session_016WV4cxHwXNcGcAHNerZsom

Re-queue · area A5 · head 91ade09 · 2026-11-14T23:06Z

Queue build 43649385454 went red on plugin-approvals src/action-page-member.integration.test.ts (Test timed out in 5000ms). This PR changes docs, comments and one plugin-hono-server test only; it does not reach plugin-approvals. The same signature has popped #33439 and #33463 too and has a queue-flake anchor, #33508. Head unchanged; re-queued once as is (landing-operations: known flake, one re-queue). A second pop on this signature stops here and goes to the seat.

@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Nov 14, 2026
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Nov 14, 2026
Any commits made after this event will not be merged.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation size/m tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface

Projects

None yet

2 participants