Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
300 commits
Select commit Hold shift + click to select a range
aedfc3b
test(perf): bind provenance fixture Trend count
seonghobae Sep 13, 2026
5807ce4
test(perf): bind edge fixture Trend count
seonghobae Sep 13, 2026
85919ec
test(perf): add right-cleared fixture evidence helper
seonghobae Sep 13, 2026
6912de4
test(perf): require immutable fixture binding
seonghobae Sep 13, 2026
43ae9f6
fix(perf): bind result to exact fixture bytes
seonghobae Sep 13, 2026
f114598
fix(perf): verify exact right-cleared fixture bytes
seonghobae Sep 13, 2026
5225ff3
fix(perf): require fixture artifact at acceptance
seonghobae Sep 13, 2026
99a31e2
test(perf): bind acceptance contract to fixture bytes
seonghobae Sep 13, 2026
cbfdb9f
test(perf): bind latency evidence to fixture bytes
seonghobae Sep 13, 2026
924d161
test(perf): bind cardinality evidence to fixture bytes
seonghobae Sep 13, 2026
0964c49
test(perf): bind provenance evidence to fixture bytes
seonghobae Sep 13, 2026
32dbdc9
test(perf): bind edge evidence to fixture bytes
seonghobae Sep 13, 2026
9b1b9bc
test(perf): reject lossy fixture decoding
seonghobae Sep 13, 2026
ebcc1b4
fix(perf): bind acceptance to raw fixture bytes
seonghobae Sep 13, 2026
986e0c5
fix(perf): preserve fixture bytes in acceptance CLI
seonghobae Sep 13, 2026
8691d8e
fix(perf): hash raw fixture bytes in k6
seonghobae Sep 13, 2026
b1af052
test(perf): expose raw fixture artifact bytes
seonghobae Sep 13, 2026
1396f8e
test(perf): validate cardinality against raw fixture bytes
seonghobae Sep 13, 2026
6b66eff
test(perf): bind acceptance tests to raw fixture bytes
seonghobae Sep 13, 2026
5a27e85
test(perf): prove raw-byte fixture binding
seonghobae Sep 13, 2026
0d2e1f0
test(perf): exercise edge acceptance with raw fixture bytes
seonghobae Sep 13, 2026
f6c81e8
test(perf): verify latency samples with raw fixture bytes
seonghobae Sep 13, 2026
f4aa8d2
test(perf): bind provenance checks to raw fixture bytes
seonghobae Sep 13, 2026
e8abd50
test(perf): reject lossy result decoding
seonghobae Sep 13, 2026
f4fcb68
fix(perf): bind acceptance to raw result bytes
seonghobae Sep 13, 2026
9187caa
fix(perf): preserve result bytes in acceptance CLI
seonghobae Sep 13, 2026
8d7f40b
test(perf): validate raw result artifacts
seonghobae Sep 13, 2026
7cdd95f
test(perf): bind result acceptance to raw artifacts
seonghobae Sep 13, 2026
00bfeb4
test(perf): preserve raw result bytes in fixture tests
seonghobae Sep 13, 2026
d5b1079
test(perf): enforce raw result artifact boundary
seonghobae Sep 13, 2026
a0bb35f
test(perf): preserve result bytes in latency acceptance
seonghobae Sep 13, 2026
d9b85d1
test(perf): preserve result bytes in provenance acceptance
seonghobae Sep 13, 2026
c71a52f
test(perf): define buyer-path elapsed timing contract
seonghobae Sep 13, 2026
a3099f6
test(perf): cover transport-inclusive buyer latency
seonghobae Sep 13, 2026
d03c8f4
fix(perf): include connection acquisition in buyer latency
seonghobae Sep 13, 2026
d3b7ba7
test(perf): require open-model arrival schedule
seonghobae Sep 13, 2026
583921f
test(perf): cover open arrival-rate contract
seonghobae Sep 13, 2026
57c7b4a
fix(perf): eliminate closed-model coordinated omission
seonghobae Sep 13, 2026
9c2c60f
fix(perf): include connection phases in buyer latency
seonghobae Sep 13, 2026
137f04f
test(perf): cover full HTTP phase timing
seonghobae Sep 13, 2026
d31b96f
fix(perf): bind open-load and direct-network evidence
seonghobae Sep 13, 2026
6bc5490
test(perf): cover load and network evidence binding
seonghobae Sep 13, 2026
ed42459
fix(perf): reject proxy timing ambiguity
seonghobae Sep 13, 2026
e8f5272
fix(perf): verify open-load result evidence
seonghobae Sep 13, 2026
dff7b3e
test(perf): centralize acceptance load evidence
seonghobae Sep 13, 2026
d92d1df
test(perf): reject closed or dropped load evidence
seonghobae Sep 13, 2026
fc7de36
test(perf): bind cardinality cases to open load model
seonghobae Sep 13, 2026
e92dee9
test(perf): bind latency samples to open load evidence
seonghobae Sep 13, 2026
21e5762
test(perf): require load-model provenance
seonghobae Sep 13, 2026
a96fa66
test(perf): bind fixture acceptance to load evidence
seonghobae Sep 13, 2026
753c1c0
test(perf): extend acceptance edge load coverage
seonghobae Sep 13, 2026
3402dbd
fix(perf): prove no drops from scheduled completion
seonghobae Sep 13, 2026
0331f20
test(perf): avoid zero-sample dropped metric assumption
seonghobae Sep 13, 2026
9d53aae
fix(perf): avoid absent-zero dropped metric evidence
seonghobae Sep 13, 2026
01abcb1
test(perf): prove no drops from completion cardinality
seonghobae Sep 13, 2026
aabf866
test(perf): accept healthy absent dropped metric
seonghobae Sep 13, 2026
6ae7da2
fix(perf): bind load model to observer evidence
seonghobae Sep 13, 2026
99be218
test(perf): reject unobserved load declarations
seonghobae Sep 13, 2026
043ebf0
test(perf): observe load in cardinality evidence
seonghobae Sep 13, 2026
68c48a8
test(perf): observe load with latency samples
seonghobae Sep 13, 2026
dd08dc6
test(perf): bind fixture run to observed load
seonghobae Sep 13, 2026
089421a
test(perf): carry observed load through provenance tests
seonghobae Sep 13, 2026
f95c70b
test(perf): cover independent load observation
seonghobae Sep 13, 2026
48fdc2b
test(perf): reject lossy runtime evidence decoding
seonghobae Sep 13, 2026
93c6f2c
fix(perf): parse runtime evidence from exact raw bytes
seonghobae Sep 13, 2026
fd4c6a4
fix(perf): bind runtime evidence artifact before acceptance
seonghobae Sep 13, 2026
9e731d5
merge: restack performance harness on separation digest hardening
seonghobae Sep 13, 2026
5eacba9
merge: restack performance harness on separation security hardening
seonghobae Sep 13, 2026
c711a4b
test(perf): define pinned k6 runtime contract
seonghobae Sep 13, 2026
9284e84
test(perf): pin k6 runner provenance
seonghobae Sep 13, 2026
14e5fee
test(perf): bind k6 release artifact to acceptance
seonghobae Sep 13, 2026
9ee37da
test(perf): pin k6 OCI runner digest
seonghobae Sep 13, 2026
5244a59
test(perf): reject benchmark CLI overrides
seonghobae Sep 13, 2026
00a4b60
fix(perf): seal k6 runner CLI surface
seonghobae Sep 13, 2026
61d1825
test(perf): exercise k6 CLI fail-closed guard
seonghobae Sep 13, 2026
b793d9e
test(perf): require versioned profile load models
seonghobae Sep 13, 2026
a4d3362
test(perf): reject caller load-model environment
seonghobae Sep 13, 2026
b808f27
fix(perf): version control profile load models
seonghobae Sep 13, 2026
ccae70e
fix(perf): bind workload to approved load model
seonghobae Sep 13, 2026
63559c6
fix(perf): stop forwarding load-model environment
seonghobae Sep 13, 2026
8c02f68
fix(perf): bind acceptance to approved cardinality
seonghobae Sep 13, 2026
cfbdad5
test(perf): use approved acceptance load models
seonghobae Sep 13, 2026
b4990c5
test(perf): reject double-counted k6 connection latency
seonghobae Sep 13, 2026
7e8b4a2
fix(perf): avoid double-counting k6 connection phases
seonghobae Sep 13, 2026
7de2f6d
test(perf): require explicit profile for load evidence
seonghobae Sep 13, 2026
655d110
test(perf): cover explicit replay and rejection load models
seonghobae Sep 13, 2026
01d3bb5
test(perf): require exact clean benchmark checkout
seonghobae Sep 13, 2026
c6b1161
fix(perf): bind benchmark workload to exact clean candidate
seonghobae Sep 13, 2026
68f91e9
test(perf): require immutable benchmark snapshot
seonghobae Sep 13, 2026
ce06fce
test(perf): require immutable workload image mount
seonghobae Sep 13, 2026
aa6d7a4
fix(perf): execute workload from immutable candidate image
seonghobae Sep 13, 2026
4b256d9
test(perf): reject stale benchmark summary reuse
seonghobae Sep 13, 2026
872c1d4
fix(perf): publish only fresh successful benchmark summaries
seonghobae Sep 13, 2026
2ded2f0
test(perf): bind fresh summary publication contract
seonghobae Sep 13, 2026
02922a3
test(perf): require non-root k6 evidence mount mapping
seonghobae Sep 13, 2026
38c6ee3
fix(perf): map private evidence mounts to pinned k6 user
seonghobae Sep 13, 2026
e17f371
test(perf): bind validated summary across publication
seonghobae Sep 13, 2026
c0a2b0c
fix(perf): bind summary identity across publication
seonghobae Sep 13, 2026
44dedef
test(perf): verify publication identity binding contract
seonghobae Sep 13, 2026
2ba21d8
test(perf): execute staged-publication replacement regression
seonghobae Sep 13, 2026
bb6e5dd
test(perf): bind acceptance to runner result digest
seonghobae Sep 13, 2026
754f7a4
fix(perf): bind acceptance to benchmark digest receipt
seonghobae Sep 13, 2026
1701501
test(perf): consume benchmark digest contract
seonghobae Sep 13, 2026
12db6d1
fix(perf): require benchmark digest at acceptance boundary
seonghobae Sep 13, 2026
b4bbb75
fix(perf): emit immutable benchmark digest receipt
seonghobae Sep 13, 2026
108f1c0
test(perf): execute post-publication substitution guard
seonghobae Sep 13, 2026
d2ab0b0
test(perf): fail closed without authenticated evidence owner
seonghobae Sep 13, 2026
5b8b497
fix(perf): fail closed until authenticated evidence owner lands
seonghobae Sep 13, 2026
51da657
fix(perf): block unauthenticated commercial acceptance
seonghobae Sep 13, 2026
b696852
docs(perf): demote local digest to structural evidence
seonghobae Sep 13, 2026
6e30f0a
test(perf): reject local commercial acceptance receipt
seonghobae Sep 13, 2026
3dec98a
fix(perf): keep local evidence validation structural
seonghobae Sep 13, 2026
e680e02
test(perf): assert structural-only evidence result
seonghobae Sep 13, 2026
0201f5d
test(perf): keep latency validation non-commercial
seonghobae Sep 13, 2026
172f757
test(perf): require explicit load-model profile identity
seonghobae Sep 13, 2026
37e40ae
fix(perf): bind load model to explicit profile
seonghobae Sep 13, 2026
9b1b116
fix(perf): bind acceptance load evidence to selected profile
seonghobae Sep 13, 2026
2aac3f8
chore(perf): adopt current separation owner integrity
seonghobae Sep 14, 2026
f3e57f5
chore(perf): adopt core mutation transaction proof
seonghobae Sep 14, 2026
8f69fd7
chore(perf): adopt authorization evidence snapshot authority
seonghobae Sep 14, 2026
db0a465
chore(perf): adopt authorization evidence edge coverage
seonghobae Sep 14, 2026
9664641
chore(perf): adopt current Position parent authority
seonghobae Sep 14, 2026
f28bcc8
chore(perf): adopt post-lock Position time authority
seonghobae Sep 14, 2026
c80621c
chore(perf): adopt effective Position parent authority
seonghobae Sep 14, 2026
40a5561
chore(perf): adopt current Assignment parent authority
seonghobae Sep 14, 2026
1fd731d
chore(perf): adopt separation authorization authority
seonghobae Sep 14, 2026
a52b3ca
chore(perf): adopt mutation receipt structural authority
seonghobae Sep 14, 2026
13262ed
chore(perf): adopt bounded mutation request metadata
seonghobae Sep 14, 2026
4d47411
chore(perf): adopt mutation request capability binding
seonghobae Sep 14, 2026
96a06dc
chore(perf): adopt bounded ASGI body-frame authority
seonghobae Sep 14, 2026
d9f9832
chore(perf): adopt separation HTTP runtime authority
seonghobae Sep 14, 2026
c5efbf5
chore(perf): adopt generated UUID integrity authority
seonghobae Sep 14, 2026
6042a04
chore(perf): adopt structural separation receipt authority
seonghobae Sep 14, 2026
1ce83bf
chore(perf): adopt separation capability binding authority
seonghobae Sep 15, 2026
3d992c9
chore(perf): adopt authenticated principal snapshot authority
seonghobae Sep 15, 2026
0638eea
chore(perf): adopt shared authorization principal authority
seonghobae Sep 15, 2026
7293f58
chore(perf): adopt generic mutation capability binding
seonghobae Sep 15, 2026
054bac0
chore(perf): adopt mutation port contract compatibility
seonghobae Sep 15, 2026
52f32f3
test(perf): reject impossible evidence calendar timestamps
seonghobae Sep 15, 2026
60244f9
fix(perf): validate evidence calendar timestamps exactly
seonghobae Sep 15, 2026
76741ca
test(perf): preserve fractional timestamp ordering
seonghobae Sep 15, 2026
efd6c56
fix(perf): preserve exact fractional evidence ordering
seonghobae Sep 15, 2026
479346f
test(perf): reject impossible fixture preparation timestamp
seonghobae Sep 15, 2026
75090bf
test(perf): reject impossible response recorded timestamp
seonghobae Sep 15, 2026
8c2bc87
fix(perf): validate fixture preparation calendar exactly
seonghobae Sep 15, 2026
ddb9469
fix(perf): validate response calendar timestamp exactly
seonghobae Sep 15, 2026
d62cf70
test(perf): reject post-completion fixture preparation
seonghobae Sep 15, 2026
e575fce
fix(perf): bind fixture preparation chronology
seonghobae Sep 15, 2026
662418e
test(perf): preserve equivalent preparation instants
seonghobae Sep 15, 2026
ed6bde1
test(perf): reject undeclared acceptance evidence fields
seonghobae Sep 15, 2026
e37e878
fix(perf): close acceptance evidence schemas
seonghobae Sep 15, 2026
60c1f8c
test(perf): reject duplicate JSON evidence members
seonghobae Sep 15, 2026
3548e9f
fix(perf): add duplicate-safe JSON parser
seonghobae Sep 15, 2026
7bc8f9b
fix(perf): reject duplicate runtime JSON members
seonghobae Sep 15, 2026
e72d857
fix(perf): reject duplicate result and fixture JSON members
seonghobae Sep 15, 2026
ea58038
test(perf): bound strict JSON evidence nesting
seonghobae Sep 15, 2026
8ebe03a
fix(perf): bound strict JSON evidence nesting
seonghobae Sep 15, 2026
1e1f6bd
test(perf): reject surplus fixture cardinality
seonghobae Sep 15, 2026
45777ab
fix(perf): bound fixture profile cardinality
seonghobae Sep 15, 2026
a3dfe3c
test(perf): bound acceptance artifact bytes (#371)
seonghobae Sep 15, 2026
91a8967
fix(perf): bound runtime evidence bytes (#371)
seonghobae Sep 15, 2026
b175cdd
fix(perf): bound result and fixture evidence bytes (#371)
seonghobae Sep 15, 2026
cc88eaf
test(perf): compose structural and pinned k6 evidence (#372)
seonghobae Sep 15, 2026
6cd3afc
fix(perf): admit governed pinned k6 identity fields (#372)
seonghobae Sep 15, 2026
188d932
fix(perf): validate strict evidence before k6 composition (#372)
seonghobae Sep 15, 2026
dd802ec
test(perf): cover k6 identity schema edges (#372)
seonghobae Sep 15, 2026
7d0f13b
test(perf): harden pinned k6 result parsing (#373)
seonghobae Sep 15, 2026
94e4a24
fix(perf): use bounded strict parser for pinned k6 evidence (#373)
seonghobae Sep 15, 2026
2161433
test(perf): reject oversized fixture before runner setup (#374)
seonghobae Sep 15, 2026
7373f5b
fix(perf): preflight fixture byte ceiling before Podman (#374)
seonghobae Sep 15, 2026
cc174e9
test(perf): cover direct k6 fixture artifact boundary (#375)
seonghobae Sep 15, 2026
6e9a578
fix(perf): add strict bounded fixture artifact boundary (#375)
seonghobae Sep 15, 2026
f3cb209
fix(perf): enforce strict bounded fixture parsing in k6 (#375)
seonghobae Sep 15, 2026
e104a6e
test(perf): expose ambiguous separation response JSON
seonghobae Sep 15, 2026
a0cd113
fix(perf): parse governed separation response JSON strictly
seonghobae Sep 15, 2026
0f5e32a
fix(perf): enforce strict response parsing in k6 workload
seonghobae Sep 15, 2026
b7e024b
test(perf): expose stale separation conflict envelope
seonghobae Sep 15, 2026
aa0889e
fix(perf): validate published separation conflict envelope
seonghobae Sep 15, 2026
5835c61
test(perf): reject undeclared success response fields
seonghobae Sep 15, 2026
4fa51a6
fix(perf): close governed success response envelope
seonghobae Sep 15, 2026
15facbc
test(perf): reject sentinel separation version identities
seonghobae Sep 15, 2026
8abcbda
fix(perf): require operational success response UUIDs
seonghobae Sep 15, 2026
92ce9c7
chore(perf): adopt current People owner head
seonghobae Sep 15, 2026
dbeab5e
chore(perf): adopt repaired People owner checks
seonghobae Sep 15, 2026
e70269c
test(perf): expose Gregorian year-bound mismatch
seonghobae Sep 15, 2026
a7c8855
fix(perf): align Gregorian year bounds
seonghobae Sep 15, 2026
c0c8712
test(perf): cover Gregorian year boundaries
seonghobae Sep 15, 2026
3aebf99
test(perf): reject year zero in acceptance timestamps
seonghobae Sep 15, 2026
7b8ce8e
fix(perf): align acceptance timestamp year bounds
seonghobae Sep 15, 2026
74cc337
chore(perf): adopt current People owner authority
seonghobae Sep 15, 2026
62d911d
chore(perf): integrate current People parent delta
seonghobae Sep 15, 2026
5d7d6ad
chore(perf): adopt current People owner repairs
seonghobae Sep 15, 2026
93231ff
test(perf): cover response recorded_at year bounds
seonghobae Sep 15, 2026
b09290d
fix(perf): align response timestamp year bounds
seonghobae Sep 15, 2026
46a5ff6
test(perf): expose governed outcome cardinality gap
seonghobae Sep 15, 2026
b47fc1c
fix(perf): bind governed outcome metric cardinality
seonghobae Sep 15, 2026
190c205
test(perf): expose pinned k6 v2 summary mismatch
seonghobae Sep 15, 2026
87df697
fix(perf): normalize pinned k6 v2 summary evidence
seonghobae Sep 15, 2026
4711724
test(perf): currentize composed outcome cardinality
seonghobae Sep 15, 2026
151d08e
test(perf): preserve outcome cardinality in latency fixtures
seonghobae Sep 15, 2026
b725496
test(perf): currentize edge outcome cardinality
seonghobae Sep 15, 2026
738ff48
test(perf): preserve outcome cardinality in fixture binding
seonghobae Sep 15, 2026
5c0098d
test(perf): preserve outcome counts in byte-budget fixtures
seonghobae Sep 15, 2026
6780037
test(perf): currentize cardinality evidence fixtures
seonghobae Sep 15, 2026
37e663d
test(perf): currentize provenance outcome cardinality
seonghobae Sep 15, 2026
0f2f9f9
test(perf): reproduce pinned k6 summary contract mismatch
seonghobae Sep 15, 2026
210cbce
fix(perf): consume pinned k6 default summary contract
seonghobae Sep 15, 2026
d5ebebe
fix(perf): bind buyer workload to pinned k6 summary contract
seonghobae Sep 15, 2026
f03b8f7
test(perf): remove impossible k6 v2 summary fixture
seonghobae Sep 15, 2026
9e0124f
fix(perf): remove impossible k6 v2 summary normalizer
seonghobae Sep 15, 2026
b01f218
chore(perf): adopt current People owner head
seonghobae Sep 15, 2026
faeb49c
chore(perf): adopt current People owner review repair
seonghobae Sep 15, 2026
807eaf6
test(perf): reject non-JSON separation response media types
seonghobae Sep 15, 2026
0ea2a59
fix(perf): validate separation JSON response media type
seonghobae Sep 15, 2026
273396d
fix(perf): bind separation verdicts to JSON media type
seonghobae Sep 15, 2026
3eb5a05
test(perf): expose collapsed Content-Type ambiguity
seonghobae Sep 15, 2026
64a9e9a
fix(perf): reject collapsed Content-Type ambiguity
seonghobae Sep 15, 2026
842320c
test(perf): cover malformed Content-Type parameter syntax
seonghobae Sep 15, 2026
cac6fbf
fix(perf): validate single Content-Type representation
seonghobae Sep 15, 2026
0de56e1
test(perf): enforce media-type parameter grammar
seonghobae Sep 15, 2026
4220c16
fix(perf): enforce Content-Type parameter grammar
seonghobae Sep 15, 2026
1f628c6
test(perf): expose unbounded separation response JSON
seonghobae Sep 15, 2026
831fe28
fix(perf): bound governed separation response bytes
seonghobae Sep 15, 2026
790468c
test(perf): expose overprecise separation response timestamps
seonghobae Sep 15, 2026
f8d8eb0
fix(perf): bind response timestamp precision to People serializer
seonghobae Sep 15, 2026
3abbd26
test(perf): reject noncanonical separation support references
seonghobae Sep 15, 2026
de8b8ea
fix(perf): require canonical separation support references
seonghobae Sep 15, 2026
9721f41
chore(perf): adopt current People receipt contract repair
seonghobae Sep 15, 2026
a5e893d
chore(perf): retain current People parent delta
seonghobae Sep 15, 2026
84d3066
chore(perf): adopt People comparison regression contract
seonghobae Sep 15, 2026
079d2b7
test(perf): require no-store separation response policy
seonghobae Sep 15, 2026
8393012
fix(perf): require no-store separation response policy
seonghobae Sep 15, 2026
79c5229
fix(perf): enforce no-store policy before response parsing
seonghobae Sep 15, 2026
b453ef9
test(perf): require no-redirect buyer request policy
seonghobae Sep 15, 2026
b78e7fb
fix(perf): disable redirect following in buyer requests
seonghobae Sep 15, 2026
3a78672
fix(perf): bind buyer path to no-redirect request policy
seonghobae Sep 15, 2026
5d83069
test(perf): require HTTPS buyer evidence origin
seonghobae Sep 15, 2026
336792c
fix(perf): require authenticated HTTPS buyer origin
seonghobae Sep 15, 2026
822e591
perf(people): bind buyer workload to HTTPS origin
seonghobae Sep 15, 2026
ad71be4
test(perf): forbid disabled TLS verification
seonghobae Sep 15, 2026
b5d20e8
fix(perf): fail closed on disabled TLS verification
seonghobae Sep 15, 2026
ea458c3
fix(perf): accept only verified k6 TLS state
seonghobae Sep 15, 2026
b87001c
perf(people): reject insecure TLS runtime override
seonghobae Sep 15, 2026
74f726d
test(perf): cover resolved TLS option defaults
seonghobae Sep 15, 2026
21f8528
test(perf): require deployed-candidate owner gap
seonghobae Sep 15, 2026
a5bf8ab
test(perf): add deployed-candidate evidence gate
seonghobae Sep 15, 2026
a913c0d
fix(perf): separate deployment identity acceptance gate
seonghobae Sep 15, 2026
3e8f44a
test(perf): require all commercial evidence authorities
seonghobae Sep 15, 2026
2b3e950
fix(perf): compose commercial evidence owner gates
seonghobae Sep 15, 2026
151a226
refactor(perf): centralize commercial owner gates
seonghobae Sep 15, 2026
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
import assert from "node:assert/strict";
import { createHash } from "node:crypto";
import test from "node:test";

import { validateEmploymentSeparationAcceptance } from "./employment_separation_acceptance_contract.mjs";
import {
acceptanceFixtureBytes,
acceptanceFixtureSha256,
acceptanceLoadModel,
} from "./employment_separation_acceptance_fixture_test_support.mjs";

const PROFILE_PRECONDITIONS = Object.freeze({
first_commit: "active_current_expected_version",
replay: "same_key_same_semantics_already_committed",
rejection: "expected_version_stale_or_semantic_conflict",
contention: "active_current_expected_version",
});
const FIXTURE_BYTES = acceptanceFixtureBytes();
const FIXTURE_SHA256 = acceptanceFixtureSha256(FIXTURE_BYTES);

function performanceResult(profile, iterations) {
const trendName = profile === "contention"
? "employment_separation_contention_duration_ms"
: "employment_separation_first_commit_duration_ms";
const latencySamples = profile === "contention" ? iterations * 2 : iterations;
return {
schema_version: "orgmetra.employment_separation.performance_result.v1",
candidate_sha: "a".repeat(40),
fixture_sha256: FIXTURE_SHA256,
selected_profile: profile,
expected_iterations: iterations,
completed_iterations: iterations,
sample_complete: true,
completed_at: "2026-09-13T04:10:00Z",
load_model: acceptanceLoadModel(iterations),
dataset_id: "dataset:employment-separation-perf-1",
clearance_reference: "data_clearance:perf-2026-09",
preparation_protocol_reference: "protocol:employment-separation-perf-v1",
prepared_state_evidence_reference: "evidence:prepared-state-perf-1",
resource_evidence_reference: "metrics:employment-separation-perf-1",
profile_preconditions: { ...PROFILE_PRECONDITIONS },
minimum_non_contending_records: 1000,
minimum_contention_pairs: 100,
k6: {
metrics: {
iterations: { values: { count: iterations } },
checks: { values: { rate: 1, passes: iterations, fails: 0 } },
employment_separation_unexpected_response: { values: { rate: 0, passes: 0, fails: iterations } },
employment_separation_latency_samples: { values: { count: latencySamples } },
[trendName]: {
values: profile === "contention"
? { "p(50)": 12, "p(95)": 80, "p(99)": 120, max: 200, count: latencySamples }
: { "p(50)": 8.1, "p(95)": 18.4, "p(99)": 19.7, max: 22.3, count: latencySamples },
},
},
},
};
}

function runtimeEvidence(resultArtifact, profile, iterations) {
return {
schema_version: "orgmetra.employment_separation.runtime_evidence.v1",
candidate_sha: "a".repeat(40),
observed_service_sha: "a".repeat(40),
selected_profile: profile,
performance_result_sha256: createHash("sha256").update(resultArtifact).digest("hex"),
fixture_sha256: FIXTURE_SHA256,
environment_reference: "environment:perf-staging-1",
deployment_reference: "deployment:orgmetra-people-a1",
observer_reference: "observer:perf-runtime-1",
load_observation_reference: "evidence:perf-load-observation-1",
observed_load_model: acceptanceLoadModel(iterations),
resource_evidence_reference: "metrics:employment-separation-perf-1",
observed_at: "2026-09-13T04:10:01Z",
host_cpu_percent_p95: 42.5,
host_rss_bytes_max: 536870912,
db_pool_acquire_p95_ms: 1.2,
db_pool_in_use_max: 18,
db_pool_waiters_max: 2,
db_connections_max: 20,
residual_http_tasks: 0,
residual_db_sessions: 0,
residual_open_transactions: 0,
residual_sockets: 0,
residual_background_workers: 0,
residual_pool_checkouts: 0,
residual_pool_waiters: 0,
};
}

function assertRejected(result, pattern) {
const artifact = Buffer.from(`${JSON.stringify(result, null, 2)}\n`, "utf8");
assert.throws(
() => validateEmploymentSeparationAcceptance(
artifact,
runtimeEvidence(artifact, result.selected_profile, result.expected_iterations),
FIXTURE_BYTES,
),
pattern,
);
}

test("requires at least 1000 ordinary buyer-path iterations", () => {
assertRejected(performanceResult("first_commit", 1), /at least 1000 iterations/);
});

test("requires at least 100 contention pairs", () => {
assertRejected(performanceResult("contention", 99), /at least 100 iterations/);
});

test("requires fixed cardinality declarations in the result artifact", () => {
const result = performanceResult("first_commit", 1000);
result.minimum_non_contending_records = 1;
result.minimum_contention_pairs = 1;
assertRejected(result, /minimum_non_contending_records must equal 1000/);
});
44 changes: 44 additions & 0 deletions tests/performance/employment_separation_acceptance_check.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
import { readFile } from "node:fs/promises";

import { validateEmploymentSeparationAcceptance } from "./employment_separation_acceptance_contract.mjs";
import { requireCommercialPerformanceAuthorities } from "./employment_separation_commercial_owner_gate.mjs";
import { validatePinnedK6AcceptanceEvidence } from "./employment_separation_k6_evidence_contract.mjs";
import { parseRuntimeEvidenceArtifact } from "./employment_separation_runtime_evidence_artifact.mjs";

async function main() {
// Byte/provenance attestation and deployed-candidate identity are separate
// trust boundaries. Surface every unresolved owner gap before touching caller
// paths so resolving one authority cannot accidentally enable acceptance while
// the other remains self-asserted.
requireCommercialPerformanceAuthorities();

const [resultPath, runtimeEvidencePath, fixturePath] = process.argv.slice(2);
if (!resultPath || !runtimeEvidencePath || !fixturePath || process.argv.length !== 5) {
throw new Error("usage: node employment_separation_acceptance_check.mjs <performance-result.json> <runtime-evidence.json> <performance-fixture.json>");
}
const [resultBytes, runtimeBytes, fixtureBytes] = await Promise.all([
readFile(resultPath),
readFile(runtimeEvidencePath),
readFile(fixturePath),
]);
const runtimeDocument = parseRuntimeEvidenceArtifact(runtimeBytes);
const evidenceContract = validateEmploymentSeparationAcceptance(
resultBytes,
runtimeDocument.parsed,
fixtureBytes,
);
// Structural validation owns the bounded/strict result parser. Run it before
// this secondary pinned-runtime interpretation so duplicate members, nesting
// abuse, and oversized result artifacts cannot reach ordinary JSON.parse first.
const k6Evidence = validatePinnedK6AcceptanceEvidence(resultBytes, runtimeDocument.parsed);
process.stdout.write(`${JSON.stringify({
...evidenceContract,
...k6Evidence,
runtime_evidence_sha256: runtimeDocument.sha256,
}, null, 2)}\n`);
}

main().catch((error) => {
process.stderr.write(`${error.message}\n`);
process.exitCode = 1;
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
import assert from "node:assert/strict";
import { spawnSync } from "node:child_process";
import { fileURLToPath } from "node:url";
import test from "node:test";

const acceptanceCheck = fileURLToPath(new URL("./employment_separation_acceptance_check.mjs", import.meta.url));

const PERFORMANCE_ATTESTATION_GAP_PATTERN = /authenticated performance-evidence attestation.*ContextualWisdomLab\/.github#2162/;
const DEPLOYMENT_IDENTITY_GAP_PATTERN = /authenticated deployed-candidate evidence.*ContextualWisdomLab\/Orgmetra#395/;

function assertCommercialOwnerGaps(stderr) {
assert.match(stderr, PERFORMANCE_ATTESTATION_GAP_PATTERN);
assert.match(stderr, DEPLOYMENT_IDENTITY_GAP_PATTERN);
}

test("commercial acceptance fails closed before trusting a caller-supplied result digest", () => {
const result = spawnSync(
process.execPath,
[acceptanceCheck, "result.json", "runtime.json", "fixture.json", "a".repeat(64)],
{ encoding: "utf8" },
);
assert.notEqual(result.status, 0);
assertCommercialOwnerGaps(result.stderr);
});

test("commercial acceptance cannot be restored by substituting both result bytes and digest locally", () => {
const result = spawnSync(
process.execPath,
[acceptanceCheck, "substituted-result.json", "substituted-runtime.json", "fixture.json", "b".repeat(64)],
{ encoding: "utf8" },
);
assert.notEqual(result.status, 0);
assertCommercialOwnerGaps(result.stderr);
});
Loading