dsh-image-integrity 0.1.0 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -6,6 +6,39 @@ adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6
6
 
7
7
  ## [Unreleased]
8
8
 
9
+ ### Added
10
+
11
+ - `bench/run-images.mjs` and the `bench:images` script: score the plugin against
12
+ the frozen 100-pair synthetic image-reuse set in `dsh-research-bench`
13
+ (`data/images`) and write `bench/results-images.json`. The adapter predicts
14
+ `manipulated = matches.length > 0` and takes the first match's kind, using the
15
+ plugin defaults; the result has no timestamps and is byte-identical on rerun.
16
+ - First reproducible benchmark numbers, replacing the "not yet claimed" status:
17
+ precision 1.0000, recall 1.0000, F1 1.0000 and false-positive rate 0.0000 on
18
+ 50 manipulated + 50 clean pairs (25 duplicate, 25 flip, 25 unrelated, 25
19
+ hard-negative). Per-category accuracy and duplicate/flip subtype recall are
20
+ all 1.0000.
21
+
22
+ ### Changed
23
+
24
+ - README evaluation sections now document the benchmark, its scope (grid-aligned
25
+ 16×16 positive blocks; no shift/JPEG/scale robustness claims) and how to
26
+ reproduce it.
27
+
28
+ ## [0.1.2] - 2026-11-08
29
+
30
+ ### Added
31
+
32
+ - 100-pair synthetic image-reuse benchmark and `pnpm run bench:images`; README reports the measured precision/recall/FPR and the grid-aligned, uncompressed-fixture limits.
33
+
34
+ ## [0.1.1] - 2026-11-08
35
+
36
+ ### Changed
37
+
38
+ - Release-engineering refresh: CHANGELOG accuracy, package metadata and authors; no runtime changes.
39
+
40
+ ## [0.1.0] - 2026-11-08
41
+
9
42
  ### Fixed
10
43
 
11
44
  - Enforce `maxPixels` from the IHDR **before** inflating IDAT, and pass the
@@ -28,8 +61,6 @@ adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
28
61
  the O(n²) comparison loop.
29
62
  - Test count is now 22; README/CHANGELOG list the new failure branches.
30
63
 
31
- ## [0.1.0] - 2026-11-08
32
-
33
64
  First release: block-level image reuse detection.
34
65
 
35
66
  ### Added
package/README-zh.md CHANGED
@@ -82,9 +82,20 @@ dsh --profile <name> --dump-config | grep dsh-image-integrity
82
82
 
83
83
  ## 评测
84
84
 
85
- **22 个测试**:PNG 往返、非 PNG / 16 位 / 截断文件拒绝、解压前依据 IHDR 拒绝超像素上限(配置值与默认值)、汉明距离与 NCC 基础函数、重复块检测、水平镜像检测、平坦图与渐变图的误报控制、小图的有效块大小、成对匹配、尺寸不一致时拒绝、runtime(合法 REP 记录、每次比较生成两份快照、路径遍历/JPEG/字节与像素超限拒绝、非法阈值拒绝)、tools(schema、check→report、compare、格式错误的报告、失败分支)、包契约。
85
+ **23 个测试**:PNG 往返、非 PNG / 16 位 / 截断文件拒绝、解压前依据 IHDR 拒绝超像素上限(配置值与默认值)、汉明距离与 NCC 基础函数、重复块检测、水平镜像检测、平坦图与渐变图的误报控制、小图的有效块大小、成对匹配、尺寸不一致时拒绝、runtime(合法 REP 记录、每次比较生成两份快照、路径遍历/JPEG/字节与像素超限拒绝、非法阈值拒绝)、tools(schema、check→report、compare、格式错误的报告、失败分支)、挂载契约(disabled 不挂载任何工具,enabled 注册三个唯一工具)、包契约。
86
86
 
