Skip to content

test(perf): add Employment separation buyer-path workload - #317

Draft
seonghobae wants to merge 300 commits into
fix/hire-identity-type-integrityfrom
perf/employment-separation-buyer-path
Draft

seonghobae wants to merge 300 commits into
fix/hire-identity-type-integrityfrom
perf/employment-separation-buyer-path

Conversation

@seonghobae

@seonghobae seonghobae commented Sep 13, 2026

Copy link
Copy Markdown
Contributor

Scope

This Draft PR owns executable Employment-separation buyer-path performance measurement and structural evidence contracts for #316. It stays stacked on active People owner #64; no force-push or destructive rebase is used to manufacture evidence.

Current parent authority

Canonical People #64 is exact 0b4409e50a1fd646c1f960164012df5984cbde0c, based on protected develop@eb9757f8649aaad026a9865508d9aad50c1a7a4f.

This performance branch is exact 151a2269ef6fb21cf5984e6ced9f98bb286cf42a. Fresh compare against current #64 has merge base exactly 0b4409e..., 0 behind, 300 commits ahead, and 48 child-owned files, all under tests/performance/....

The parent remains the canonical People source owner. #317 contains performance/evidence contracts only.

Evidence-integrity lineage

#363#383 retain calendar/chronology, strict JSON, bounded-evidence, fixture/runtime, response-envelope and identity contracts. #384 binds governed outcome Rate cardinality to one verdict per scheduled iteration while contention retains two latency samples per pair. #386 keeps pinned k6 2.2.0 default handleSummary() aligned with required p(50)/p(95)/p(99)/max/count evidence. #387 binds governed responses to JSON media type; #388 rejects ambiguity caused by k6's collapsed repeated Content-Type representation. #389 bounds live response JSON to 16 KiB UTF-8 before strict parsing; #390 narrows only HTTP success recorded_at to canonical Python datetime.isoformat() precision; #391 binds conflict support_reference to the current People token_urlsafe(24) representation; #392 binds commercial response evidence to the owner's Cache-Control: no-store and explicit Vary: Authorization policy. #393 closes redirect-following ambiguity with request-scoped redirects: 0 for every profile. #394 requires an authenticated HTTPS origin and verifies the resolved k6 runtime has not disabled TLS certificate verification.

#395 closes a separate deployment-identity false-GREEN that #2162 cannot solve by itself. The predecessor acceptance contract required caller-supplied runtime.observed_service_sha to equal candidate_sha, but the benchmark runner only proved that the benchmark checkout matched the target SHA. It did not independently prove which deployed service behind ORGMETRA_PERFORMANCE_BASE_URL actually served the timed requests. Sealing or attesting a self-asserted observed_service_sha makes that statement immutable but does not authenticate the measured deployment.

Current repair lineage:

  • 21f8528abbe3b7edee68b50c500aa5bf1d77cb3a: test-first CLI contract requiring both unresolved commercial owner gaps (.github#2162 evidence attestation and Orgmetra perf(people): authenticate exact deployed candidate before Employment-separation acceptance #395 deployed-candidate identity); RED because the predecessor entry point only surfaced #2162.
  • a5bf8abf51751a436e2cdc6cf694a798884413d5: adds the deployment-evidence fail-closed owner gate for perf(people): authenticate exact deployed candidate before Employment-separation acceptance #395.
  • a913c0d231cc1d9ed596a7749822b18c65c7fbd1: prevents the first unresolved authority from masking the second.
  • 3e8f44ad5a32cf607fc6a95e6cbfd27cf2235edc: test-first composed-owner contract; RED because its parent had no composed gate module.
  • 2b3e9502333d4295863674f7d3d4b30cdd3b8917: adds requireCommercialPerformanceAuthorities() and preserves both fail-closed boundaries.
  • Current 151a2269...: acceptance CLI consumes the composed owner gate before any caller-controlled artifact paths are opened.

Focused Node execution of the composed owner contract is 1/1 GREEN locally. This is structural contract evidence only; it is not hosted k6, deployment, performance or release evidence.

Acceptance boundary

The workload retains right-cleared non-synthetic fixture provenance, one governed profile per invocation, pinned k6 runtime/load contracts, exact outcome/latency cardinality, authenticated-HTTPS + certificate-verified exact-route/no-redirect/no-proxy request policy, p50/p95/p99/max evidence shape, exact-candidate benchmark materialization, no-clobber publication and explicit resource/cleanup evidence. p(95) <= 20 ms applies only to ordinary first_commit; no measurement is claimed here.

Two different authority boundaries remain intentionally separate:

  1. .github#2162 must authenticate the exact inert performance evidence bytes/provenance.
  2. Orgmetra perf(people): authenticate exact deployed candidate before Employment-separation acceptance #395 must independently authenticate that the deployment/origin actually measured was built from the exact candidate SHA under the required production-equivalent runtime boundary.

A positive receipt is forbidden until both released/versioned authorities are consumed. Mutable Draft central workflow work and caller-authored deployment/SHA strings are not released truth.

State: open · Draft. Current 151a2269... has no claimed hosted exact-head k6 run, production-equivalent authenticated deployment, measured p50/p95/p99/max, protected status or release status. #316 and #363#395 remain open until protected/integration acceptance conditions are satisfied.

@coderabbitai

coderabbitai Bot commented Sep 13, 2026

Copy link
Copy Markdown

Review Change StackReview Change Stack

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch perf/employment-separation-buyer-path

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

Please review the exact current head for performance-evidence false-GREEN risk: right-cleared/non-synthetic fixture enforcement, cross-profile Employment isolation, contention semantics, bearer handling, p95 threshold scoping, result provenance, and any k6 runtime incompatibility. This PR must not claim measured acceptance.

@coderabbitai

coderabbitai Bot commented Sep 13, 2026

Copy link
Copy Markdown
🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo '=== HEAD / PR FILES ==='
git rev-parse HEAD
git diff --name-status HEAD^ HEAD
git diff --check HEAD^ HEAD

echo '=== REPOSITORY MAP ==='
fd -HI -t f | rg -i '(k6|perf|performance|employment|fixture|workload|package\.json|readme|requirements)'

echo '=== JAVASCRIPT/TYPECRIPT OUTLINES ==='
while IFS= read -r file; do
  echo "--- $file"
  ast-grep outline "$file" --items all 2>/dev/null || true
done < <(fd -HI -t f -e js -e mjs -e cjs -e ts | rg -i '(k6|perf|performance|employment|fixture|workload)')

echo '=== DIFF ==='
git diff --find-renames --find-copies --unified=80 HEAD^ HEAD

Length of output: 3432


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo '=== OUTLINE: WORKLOAD ==='
ast-grep outline tests/performance/employment_separation_buyer_path.js --items all || true

echo '=== OUTLINE: FIXTURE CONTRACT ==='
ast-grep outline tests/performance/employment_separation_fixture_contract.mjs --items all || true

echo '=== OUTLINE: FIXTURE CONTRACT TEST ==='
ast-grep outline tests/performance/employment_separation_fixture_contract.test.mjs --items all || true

echo '=== WORKLOAD ==='
cat -n tests/performance/employment_separation_buyer_path.js

echo '=== FIXTURE CONTRACT ==='
cat -n tests/performance/employment_separation_fixture_contract.mjs

echo '=== FIXTURE CONTRACT TEST ==='
cat -n tests/performance/employment_separation_fixture_contract.test.mjs

echo '=== RELATED PERFORMANCE POLICY ==='
cat -n docs/adr/0009-performance-criterion-observation-scope.md

echo '=== ALL SHARED-CONTRACT IMPORTS AND CALL SITES ==='
rg -n -C 4 --glob '*.mjs' --glob '*.js' \
  '(from .*\bemployment_separation_fixture_contract\b|require\(.+employment_separation_fixture_contract|validateFixture|fixtureIdentity|candidateSha|resourceEvidence)' \
  tests services packages

Length of output: 37674


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo '=== PACKAGE METADATA ==='
cat -n package.json

echo '=== PERFORMANCE DOCUMENTATION AND EXECUTION REFERENCES ==='
rg -n -C 5 -i \
  '(employment[-_ ]separation.*(performance|buyer|k6)|ORGMETRA_PERFORMANCE_|k6 run|performance-result|candidate_sha|right_cleared)' \
  README.md docs tests package.json .github 2>/dev/null || true

echo '=== SERVICE ROUTE CONTRACT ==='
rg -n -C 8 --glob '*.py' --glob '*.md' --glob '*.json' \
  '(/v1/employment-separations|employment-separations|separation_conflict|X-Actor-Reference|X-Purpose-Code|X-Tenant-Reference)' \
  services/people-api packages tests | head -n 500

echo '=== K6 VERSION PINNING OR CONTAINER CONFIGURATION ==='
fd -HI -t f | rg -i '(dockerfile|compose|k6|tool-versions|mise|asdf|package-lock|pnpm-lock|yarn\.lock|github/workflows)'
rg -n -C 3 -i '(grafana/k6|k6(\s|:|@)|xk6)' .github README.md package.json Dockerfile docker-compose.yml 2>/dev/null || true

echo '=== CURRENT HEAD ID REFERENCES ==='
rg -n -C 3 '(2046bc4bea97cf8e0a11694fe3b707c23d5273df|ORGMETRA_PERFORMANCE_TARGET_SHA|candidate_sha)' .

Length of output: 54948


@seonghobae Review found one false-GREEN risk.

  • P1 — Require completion of every configured iteration before accepting the p95 result. tests/performance/employment_separation_buyer_path.js Lines 56-87 set maxDuration: "30m" for all shared-iterations scenarios. If a scenario reaches that limit, k6 can stop it before it processes every fixture record. The first-commit trend can then satisfy p(95)<=20 from the completed subset. The result envelope contains the k6 summary, but the workload has no threshold or explicit completion check for the required 1,000 first-commit, replay, and rejection records or the 100 contention pairs. Add per-scenario completed-iteration assertions, or fail handleSummary when the completed counts differ from the configured counts. This prevents timeout-truncated samples from appearing as an acceptance result.

The fixture contract otherwise enforces the requested controls: right-cleared and non-synthetic flags, full-SHA format and fixture/runtime SHA equality, non-empty evidence references, cross-profile Employment isolation, contention command equivalence except for idempotency key, runtime bearer credentials, and a first-commit-only p95 trend. The workload does not contain a measured acceptance claim.

⚠️ Action not completed

Head commit changed.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

Copy link
Copy Markdown
Contributor Author

Finding verification on current stack: the initial performance fixture validator accepted short idempotency keys, while the live People contract requires 16–200 visible ASCII characters. A real run with those fixtures would have returned request-validation 400s and produced a false performance RED. Repaired ordinary-forward in b5c25443713b769f6945dec62a300b97593a290e, then aligned the fixture with the remaining separation HTTP/application preconditions in 2d11255b2867e86ad587a74674133167c8652f6a + 093e8b200bff732a3dd67e9b76bfed10bb0add40. The final workload head 6dc5e2806b566ca8952eaf2d5bd65de6fa41d836 also keeps the target endpoint out of emitted evidence. Local contract result is now 9/9 PASS; this is harness evidence only, not a p95 claim.

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

Please review exact head 6dc5e2806b566ca8952eaf2d5bd65de6fa41d836. Focus on false-GREEN/false-RED risk, k6 runtime compatibility, concurrency semantics, request-contract parity, credential/result leakage, sample cardinality, and whether the p95 threshold is scoped to the ordinary buyer path without hiding contention.

@coderabbitai

coderabbitai Bot commented Sep 13, 2026

Copy link
Copy Markdown

Tip

For best results, initiate chat on the files or code changes.

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

target='6dc5e2806b566ca8952eaf2d5bd65de6fa41d836'
base='d9cc516d54b4642f59fe126c331a19945fdf75f1'

echo '=== VERIFY EXACT HEAD ==='
git rev-parse HEAD
git cat-file -t "$target"
git merge-base --is-ancestor "$base" "$target" && echo "base_is_ancestor=yes"
git diff --check "$base" "$target"

echo '=== CHANGED FILES ==='
git diff --name-status "$base" "$target"

echo '=== JAVASCRIPT OUTLINES ==='
git diff --name-only "$base" "$target" | while IFS= read -r f; do
  case "$f" in
    *.js|*.mjs|*.cjs)
      echo "--- $f"
      ast-grep outline "$f" --items all || true
      ;;
  esac
done

echo '=== PERFORMANCE HARNESS FILES AT TARGET ==='
fd -HI -t f . tests 2>/dev/null | rg 'tests/performance/(employment_separation|.*performance)' || true

echo '=== TARGET DIFF ==='
git diff --find-renames --unified=100 "$base" "$target" -- tests/performance docs package.json

echo '=== RELATED PRODUCTION BOUNDARY LOCATIONS ==='
rg -n -C 5 --glob '*.py' \
  '(Idempotency-Key|X-Actor-Reference|X-Purpose-Code|X-Tenant-Reference|Bearer |employment-separations|separation_reason|evidence_version|confirmation_reference)' \
  services packages tests | head -n 1000

echo '=== EXECUTION / VERSION REFERENCES ==='
rg -n -C 4 --glob '*.md' --glob '*.json' --glob '*.yml' --glob '*.yaml' --glob '*.js' --glob '*.mjs' \
  '(k6 run|grafana/k6|shared-iterations|maxDuration|handleSummary|thresholds|ORGMETRA_PERFORMANCE|candidate_sha|resource_evidence)' \
  README.md docs tests package.json .github 2>/dev/null || true

Length of output: 146825


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo '=== PEOPLE SEPARATION SOURCE MAP ==='
rg -n -l --glob '*.py' '(employment.separation|employment-separation|separation_conflict|separation_effective_on)' services/people-api | while IFS= read -r f; do
  echo "--- $f"
  ast-grep outline "$f" --items all 2>/dev/null || true
done

echo '=== PEOPLE SEPARATION HTTP AND COMMAND IMPLEMENTATIONS ==='
rg -n -C 12 --glob '*.py' \
  '(def .*separation|class .*Separation|/v1/employment-separations|separation_conflict|Idempotency-Key|idempotency.*(16|200)|evidence_version_code|confirmation_reference)' \
  services/people-api/src services/people-api/tests | head -n 1600

echo '=== PERFORMANCE CONTRACT TEST COMPLETE ==='
cat -n tests/performance/employment_separation_fixture_contract.test.mjs

