From local files to a deterministic, byte-identical comparison report
Traceweave puts one shared evidence format underneath profile-specific extractors. Every comparison runs in three local steps so your content stays on your machine and anyone with the same catalogues can reproduce the exact report bytes.
The three-stage pipeline
Extract fingerprints
A profile lexer scans UTF-8 input bytes with pinned Unicode 17.0.0 tables — no parser, compiler, or network access. It produces two streams: an exact channel keeping names and literals, and a normalized channel clearing identifier and literal values so simple renaming still aligns.
Overlapping token k-grams are hashed to 64-bit SHA-256 prefixes and selected with rightmost-minimum winnowing. Every fingerprint keeps its original half-open UTF-8 byte span. spec/extraction.md
Build a private catalogue
Selected fingerprints, artifact SHA-256 digests, and the exact extraction configuration bytes are serialized into a canonical JSON catalogue. Source text, token strings, and file paths are discarded.
Catalogues are stored outside git working trees by default. Because hashes are unkeyed, someone holding a catalogue can still test guessed code against it — so catalogues are treated as private material. spec/catalogue-report.md
Compare and report
Comparison reads only the reference catalogue, candidate catalogue, optional boilerplate-suppression catalogue, and comparison configuration bytes. It never reads source text.
Matching hashes on a consistent offset diagonal merge into regions when their reference-position gap is at most mergeGap, and become reportable once they reach minRegionDistinctHashes distinct non-common hashes. spec/catalogue-report.md
Finding a small Go function inside a larger file (go-function-in-host)
This example comes verbatim from the published matching vectors (test-vectors/matching/extraction-go.json and test-vectors/matching/example-report.json). Both files are extracted under go-tokens draft-1 with k = 5 and window = 4, and compared with minRegionDistinctHashes = 2 and mergeGap = 4.
Reference: sum.go
40 tokens · 14 exact fingerprints · 17 normalized fingerprints
func sumPositive(values []int) int {
total := 0
for _, v := range values {
if v > 0 {
total += v
}
}
return total
}Candidate: host.go
100 tokens · 39 exact fingerprints · 42 normalized fingerprints
package stats
type Point struct {
X, Y float64
}
func (p Point) String() string {
return fmt.Sprintf("(%g, %g)", p.X, p.Y)
}
func sumPositive(values []int) int {
total := 0
for _, v := range values {
if v > 0 {
total += v
}
}
return total
}
var names = map[string]bool{"a": true, "b": false}What the canonical report records
| Channel / mode | Outcome | Reference in candidate | Whole-file Jaccard | Reference byte span | Candidate byte span |
|---|---|---|---|---|---|
| exact | match | 14/14 | 14/39 | [16, 124] | [146, 254] |
| normalized | match | 17/17 | 17/42 | [0, 126] | [130, 256] |
Why two metrics matter: in the exact channel, every fingerprint from sum.go appears inside host.go (14/14 directional containment), while whole-file Jaccard similarity is only 14/39 because host.go has surrounding code. Reporting raw unreduced fractions keeps the small copied fragment visible.
Canonical digest: the RFC 8785 canonical report body hashes to 081d860084af229d77137e32dedd9f40f7d0bbeca6b18424b6d51cc1d89ed3be. As evidence that the specification can be implemented independently, both the Rust and Go implementations emit those exact deterministic, byte-identical report bytes for this vector.
Two companion cases from the same vector set
go-renamed
Identifiers changedWhen variable and function names are renamed, the exact channel reports no-shared-fingerprints (0/4), while the normalized channel still matches (4/4). test-vectors/matching/matching.json
go-independent-same-task
Independent controlWhen someone writes a separate solution to the same summing task, exact reports no-shared-fingerprints (0/14) and normalized reports below-minimum-evidence (2/17 split across single-hash regions). test-vectors/matching/matching.json
Independent layers, recorded separately
Traceweave keeps exact byte digests, similarity comparison, cryptographic signing, timestamps, and origin notes in separate fields so each layer can be verified on its own (spec/core.md):
| Layer | What it records | Status |
|---|---|---|
| Exact artifact & commitment | SHA-256 subject digest and private salted catalogue commitment (32-byte nonce) | Draft format & vectors |
| Fingerprint comparison | Deterministic extraction, private catalogues, and seed-merge comparison reports | Working (Go & Rust case studies) |
| Signed & timestamped records | DSSE / in-toto attestation, explicit trust policy, and optional RFC 3161 timestamp | Planned (M4.3–M4.6) |
| Origin & licence history | Separate review-packet record linked by bodySha256 | Planned (M2.7) |
| Agent interoperability | Optional CLI-wrapping skill with transcript canary checks | Planned (SK.1–SK.2) |