87
- **基准测试状态:尚未声称。** 计划中的 `dsh-research-bench` 数据集是 100 对合成 PNG(重复 / 镜像 / 无关 / 困难负样本)。在该数据集冻结并评分之前,上述单元 fixture 是唯一的证据,README 也如实说明这一点。
87
+ **基准测试 —— 100 对合成图像。** `pnpm run bench:images` 会在配套的 [`dsh-research-bench`](https://github.com/PerryLink/dsh-research-bench) 仓库(`data/images`,数据集版本 0.1.0)上评分:25 对 duplicate + 25 对 flip + 25 对 unrelated + 25 对 hard-negative,均为 64×64 8 位灰度 PNG,固定种子,正样本复制的是与网格对齐的 16×16 块。适配器针对构建后的 `lib/` 运行,写入 [`bench/results-images.json`](bench/results-images.json),不含时间戳(同一数据复跑字节一致);默认读取同级 `../dsh-research-bench` 检出。其他位置可用 `BENCH_DIR`,或用 `node bench/run-images.mjs --data <dir>` 指定。
88
+
89
+ | 指标(50 对 manipulated / 50 对 clean) | 值 |
90
+ |---|---|
91
+ | Manipulated precision | 1.0000 |
92
+ | Manipulated recall | 1.0000 |
93
+ | Manipulated F1 | 1.0000 |
94
+ | 误报率(unrelated + hard-negative) | 0.0000 |
95
+ | Subtype recall —— duplicate | 1.0000 |
96
+ | Subtype recall —— flip(水平 13 / 垂直 12) | 1.0000 |
97
+
98
+ 混淆计数:TP 50、FP 0、TN 50、FN 0;没有误分类的图对。四类逐类准确率均为 1.0000(各 25/25)。范围:正样本复制的是**与网格对齐**的 16×16 块(即检测器自身的处理单元);亚块偏移、JPEG 重压缩、缩放、旋转不在本集合内,仍是已记录的限制。这些是冻结合成 fixture 上的数字,不代表真实论文图中复用现象的比例。数据集与生成器维护在配套仓库中,不随本包发布。
88
99
 
89
100
  ## 已知限制(v0.1)
90
101
 
package/README.md CHANGED
@@ -85,9 +85,20 @@ dsh --profile <name> --dump-config | grep dsh-image-integrity
85
85
 
86
86
  ## Evaluation
87
87
 
88
- **22 tests**: PNG round-trip, non-PNG / 16-bit / truncated rejection, pixel-cap rejection from the IHDR before inflation (configured and default), Hamming and NCC primitives, duplicate block detection, horizontal mirror detection, flat-image and gradient false-positive controls, small-image effective block size, pair matching, dimension-mismatch refusal, runtime (valid REP record, two snapshots per comparison, traversal/JPEG/byte-and-pixel oversize rejection, invalid threshold rejection), tools (schemas, check→report, compare, malformed report, failure branch), package contract.
88
+ **23 tests**: PNG round-trip, non-PNG / 16-bit / truncated rejection, pixel-cap rejection from the IHDR before inflation (configured and default), Hamming and NCC primitives, duplicate block detection, horizontal mirror detection, flat-image and gradient false-positive controls, small-image effective block size, pair matching, dimension-mismatch refusal, runtime (valid REP record, two snapshots per comparison, traversal/JPEG/byte-and-pixel oversize rejection, invalid threshold rejection), tools (schemas, check→report, compare, malformed report, failure branch), mount contract (disabled mounts nothing, enabled registers three unique tools), package contract.
89
89
 
90
- **Benchmark status: not yet claimed.** The planned `dsh-research-bench` set is 100 synthetic PNG pairs (duplicate / mirrored / unrelated / hard negative). Until that set is frozen and scored, the unit fixtures above are the only evidence, and the README says so.
90
+ **Benchmark — 100 synthetic pairs.** `pnpm run bench:images` scores the plugin against the frozen set (dataset version 0.1.0) in the companion [`dsh-research-bench`](https://github.com/PerryLink/dsh-research-bench) repository (`data/images`): 25 duplicate + 25 flip + 25 unrelated + 25 hard-negative pairs of 64×64 8-bit grey PNGs, fixed seed, with positives copying grid-aligned 16×16 blocks. The adapter runs against the built `lib/`, writes [`bench/results-images.json`](bench/results-images.json) with no timestamps (rerunning on the same data is byte-identical), and reads a sibling `../dsh-research-bench` checkout by default. Set `BENCH_DIR` or pass `node bench/run-images.mjs --data <dir>` for another location.
91
+
92
+ | Metric (50 manipulated / 50 clean) | Value |
93
+ |---|---|
94
+ | Manipulated precision | 1.0000 |
95
+ | Manipulated recall | 1.0000 |
96
+ | Manipulated F1 | 1.0000 |
97
+ | False-positive rate (unrelated + hard-negative) | 0.0000 |
98
+ | Subtype recall — duplicate | 1.0000 |
99
+ | Subtype recall — flip (horizontal 13 / vertical 12) | 1.0000 |
100
+
101
+ Confusion: TP 50, FP 0, TN 50, FN 0; no pair was misclassified. Per-category accuracy is 1.0000 in all four categories (25/25 each). Scope: the positives copy **grid-aligned** 16×16 blocks, i.e. the detector's own unit; sub-grid shifts, JPEG recompression, scaling and rotation are outside this set and remain documented limitations. These are synthetic numbers on a frozen fixture, not a claim about how often real figures reuse panels. The dataset and generator live in the companion repository and are not published with this package.
91
102
 
92
103
  ## Known limitations (v0.1)
93
104
 
package/SECURITY.md ADDED
@@ -0,0 +1,19 @@
1
+ # Security policy
2
+
3
+ ## Supported versions
4
+
5
+ The latest published `0.1.x` release of this package receives security fixes.
6
+
7
+ ## Reporting a vulnerability
8
+
9
+ Please use GitHub's private vulnerability reporting (Security → Advisories) on
10
+ the repository, or open a minimal issue asking for a private channel if
11
+ advisories are unavailable. Do not include credentials, personal data or
12
+ working exploits in a public issue.
13
+
14
+ ## Scope notes
15
+
16
+ - This package performs local file analysis only unless its README documents a
17
+ network provider; when it does, only the documented hosts are contacted.
18
+ - Inputs are treated as untrusted data: document text is never executed.
19
+ - No secrets are read or written by the package.
@@ -0,0 +1,10 @@
1
+ # Third-party notices
2
+
3
+ This package contains **no third-party runtime code**: `dependencies` is empty.
4
+
5
+ Development-only tooling (TypeScript, Vitest, `@deepseek-ai/*` type packages and
6
+ the shared `@perrylink/dsh-research-core` peer, when present) is not bundled and
7
+ is not distributed in the published tarball.
8
+
9
+ If that ever changes, the affected license texts must be added here before a
10
+ release.
package/lib/version.d.ts CHANGED
@@ -3,5 +3,5 @@
3
3
  * @module dsh-image-integrity/version
4
4
  */
5
5
  /** The package version. */
6
- export declare const VERSION = "0.1.0";
6
+ export declare const VERSION = "0.1.2";
7
7
  //# sourceMappingURL=version.d.ts.map
package/lib/version.js CHANGED
@@ -3,5 +3,5 @@
3
3
  * @module dsh-image-integrity/version
4
4
  */
5
5
  /** The package version. */
6
- export const VERSION = '0.1.0';
6
+ export const VERSION = '0.1.2';
7
7
  //# sourceMappingURL=version.js.map
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "dsh-image-integrity",
3
- "version": "0.1.0",
3
+ "version": "0.1.2",
4
4
  "description": "Image integrity checks for DeepSeek Harness: zero-dependency 8-bit PNG decoding (grey/RGB/RGBA) with mean-threshold block fingerprints and NCC confirmation to find duplicated or mirrored regions inside one figure or shared between two figures, plus REP evidence and Markdown/SARIF reports. Finds reused pixels, not manipulation intent; JPEG is out of scope in v0.1.",
5
- "author": "dsh-statcheck contributors",
5
+ "author": "PerryLink contributors",
6
6
  "repository": {
7
7
  "type": "git",
8
8
  "url": "git+https://github.com/PerryLink/dsh-image-integrity.git"
@@ -29,7 +29,9 @@
29
29
  "CHANGELOG.md",
30
30
  "README.md",
31
31
  "README-zh.md",
32
- "LICENSE"
32
+ "LICENSE",
33
+ "SECURITY.md",
34
+ "THIRD_PARTY_NOTICES.md"
33
35
  ],
34
36
  "sideEffects": false,
35
37
  "dsh": {
@@ -75,7 +77,8 @@
75
77
  "typecheck": "tsc -p tsconfig.json --noEmit && tsc -p tsconfig.test.json",
76
78
  "test": "vitest run",
77
79
  "test:watch": "vitest",
78
- "verify:package": "node scripts/verify-package.mjs"
80
+ "verify:package": "node scripts/verify-package.mjs",
81
+ "bench:images": "node bench/run-images.mjs"
79
82
  },
80
83
  "license": "Apache-2.0"
81
84
  }
package/src/version.ts CHANGED
@@ -4,4 +4,4 @@
4
4
  */
5
5
 
6
6
  /** The package version. */
7
- export const VERSION = '0.1.0'
7
+ export const VERSION = '0.1.2'