echo '=== K6-SPECIFIC API PATTERNS IN REPOSITORY ==='
rg -n -C 5 --glob '*.js' --glob '*.mjs' \
  '(handleSummary|execution|iterationInTest|http\.batch|shared-iterations)' . 2>/dev/null

echo '=== COMMIT HISTORY FOR HARNESS ==='
git log --format='%H%n%s%n%b%n---' --reverse d9cc516d54b4642f59fe126c331a19945fdf75f1..6dc5e2806b566ca8952eaf2d5bd65de6fa41d836 -- tests/performance

Length of output: 210212


@seonghobae Review found one false-GREEN risk in exact head 6dc5e2806b566ca8952eaf2d5bd65de6fa41d836.

  • P1 — Fail the result when a scenario does not complete its configured iterations. tests/performance/employment_separation_buyer_path.js Lines 56-87 sets maxDuration: "30m" for each shared-iterations scenario. k6 can stop a scenario at that limit before it processes every fixture record. The first-commit trend can then satisfy p(95)<=20 from only the completed subset. The existing checks and employment_separation_unexpected_response thresholds only validate executed requests. They do not prove completion of 1,000 first-commit, replay, and rejection records, or 100 contention pairs. Add a per-scenario completion counter with an exact-count threshold, or make handleSummary() fail when each completed count differs from its configured iteration count.

The remaining reviewed controls are consistent with the stated harness scope. The fixture validator enforces right-cleared non-synthetic input, candidate-SHA equality, resource-evidence presence, cross-profile Employment isolation, and contention pair equivalence except for idempotency key. The workload supplies the bearer token only from the runtime environment. The result envelope does not explicitly contain the target endpoint. The p(95)<=20 threshold applies only to the ordinary first-commit trend. Contention remains a separate reported distribution with a 200 plus 409 outcome check.

You are interacting with an AI system.

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

Please review exact head beff0210c24f5d179f8a6717fbfeb5881f7c5365. In addition to runtime/k6 and false-GREEN/false-RED risk, verify that replay/rejection prepared-state provenance is explicit enough to prevent hidden pre-materialization claims and that no endpoint/credential material is emitted into result evidence.

@coderabbitai

coderabbitai Bot commented Sep 13, 2026

Copy link
Copy Markdown

Tip

For best results, initiate chat on the files or code changes.

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

target='beff0210c24f5d179f8a6717fbfeb5881f7c5365'
base='d9cc516d54b4642f59fe126c331a19945fdf75f1'

echo '=== EXACT-HEAD VERIFICATION ==='
printf 'checked_out='
git rev-parse HEAD
git cat-file -t "$target"
git merge-base --is-ancestor "$base" "$target" && echo 'base_is_ancestor=yes'
git diff --check "$base" "$target"

echo '=== CHANGED FILES ==='
git diff --name-status "$base" "$target"

echo '=== PERFORMANCE FILES AT TARGET ==='
git ls-tree -r --name-only "$target" | rg '^tests/performance/|(^|/)(package\.json|README\.md)$|^docs/' | rg -i '(employment|separation|performance|buyer|fixture|workload|package\.json|readme)' || true

echo '=== JAVASCRIPT OUTLINES ==='
git diff --name-only "$base" "$target" | while IFS= read -r file; do
  case "$file" in
    *.js|*.mjs|*.cjs)
      echo "--- $file"
      ast-grep outline "$file" --items all 2>/dev/null || true
      ;;
  esac
done

echo '=== HARNESS DIFF ==='
git diff --find-renames --unified=100 "$base" "$target" -- tests/performance docs package.json README.md

echo '=== CURRENT HARNESS SOURCES ==='
for file in \
  tests/performance/employment_separation_buyer_path.js \
  tests/performance/employment_separation_fixture_contract.mjs \
  tests/performance/employment_separation_fixture_contract.test.mjs
do
  if git cat-file -e "$target:$file" 2>/dev/null; then
    echo "--- $file"
    git show "$target:$file" | cat -n
  fi
done

echo '=== PEOPLE REQUEST-BOUNDARY IMPLEMENTATION ==='
rg -n -C 10 --glob '*.py' \
  '(Idempotency-Key|X-Actor-Reference|X-Purpose-Code|X-Tenant-Reference|Authorization|Bearer |/v1/employment-separations|separation_reason|evidence_version|confirmation_reference)' \
  services/people-api packages 2>/dev/null | head -n 1800 || true

echo '=== K6 RUNTIME/PATTERN REFERENCES ==='
rg -n -C 6 --glob '*.js' --glob '*.mjs' --glob '*.md' --glob '*.json' --glob '*.yml' --glob '*.yaml' \
  '(shared-iterations|maxDuration|handleSummary|execution|iterationInTest|Trend|Counter|thresholds|k6 run|grafana/k6|ORGMETRA_PERFORMANCE|candidate_sha|prepared_state|preparation_protocol|resource_evidence)' \
  tests docs README.md package.json .github 2>/dev/null || true

echo '=== RESULT-EVIDENCE FIELD AND SECRET/ENDPOINT AUDIT ==='
rg -n -C 5 --glob '*.js' --glob '*.mjs' \
  '(handleSummary|JSON\.stringify|result|envelope|endpoint|target|base_url|authorization|bearer|token|ORGMETRA_PERFORMANCE)' \
  tests/performance 2>/dev/null || true

echo '=== FIXTURE/PROFILE CROSS-REFERENCE ==='
rg -n -C 5 --glob '*.js' --glob '*.mjs' \
  '(first_commit|replay|rejection|contention|employment_id|employment_reference|profile_precondition|prepared_state|preparation_protocol)' \
  tests/performance 2>/dev/null || true

Length of output: 203259


🏁 Script executed:

#!/bin/bash
set -euo pipefail

target='beff0210c24f5d179f8a6717fbfeb5881f7c5365'
log='/tmp/coderabbit-shell-logs/shell-output-5yYGg9'

echo '=== EXACT HEAD AND DIFF STAT ==='
git rev-parse HEAD
git show -s --format='%H%n%P%n%s' "$target"
git diff --stat d9cc516d54b4642f59fe126c331a19945fdf75f1 "$target"
git diff --name-status 6dc5e2806b566ca8952eaf2d5bd65de6fa41d836 "$target"

echo '=== COMPLETE TARGET: WORKLOAD ==='
git show "$target:tests/performance/employment_separation_buyer_path.js" | nl -ba

echo '=== COMPLETE TARGET: FIXTURE CONTRACT ==='
git show "$target:tests/performance/employment_separation_fixture_contract.mjs" | nl -ba

echo '=== COMPLETE TARGET: CONTRACT TESTS ==='
git show "$target:tests/performance/employment_separation_fixture_contract.test.mjs" | nl -ba

echo '=== PREVIOUS COMMAND: KEY SECTIONS ==='
rg -n -C 3 '^=== EXACT-HEAD|^checked_out=|^base_is_ancestor|^=== CHANGED FILES|^=== HARNESS DIFF|^=== CURRENT HARNESS SOURCES' "$log" || true

echo '=== TARGET: ALL PERFORMANCE OUTPUT SINKS AND ENVIRONMENT USE ==='
git grep -n -E '(handleSummary|console\.|JSON\.stringify|__ENV|http\.(post|batch)|open\()' "$target" -- tests/performance || true

echo '=== TARGET: DOCUMENTED K6 INVOCATION ==='
git grep -n -i -E '(k6 run|ORGMETRA_PERFORMANCE_|employment-separation-performance-result)' "$target" -- README.md docs tests package.json .github 2>/dev/null || true

Length of output: 36295


@seonghobae Review found one false-GREEN risk in exact head beff0210c24f5d179f8a6717fbfeb5881f7c5365.

  • P1 — Fail an incomplete scenario before accepting its latency result. tests/performance/employment_separation_buyer_path.js Lines 56-87 configure shared-iterations with maxDuration: "30m". k6 can stop a scenario when this duration expires. The first-commit trend can then pass p(95)<=20 from fewer than the required 1,000 records. The current checks and unexpected-response thresholds only validate requests that ran. They do not prove that all first-commit, replay, rejection, and contention iterations completed. Add exact per-profile completion counters and thresholds, or validate the completed iteration counts in handleSummary() before emitting an acceptance result.

The prepared-state provenance is structurally explicit. The fixture requires preparation_protocol_reference, prepared_state_evidence_reference, and fixed preconditions for replay and rejection. The result envelope preserves those fields. Source review cannot verify that an external reference proves the declared database state.

The result envelope does not explicitly emit baseUrl or bearerToken. The bearer token comes only from ORGMETRA_PERFORMANCE_BEARER_TOKEN. The p95 threshold applies only to employment_separation_first_commit_duration_ms. The contention distribution remains separate.

k6 runtime execution was not available in this environment. The source uses standard k6 module imports, shared-iterations, exec.scenario.iterationInTest, http.batch, and handleSummary patterns.

You are interacting with an AI system.

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

Please review exact head 2ef2f39449bcaa0ce8a077f43649af4a70a8e0e3, focusing on false-GREEN/false-RED risks in the published response contract, single-profile isolation, contention result classification, k6 threshold semantics, and evidence provenance. This is a stacked Draft on #64; do not infer protected/released status.

@coderabbitai

coderabbitai Bot commented Sep 13, 2026

Copy link
Copy Markdown

Tip

For best results, initiate chat on the files or code changes.

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

target='2ef2f39449bcaa0ce8a077f43649af4a70a8e0e3'
base='d9cc516d54b4642f59fe126c331a19945fdf75f1'

echo '=== EXACT HEAD ==='
printf 'checked_out='
git rev-parse HEAD
printf 'target_type='
git cat-file -t "$target"
git merge-base --is-ancestor "$base" "$target" && echo 'base_is_ancestor=yes'
git diff --check "$base" "$target"
git show -s --format='target=%H%nparents=%P%nsubject=%s' "$target"

echo '=== CHANGED FILES ==='
git diff --name-status "$base" "$target"

echo '=== PERFORMANCE SOURCE OUTLINES ==='
for file in \
  tests/performance/employment_separation_buyer_path.js \
  tests/performance/employment_separation_fixture_contract.mjs \
  tests/performance/employment_separation_fixture_contract.test.mjs
do
  if git cat-file -e "$target:$file" 2>/dev/null; then
    echo "--- $file"
    git show "$target:$file" > "/tmp/$(basename "$file")"
    ast-grep outline "/tmp/$(basename "$file")" --items all 2>/dev/null || true
  fi
done

echo '=== WORKLOAD ==='
git show "$target:tests/performance/employment_separation_buyer_path.js" | nl -ba

echo '=== FIXTURE CONTRACT ==='
git show "$target:tests/performance/employment_separation_fixture_contract.mjs" | nl -ba

echo '=== CONTRACT TESTS ==='
git show "$target:tests/performance/employment_separation_fixture_contract.test.mjs" | nl -ba

echo '=== HARNESS DIFF ==='
git diff --find-renames --unified=100 "$base" "$target" -- \
  tests/performance docs README.md package.json

echo '=== RESPONSE BOUNDARY ==='
rg -n -C 12 --glob '*.py' \
  '(/v1/employment-separations|separation_conflict|replayed|recorded_at|employment_id|Idempotency-Key|X-Actor-Reference|X-Purpose-Code|X-Tenant-Reference)' \
  services packages tests | head -n 1800 || true

echo '=== K6, THRESHOLD, AND RESULT-EVIDENCE AUDIT ==='
git grep -n -E \
  '(shared-iterations|maxDuration|thresholds|Trend|Counter|handleSummary|JSON\.stringify|__ENV|http\.(post|batch)|iterationInTest|baseUrl|bearer|token|endpoint|candidate_sha|prepared_state|preparation_protocol|resource_evidence)' \
  "$target" -- tests/performance docs README.md package.json 2>/dev/null || true

echo '=== TARGET PERFORMANCE INVOCATION REFERENCES ==='
git grep -n -i -E \
  '(k6 run|ORGMETRA_PERFORMANCE_PROFILE|first_commit|replay|rejection|contention|employment-separation-performance-result)' \
  "$target" -- README.md docs tests package.json .github 2>/dev/null || true

Length of output: 202926


🏁 Script executed:

#!/bin/bash
set -euo pipefail

target='2ef2f39449bcaa0ce8a077f43649af4a70a8e0e3'

echo '=== EXACT HEAD SUMMARY ==='
git show -s --format='target=%H%nparents=%P%nsubject=%s' "$target"
git diff --name-status 'd9cc516d54b4642f59fe126c331a19945fdf75f1' "$target"

echo '=== WORKLOAD 1-240 ==='
git show "$target:tests/performance/employment_separation_buyer_path.js" | nl -ba | sed -n '1,240p'

echo '=== RUN CONTRACT ==='
git show "$target:tests/performance/employment_separation_run_contract.mjs" | nl -ba

echo '=== RESPONSE CONTRACT ==='
git show "$target:tests/performance/employment_separation_response_contract.mjs" | nl -ba

echo '=== FIXTURE CONTRACT 1-280 ==='
git show "$target:tests/performance/employment_separation_fixture_contract.mjs" | nl -ba | sed -n '1,280p'

echo '=== RESPONSE AND RUN CONTRACT TESTS ==='
for file in \
  tests/performance/employment_separation_response_contract.test.mjs \
  tests/performance/employment_separation_run_contract.test.mjs
do
  echo "--- $file"
  git show "$target:$file" | nl -ba
done

echo '=== PUBLISHED SEPARATION ERROR ENVELOPE ==='
sed -n '300,385p' services/people-api/src/orgmetra_people_api/separation_http.py | nl -ba -v300

echo '=== K6 PACKAGE / VERSION DECLARATIONS ==='
fd -HI -t f -a 'package.json' -a 'Dockerfile*' -a 'docker-compose*.yml' -a 'docker-compose*.yaml' -a '*.tool-versions' -a 'mise.toml' -a '.github/workflows' | while IFS= read -r file; do
  echo "--- $file"
  rg -n -i -C 3 '(k6|grafana/k6|xk6)' "$file" || true
done

Length of output: 33949


