Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
# REV PR4 Local zxcvbn review r3 / zxcvbn ローカル配信レビュー r3

> **Summary:** Pass for the declared build-time lint scope: R2–R5 and the import-map gap are fixed, with 73 tests and 37 repeated probes passing their expected outcomes. Runtime isolation remains a separate acceptance responsibility.
> **概要:** 明示されたビルド時 lint の範囲で合格。R2–R5 と import map の穴は修正され、73 件の試験と再実行した 37 プローブが期待結果になった。実行時の通信遮断は受入試験側の別の責務である。

**Jump:** [English](#english) · [日本語](#japanese)

- Version / 版: 0.1 — 2026-11-12. **Learned:** a useful source lint can have explicit limits without claiming browser-wide network enforcement. / ソースの有用な lint は、ブラウザ全体の通信遮断を保証せずに、限界を明示して運用できる。
- Applies to: RCOSDP/RDM-ember-osf-web-dev2027 PR #4, head `4836609f76136d9a692b83c83c5cd2b3bc13dc5e`; incremental review from `310dfb883b167959e81e5b134bb315e971541054`.
- Reviewer / レビュワ: REV(担当レビュワ, Codex Astra); reviewed / レビュー日: 2026-11-12.
- Related: [Review index / レビュー索引](README.md) · [SPEC-04](../spec/04_acceptance_tests.md) · [SPEC-06](../spec/06_documentation_conventions.md).
- Used by / 利用先: PR #4 integration decision / PR #4 の統合判断、[review index / レビュー索引](README.md).

---

<a id="english"></a>
## English

[→ 日本語版へ](#japanese)

### Verdict

**Pass — no blocking findings in this round.** A lint is a build-time check for likely mistakes in source files. The revised scope is substantively honest: it names the inspected file and deliberately excludes computed JavaScript URLs, data/blob contents, HTML comments, other asset files, transitive module contents and full interpretation of unknown script types. Those limits are acceptable for catching accidental external loads in maintained source. This verdict does not certify absence of external browser traffic or reopen the accepted zxcvbn provenance and delivery review.

### Resolution and evidence

R2 is resolved: HTML attribute processing keeps SVG `href` and `xlink:href` distinct and inspects both conservatively. Both attribute orders and the `use` case now fail for the unlisted URL.

R3 is resolved: CSS extraction consumes postcss declaration values without applying the old blanket comment-removal regex. The `image-set("/*", external, "*/")` reproductions now fail in both a style element and an attribute. Real-comment and escaped-URL coverage remains green.

R4 is resolved: refresh extraction handles semicolon, comma and whitespace separators, optional `url=` and quoted targets. R5 is resolved for all reported cases: inline SVG namespace declarations, data SVG images and blob URLs pass without expanding `EXTERNAL_LOADS`; an adjacent external image still fails.

Import maps now use `JSON.parse` and recursively inspect keys and string values. Protocol-relative and JSON-escaped URLs fail; a local mapping passes; malformed JSON fails. Neither mapped modules nor arbitrary runtime URL construction are claimed to be followed.

Measured results are review evidence, not a canonical project inventory. TOON is a compact text format for these results.

```toon
checks[7]{case,result}:
current_postbuild_suite,73_pass_0_fail
repeated_r2_probes,37_expected_outcomes
repeated_r2_external_or_invalid_cases,31_rejected
repeated_r2_baseline_and_local_controls,6_accepted
explicit_scope_probes,4_accepted_as_limits
github_run_43129960418,SUCCESS
github_run_43129952828,SUCCESS
```

The 37 probes preserve both allowed URLs and the local zxcvbn tag/file, then run the actual postbuild child process. All four r1 reproductions remain rejected. The current suite additionally covers whitespace refresh, import-map scope keys, invalid JSON and local controls. The suite grew from 47 to 73 tests. Tests used Node 26.12.0 and an isolated dependency directory: parse5 4.0.0, postcss 6.0.23, @babel/parser 7.6.2, Mocha 6.2.1 and Chai 4.2.0. No full application install or production rebuild was performed.

To repeat the project suite from the target repository root with those dependencies available:

```sh
node node_modules/mocha/bin/mocha node-tests/docker-static-postbuild-test.js
```

Expected result at this head: 73 passing. This review supplied the same dependencies through `NODE_PATH` and invoked the isolated Mocha executable, leaving the clone clean.

### Accepted limits and wording notes

**Non-blocking scope precision:** SPEC-04's network guard aborts non-local requests during acceptance scenarios; known external assets are also aborted and counted. It is not a production-wide firewall, and this review did not rerun it. The PR correctly identifies it as the runtime observation/enforcement layer for acceptance. The source comment and PR wording about CSP being limited to self, configured backends and “two hosts” are too broad as a description of the entire policy: `render.sh:185` permits `img-src https:`, and the font directive separately names `fonts.gstatic.com`. CSP (the browser's resource-loading rules) is defense in depth, not an exact `EXTERNAL_LOADS` allowlist. A future wording edit should make this distinction explicit; no CSP tightening is required by this lint review.

Four focused scope probes exit 0: an `atob`-constructed URL, an encoded data HTML document, a protocol-relative string in an unknown script type, and `<img src="http://www.w3.org/2000/svg">`. The first three directly match stated exclusions. The last illustrates that `NAMESPACE_IDS` suppresses six exact strings in every context, not just namespace declarations or `createElementNS` arguments. In an actual resource attribute such a string is a URL, so describing it as always fetching nothing is imprecise. This narrow, disclosed identifier heuristic is acceptable for this accidental-source lint; context-sensitive namespace handling would be a useful follow-up. These are scanner results, not proof that the browser executes each fixture or that CSP permits it.

No new blocker is warranted by demanding a complete browser interpreter from this lint. Keep the exact allowlist and SPEC-04 runtime checks as separate controls, and retain the explicit exclusions when describing the result.

### Record and restrictions

The exact head and two successful GitHub checks were read. The fresh scratch clone has no tracked or untracked changes. Only reviewer artifacts outside the clone were written. The bilingual record passed SPEC-06 structural/link checks in a temporary mirror of its intended `docs/reviews/` location. The only GitHub write is the requested single Japanese PR comment. No commit, push, merge, approval, close, Docker operation or runtime/.env access was performed. No blocking work remains for this review; production rebuild and live browser/network verification were not repeated.

---

<a id="japanese"></a>
## 日本語

[→ To English](#english)

### 判定

**合格(pass)— 今回の阻害指摘なし。** lint はソース内の起こりやすい誤りをビルド時に調べる検査である。改訂された範囲は実質的に正確であり、対象ファイルと、JavaScript による URL 構築、data/blob の中身、HTML コメント、他の資産ファイル、参照先モジュールの中身、未知の script type の完全な解釈を対象外と明記している。保守するソースへ意図せず外部読み込みが入ることを見つける用途には許容できる。この判定はブラウザの外部通信がないことの証明ではなく、確認済みの zxcvbn の由来・配信レビューを再開するものでもない。

### 解決と証拠

R2 は解決した。HTML 属性の処理で SVG の `href` と `xlink:href` を区別し、両方を保守的に検査する。属性順の両方と `use` の例が、未掲載 URL により失敗する。

R3 は解決した。CSS 抽出は postcss の宣言値を使い、旧来の一括コメント削除正規表現を適用しない。`image-set("/*", external, "*/")` の再現例は style 要素と属性の両方で失敗する。本当のコメントと URL のエスケープを扱う試験も成功している。

R4 は解決した。refresh 抽出はセミコロン・カンマ・空白の区切り、任意の `url=` と引用符付きの対象を扱う。R5 は報告した全例で解決した。インライン SVG の名前空間宣言、data SVG 画像、blob URL は `EXTERNAL_LOADS` を広げずに成功し、隣接した外部画像は失敗する。

import map は `JSON.parse` を用い、キーと文字列値を再帰的に調べる。プロトコル相対と JSON エスケープの URL は失敗し、ローカルの対応付けは成功、不正な JSON は失敗する。参照先モジュールや任意の実行時 URL 構築まで追跡するとは主張していない。

測定結果はレビュー証拠であり、プロジェクト構成の正本ではない。TOON は結果を短いテキストで記す形式である。

```toon
checks[7]{case,result}:
current_postbuild_suite,73_pass_0_fail
repeated_r2_probes,37_expected_outcomes
repeated_r2_external_or_invalid_cases,31_rejected
repeated_r2_baseline_and_local_controls,6_accepted
explicit_scope_probes,4_accepted_as_limits
github_run_43129960418,SUCCESS
github_run_43129952828,SUCCESS
```

37 プローブは許可 URL 2 件とローカルの zxcvbn タグ・ファイルを残し、実際の postbuild を子プロセスとして実行した。r1 の再現例 4 件も引き続き拒否する。現行試験は空白区切りの refresh、import map の scope キー、不正な JSON、ローカルの対照例も含む。試験は 47 件から 73 件へ増えた。Node 26.12.0 と隔離した依存ディレクトリを使用し、parse5 4.0.0、postcss 6.0.23、@babel/parser 7.6.2、Mocha 6.2.1、Chai 4.2.0 とした。アプリ全体の依存導入や production 再ビルドは行っていない。

対象リポジトリのルートで、これらの依存が利用できる状態から既存試験を再実行する。

```sh
node node_modules/mocha/bin/mocha node-tests/docker-static-postbuild-test.js
```

この head の期待結果は 73 件成功。本レビューでは同じ依存を `NODE_PATH` で与え、隔離した Mocha 実行ファイルを使ってクローンを差分なしに保った。

### 許容した限界と表現上の注意

**非阻害の範囲の補足:** SPEC-04 のネットワーク遮断は受入シナリオ中に非ローカル要求を中断し、既知の外部資産も中断して件数を記録する。本番全体の firewall ではなく、今回再実行していない。PR がこれを受入の実行時観測・強制の層と位置付けることは正しい。一方、CSP が self・設定済み接続先・「2 ホスト」に限るというソースコメントと PR の表現は、方針全体の説明として広すぎる。`render.sh:185` は `img-src https:` を許し、フォントの指定は `fonts.gstatic.com` も別に含む。CSP(ブラウザの資源読み込み規則)は追加の防御であり、`EXTERNAL_LOADS` の完全一致一覧ではない。今後の表現修正ではこの区別を明記するとよいが、この lint レビューで CSP の制限強化は要求しない。

範囲確認の 4 プローブは終了 0 となった。`atob` で構築する URL、符号化した data HTML 文書、未知の script type 内のプロトコル相対文字列、`<img src="http://www.w3.org/2000/svg">` である。最初の 3 件は明記された対象外と一致する。最後は `NAMESPACE_IDS` が名前空間宣言や `createElementNS` 引数だけでなく、すべての文脈で 6 個の文字列を完全一致で除外することを示す。実際の資源属性ならその文字列は URL なので、常に読み込みがないと説明するのは不正確である。この狭く明示された識別子の近似処理は、ソースへの偶発的な混入を検査する lint として許容し、文脈に応じた名前空間処理は今後の改善とする。これらは検査器の結果であり、各 fixture をブラウザが実行することや CSP が許すことの証明ではない。

この lint にブラウザ全体の完全な解釈を求め、新しい阻害指摘にする必要はない。完全一致の許可一覧と SPEC-04 の実行時検査を別の制御として維持し、結果を説明するときも対象外の明記を残すこと。

### 記録と制約

正確な head と成功した GitHub 検査 2 件を読み取った。scratch の新規クローンは追跡対象・未追跡とも差分なし。クローン外のレビュワ成果物だけを書き込んだ。日英記録は、想定する `docs/reviews/` の配置を一時領域に再現して SPEC-06 の構造・リンク検査に合格した。GitHub への書き込みは依頼された日本語 PR コメント 1 件だけである。コミット・push・マージ・承認・close・Docker 操作・runtime/.env の参照は行っていない。このレビューの阻害作業は残っておらず、production 再ビルドと実ブラウザ・通信検証は再実行していない。
Loading
Loading