test(catalog): expand research to 10 tests per subcategory

Add 9 tests to research/web, research/whitepapers, and
research/codebase, bringing each subcategory from 1 test to 10.

Web tests extract data from inline HTML, headers, and URLs, and
answer protocol scenarios for HTTP status codes, CORS, DNS, and
canonicalization. Every fixture stays inline; no test makes a live
web call.

Whitepaper tests each pair a 120 to 180 word, technically accurate
excerpt with numeric or JSON extraction questions. Topics cover
product quantization, Bloom filters, TF-IDF, recall@k, LSM-tree
write amplification, Raft quorum sizing, B-tree capacity, the CAP
theorem, and attention scaling. Every derived constant carries a
ground-truth comment and a unit test that recomputes the value with
an independent formula.

Codebase tests trace a Python function and a TypeScript function to
exact output, then reason over an inline diff, a data race, dead
code, Big-O complexity, an import cycle, a generic return type, and
a git-bisect scenario. The Python trace test runs the same source
through python3 when available and skips otherwise; the TypeScript
trace test cross-checks its hand-derivation against an equivalent Go
function.

New package-level helpers use a wp or code prefix to avoid name
collisions with sibling category authors sharing this package. Test
IDs keep the paper, web, and code prefixes already established by
the existing catalog entries. New tests omit MaxTokens so the runner
falls back to its default, per the catalog's authoring rules.

catalog_test.go's exact-map assertion now fails as expected, since
it still lists only the original 17-test catalog; that assertion is
owned centrally and is not touched here.
This commit is contained in:
2026-08-17 01:51:11 +01:00
parent 764fe990fd
commit e7479e9169
18 changed files with 2368 additions and 0 deletions
+9
View File
@@ -7,6 +7,15 @@ import (
func registerWhitepapersTests(r *testkit.Registry) {
r.Register(paperHnswParamsTest())
r.Register(paperPQCompressionRatioTest())
r.Register(paperBloomFPRateTest())
r.Register(paperTFIDFTermScoreTest())
r.Register(paperRecallAtKTest())
r.Register(paperLSMWriteAmplificationTest())
r.Register(paperRaftQuorumFailuresTest())
r.Register(paperBTreeHeightLevelsTest())
r.Register(paperCAPAvailabilityChoiceTest())
r.Register(paperAttentionScaleFactorTest())
}
// paperHnswParamsExcerpt is a ~150-word, technically accurate original