@seonghobae Review found one false-GREEN risk in exact head 2ef2f39449bcaa0ce8a077f43649af4a70a8e0e3.

  • P1 — Require all configured iterations before a profile result can pass. tests/performance/employment_separation_buyer_path.js Lines 67-98 use shared-iterations with maxDuration: "30m". k6 can stop the selected scenario when that duration expires. The existing checks and employment_separation_unexpected_response thresholds validate only requests that completed. Therefore, first_commit can satisfy p(95)<=20 from fewer than the required 1,000 records. The same condition can hide incomplete replay, rejection, or contention coverage. Add an exact completion counter and threshold for the selected profile. Alternatively, make handleSummary() fail when completed iterations do not equal the configured fixture-record count. For contention, the required completed count is the configured pair count, not the number of HTTP requests.

The reviewed response contract matches the published boundary. First-commit and replay require 200, the requested Employment identity, a UUID terminal-version identity, a valid UTC recorded_at, and the expected replayed value. Rejection and contention conflicts require 409 with error: "separation_conflict".

The selected-profile design prevents replay, rejection, and contention traffic from entering the first-commit duration trend. The p95 threshold exists only for first_commit. Contention remains separately measured and requires one governed non-replay success plus one governed conflict per pair.

The fixture contract requires right-cleared, non-synthetic data, exact candidate-SHA binding, explicit preparation and prepared-state references, resource evidence, minimum profile cardinality, and Employment isolation across profiles. The result envelope does not emit the endpoint or bearer token.

This is a Draft stacked on #64. This review does not infer protected, released, or measured acceptance status. k6 runtime execution was not available.

You are interacting with an AI system.

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

Please re-review exact head 2dff0b072417332683a1d814b5fac1c80b07c9cc. Since the previous request, profile isolation and explicit p50/p95/p99/max summary evidence were added. Focus on false-GREEN/false-RED risks, k6 option semantics, response classification, contention behavior, and whether #316's evidence requirements are still under-specified.

@coderabbitai

coderabbitai Bot commented Sep 13, 2026

Copy link
Copy Markdown

Tip

For best results, initiate chat on the files or code changes.

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

target='2dff0b072417332683a1d814b5fac1c80b07c9cc'
base='d9cc516d54b4642f59fe126c331a19945fdf75f1'

echo '=== EXACT HEAD ==='
git rev-parse HEAD
git cat-file -t "$target"
git merge-base --is-ancestor "$base" "$target" && echo 'base_is_ancestor=yes'
git show -s --format='target=%H%nparents=%P%nsubject=%s' "$target"
git diff --check "$base" "$target"

echo '=== CHANGED FILES ==='
git diff --name-status "$base" "$target"

echo '=== PERFORMANCE SOURCE OUTLINES ==='
for file in \
  tests/performance/employment_separation_buyer_path.js \
  tests/performance/employment_separation_fixture_contract.mjs \
  tests/performance/employment_separation_run_contract.mjs \
  tests/performance/employment_separation_response_contract.mjs \
  tests/performance/employment_separation_fixture_contract.test.mjs \
  tests/performance/employment_separation_run_contract.test.mjs \
  tests/performance/employment_separation_response_contract.test.mjs
do
  if git cat-file -e "$target:$file" 2>/dev/null; then
    echo "--- $file"
    git show "$target:$file" > "/tmp/$(basename "$file")"
    ast-grep outline "/tmp/$(basename "$file")" --items all 2>/dev/null || true
  fi
done

echo '=== WORKLOAD ==='
git show "$target:tests/performance/employment_separation_buyer_path.js" | nl -ba

echo '=== RUN CONTRACT ==='
git show "$target:tests/performance/employment_separation_run_contract.mjs" | nl -ba

echo '=== RESPONSE CONTRACT ==='
git show "$target:tests/performance/employment_separation_response_contract.mjs" | nl -ba

echo '=== FIXTURE CONTRACT ==='
git show "$target:tests/performance/employment_separation_fixture_contract.mjs" | nl -ba

echo '=== CONTRACT TESTS ==='
for file in \
  tests/performance/employment_separation_fixture_contract.test.mjs \
  tests/performance/employment_separation_run_contract.test.mjs \
  tests/performance/employment_separation_response_contract.test.mjs
do
  echo "--- $file"
  git show "$target:$file" | nl -ba
done

echo '=== DIFF FROM PREVIOUS REVIEW HEAD ==='
git diff --find-renames --unified=80 '2ef2f39449bcaa0ce8a077f43649af4a70a8e0e3' "$target" -- tests/performance docs README.md package.json

echo '=== PRODUCTION HTTP BOUNDARY ==='
rg -n -C 10 --glob '*.py' \
  '(/v1/employment-separations|separation_conflict|replayed|recorded_at|employment_id|Idempotency-Key|X-Actor-Reference|X-Purpose-Code|X-Tenant-Reference)' \
  services packages | head -n 1800

echo '=== OUTPUT / K6 / LEAK AUDIT ==='
git grep -n -E \
  '(shared-iterations|maxDuration|summaryTrendStats|thresholds|Trend|Counter|handleSummary|JSON\.stringify|__ENV|http\.(post|batch)|iterationInTest|baseUrl|bearer|token|endpoint|candidate_sha|prepared_state|preparation_protocol|resource_evidence)' \
  "$target" -- tests/performance docs README.md package.json .github 2>/dev/null || true

echo '=== K6 PINNING OR DOCUMENTATION ==='
git grep -n -i -E '(k6 run|grafana/k6|xk6|k6 version|ORGMETRA_PERFORMANCE_PROFILE)' \
  "$target" -- README.md docs tests package.json .github 2>/dev/null || true

Length of output: 203490


🏁 Script executed:

#!/bin/bash
set -euo pipefail
target='2dff0b072417332683a1d814b5fac1c80b07c9cc'

for file in \
  tests/performance/employment_separation_buyer_path.js \
  tests/performance/employment_separation_run_contract.mjs \
  tests/performance/employment_separation_response_contract.mjs \
  tests/performance/employment_separation_fixture_contract.mjs \
  tests/performance/employment_separation_run_contract.test.mjs \
  tests/performance/employment_separation_response_contract.test.mjs
do
  echo "=== $file ==="
  git show "$target:$file" | nl -ba
done

echo '=== EXACT DIFF SINCE 2ef ==='
git diff --unified=40 2ef2f39449bcaa0ce8a077f43649af4a70a8e0e3 "$target" -- tests/performance

echo '=== PRODUCTION SEPARATION HEADER PARSING AND HANDLER ==='
sed -n '140,385p' services/people-api/src/orgmetra_people_api/separation_http.py | nl -ba -v140

echo '=== K6 CONFIG/DEPENDENCY REFERENCES ==='
fd -HI -t f | rg '(^|/)(Dockerfile[^/]*|docker-compose[^/]*|package\.json|.*\.ya?ml|.*\.md)$' | while IFS= read -r file; do
  rg -n -i -C2 '(grafana/k6|xk6|\bk6\b)' "$file" && echo "--- $file"
done || true

Length of output: 50096


@seonghobae Review found one false-GREEN risk in exact head 2dff0b072417332683a1d814b5fac1c80b07c9cc.

  • P1 — Reject profile results when the run does not complete every configured iteration. tests/performance/employment_separation_buyer_path.js Lines 68-99 use shared-iterations with maxDuration: "30m". If k6 reaches this limit, it can stop the selected scenario before it processes all fixture entries. The checks and employment_separation_unexpected_response thresholds validate only executed requests. They do not prove that the run completed 1,000 records for first_commit, replay, or rejection, or 100 pairs for contention. Therefore, first_commit can pass p(95)<=20 on a truncated sample. Add an exact per-profile completed-iteration counter and threshold. Alternatively, make handleSummary() reject the artifact when the selected profile completed count differs from its configured fixture count. For contention, count completed pairs, not HTTP requests.

The new profile isolation is correct. The options.scenarios object contains only the selected profile. The explicit summaryTrendStats setting includes p(50), p(95), p(99), and max.

The response contract matches the published People boundary. Success requires HTTP 200, the requested Employment identity, a valid separated-version UUID, a valid UTC recorded_at, and the required replayed value. Conflict requires HTTP 409 and error: "separation_conflict".

The contention check requires exactly one governed non-replay success and one governed conflict for each pair. The fixture requires pair commands to differ only by idempotency key.

The fixture contract requires right-cleared, non-synthetic data, exact candidate-SHA binding, prepared-state references, resource evidence, required profile cardinality, and Employment isolation across profiles. The result envelope does not add the base URL or bearer token. This source review does not claim measured acceptance or released status.

You are interacting with an AI system.

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

P1 completion finding repaired at exact head abc0fadc8641b5be34010885c87b9bd6d152e63c: selected-profile acceptance now fails unless the built-in iterations counter reaches every required record/pair, and the summary exposes expected/completed counts plus sample_complete. Please review this exact head for any remaining false-GREEN path.

@coderabbitai

coderabbitai Bot commented Sep 13, 2026

Copy link
Copy Markdown

Tip

For best results, initiate chat on the files or code changes.

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

target='abc0fadc8641b5be34010885c87b9bd6d152e63c'
base='d9cc516d54b4642f59fe126c331a19945fdf75f1'
previous='2dff0b072417332683a1d814b5fac1c80b07c9cc'

echo '=== EXACT HEAD ==='
printf 'checked_out='
git rev-parse HEAD
printf 'target_type='
git cat-file -t "$target"
git merge-base --is-ancestor "$base" "$target" && echo 'base_is_ancestor=yes'
git show -s --format='target=%H%nparents=%P%nsubject=%s' "$target"
git diff --check "$base" "$target"

echo '=== CHANGES SINCE PREVIOUS REVIEW ==='
git diff --name-status "$previous" "$target"
git diff --find-renames --unified=100 "$previous" "$target" -- tests/performance docs README.md package.json

echo '=== PERFORMANCE SOURCE OUTLINES ==='
for file in \
  tests/performance/employment_separation_buyer_path.js \
  tests/performance/employment_separation_run_contract.mjs \
  tests/performance/employment_separation_response_contract.mjs \
  tests/performance/employment_separation_fixture_contract.mjs \
  tests/performance/employment_separation_fixture_contract.test.mjs \
  tests/performance/employment_separation_run_contract.test.mjs \
  tests/performance/employment_separation_response_contract.test.mjs
do
  if git cat-file -e "$target:$file" 2>/dev/null; then
    echo "--- $file"
    git show "$target:$file" > "/tmp/$(basename "$file")"
    ast-grep outline "/tmp/$(basename "$file")" --items all 2>/dev/null || true
  fi
done

echo '=== WORKLOAD ==='
git show "$target:tests/performance/employment_separation_buyer_path.js" | nl -ba

echo '=== RUN CONTRACT ==='
git show "$target:tests/performance/employment_separation_run_contract.mjs" | nl -ba

echo '=== RESPONSE CONTRACT ==='
git show "$target:tests/performance/employment_separation_response_contract.mjs" | nl -ba

echo '=== FIXTURE CONTRACT ==='
git show "$target:tests/performance/employment_separation_fixture_contract.mjs" | nl -ba

echo '=== CONTRACT TESTS ==='
for file in \
  tests/performance/employment_separation_fixture_contract.test.mjs \
  tests/performance/employment_separation_run_contract.test.mjs \
  tests/performance/employment_separation_response_contract.test.mjs
do
  if git cat-file -e "$target:$file" 2>/dev/null; then
    echo "--- $file"
    git show "$target:$file" | nl -ba
  fi
done

echo '=== K6 / EVIDENCE / LEAK AUDIT ==='
git grep -n -E \
  '(shared-iterations|maxDuration|iterations|summaryTrendStats|thresholds|Trend|Counter|handleSummary|JSON\.stringify|__ENV|http\.(post|batch)|iterationInTest|baseUrl|bearer|token|endpoint|candidate_sha|prepared_state|preparation_protocol|resource_evidence|sample_complete)' \
  "$target" -- tests/performance docs README.md package.json .github 2>/dev/null || true

echo '=== PRODUCTION HTTP BOUNDARY ==='
rg -n -C 10 --glob '*.py' \
  '(/v1/employment-separations|separation_conflict|replayed|recorded_at|employment_id|Idempotency-Key|X-Actor-Reference|X-Purpose-Code|X-Tenant-Reference)' \
  services packages | head -n 1800

Length of output: 203415


🏁 Script executed:

#!/bin/bash
set -euo pipefail

target='abc0fadc8641b5be34010885c87b9bd6d152e63c'

echo '=== HEAD AND DELTA ==='
git show -s --format='target=%H%nparents=%P%nsubject=%s' "$target"
git diff --unified=60 2dff0b072417332683a1d814b5fac1c80b07c9cc "$target" -- \
  tests/performance/employment_separation_buyer_path.js \
  tests/performance/employment_separation_run_contract.mjs \
  tests/performance/employment_separation_run_contract.test.mjs

echo '=== WORKLOAD ==='
git show "$target:tests/performance/employment_separation_buyer_path.js" | nl -ba

echo '=== RUN CONTRACT ==='
git show "$target:tests/performance/employment_separation_run_contract.mjs" | nl -ba

echo '=== RUN-CONTRACT TESTS ==='
git show "$target:tests/performance/employment_separation_run_contract.test.mjs" | nl -ba

echo '=== FIXTURE CONTRACT: VALIDATION AND RESULT ENVELOPE HELPERS ==='
git show "$target:tests/performance/employment_separation_fixture_contract.mjs" | nl -ba | sed -n '1,360p'

echo '=== RESPONSE CONTRACT ==='
git show "$target:tests/performance/employment_separation_response_contract.mjs" | nl -ba

echo '=== OUTPUT SINKS AND SENSITIVE ENVIRONMENT VALUES ==='
git grep -n -E '(handleSummary|JSON\.stringify|console\.|ORGMETRA_PERFORMANCE_|baseUrl|base_url|bearer|token|endpoint|url)' \
  "$target" -- tests/performance

echo '=== PROFILE COUNTS, OPTIONS, AND THRESHOLDS ==='
git grep -n -E '(iterations|vus|maxDuration|executor|scenarios|thresholds|sample_complete|expected_iterations|completed_iterations|summaryTrendStats)' \
  "$target" -- tests/performance

Length of output: 50500


@seonghobae Review completed for exact head abc0fadc8641b5be34010885c87b9bd6d152e63c.

I found no remaining false-GREEN path in the reviewed harness.

The repair closes the previous P1 path. Each invocation configures only one profile. The built-in iterations threshold requires count>=expectedIterations for that profile. Therefore, a maxDuration-truncated run cannot pass with a partial sample.

The result envelope also reports expected_iterations, completed_iterations, and sample_complete. For a normal shared-iterations run, sample_complete is true only when the completed count equals the configured record or pair count.

