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
4 changes: 2 additions & 2 deletions README.ja.md
Original file line number Diff line number Diff line change
Expand Up @@ -209,12 +209,12 @@ aiitg hook pretooluse < payload.json # deny(POL-001): ファイルは
| 攻撃コーパス(10 クラス × 3 フレーミング + エージェント向け 2 件。うち 2 件は論文から逐語) | 32/32 検出、29 CRITICAL / 3 HIGH |
| 良性コーパス(通常の作業コメント 46 件、5 つのコメント記法) | 誤検知 0 |
| 曖昧コーパス(ペイロードと同じ形をした正当なメモ 4 件、テストに固定) | 4/4 検出 — 受け入れた**誤検知クラス**(意図的な fail-closed) |
| 実在ソース走査(`scripts/probe_comment_directive.py`、本プロジェクト + `takumi/packages`、ビルド成果物は除外: 106 ファイル / コメント 738 行) | 検出 0 |
| 実在ソース走査(`scripts/probe_comment_directive.py`、本プロジェクト + `takumi/packages`、ビルド成果物は除外: 107 ファイル / コメント 750 行) | 検出 0 |

曖昧コーパスの 4 件は *正当な* メモであり、それでも報告されます。これは検出ではなく既知の誤検知として計上し、
コーパスが実際よりきれいに見えることはありません。実在ソース走査の数値はコミット済みスクリプトで再現できます(§6)。
以前の「167 ファイル / コメント 4,643 行」はビルド成果物(`dist/`)を含み、コメント行の数え方も緩かったものです——
`--include-build` で 168 ファイルになりますが、生成物は開発者が読むサードパーティソースではないため既定で除外します。
`--include-build` で 169 ファイルになりますが、生成物は開発者が読むサードパーティソースではないため既定で除外します。

正直な境界: 論文の 700 件コーパスは HTML と一緒に公開されていないため、この数値は論文の数値の**再現ではありません**。
決定的なパターン検出器は原理的に不完全です(論文自身の最強スクリーナーでも約 1/3 を見逃しています)。
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ Measured on this repository's corpus and on live third-party source, with the bo
| Attack corpus (10 classes × 3 framings + 2 agent-directed; 2 payloads verbatim from the paper) | 32/32 detected, 29 CRITICAL / 3 HIGH |
| Benign corpus (46 ordinary work comments, five syntax families) | 0 false positives |
| Ambiguous corpus (4 legit notes byte-shaped like a payload, pinned in `tests/`) | 4/4 reported — accepted false positives, the deliberate fail-closed choice |
| Live third-party source probe (`scripts/probe_comment_directive.py`: this project + `takumi/packages`, build output excluded: 106 files, 738 comment lines) | 0 findings |
| Live third-party source probe (`scripts/probe_comment_directive.py`: this project + `takumi/packages`, build output excluded: 107 files, 750 comment lines) | 0 findings |

Honest boundaries: the paper's 700-item corpus was not released with its HTML, so these figures are
**not** a reproduction of the paper's numbers; a deterministic pattern detector is incomplete by
Expand Down
6 changes: 3 additions & 3 deletions docs/comment-directive-coverage.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,13 +98,13 @@ Corpus and probe live in `tests/detectors/test_comment_directive.py`,
| Attack corpus — 32 payloads: the paper's 10 classes × 3 framings + 2 agent-directed (2 payloads verbatim from the paper; the rest authored in its stated format) | **32/32 detected**, class agreement 32/32, 29 CRITICAL / 3 HIGH |
| Benign corpus — 46 ordinary work comments across five comment syntax families | **0 false positives** |
| Ambiguous corpus — 4 legit notes byte-shaped like payloads, pinned in the test file | 4/4 reported — **accepted false positives**, the fail-closed choice |
| Live source probe — `scripts/probe_comment_directive.py` over this project + `takumi/packages` (build output excluded): **106 files / 738 comment lines**, via the shipped `run_scan()` | **0 findings** |
| Live source probe — `scripts/probe_comment_directive.py` over this project + `takumi/packages` (build output excluded): **107 files / 750 comment lines**, via the shipped `run_scan()` | **0 findings** |

The ambiguous row is the honest one: those four are *legit* notes that are reported anyway. They are
counted as a known false-positive class, not as detections, so the corpus can never look cleaner than
it is. The live-probe figures are reproducible with the committed script (see §6); the earlier
"167 files / 4,643 comment lines" figure came from *including* build output (`dist/`) and from a looser
comment-line definition — `--include-build` restores 168 files, but generated bundles are not
comment-line definition — `--include-build` restores 169 files, but generated bundles are not
third-party source a developer reads, so they are excluded by default.

Boundaries, stated plainly:
Expand Down Expand Up @@ -135,7 +135,7 @@ make test # unit + integration + e2e, incl. th
pytest tests/detectors/test_comment_directive.py -q # the attack/benign/ambiguous corpora

# The live false-positive probe. Build output is excluded by default; pass
# --include-build to reproduce the (older, larger) 168-file figure.
# --include-build to reproduce the (older, larger) 169-file figure.
python scripts/probe_comment_directive.py . ../takumi/packages
python scripts/probe_comment_directive.py . ../takumi/packages --json
```
Expand Down
Loading