Skip to content

test(fixtures): pk-box config corpus + the three diagnostic gaps it exposed#347

Merged
JegoVPN merged 4 commits into
mainfrom
feat/external-pk-box-corpus
Jul 8, 2026
Merged

test(fixtures): pk-box config corpus + the three diagnostic gaps it exposed#347
JegoVPN merged 4 commits into
mainfrom
feat/external-pk-box-corpus

Conversation

@JegoVPN

@JegoVPN JegoVPN commented Jul 8, 2026

Copy link
Copy Markdown
Owner

Summary

Ingests huixiao666/pk-box (curated per-release sing-box templates, 1.13.x → every 1.14 alpha) into the external fixture corpus, then closes the diagnostic gaps a full diagnostics-vs-real-binary cross-check exposed.

Corpus (+17 fixtures, 220 → 237)

  • 8 pass the matched real binary (1.13.10-11 + alphas 12–20); 9 are display-class (reF1nd-fork extensions vanilla sing-box rejects + one 1.14-removed legacy field)
  • 77 sibling files are JSONC/中文占位符 teaching templates → rejected.json by design
  • official gates re-ran over the whole corpus on the 1.13.14/alpha.40 pins: pass 34→42, no old-fixture verdict flipped

Ingest tooling (update-external-fixtures.mjs)

  • new --append --repo <owner/name> scoped mode — adding one upstream no longer rebuilds ~70 repos; bare --repo without --append throws (would wipe the corpus)
  • per-source maxFixtures override; authenticated contents-API fetches (anonymous raw fetches tripped 429s); total cap 240→320 + loud log when the cap bites

Diagnostics (cross-check verdict: FP=0, FN=3 → all fixed, final FP=0 / FN=0)

  • dial-domain-strategy-deprecatederror on 1.13+ targets: current binaries fail check outright (ENABLE_DEPRECATED_LEGACY_DOMAIN_STRATEGY_OPTIONS); the dns.servers[] emission stays a warning (those dial fields still pass on every binary)
  • inbound-legacy-sniff/domain-strategy-deprecatederror on 1.13+ only for check-fatal values — the binary's legacy gate keys on non-zero values, so sniff:false/"0s" stay warnings (review finding, binary-verified)
  • new rule-clash-mode-type error: fork-style array clash_mode decode-FATALs on vanilla sing-box (route + DNS + logical sub-rules; null exempt)

Verification

  • every escalation binary-verified on all three pins (1.12.25 / 1.13.14 / 1.14.0-alpha.40), including the zero-value counter-cases and the dns-server exception
  • unit 1814/1814 · tsc clean · internal fixtures 19/19 · external render gate 237/237
  • senior review: REQUEST-CHANGES → all 5 findings fixed (value-keyed sniff gate, clash_mode null, --repo guard, cap log, comment)

🤖 Generated with Claude Code

JegoVPN and others added 4 commits July 8, 2026 14:13
Adding one upstream no longer forces a full ~70-repo corpus rebuild: --append
keeps every other repo's fixtures/manifest/rejected entries verbatim and
re-ingests only the named --repo(s). Sources may carry maxFixtures to override
the per-repo cap (legit large curated collections). Raw fetches move to the
authenticated contents API — ~50 anonymous raw.githubusercontent fetches
tripped 429s. Total cap 240->320 so a full refresh cannot silently truncate
the committed corpus.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…14a31)

Curated per-release template collection: 8 pass the matched real binary
(1.13.10-11 + alphas 12-20), 9 are display-class (reF1nd-fork extensions
vanilla sing-box rejects; one 1.14-removed legacy field). 77 sibling files
are JSONC/placeholder teaching templates and land in rejected.json by design.
Official gates re-ran over the full corpus with the 1.13.14/alpha.40 pins
(pass 34->42; no old-fixture verdict flipped).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Diagnostics-vs-binary cross-check over the new corpus found 0 false positives
and 3 false negatives; all binary-verified on 1.12.25 / 1.13.14 / alpha.40:

- dial domain_strategy escalates warning->error on 1.13+ targets: the current
  1.13/1.14 binaries fail check outright (env-gated removal). The dns.servers[]
  emission stays a warning - those dial fields still accept it on every binary.
- inbound sniff*/domain_strategy escalate warning->error on 1.13+: decode-FATAL
  ("legacy inbound fields are deprecated").
- new rule-clash-mode-type error: reF1nd-fork array clash_mode decode-FATALs on
  vanilla sing-box (route + DNS rules, logical sub-rules included).

Cross-check after: FP=0, FN=0 across all 17 pk-box fixtures.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…shapes

- inbound sniff escalation now keys on the VALUE like the binary's legacy gate:
  sniff:false / sniff_override_destination:false / sniff_timeout:"0s" pass
  check on 1.13.14+alpha.40 (binary-verified) and stay warnings; only true /
  non-zero-timeout values error. Non-zero timeout re-verified (300ms: exit 1).
- rule-clash-mode-type skips null (decodes as a no-op on all three binaries)
- update-external-fixtures: --repo without --append now throws (bare --repo
  would wipe the corpus and rebuild one repo); total-cap break logs loudly;
  corpus-size comment corrected to 237

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
✅ Deployment successful!
View logs
sbcv cffa7a2 Jul 08 2026, 06:33 AM

@JegoVPN JegoVPN merged commit f1362a6 into main Jul 8, 2026
3 checks passed
@JegoVPN JegoVPN deleted the feat/external-pk-box-corpus branch July 8, 2026 06:33
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.

1 participant