The first-commit p95 threshold remains limited to employment_separation_first_commit_duration_ms. Replay, rejection, and contention remain separately reported. The contention iteration count correctly represents pairs, not individual HTTP requests.

The response classification and fixture controls remain consistent with the prior review. The result envelope does not explicitly emit the endpoint or bearer token.

This source review does not claim measured acceptance, protected status, released status, or runtime k6 compatibility. k6 execution with the required deployment, credentials, fixture state, and resource evidence was not available.


If you found this review helpful, would you consider giving us a shout-out on X?

Thank you for using CodeRabbit!

You are interacting with an AI system.

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

Please review exact head 87b4039c50448689edc70cc37a331022432febff, focusing on false-GREEN paths in the new post-run acceptance boundary: deployed-revision binding, exact result-artifact SHA-256 binding, first-commit p95/sample completeness, resource/pool evidence, and zero residual HTTP/DB/transaction/socket/background/pool state. This is acceptance-mechanics review only; no latency or runtime GREEN is claimed.

@coderabbitai

coderabbitai Bot commented Sep 13, 2026

Copy link
Copy Markdown

Tip

For best results, initiate chat on the files or code changes.

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

target='87b4039c50448689edc70cc37a331022432febff'
previous='abc0fadc8641b5be34010885c87b9bd6d152e63c'
base='d9cc516d54b4642f59fe126c331a19945fdf75f1'

echo '=== EXACT HEAD ==='
printf 'checked_out='; git rev-parse HEAD
printf 'target_type='; git cat-file -t "$target"
git merge-base --is-ancestor "$base" "$target" && echo 'base_is_ancestor=yes'
git show -s --format='target=%H%nparents=%P%nsubject=%s' "$target"
git diff --check "$base" "$target"

echo '=== DELTA SINCE PRIOR REVIEW ==='
git diff --name-status "$previous" "$target"
git diff --find-renames --unified=100 "$previous" "$target" -- tests/performance docs README.md package.json

echo '=== PERFORMANCE FILE MAP AT TARGET ==='
git ls-tree -r --name-only "$target" | rg '^tests/performance/' | sort

echo '=== SOURCE OUTLINES ==='
git ls-tree -r --name-only "$target" | rg '^tests/performance/.*\.(js|mjs|cjs)$' | while IFS= read -r file; do
  echo "--- $file"
  git show "$target:$file" > "/tmp/$(basename "$file")"
  ast-grep outline "/tmp/$(basename "$file")" --items all 2>/dev/null || true
done

echo '=== POST-RUN / ACCEPTANCE / ARTIFACT / RESIDUAL REFERENCES ==='
git grep -n -E -i \
  '(post.run|acceptance|artifact|sha.?256|deployed|revision|residual|resource|pool|transaction|socket|background|sample_complete|expected_iterations|completed_iterations|p\(95\)|first_commit)' \
  "$target" -- tests/performance docs README.md package.json 2>/dev/null || true

echo '=== OUTPUT AND ENVIRONMENT AUDIT ==='
git grep -n -E \
  '(handleSummary|JSON\.stringify|console\.|__ENV|open\(|baseUrl|base_url|bearer|token|endpoint|url|sha256)' \
  "$target" -- tests/performance 2>/dev/null || true

Length of output: 159030


@seonghobae Review found one false-GREEN path in exact head 87b4039c50448689edc70cc37a331022432febff.

  • P1 — Enforce the required profile cardinality in the post-run acceptance contract. tests/performance/employment_separation_acceptance_contract.mjs Lines 95-105 require only a positive expected_iterations value and equality among expected_iterations, completed_iterations, and iterations.values.count. The contract does not require at least 1,000 iterations for first_commit, replay, and rejection, or 100 iterations for contention. It also does not validate minimum_non_contending_records or minimum_contention_pairs from the result artifact.

    As a result, a supplied first_commit artifact with one completed iteration, a p(95) at or below 20 ms, and matching runtime-evidence SHA-256 can pass validateEmploymentSeparationAcceptance(). The artifact hash correctly binds those bytes, but it does not establish that the bytes represent the required buyer-path sample.

    Add profile-specific cardinality checks to validateResult(). Require expected_iterations >= 1000 for first_commit, replay, and rejection. Require expected_iterations >= 100 for contention. Validate the declared minimum fields against these fixed requirements, or remove them from the artifact if they are not acceptance inputs. Add rejection tests for an otherwise valid under-sized first_commit artifact and an under-sized contention artifact.

The reviewed contract correctly rejects a mismatched observed service SHA, a mismatched result SHA-256, an incomplete sample, a first-commit p95 above 20 ms, missing resource and pool measurements, and each nonzero residual-state field.

This is an acceptance-mechanics source review only. It does not claim latency acceptance, runtime execution, protected status, or release status.

You are interacting with an AI system.

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

Please review exact head 301053f0f504484dfa65ee36058933997df26143. The previous P1 cardinality false-GREEN is now test-first repaired. Focus on any remaining false-GREEN/false-RED path in: fixed 1,000/100 sample floors, exact result-byte SHA-256 binding, independently observed deployed service SHA, first-commit p95<=20 only, profile separation, host/pool evidence, and zero residual HTTP/DB/transaction/socket/background/pool state. Local acceptance-contract scope is 21/21 with 100% line/branch/function coverage; no actual buyer-latency GREEN is claimed.

@coderabbitai

coderabbitai Bot commented Sep 13, 2026

Copy link
Copy Markdown

Tip

For best results, initiate chat on the files or code changes.

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

target='301053f0f504484dfa65ee36058933997df26143'
previous='87b4039c50448689edc70cc37a331022432febff'
base='d9cc516d54b4642f59fe126c331a19945fdf75f1'

echo '=== EXACT HEAD ==='
printf 'checked_out='; git rev-parse HEAD
printf 'target_type='; git cat-file -t "$target"
git merge-base --is-ancestor "$base" "$target" && echo 'base_is_ancestor=yes'
git show -s --format='target=%H%nparents=%P%nsubject=%s' "$target"
git diff --check "$base" "$target"

echo '=== DELTA SINCE PRIOR REVIEW ==='
git diff --name-status "$previous" "$target"
git diff --find-renames --unified=100 "$previous" "$target" -- tests/performance docs README.md package.json

echo '=== PERFORMANCE SOURCE MAP ==='
git ls-tree -r --name-only "$target" | rg '^tests/performance/' | sort

echo '=== SOURCE OUTLINES ==='
for file in \
  tests/performance/employment_separation_buyer_path.js \
  tests/performance/employment_separation_fixture_contract.mjs \
  tests/performance/employment_separation_run_contract.mjs \
  tests/performance/employment_separation_response_contract.mjs \
  tests/performance/employment_separation_acceptance_contract.mjs \
  tests/performance/employment_separation_acceptance_contract_cli.mjs \
  tests/performance/employment_separation_acceptance_contract.test.mjs \
  tests/performance/employment_separation_acceptance_contract_cardinality.test.mjs \
  tests/performance/employment_separation_acceptance_contract_edges.test.mjs
do
  if git cat-file -e "$target:$file" 2>/dev/null; then
    echo "--- $file"
    git show "$target:$file" > "/tmp/$(basename "$file")"
    ast-grep outline "/tmp/$(basename "$file")" --items all 2>/dev/null || true
  fi
done

echo '=== ACCEPTANCE CONTRACT AND TESTS ==='
for file in \
  tests/performance/employment_separation_acceptance_contract.mjs \
  tests/performance/employment_separation_acceptance_contract_cli.mjs \
  tests/performance/employment_separation_acceptance_contract.test.mjs \
  tests/performance/employment_separation_acceptance_contract_cardinality.test.mjs \
  tests/performance/employment_separation_acceptance_contract_edges.test.mjs
do
  if git cat-file -e "$target:$file" 2>/dev/null; then
    echo "--- $file"
    git show "$target:$file" | nl -ba
  fi
done

echo '=== WORKLOAD AND UPSTREAM CONTRACTS ==='
for file in \
  tests/performance/employment_separation_buyer_path.js \
  tests/performance/employment_separation_fixture_contract.mjs \
  tests/performance/employment_separation_run_contract.mjs \
  tests/performance/employment_separation_response_contract.mjs
do
  echo "--- $file"
  git show "$target:$file" | nl -ba
done

echo '=== ALL ACCEPTANCE CALL SITES AND OUTPUT SINKS ==='
git grep -n -E \
  '(validateEmploymentSeparationAcceptance|acceptance_contract|acceptance|sha256|observed_deployed|deployed.*sha|residual|pool|host_cpu|host_rss|handleSummary|JSON\.stringify|console\.|__ENV|baseUrl|bearer|token|endpoint)' \
  "$target" -- tests/performance docs README.md package.json 2>/dev/null || true

echo '=== PRODUCTION SEPARATION HTTP BOUNDARY ==='
rg -n -C 8 --glob '*.py' \
  '(/v1/employment-separations|separation_conflict|replayed|recorded_at|employment_id|Idempotency-Key|X-Actor-Reference|X-Purpose-Code|X-Tenant-Reference)' \
  services packages | head -n 1400

Length of output: 203737


🏁 Script executed:

#!/bin/bash
set -euo pipefail

target='301053f0f504484dfa65ee36058933997df26143'
log='/tmp/coderabbit-shell-logs/shell-output-86BN0G'

echo '=== EXACT CONTRACT FROM PREVIOUS LOG ==='
awk '/^--- tests\/performance\/employment_separation_acceptance_contract\.mjs$/{p=1;next} p && /^--- tests\/performance\//{exit} p{print}' "$log"

echo '=== EXACT CLI FROM PREVIOUS LOG ==='
awk '/^--- tests\/performance\/employment_separation_acceptance_check\.mjs$/{p=1;next} p && /^--- tests\/performance\//{exit} p{print}' "$log"

echo '=== CARDINALITY TEST FROM PREVIOUS LOG ==='
awk '/^--- tests\/performance\/employment_separation_acceptance_cardinality\.test\.mjs$/{p=1;next} p && /^--- tests\/performance\//{exit} p{print}' "$log"

echo '=== EDGE TEST: PROFILE/FLOOR AND PROVENANCE CASES ==='
awk '/^--- tests\/performance\/employment_separation_acceptance_edge\.test\.mjs$/{p=1;next} p && /^--- tests\/performance\//{exit} p{print}' "$log" | sed -n '1,260p'

echo '=== WORKLOAD RESULT SHAPE ==='
git show "$target:tests/performance/employment_separation_buyer_path.js" | nl -ba | sed -n '1,260p'

echo '=== CURRENT ACCEPTANCE FILE NAMES ==='
git ls-tree -r --name-only "$target" -- tests/performance | rg 'acceptance'

echo '=== VALIDATOR IMPORTS AND RUNTIME-EVIDENCE FIELD REFERENCES ==='
git grep -n -E \
  '(observed_service_sha|environment|deployment|observer|completed_at|candidate_sha|selected_profile|minimum_non_contending_records|minimum_contention_pairs|db_connections_max|residual_)' \
  "$target" -- tests/performance

Length of output: 35917


🏁 Script executed:

#!/bin/bash
set -euo pipefail

target='301053f0f504484dfa65ee36058933997df26143'

echo '=== ACCEPTANCE CONTRACT ==='
git show "$target:tests/performance/employment_separation_acceptance_contract.mjs" | nl -ba

echo '=== ACCEPTANCE CLI ==='
git show "$target:tests/performance/employment_separation_acceptance_check.mjs" | nl -ba

echo '=== CARDINALITY REGRESSIONS ==='
git show "$target:tests/performance/employment_separation_acceptance_cardinality.test.mjs" | nl -ba

echo '=== ACCEPTANCE CORE TESTS ==='
git show "$target:tests/performance/employment_separation_acceptance_contract.test.mjs" | nl -ba

echo '=== ACCEPTANCE EDGE TESTS ==='
git show "$target:tests/performance/employment_separation_acceptance_edge.test.mjs" | nl -ba

echo '=== RESULT AND RUNTIME SCHEMA/PROVENANCE DOCUMENTATION ==='
git grep -n -C 5 -E \
  '(runtime_evidence|observed_service_sha|observer_reference|performance_result_sha256|residual_http_tasks|acceptance_check)' \
  "$target" -- README.md docs tests/performance package.json 2>/dev/null || true

echo '=== RESULT FIELDS NOT CONSUMED BY THE ACCEPTANCE VALIDATOR ==='
python3 - <<'PY'
import subprocess, re
target='301053f0f504484dfa65ee36058933997df26143'
workload=subprocess.check_output(['git','show',f'{target}:tests/performance/employment_separation_buyer_path.js'], text=True)
contract=subprocess.check_output(['git','show',f'{target}:tests/performance/employment_separation_acceptance_contract.mjs'], text=True)
# Report payload literal keys and their textual occurrence in validation source.
keys=re.findall(r'^\s{4}([a-z][a-z0-9_]*):', workload, re.M)
for key in keys:
    print(f'{key}: contract_occurrences={len(re.findall(r"\\b"+re.escape(key)+r"\\b", contract))}')
PY

Length of output: 70715


@seonghobae Review found one remaining false-GREEN path in exact head 301053f0f504484dfa65ee36058933997df26143.

  • P1 — Require fixture and prepared-state provenance in the acceptance contract. tests/performance/employment_separation_acceptance_contract.mjs validates only result.resource_evidence_reference at Line 114. It does not require dataset_id, clearance_reference, preparation_protocol_reference, prepared_state_evidence_reference, or profile_preconditions.

    Therefore, the acceptance CLI can accept an artifact that has the required cardinality, fast first-commit p95, matching result-byte SHA-256, matching observed service SHA, host/pool values, and zero residual counters, but no evidence that the workload used right-cleared, non-synthetic data or that replay and rejection had the declared prepared state.

    tests/performance/employment_separation_acceptance_edge.test.mjs Lines 14-38 demonstrates the gap. Its accepted result fixture omits these fields.

    In validateResult(), require each provenance field with the same opaque-reference and profile-precondition rules that the workload fixture contract uses. Add rejection cases for each missing or malformed field. This makes the post-run acceptance boundary require the fixture conditions that the workload result is intended to carry.

The cardinality repair closes the prior P1 path. The acceptance contract now independently requires at least 1,000 iterations for first_commit, replay, and rejection, and at least 100 iterations for contention. It also requires complete samples and matching k6 iteration counts.

