Skip to content

fix: honor HTTP negotiation and method contracts - #38

Merged
Nagi-Inaba merged 11 commits into
mainfrom
fix/worker-http-contract
Aug 22, 2026
Merged

Nagi-Inaba merged 11 commits into
mainfrom
fix/worker-http-contract

Conversation

@Nagi-Inaba

Copy link
Copy Markdown
Owner

概要

Workerの表現選択とAllowヘッダーをHTTP契約に合わせます。

  • Acceptのmedia range・品質値・wildcardを解釈
  • q=0を選択対象から除外
  • 同順位・未指定時はHTMLを既定に維持
  • APIと非APIで実際に受理するmethodだけをAllowへ表示
  • helper単体テストとWorker統合テストを追加

検証

  • Node組込みtestによるRED/GREEN確認
  • 変更したTypeScriptのsyntax check
  • GitHub CIでWorkerのtypecheck、lint、Vitest、bundle、npm auditを実行

Closes #23

@github-actions
github-actions Bot force-pushed the fix/worker-http-contract branch from 3c57d18 to c4b4749 Compare August 22, 2026 07:43

@Nagi-Inaba Nagi-Inaba left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

現head c4b4749 はDraftのままマージ保留です。実装差分自体にCritical/Highは見つかりませんでしたが、次を解消してください。

  1. worker/test/http.spec.ts が worker/vitest.config.ts の include: ["test/worker.spec.ts"] に含まれていません。隔離worktreeで npm --prefix worker run verify を実行した結果も、従来どおり main Workerは 1 test file / 31 tests で、新規helper testは0件実行でした。includeへ追加するか、既存worker.spec.tsへ統合してください。
  2. branch commitがgithub-actions[bot]由来のため、PRにはrequired CI checkが記録されずCodeQLだけです。通常のbranch更新でrequired checksを発火させ、全check成功を確認してください。
  3. Accept選択とAllow headerは外部HTTP契約の変更です。docs/current-status.mdと適用するarchitecture/traceability文書へ、挙動と検証結果を同期してください。
  4. issue #23の「q=0を選択対象から除外」と、両representationがq=0またはAcceptが非対応mediaだけの場合にHTMLへfallbackする現在実装の関係を、テストまたは文書で明示してください。

ローカル確認:

  • npm --prefix worker ci: 成功、audit 0
  • npm --prefix worker run verify: 成功
  • Worker 31件 / WebMCP 3件(ただし新規http.spec.tsは未実行)

@Nagi-Inaba
Nagi-Inaba marked this pull request as ready for review August 22, 2026 08:15

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: d83b819952

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread worker/src/http.ts Outdated
Comment thread worker/src/http.ts
@Nagi-Inaba
Nagi-Inaba merged commit 951774a into main Aug 22, 2026
32 checks passed
@github-actions
github-actions Bot deleted the fix/worker-http-contract branch August 25, 2026 12:51
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.

worker: Accept品質値とAllow/OPTIONSのHTTP契約を正しく扱う

1 participant