The contract binds the supplied result bytes by SHA-256. It requires observed_service_sha to equal the candidate SHA. It applies p(95) <= 20 only to first_commit. It validates required host/pool fields and zero values for all declared residual-state counters.

This source review does not claim buyer-latency acceptance, runtime execution, protected status, or release status.

You are interacting with an AI system.

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

Please re-review exact head 964de4e20ec67319b46a095fb82f6cf80e86f9f3. Your P1 about missing dataset_id / clearance / preparation / prepared-state / profile-precondition validation was reproduced as a dedicated regression (999a825...) and repaired in 5b13e3f...; cardinality/edge fixtures were then currentized so they preserve the required provenance. Please run the acceptance test scope if available and look specifically for any remaining false-GREEN around fixture provenance or post-run evidence binding. No measured latency GREEN is claimed.

@coderabbitai

coderabbitai Bot commented Sep 13, 2026

Copy link
Copy Markdown

Tip

For best results, initiate chat on the files or code changes.

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

target='964de4e20ec67319b46a095fb82f6cf80e86f9f3'
previous='301053f0f504484dfa65ee36058933997df26143'
base='d9cc516d54b4642f59fe126c331a19945fdf75f1'

echo '=== EXACT HEAD ==='
printf 'checked_out='; git rev-parse HEAD
printf 'target_type='; git cat-file -t "$target"
git merge-base --is-ancestor "$base" "$target" && echo 'base_is_ancestor=yes'
git show -s --format='target=%H%nparents=%P%nsubject=%s' "$target"
git diff --check "$base" "$target"

echo '=== DELTA SINCE PRIOR REVIEW ==='
git diff --name-status "$previous" "$target"
git diff --find-renames --unified=100 "$previous" "$target" -- tests/performance docs README.md package.json

echo '=== PERFORMANCE FILE MAP ==='
git ls-tree -r --name-only "$target" -- tests/performance | sort

echo '=== SOURCE OUTLINES ==='
for file in \
  tests/performance/employment_separation_acceptance_contract.mjs \
  tests/performance/employment_separation_acceptance_check.mjs \
  tests/performance/employment_separation_fixture_contract.mjs \
  tests/performance/employment_separation_buyer_path.js \
  tests/performance/employment_separation_acceptance_contract.test.mjs \
  tests/performance/employment_separation_acceptance_cardinality.test.mjs \
  tests/performance/employment_separation_acceptance_edge.test.mjs
do
  if git cat-file -e "$target:$file" 2>/dev/null; then
    echo "--- $file"
    git show "$target:$file" > "/tmp/$(basename "$file")"
    ast-grep outline "/tmp/$(basename "$file")" --items all 2>/dev/null || true
  fi
done

echo '=== ACCEPTANCE CONTRACT, CLI, AND TESTS ==='
for file in \
  tests/performance/employment_separation_acceptance_contract.mjs \
  tests/performance/employment_separation_acceptance_check.mjs \
  tests/performance/employment_separation_acceptance_contract.test.mjs \
  tests/performance/employment_separation_acceptance_cardinality.test.mjs \
  tests/performance/employment_separation_acceptance_edge.test.mjs
do
  if git cat-file -e "$target:$file" 2>/dev/null; then
    echo "--- $file"
    git show "$target:$file" | nl -ba
  fi
done

echo '=== WORKLOAD AND FIXTURE CONTRACT ==='
for file in \
  tests/performance/employment_separation_buyer_path.js \
  tests/performance/employment_separation_fixture_contract.mjs \
  tests/performance/employment_separation_run_contract.mjs \
  tests/performance/employment_separation_response_contract.mjs
do
  if git cat-file -e "$target:$file" 2>/dev/null; then
    echo "--- $file"
    git show "$target:$file" | nl -ba
  fi
done

echo '=== ACCEPTANCE / PROVENANCE / BINDING REFERENCES ==='
git grep -n -E \
  '(validateEmploymentSeparationAcceptance|validateResult|dataset_id|clearance_reference|preparation_protocol_reference|prepared_state_evidence_reference|profile_preconditions|resource_evidence_reference|performance_result_sha256|observed_service_sha|candidate_sha|JSON\.stringify|readFile|sha256|residual_)' \
  "$target" -- tests/performance docs README.md package.json 2>/dev/null || true

echo '=== ACCEPTANCE TEST COMMAND REFERENCES ==='
git grep -n -E '(node --test|acceptance_.*test|coverage|acceptance_check)' \
  "$target" -- package.json README.md docs tests 2>/dev/null || true

Length of output: 166621


@seonghobae Review found one remaining false-GREEN path in exact head 964de4e20ec67319b46a095fb82f6cf80e86f9f3.

  • P1 — Bind the acceptance result to the exact validated fixture artifact. tests/performance/employment_separation_acceptance_contract.mjs Lines 112-123 validates only the syntax and fixed vocabulary of result provenance fields. The acceptance contract does not receive the fixture bytes or a fixture SHA-256 digest. It also does not require right_cleared: true or synthetic: false in the result artifact.

    A manually constructed result can therefore contain valid opaque values such as dataset:..., data_clearance:..., and evidence:.... It can also satisfy the result-byte SHA-256, observed-service-SHA, cardinality, p95, resource, and residual checks. The acceptance CLI then returns acceptance without proving that k6 used the exact fixture whose validator enforced right-cleared, non-synthetic input and profile isolation.

    Add a SHA-256 digest of the exact fixture bytes to the k6 result artifact. Require independently supplied runtime evidence to contain the same fixture digest. The acceptance contract should recompute the digest from the supplied fixture artifact, or validate a separately supplied immutable fixture artifact against that digest. Also carry and validate right_cleared: true and synthetic: false, or prove these properties through the immutable fixture artifact.

The current repair closes the previous missing-provenance path. The acceptance contract now requires dataset_id, clearance_reference, preparation_protocol_reference, prepared_state_evidence_reference, resource_evidence_reference, and the exact profile-precondition map. The dedicated provenance regressions cover missing and malformed references and invalid profile-precondition entries.

The result-byte SHA-256 binding remains exact for the supplied result text. The observed deployed SHA must match the candidate SHA. The runtime resource reference must match the result resource reference.

I did not run the acceptance test scope. This sandbox permits static inspection only and does not permit repository-code execution.

This review does not claim measured buyer latency, runtime acceptance, protected status, or release status.

You are interacting with an AI system.

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

Please review exact head e6e2511d09f56facf494eb8ee2969b3de61eac40. Focus on false-GREEN paths after the new latency-sample cardinality gate: whether every percentile sample is cardinality-bound to executed buyer requests, whether contention correctly requires two latency samples per completed pair, whether the post-run validator can still accept a fast subset, and whether the new Counter/threshold usage is valid k6 behavior. Also re-check fixture provenance and runtime evidence binding. Do not infer measured p95, protected, or release status.

@coderabbitai

coderabbitai Bot commented Sep 13, 2026

Copy link
Copy Markdown

Tip

For best results, initiate chat on the files or code changes.

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

target='e6e2511d09f56facf494eb8ee2969b3de61eac40'
previous='964de4e20ec67319b46a095fb82f6cf80e86f9f3'
base='d9cc516d54b4642f59fe126c331a19945fdf75f1'

echo '=== EXACT HEAD ==='
printf 'checked_out='; git rev-parse HEAD
printf 'target_type='; git cat-file -t "$target"
git merge-base --is-ancestor "$base" "$target" && echo 'base_is_ancestor=yes'
git show -s --format='target=%H%nparents=%P%nsubject=%s' "$target"
git diff --check "$base" "$target"

echo '=== DELTA SINCE PRIOR REVIEW ==='
git diff --name-status "$previous" "$target"
git diff --find-renames --unified=100 "$previous" "$target" -- tests/performance docs README.md package.json

echo '=== PERFORMANCE FILE MAP ==='
git ls-tree -r --name-only "$target" -- tests/performance | sort

echo '=== OUTLINES ==='
for file in \
  tests/performance/employment_separation_buyer_path.js \
  tests/performance/employment_separation_run_contract.mjs \
  tests/performance/employment_separation_acceptance_contract.mjs \
  tests/performance/employment_separation_acceptance_check.mjs \
  tests/performance/employment_separation_fixture_contract.mjs \
  tests/performance/employment_separation_response_contract.mjs \
  tests/performance/employment_separation_run_contract.test.mjs \
  tests/performance/employment_separation_acceptance_contract.test.mjs \
  tests/performance/employment_separation_acceptance_latency_cardinality.test.mjs \
  tests/performance/employment_separation_fixture_contract.test.mjs
do
  if git cat-file -e "$target:$file" 2>/dev/null; then
    echo "--- $file"
    git show "$target:$file" > "/tmp/$(basename "$file")"
    ast-grep outline "/tmp/$(basename "$file")" --items all 2>/dev/null || true
  fi
done

echo '=== WORKLOAD ==='
git show "$target:tests/performance/employment_separation_buyer_path.js" | nl -ba

echo '=== RUN CONTRACT ==='
git show "$target:tests/performance/employment_separation_run_contract.mjs" | nl -ba

echo '=== ACCEPTANCE CONTRACT ==='
git show "$target:tests/performance/employment_separation_acceptance_contract.mjs" | nl -ba

echo '=== FIXTURE CONTRACT ==='
git show "$target:tests/performance/employment_separation_fixture_contract.mjs" | nl -ba

echo '=== RESPONSE CONTRACT ==='
git show "$target:tests/performance/employment_separation_response_contract.mjs" | nl -ba

echo '=== FOCUSED TESTS ==='
git ls-tree -r --name-only "$target" -- tests/performance | rg '(run_contract|acceptance.*(cardinality|latency|contract|edge)|fixture_contract|response_contract).*test\.mjs$' | while IFS= read -r file; do
  echo "--- $file"
  git show "$target:$file" | nl -ba
done

echo '=== METRIC / THRESHOLD / OUTPUT AUDIT ==='
git grep -n -E \
  '(employment_separation_latency_samples|duration_ms|new (Counter|Trend)|\.add\(|thresholds|sample_complete|expected_iterations|completed_iterations|iterations\.values\.count|handleSummary|JSON\.stringify|__ENV|baseUrl|bearer|token|endpoint|fixture.*sha|sha256)' \
  "$target" -- tests/performance docs README.md package.json 2>/dev/null || true

echo '=== ACCEPTANCE PROVENANCE / RUNTIME EVIDENCE FIELD AUDIT ==='
git grep -n -E \
  '(dataset_id|clearance_reference|preparation_protocol_reference|prepared_state_evidence_reference|profile_preconditions|resource_evidence_reference|observed_service_sha|performance_result_sha256|fixture_sha|right_cleared|synthetic|host_cpu|host_rss|pool|residual_)' \
  "$target" -- tests/performance docs README.md package.json 2>/dev/null || true

echo '=== K6 PINNING OR DOCUMENTED VERSION ==='
git grep -n -i -E '(grafana/k6|xk6|k6 version|k6 run)' \
  "$target" -- README.md docs tests package.json .github 2>/dev/null || true

Length of output: 223913


🤖 web_search executed:

site:grafana.com/docs/k6 "summary" Trend "count" "handleSummary" Counter threshold count>=

Length of output: 11255


🤖 web_search executed:

site:grafana.com/docs/k6 summaryTrendStats "count" valid options

Length of output: 8339


@seonghobae Review found one remaining false-GREEN path in exact head e6e2511d09f56facf494eb8ee2969b3de61eac40.

  • P1 — Bind the selected Trend sample count to the required request count in post-run acceptance. tests/performance/employment_separation_acceptance_contract.mjs Lines 147-156 requires employment_separation_latency_samples.values.count to equal the required count. However, it does not require that the selected latency Trend contains that same number of samples.

    The workload writes the Trend sample immediately before the Counter increment. This is correct for normal execution. It writes one pair for each ordinary request. It writes two pairs for each contention pair. The k6 threshold is also valid: Counter thresholds use the count operand.

    However, the post-run validator accepts supplied summary data. It can accept a result where employment_separation_latency_samples.values.count is 1000 or 200, but the selected Trend percentile values came from fewer samples. The exact result-byte SHA-256 binds that supplied result text. It does not establish the selected Trend cardinality.

    Add the selected Trend sample count to the emitted evidence and require it to equal:

    • expected_iterations for first_commit, replay, and rejection.
    • expected_iterations * 2 for contention.

    Use a k6-supported Trend count summary field for the pinned k6 version. If the summary does not expose a Trend count, emit a separate, independently derived per-Trend Counter and validate that Counter. The validator must reject a complete iteration Counter combined with an under-sized selected Trend distribution. Add regression cases for both ordinary and contention profiles.

The new latency Counter closes the direct runtime gap. Every ordinary observe() call adds one latency sample. The contention loop adds two samples for each completed pair. The threshold requires count>=expected, and post-run acceptance requires exact equality. The first-commit p95 threshold remains isolated to employment_separation_first_commit_duration_ms.

Fixture provenance checks remain present. The fixture validator requires right_cleared: true, synthetic: false, exact profile preconditions, prepared-state references, and Employment isolation. The result carries the required provenance references. Runtime evidence still binds the exact result bytes, candidate SHA, independently observed service SHA, resource reference, host/pool observations, and zero residual-state counters.

This static review does not claim measured p95 acceptance, k6 runtime execution, protected status, or release status.

You are interacting with an AI system.

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

Please review exact current head 5807ce42aa88805c66287bd81d9e241f149d6ac8. Re-check false-GREEN risk after the stronger Trend-cardinality repair: summaryTrendStats now exposes count; the post-run validator requires the selected Trend's own count to equal the exact expected request cardinality, in addition to iteration and parallel Counter checks. Verify ordinary profiles require N Trend samples, contention requires 2N, and that k6 supports the configured Trend count summary value. Also re-check provenance/runtime binding. Do not infer measured p95, protected, or release status.

@coderabbitai

coderabbitai Bot commented Sep 13, 2026

Copy link
Copy Markdown

Tip

For best results, initiate chat on the files or code changes.

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

target='5807ce42aa88805c66287bd81d9e241f149d6ac8'
previous='e6e2511d09f56facf494eb8ee2969b3de61eac40'
base='d9cc516d54b4642f59fe126c331a19945fdf75f1'

echo '=== EXACT HEAD ==='
printf 'checked_out='; git rev-parse HEAD
printf 'target_type='; git cat-file -t "$target"
git merge-base --is-ancestor "$base" "$target" && echo 'base_is_ancestor=yes'
git show -s --format='target=%H%nparents=%P%nsubject=%s' "$target"
git diff --check "$base" "$target"

echo '=== DELTA SINCE PRIOR REVIEW ==='
git diff --name-status "$previous" "$target"
git diff --find-renames --unified=100 "$previous" "$target" -- tests/performance docs README.md package.json

echo '=== PERFORMANCE FILE MAP ==='
git ls-tree -r --name-only "$target" -- tests/performance | sort

echo '=== SOURCE OUTLINES ==='
for file in \
  tests/performance/employment_separation_buyer_path.js \
  tests/performance/employment_separation_run_contract.mjs \
  tests/performance/employment_separation_acceptance_contract.mjs \
  tests/performance/employment_separation_acceptance_check.mjs \
  tests/performance/employment_separation_fixture_contract.mjs \
  tests/performance/employment_separation_response_contract.mjs \
  tests/performance/employment_separation_run_contract.test.mjs \
  tests/performance/employment_separation_acceptance_contract.test.mjs \
  tests/performance/employment_separation_acceptance_latency_cardinality.test.mjs \
  tests/performance/employment_separation_fixture_contract.test.mjs
do
  if git cat-file -e "$target:$file" 2>/dev/null; then
    echo "--- $file"
    git show "$target:$file" > "/tmp/$(basename "$file")"
    ast-grep outline "/tmp/$(basename "$file")" --items all 2>/dev/null || true
  fi
done

echo '=== WORKLOAD ==='
git show "$target:tests/performance/employment_separation_buyer_path.js" | nl -ba

echo '=== RUN CONTRACT ==='
git show "$target:tests/performance/employment_separation_run_contract.mjs" | nl -ba

echo '=== ACCEPTANCE CONTRACT ==='
git show "$target:tests/performance/employment_separation_acceptance_contract.mjs" | nl -ba

echo '=== FIXTURE CONTRACT ==='
git show "$target:tests/performance/employment_separation_fixture_contract.mjs" | nl -ba

echo '=== LATENCY CARDINALITY TESTS ==='
git show "$target:tests/performance/employment_separation_acceptance_latency_cardinality.test.mjs" | nl -ba

echo '=== RUN CONTRACT TESTS ==='
git show "$target:tests/performance/employment_separation_run_contract.test.mjs" | nl -ba

echo '=== METRIC, EVIDENCE, AND OUTPUT AUDIT ==='
git grep -n -E \
  '(summaryTrendStats|count|new (Counter|Trend)|employment_separation_latency_samples|duration_ms|thresholds|iterations\.values\.count|handleSummary|JSON\.stringify|fixture.*sha|sha256|dataset_id|clearance_reference|preparation_protocol_reference|prepared_state_evidence_reference|profile_preconditions|observed_service_sha|performance_result_sha256|resource_evidence_reference|host_cpu|host_rss|residual_)' \
  "$target" -- tests/performance docs README.md package.json 2>/dev/null || true

Length of output: 97202


🤖 web_search executed:

site:grafana.com/docs/k6 "summaryTrendStats" "count" Trend summary statistics

Length of output: 8536


🏁 Script executed:

#!/bin/bash
set -euo pipefail

target='5807ce42aa88805c66287bd81d9e241f149d6ac8'

echo '=== ACCEPTANCE CLI ==='
git show "$target:tests/performance/employment_separation_acceptance_check.mjs" | nl -ba

echo '=== ACTUAL LATENCY SAMPLE REGRESSIONS ==='
git show "$target:tests/performance/employment_separation_acceptance_latency_samples.test.mjs" | nl -ba

echo '=== ALL ACCEPTANCE REGRESSIONS ==='
for file in \
  tests/performance/employment_separation_acceptance_cardinality.test.mjs \
  tests/performance/employment_separation_acceptance_contract.test.mjs \
  tests/performance/employment_separation_acceptance_edge.test.mjs \
  tests/performance/employment_separation_acceptance_latency_samples.test.mjs \
  tests/performance/employment_separation_acceptance_provenance.test.mjs
do
  echo "--- $file"
  git show "$target:$file" | nl -ba | sed -n '1,280p'
done

echo '=== FIXTURE-IDENTITY / RIGHT-CLEARANCE / SYNTHETIC FIELD REFERENCES ==='
git grep -n -E \
  '(fixture_sha|fixture.*digest|sha256.*fixture|right_cleared|synthetic|dataset_id|clearance_reference)' \
  "$target" -- tests/performance docs README.md package.json 2>/dev/null || true

echo '=== K6 VERSION DECLARATION ==='
git grep -n -i -E '(grafana/k6|xk6|k6 version|image:.*k6)' \
  "$target" -- .github docs README.md package.json Dockerfile docker-compose.yml 2>/dev/null || true

echo '=== RESULT OUTPUT SINKS ==='
git grep -n -E '(handleSummary|stdout|JSON\.stringify|console\.|baseUrl|bearerToken|ORGMETRA_PERFORMANCE_BEARER_TOKEN|ROUTE)' \
  "$target" -- tests/performance

Length of output: 56664


🤖 web_search executed:

site:grafana.com/docs/k6/latest/using-k6/k6-options/reference/ summaryTrendStats "count" supported values

Length of output: 7533


@seonghobae Review found one remaining false-GREEN path in exact head 5807ce42aa88805c66287bd81d9e241f149d6ac8.

  • P1 — Bind post-run acceptance to the exact validated fixture bytes. tests/performance/employment_separation_acceptance_contract.mjs Lines 105-181 validates namespaced provenance references. It does not receive the fixture artifact or a fixture SHA-256 digest. tests/performance/employment_separation_buyer_path.js Lines 204-209 copies these references into the result artifact. It does not include a fixture digest or the right_cleared and synthetic fixture properties.

    Therefore, the acceptance CLI can accept a manually constructed result with valid-looking provenance references, complete iteration and Trend counts, a matching result SHA-256, and matching runtime evidence. This does not prove that k6 used the exact fixture that validatePerformanceFixture() checked for right_cleared: true, synthetic: false, Employment isolation, and prepared-state requirements.

    Add a SHA-256 digest over the exact fixture bytes to the result artifact. Require the independently collected runtime evidence to contain the same digest. The acceptance check must receive the fixture artifact, recompute its digest, and validate it with validatePerformanceFixture(). Alternatively, the acceptance check can consume a separately stored immutable fixture artifact with the same guarantees. Add rejection tests for a missing digest, a mismatched digest, and a fixture with right_cleared: false or synthetic: true.

The stronger Trend-cardinality repair closes the prior path. The workload adds one Trend sample and Counter sample for each ordinary request. It adds two Trend samples and Counter samples for each contention pair. The acceptance contract requires:

  • N iteration samples, Counter samples, and selected Trend samples for first_commit, replay, and rejection.
  • N completed contention pairs, plus 2N Counter samples and selected Trend samples for contention.

The contract applies p(95) <= 20 only to first_commit.

summaryTrendStats: ["p(50)", "p(95)", "p(99)", "max", "count"] is valid k6 configuration. The k6 options reference lists count as a supported Trend summary statistic. Grafana k6 documentation

The runtime evidence still binds the exact result bytes by SHA-256. It requires the independently observed service SHA to match the candidate SHA. It also requires matching resource references, host and pool observations, and zero values for all declared residual-state counters.

This static review does not claim measured p95 acceptance, k6 runtime execution, protected status, or release status.

You are interacting with an AI system.

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

Please review exact current head 3a78672949032f324fe3bbeae0f427ec73920bd7 only, with emphasis on #393 request-path evidence integrity: pinned k6 v2.2.0 redirect semantics, whether request-scoped redirects: 0 is applied to every first_commit/replay/rejection/contention HTTP request without weakening headers/tags/cardinality/timing, and any remaining false-GREEN where a non-canonical responder/path could be certified. Do not transfer prior-head verdicts; this Draft still has no hosted buyer-performance acceptance.

@coderabbitai

coderabbitai Bot commented Sep 15, 2026

Copy link
Copy Markdown

Tip

For best results, initiate chat on the files or code changes.

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

target='3a78672949032f324fe3bbeae0f427ec73920bd7'
previous='79c5229717459ea6090d22652500484d9c5a0246'

show() {
  local file="$1"
  local range="$2"
  echo "--- $file:$range"
  git show "$target:$file" | nl -ba | sed -n "$range"
}

echo '=== EXACT TARGET IDENTITY ==='
echo "checked_out=$(git rev-parse HEAD)"
git cat-file -t "$target"
git show -s --format='target=%H%nparents=%P%nsubject=%s' "$target"
git diff --check "$previous" "$target" && echo 'diff_check=clean'

echo '=== `#393` DELTA ==='
git diff --name-status "$previous" "$target" -- tests/performance
git diff --unified=160 "$previous" "$target" -- tests/performance

echo '=== WORKLOAD OUTLINE ==='
git show "$target:tests/performance/employment_separation_buyer_path.js" \
  > /tmp/employment_separation_buyer_path.js
ast-grep outline /tmp/employment_separation_buyer_path.js --items all || true

echo '=== WORKLOAD ==='
show tests/performance/employment_separation_buyer_path.js '1,380p'

echo '=== REQUEST/REDIRECT/PARSE CALL-SITE AUDIT ==='
git grep -n -E -C 10 \
  '(http\.(post|batch)\(|redirects|firstCommit|replay|rejection|contention|parseJson\(|hasGovernedSeparation|headers|tags|unexpectedResponse|duration|latency)' \
  "$target" -- tests/performance \
  ':!tests/performance/*test_support.mjs' || true

echo '=== FOCUSED `#393` REGRESSIONS ==='
git ls-tree -r --name-only "$target" -- tests/performance | \
  rg '(redirect|buyer_path|request.*contract|response_contract).*\.test\.(mjs|js)$' | sort | \
  while IFS= read -r file; do
    echo "--- $file"
    git show "$target:$file" | nl -ba
  done

echo '=== K6 PINNING AND RUNNER ==='
for file in \
  tests/performance/run_employment_separation_benchmark.sh \
  tests/performance/employment_separation_k6_runtime_contract.mjs \
  tests/performance/employment_separation_k6_evidence_contract.mjs
do
  if git cat-file -e "$target:$file" 2>/dev/null; then
    show "$file" '1,280p'
  fi
done

echo '=== REQUEST URL CONSTRUCTION / CANONICAL ROUTE REFERENCES ==='
git grep -n -E -C 7 \
  '(/v1/employment-separations|ORGMETRA_PERFORMANCE_TARGET|target.*url|base.*url|new URL|http\.(post|batch)\()' \
  "$target" -- tests/performance ':!tests/performance/*test.mjs' ':!tests/performance/*test_support.mjs' || true

Length of output: 202798


🤖 web_search executed:

Grafana k6 v2.2.0 HTTP request redirects option default behavior Response after redirect documentation source

Length of output: 3279


@seonghobae Review completed for exact head 3a78672949032f324fe3bbeae0f427ec73920bd7 only.

I found no false-GREEN or false-RED issue in the requested #393 request-path scope.

  • Pinned k6 follows redirects by default. A returned Response then describes the final request in the redirect chain. This could otherwise allow a non-canonical responder to satisfy the governed response checks.
  • governedSeparationRequestParams() in tests/performance/employment_separation_request_contract.mjs sets redirects: 0 for each accepted profile.
  • The helper permits only first_commit, replay, rejection, and contention.
  • The helper preserves the supplied request-header object and sets only headers, redirects, and tags.

The workload applies the helper to every governed request.

  • post() uses governedSeparationRequestParams() for ordinary first_commit, replay, and rejection requests.
  • Each entry in http.batch() uses governedSeparationRequestParams() for both contention requests.
  • Every request targets the fixed ROUTE value, /v1/employment-separations, appended to the configured base URL.
  • The helper retains the profile tag. It does not remove the bearer, idempotency, or People request headers.
  • The request policy does not change the response validation path, governed verdict cardinality, or the timing observation path.

The new request-contract regression verifies the following conditions.

  • redirects equals 0.
  • The original headers object is retained.
  • The profile tag is retained.
  • All four profiles use the same no-redirect policy.
  • Unknown profiles and non-object headers fail closed.

The existing response contracts prevent a direct non-canonical responder from passing merely by returning a 200 or 409.

  • The response must satisfy the JSON media-type and no-store/Vary policy checks before body parsing.
  • The strict parser and closed success or conflict envelope checks remain active.
  • Success evidence must match the commanded Employment UUID and replay state.
  • Conflict evidence must use the required conflict code and canonical support-reference format.

The runner still pins k6 2.2.0 and its OCI digest. The runner also rejects caller-provided k6 CLI options. This prevents a caller from enabling a conflicting global redirect configuration through the canonical runner. Per-request redirects: 0 remains authoritative over k6 global maxRedirects.

I used the existing project guidance that local fixture, result, runtime, and digest validation is structural evidence only. This Draft does not provide a measured performance result, commercial acceptance, protected integration, or release status. Commercial acceptance remains fail closed pending ContextualWisdomLab/.github#2162.

I did not run repository tests, k6, Podman, or a hosted workflow.


🧠 Learnings used
Learnt from: seonghobae
URL: https://github.com/ContextualWisdomLab/Orgmetra/pull/317

Timestamp: 2026-09-13T12:46:51.079Z
Learning: For the Employment separation performance harness, local result, runtime, fixture, and digest validation is structural evidence only. A positive commercial acceptance receipt requires the organization-owned authenticated performance-evidence attestation contract tracked by ContextualWisdomLab/.github#2162.

You are interacting with an AI system.

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

Please review exact head 822e591b3b111e5900daecefdd20ea160e50abbe only, especially #394's authenticated-HTTPS-origin fail-closed boundary and its interaction with the existing no-redirect/no-proxy commercial evidence contract. Do not transfer predecessor verdicts.

@coderabbitai

coderabbitai Bot commented Sep 15, 2026

Copy link
Copy Markdown

Tip

For best results, initiate chat on the files or code changes.

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

target='822e591b3b111e5900daecefdd20ea160e50abbe'
previous='3a78672949032f324fe3bbeae0f427ec73920bd7'

show() {
  local file="$1"
  local range="${2:-1,420p}"
  echo "--- $file:$range"
  git show "$target:$file" | nl -ba | sed -n "$range"
}

echo '=== EXACT TARGET IDENTITY ==='
echo "checked_out=$(git rev-parse HEAD)"
git cat-file -t "$target"
git show -s --format='target=%H%nparents=%P%nsubject=%s' "$target"
git diff --check "$previous" "$target" && echo 'diff_check=clean'

echo '=== `#394` DELTA ==='
git diff --name-status "$previous" "$target" -- tests/performance
git diff --unified=180 "$previous" "$target" -- tests/performance

echo '=== PERFORMANCE FILE MAP ==='
git ls-tree -r --name-only "$target" -- tests/performance | sort

echo '=== ORIGIN, REQUEST, WORKLOAD, AND RUNNER OUTLINES ==='
for file in \
  tests/performance/employment_separation_origin_contract.mjs \
  tests/performance/employment_separation_origin_contract.test.mjs \
  tests/performance/employment_separation_buyer_path.js \
  tests/performance/employment_separation_request_contract.mjs \
  tests/performance/employment_separation_request_contract.test.mjs \
  tests/performance/run_employment_separation_benchmark.sh \
  tests/performance/employment_separation_k6_runtime_contract.mjs \
  tests/performance/employment_separation_k6_evidence_contract.mjs
do
  if git cat-file -e "$target:$file" 2>/dev/null; then
    echo "--- $file"
    git show "$target:$file" > "/tmp/$(basename "$file")"
    case "$file" in
      *.mjs|*.js) ast-grep outline "/tmp/$(basename "$file")" --items all 2>/dev/null || true ;;
    esac
  fi
done

echo '=== FOCUSED IMPLEMENTATIONS AND REGRESSIONS ==='
for file in \
  tests/performance/employment_separation_origin_contract.mjs \
  tests/performance/employment_separation_origin_contract.test.mjs \
  tests/performance/employment_separation_buyer_path.js \
  tests/performance/employment_separation_request_contract.mjs \
  tests/performance/employment_separation_request_contract.test.mjs \
  tests/performance/run_employment_separation_benchmark.sh \
  tests/performance/employment_separation_k6_runtime_contract.mjs \
  tests/performance/employment_separation_k6_evidence_contract.mjs
do
  if git cat-file -e "$target:$file" 2>/dev/null; then
    show "$file" '1,460p'
  fi
done

echo '=== ORIGIN / PROXY / REDIRECT / URL-CONSTRUCTION CALL-SITE AUDIT ==='
git grep -n -E -C 8 \
  '(ORGMETRA_PERFORMANCE_BASE_URL|normalize.*Origin|https:|redirects|noProxy|no_proxy|HTTP_PROXY|HTTPS_PROXY|http_proxy|https_proxy|proxy|/v1/employment-separations|http\.(post|batch)\(|new URL|ROUTE)' \
  "$target" -- tests/performance ':!tests/performance/*test_support.mjs' || true

echo '=== RUNTIME ENVIRONMENT AND EXECUTION ENTRY-POINT AUDIT ==='
git grep -n -E -C 8 \
  '(run_employment_separation_benchmark|ORGMETRA_PERFORMANCE_|K6_|HTTP_PROXY|HTTPS_PROXY|NO_PROXY|no_proxy|grafana/k6|k6 run|redirects)' \
  "$target" -- . ':!node_modules' ':!dist' ':!build' 2>/dev/null || true

echo '=== DIRECT URL PARSING OUTSIDE ORIGIN CONTRACT ==='
git grep -n -E -C 5 \
  '(new URL\(|URL\(|ORGMETRA_PERFORMANCE_BASE_URL)' \
  "$target" -- tests/performance ':!tests/performance/*test.mjs' ':!tests/performance/*test_support.mjs' || true

Length of output: 203798


🤖 web_search executed:

Grafana k6 v2.2.0 HTTP proxy environment variables HTTPS_PROXY HTTP_PROXY NO_PROXY request redirects 0 documentation source

Length of output: 11722


🏁 Script executed:

#!/bin/bash
set -euo pipefail
target='822e591b3b111e5900daecefdd20ea160e50abbe'

show() {
  local file="$1" range="$2"
  echo "--- $file:$range"
  git show "$target:$file" | nl -ba | sed -n "$range"
}

echo '=== EXACT COMMIT / DELTA PATHS ==='
echo "checked_out=$(git rev-parse HEAD)"
git show -s --format='%H%n%P%n%s' "$target"
git diff --name-status 3a78672949032f324fe3bbeae0f427ec73920bd7 "$target"

echo '=== REQUEST CONTRACT COMPLETE ==='
show tests/performance/employment_separation_request_contract.mjs '1,180p'
echo '=== REQUEST CONTRACT TEST COMPLETE ==='
show tests/performance/employment_separation_request_contract.test.mjs '1,220p'

echo '=== DIRECT-NETWORK CONTRACT COMPLETE ==='
show tests/performance/employment_separation_run_contract.mjs '1,200p'
echo '=== DIRECT-NETWORK TESTS ==='
show tests/performance/employment_separation_run_contract.test.mjs '80,150p'

echo '=== RUNNER EXECUTION / NETWORK / PUBLICATION ==='
show tests/performance/run_employment_separation_benchmark.sh '95,175p'

echo '=== TLS, PROXY, AND REDIRECT OPTIONS IN ALL PERFORMANCE SOURCES ==='
git grep -n -E -C 4 \
  '(insecureSkipTLSVerify|insecure-skip-tls-verify|K6_INSECURE_SKIP_TLS_VERIFY|HTTP_PROXY|HTTPS_PROXY|ALL_PROXY|NO_PROXY|no_proxy|redirects|maxRedirects|K6_MAX_REDIRECTS)' \
  "$target" -- tests/performance ':!tests/performance/*test_support.mjs' || true

echo '=== ORIGIN CONTRACT TEST INVENTORY ==='
git ls-tree -r --name-only "$target" -- tests/performance | rg '(request_contract|origin).*test\.(mjs|js)$' | sort

echo '=== EXPORTED REQUEST-CONTRACT IMPORTS AND URL REQUESTS ==='
git grep -n -E -C 4 \
  '(requireGovernedSeparationHttpsOrigin|governedSeparationRequestParams|http\.(post|batch)\()' \
  "$target" -- tests/performance ':!tests/performance/*test.mjs' ':!tests/performance/*test_support.mjs'

Length of output: 40812


@seonghobae Review completed for exact head 822e591b3b111e5900daecefdd20ea160e50abbe only.

I found no false-GREEN or false-RED issue in the requested #394 scope.

  • requireGovernedSeparationHttpsOrigin() validates ORGMETRA_PERFORMANCE_BASE_URL during workload initialization. The workload cannot issue a request when the value is invalid.
  • The boundary accepts only a lowercase https:// origin with a valid host, an optional port in 1..65535, and an optional single trailing slash.
  • The boundary removes the accepted trailing slash. This preserves one URL form when the workload appends /v1/employment-separations.
  • The boundary rejects plaintext HTTP, whitespace, userinfo, non-root paths, queries, fragments, invalid ports, malformed IPv6 bracket forms, and repeated slashes.

All governed requests retain the existing path controls.

  • post() constructs the ordinary request URL from the normalized origin and the fixed route.
  • Both http.batch() entries construct the contention request URL in the same way.
  • governedSeparationRequestParams() sets redirects: 0 for first_commit, replay, rejection, and contention.
  • The helper retains the request headers and profile tag. It does not weaken bearer handling, request headers, timing, or metric cardinality.

The direct-network control composes correctly with the origin control.

  • requireDirectPerformanceClientNetwork(__ENV) rejects non-empty HTTP_PROXY, HTTPS_PROXY, ALL_PROXY, and lowercase equivalents.
  • The canonical Podman runner forwards only the required ORGMETRA_PERFORMANCE_* variables. It does not forward host proxy variables into the k6 container.
  • The runner does not enable an insecure TLS-verification option.
  • Grafana documents that k6 uses HTTP_PROXY and HTTPS_PROXY for proxy routing. The workload and runner therefore fail closed for the relevant proxy configuration.

The focused regression covers valid HTTPS origins, optional port and trailing-slash normalization, plaintext HTTP, userinfo, path, query, fragment, whitespace, and invalid port rejection.

I used the existing project guidance that local fixture, runtime, result, and digest validation is structural evidence only. Commercial acceptance remains fail closed pending ContextualWisdomLab/.github#2162.

I did not run repository tests, k6, Podman, or a hosted workflow. This source review does not claim measured performance, commercial acceptance, protected integration, or release status.


🧠 Learnings used
Learnt from: seonghobae
URL: https://github.com/ContextualWisdomLab/Orgmetra/pull/317

Timestamp: 2026-09-13T12:46:51.079Z
Learning: For the Employment separation performance harness, local result, runtime, fixture, and digest validation is structural evidence only. A positive commercial acceptance receipt requires the organization-owned authenticated performance-evidence attestation contract tracked by ContextualWisdomLab/.github#2162.

You are interacting with an AI system.

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

Please review exact current head 74f726d2e81ab7b15df4944387817059588045d1 only. Focus on #394's two transport-authentication boundaries: strict HTTPS-origin parsing and rejection of resolved k6 insecureSkipTLSVerify overrides before both ordinary and contention requests. Do not transfer any verdict from 822e591b... or earlier heads.

@coderabbitai

coderabbitai Bot commented Sep 15, 2026

Copy link
Copy Markdown

Tip

For best results, initiate chat on the files or code changes.

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

target='74f726d2e81ab7b15df4944387817059588045d1'
previous='b87001c4b8b0154bcb259a2fac5dc5d4dc13108b'

show() {
  local file="$1"
  local range="${2:-1,420p}"
  echo "--- $file:$range"
  git show "$target:$file" | nl -ba | sed -n "$range"
}

echo '=== EXACT TARGET IDENTITY ==='
echo "checked_out=$(git rev-parse HEAD)"
git cat-file -t "$target"
git show -s --format='target=%H%nparents=%P%nsubject=%s' "$target"
git diff --check "$previous" "$target" && echo 'diff_check=clean'

echo '=== `#394` CURRENT-HEAD DELTA ==='
git diff --name-status "$previous" "$target" -- tests/performance
git diff --unified=160 "$previous" "$target" -- tests/performance

echo '=== RELEVANT SOURCE OUTLINES ==='
for file in \
  tests/performance/employment_separation_origin_contract.mjs \
  tests/performance/employment_separation_origin_contract.test.mjs \
  tests/performance/employment_separation_k6_tls_contract.mjs \
  tests/performance/employment_separation_k6_tls_contract.test.mjs \
  tests/performance/employment_separation_buyer_path.js \
  tests/performance/employment_separation_request_contract.mjs \
  tests/performance/employment_separation_run_contract.mjs \
  tests/performance/run_employment_separation_benchmark.sh
do
  if git cat-file -e "$target:$file" 2>/dev/null; then
    git show "$target:$file" > "/tmp/$(basename "$file")"
    echo "--- $file"
    case "$file" in
      *.mjs|*.js) ast-grep outline "/tmp/$(basename "$file")" --items all 2>/dev/null || true ;;
    esac
  fi
done

echo '=== FOCUSED IMPLEMENTATIONS AND REGRESSIONS ==='
for file in \
  tests/performance/employment_separation_origin_contract.mjs \
  tests/performance/employment_separation_origin_contract.test.mjs \
  tests/performance/employment_separation_k6_tls_contract.mjs \
  tests/performance/employment_separation_k6_tls_contract.test.mjs \
  tests/performance/employment_separation_buyer_path.js \
  tests/performance/employment_separation_request_contract.mjs \
  tests/performance/employment_separation_run_contract.mjs \
  tests/performance/run_employment_separation_benchmark.sh
do
  if git cat-file -e "$target:$file" 2>/dev/null; then
    show "$file" '1,460p'
  fi
done

echo '=== TLS, ORIGIN, AND HTTP-CALL AUDIT ==='
git grep -n -E -C 10 \
  '(insecureSkipTLSVerify|insecure-skip-tls-verify|exec\.test\.options|require.*Tls|require.*Origin|ORGMETRA_PERFORMANCE_BASE_URL|https:|http\.(post|batch)\(|firstCommit|replay|rejection|contention|redirects|HTTP_PROXY|HTTPS_PROXY|ALL_PROXY)' \
  "$target" -- tests/performance \
  ':!tests/performance/*test.mjs' ':!tests/performance/*test_support.mjs' || true

echo '=== TEST ASSERTION AUDIT ==='
git grep -n -E -C 5 \
  '(insecureSkipTLSVerify|undefined|null|false|true|ordinary|contention|http\.post|http\.batch|require.*Origin|https)' \
  "$target" -- tests/performance \
  '*tls*test*.mjs' '*origin*test*.mjs' '*buyer*test*.mjs' 2>/dev/null || true

echo '=== ALL PERFORMANCE EXECUTION REFERENCES ==='
git grep -n -E -C 5 \
  '(run_employment_separation_benchmark|employment_separation_buyer_path\.js|insecureSkipTLSVerify|K6_INSECURE|ORGMETRA_PERFORMANCE_BASE_URL)' \
  "$target" -- . ':!node_modules' ':!dist' ':!build' 2>/dev/null || true

Length of output: 203747


🤖 web_search executed:

Grafana k6 v2.2.0 JavaScript execution module exec.test.options insecureSkipTLSVerify option resolved options documentation source

Length of output: 12646


🏁 Script executed:

#!/bin/bash
set -euo pipefail
target='74f726d2e81ab7b15df4944387817059588045d1'
previous='b87001c4b8b0154bcb259a2fac5dc5d4dc13108b'

show() {
  local file="$1"
  echo "--- $file"
  git show "$target:$file" | nl -ba
}

echo '=== IDENTITY AND FOCUSED DELTA ==='
git show -s --format='target=%H%nparents=%P%nsubject=%s' "$target"
git diff --check "$previous" "$target" && echo 'diff_check=clean'
git diff --unified=100 "$previous" "$target" -- \
  tests/performance/employment_separation_run_contract.mjs \
  tests/performance/employment_separation_run_contract.test.mjs \
  tests/performance/employment_separation_buyer_path.js

echo '=== REQUEST ORIGIN CONTRACT ==='
show tests/performance/employment_separation_request_contract.mjs
echo '=== REQUEST ORIGIN TEST ==='
show tests/performance/employment_separation_request_contract.test.mjs
echo '=== TLS RUN CONTRACT ==='
git show "$target:tests/performance/employment_separation_run_contract.mjs" | nl -ba | sed -n '60,90p'
echo '=== TLS RUN-CONTRACT TEST ==='
git show "$target:tests/performance/employment_separation_run_contract.test.mjs" | nl -ba | sed -n '90,125p'
echo '=== WORKLOAD INITIALIZATION AND PROFILE FUNCTIONS ==='
git show "$target:tests/performance/employment_separation_buyer_path.js" | nl -ba | sed -n '1,175p'

echo '=== TLS-GUARD CALL CONTEXTS ==='
git grep -n -E -C 16 'requireCommercialTls\(|http\.(post|batch)\(' \
  "$target" -- tests/performance/employment_separation_buyer_path.js

echo '=== TLS-RELATED TEST FILES ==='
git ls-tree -r --name-only "$target" -- tests/performance | rg '(tls|transport|buyer_path).*test\.(mjs|js)$' | sort | while IFS= read -r file; do
  echo "--- $file"
  git show "$target:$file" | nl -ba | grep -E -C 8 '(insecureSkipTLSVerify|requireCommercialTls|http\.post|http\.batch|ordinary|contention)' || true
done

Length of output: 38677


@seonghobae Review completed for exact head 74f726d2e81ab7b15df4944387817059588045d1 only.

I found no false-GREEN or false-RED issue in the requested #394 transport-authentication scope.

  • requireGovernedSeparationHttpsOrigin() validates ORGMETRA_PERFORMANCE_BASE_URL during workload initialization in tests/performance/employment_separation_buyer_path.js Line 50.
  • The validator accepts only the literal https:// scheme, a valid authority, an optional port from 1 through 65535, and one optional trailing slash.
  • The validator rejects an empty value, surrounding whitespace, plaintext HTTP, userinfo, non-root paths, queries, fragments, repeated slashes, malformed bracketed IP literals, port 0, and ports above 65535.
  • The validator removes the allowed trailing slash. The workload then appends only the fixed /v1/employment-separations route.

The certificate-verification boundary also fails closed.

  • requireVerifiedTlsTransport() in tests/performance/employment_separation_run_contract.mjs Lines 79-84 accepts only false, null, and undefined.
  • These values preserve the secure k6 default. k6 documents false as the default for insecureSkipTLSVerify, and exec.test.options exposes consolidated options with unset values represented as null.
  • The validator rejects true and noncanonical values such as "true" and 1.
  • The focused regression in tests/performance/employment_separation_run_contract.test.mjs Lines 107-117 covers all three safe representations and the unsafe values.

The workload applies the resolved-option guard before all governed requests.

  • post() calls requireCommercialTls() before http.post(). This covers firstCommit(), replay(), and rejection().
  • contention() calls requireCommercialTls() before http.batch(). This covers both concurrent requests in each contention pair.
  • No other http.post() or http.batch() call in the workload bypasses this guard.

The existing direct-network and no-redirect controls remain active.

  • requireDirectPerformanceClientNetwork(__ENV) rejects configured proxy environment variables.
  • governedSeparationRequestParams() keeps redirects: 0 for all four profiles.
  • The TLS check does not alter request headers, profile tags, response validation, latency recording, or governed verdict cardinality.

I inspected source only. I did not run repository tests, k6, Podman, or a hosted workflow. This review does not claim measured performance, commercial acceptance, protected integration, or release status.

You are interacting with an AI system.

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

Please review exact head 151a2269ef6fb21cf5984e6ced9f98bb286cf42a only. Scope: #395 deployed-candidate identity false-GREEN and the composed fail-closed commercial owner gate. Check specifically that .github#2162 evidence-byte/provenance attestation remains distinct from authentication of the deployed service actually timed, that both unresolved authorities are surfaced before caller-controlled artifact paths are opened, and that no positive performance/deployment claim or gate weakening was introduced.

@coderabbitai

coderabbitai Bot commented Sep 15, 2026

Copy link
Copy Markdown

Tip

For best results, initiate chat on the files or code changes.

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

target='151a2269ef6fb21cf5984e6ced9f98bb286cf42a'
previous='2b3e9502333d4295863674f7d3d4b30cdd3b8917'

show() {
  local file="$1"
  local range="${2:-1,420p}"
  echo "--- $file:$range"
  git show "$target:$file" | nl -ba | sed -n "$range"
}

echo '=== EXACT TARGET IDENTITY ==='
echo "checked_out=$(git rev-parse HEAD)"
git cat-file -t "$target"
git show -s --format='target=%H%nparents=%P%nsubject=%s' "$target"
git diff --check "$previous" "$target" && echo 'diff_check=clean'

echo '=== `#395` DELTA ==='
git diff --name-status "$previous" "$target" -- tests/performance
git diff --find-renames --unified=160 "$previous" "$target" -- tests/performance

echo '=== PERFORMANCE FILE MAP ==='
git ls-tree -r --name-only "$target" -- tests/performance | sort

echo '=== TARGET SOURCE OUTLINES ==='
for file in \
  tests/performance/employment_separation_acceptance_check.mjs \
  tests/performance/employment_separation_commercial_authority_contract.mjs \
  tests/performance/employment_separation_commercial_authority_contract.test.mjs \
  tests/performance/employment_separation_deployment_evidence_contract.mjs \
  tests/performance/employment_separation_deployment_evidence_contract.test.mjs \
  tests/performance/employment_separation_evidence_attestation_contract.mjs \
  tests/performance/employment_separation_evidence_attestation_contract.test.mjs \
  tests/performance/employment_separation_acceptance_contract.mjs \
  tests/performance/employment_separation_result_artifact.mjs \
  tests/performance/employment_separation_runtime_evidence_artifact.mjs
do
  if git cat-file -e "$target:$file" 2>/dev/null; then
    echo "--- $file"
    git show "$target:$file" > "/tmp/$(basename "$file")"
    ast-grep outline "/tmp/$(basename "$file")" --items all 2>/dev/null || true
  fi
done

echo '=== COMPOSED GATE, OWNER GATES, AND CLI ==='
for file in \
  tests/performance/employment_separation_acceptance_check.mjs \
  tests/performance/employment_separation_commercial_authority_contract.mjs \
  tests/performance/employment_separation_deployment_evidence_contract.mjs \
  tests/performance/employment_separation_evidence_attestation_contract.mjs
do
  if git cat-file -e "$target:$file" 2>/dev/null; then
    show "$file" '1,500p'
  fi
done

echo '=== FOCUSED TESTS ==='
git ls-tree -r --name-only "$target" -- tests/performance | \
  rg '(commercial.*authority|deployment.*evidence|evidence.*attestation|acceptance.*(check|contract)).*\.test\.m?js$' | sort | \
  while IFS= read -r file; do
    echo "--- $file"
    git show "$target:$file" | nl -ba
  done

echo '=== GATE/CALLER-CONTROLLED-ARTIFACT/CANDIDATE-IDENTITY AUDIT ==='
git grep -n -E -C 10 \
  '(requireCommercialPerformanceAuthorities|require.*Authority|`#2162`|2162|`#395`|395|observed_service_sha|candidate_sha|deployment|attestation|readFile|readFileSync|open\(|createReadStream|process\.argv|ORGMETRA_PERFORMANCE|accept|accepted|commercial|receipt|result)' \
  "$target" -- tests/performance ':!tests/performance/*test_support.mjs' || true

echo '=== ENTRY POINTS AND POSITIVE-CLAIM AUDIT ==='
git grep -n -E -C 6 \
  '(employment_separation_acceptance_check|acceptance.*check|commercial.*accept|performance.*accept|deployment.*accept|accepted[[:space:]]*:|receipt|structurally_valid|passed)' \
  "$target" -- . ':!node_modules' ':!dist' ':!build' 2>/dev/null || true

Length of output: 203899


🏁 Script executed:

#!/bin/bash
set -euo pipefail
target='151a2269ef6fb21cf5984e6ced9f98bb286cf42a'

echo '=== IDENTITY ==='
echo "checked_out=$(git rev-parse HEAD)"
git show -s --format='target=%H%nparents=%P%nsubject=%s' "$target"

echo '=== RELEVANT FILES ==='
git ls-tree -r --name-only "$target" -- tests/performance | \
  rg '(commercial|authenticated.*evidence|deployment.*evidence|acceptance_check|acceptance_cli).*\.m?js$' | sort

echo '=== COMPOSED GATE ==='
git show "$target:tests/performance/employment_separation_commercial_authority_contract.mjs" | nl -ba

echo '=== EVIDENCE ATTESTATION GATE ==='
git show "$target:tests/performance/employment_separation_authenticated_evidence_gate.mjs" | nl -ba

echo '=== DEPLOYMENT IDENTITY GATE ==='
git show "$target:tests/performance/employment_separation_deployment_evidence_gate.mjs" | nl -ba

echo '=== ACCEPTANCE CLI ==='
git show "$target:tests/performance/employment_separation_acceptance_check.mjs" | nl -ba

echo '=== COMPOSED GATE TEST ==='
git show "$target:tests/performance/employment_separation_commercial_authority_contract.test.mjs" | nl -ba

echo '=== CLI DIGEST TEST ==='
git show "$target:tests/performance/employment_separation_acceptance_cli_digest.test.mjs" | nl -ba

echo '=== ALL IMPORTS AND INVOCATIONS ==='
git grep -n -E -C 4 \
  '(requireCommercialPerformanceAuthorities|requireAuthenticatedPerformanceEvidence|requireAuthenticatedDeploymentEvidence)' \
  "$target" -- tests/performance

echo '=== ACCEPTANCE CLI FILE READ ORDER ==='
git grep -n -E -C 5 \
  '(process\.argv|readFile\(|validateEmploymentSeparationAcceptance|validatePinnedK6AcceptanceEvidence|console\.log|JSON\.stringify)' \
  "$target" -- tests/performance/employment_separation_acceptance_check.mjs

echo '=== RELATED POSITIVE-RESULT FIELDS ==='
git grep -n -E -C 3 \
  '(structurally_valid|commercially_valid|commercial_accept|accepted|deployment.*verified|observed_service_sha)' \
  "$target" -- tests/performance/employment_separation_acceptance_check.mjs \
    tests/performance/employment_separation_acceptance_contract.mjs \
    tests/performance/employment_separation_deployment_evidence_gate.mjs \
    tests/performance/employment_separation_authenticated_evidence_gate.mjs \
    tests/performance/employment_separation_commercial_authority_contract.mjs || true

Length of output: 3442


🏁 Script executed:

#!/bin/bash
set -euo pipefail
target='151a2269ef6fb21cf5984e6ced9f98bb286cf42a'

for file in \
  tests/performance/employment_separation_commercial_owner_gate.mjs \
  tests/performance/employment_separation_authenticated_evidence_gate.mjs \
  tests/performance/employment_separation_deployment_evidence_gate.mjs \
  tests/performance/employment_separation_acceptance_check.mjs \
  tests/performance/employment_separation_commercial_owner_gate.test.mjs \
  tests/performance/employment_separation_acceptance_cli_digest.test.mjs
do
  echo "--- $file"
  git show "$target:$file" | nl -ba
done

echo '=== ALL GATE IMPORTS AND INVOCATIONS ==='
git grep -n -E -C 4 \
  '(requireCommercialPerformanceAuthorities|requireAuthenticatedPerformanceEvidence|requireAuthenticatedDeploymentEvidence)' \
  "$target" -- tests/performance

echo '=== ALL ACCEPTANCE ENTRYPOINTS ==='
git grep -n -E -C 5 \
  '(readFile\(|process\.argv|validateEmploymentSeparationAcceptance\(|validatePinnedK6AcceptanceEvidence\(|requireCommercialPerformanceAuthorities\()' \
  "$target" -- tests/performance ':!tests/performance/*test.mjs'

echo '=== TARGET DELTA ==='
git diff --unified=100 2b3e9502333d4295863674f7d3d4b30cdd3b8917 "$target" -- tests/performance

Length of output: 32330


@seonghobae Review completed for exact head 151a2269ef6fb21cf5984e6ced9f98bb286cf42a only.

I found no false-GREEN or gate-weakening issue in the requested #395 scope.

  • tests/performance/employment_separation_authenticated_evidence_gate.mjs keeps ContextualWisdomLab/.github#2162 as the separate authority for authenticated performance-evidence bytes and provenance.

  • Its error text states that local result, runtime, and fixture bytes, plus caller-supplied digests, are structural evidence only.

  • tests/performance/employment_separation_deployment_evidence_gate.mjs keeps ContextualWisdomLab/Orgmetra#395 as a separate authority for deployed-candidate identity.

  • Its error text correctly states that a caller-supplied observed_service_sha or deployment reference does not prove which deployment served the timed HTTPS requests.

  • tests/performance/employment_separation_commercial_owner_gate.mjs runs both gates.

  • It captures both failures and throws one combined fail-closed error.

  • Therefore, resolution of one authority cannot mask the other unresolved authority.

  • tests/performance/employment_separation_acceptance_check.mjs calls requireCommercialPerformanceAuthorities() before it reads CLI arguments or calls readFile().

  • Caller-controlled result, runtime, and fixture paths therefore remain unopened while either authority is unresolved.

  • tests/performance/employment_separation_commercial_owner_gate.test.mjs requires the combined error to include both the #2162 and #395 owner gaps.

  • tests/performance/employment_separation_acceptance_cli_digest.test.mjs verifies the same behavior for substituted paths and supplied digests.

  • The structural validator still returns structurally_valid: true only.

  • The inspected acceptance path does not emit accepted, a commercial receipt, or a deployed-candidate verification claim.

I used the existing project guidance that local result, runtime, fixture, and digest validation is structural evidence only. Commercial acceptance remains fail closed until the organization-owned #2162 attestation contract and the #395 deployed-candidate identity authority are released and consumed.

I inspected source only. I did not run repository tests, k6, Podman, or hosted workflows. This review does not claim measured performance, commercial acceptance, protected integration, or release status.


🧠 Learnings used
Learnt from: seonghobae
URL: https://github.com/ContextualWisdomLab/Orgmetra/pull/317

Timestamp: 2026-09-13T12:46:51.079Z
Learning: For the Employment separation performance harness, local result, runtime, fixture, and digest validation is structural evidence only. A positive commercial acceptance receipt requires the organization-owned authenticated performance-evidence attestation contract tracked by ContextualWisdomLab/.github#2162.

You are interacting with an AI system.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant