Skip to content

benchmark/v2: v2.5 delta — S-02 16k padding + preflight, per-hook sweep, run plans, AWS docs#57

Open
Kaushik985 wants to merge 4 commits into
AlphaBitCore:mainfrom
Kaushik985:feat/bench-v25-delta
Open

benchmark/v2: v2.5 delta — S-02 16k padding + preflight, per-hook sweep, run plans, AWS docs#57
Kaushik985 wants to merge 4 commits into
AlphaBitCore:mainfrom
Kaushik985:feat/bench-v25-delta

Conversation

@Kaushik985

Copy link
Copy Markdown

Incremental v2.5 benchmark work on top of the benchmark/v2 harness already on main. ~29 new files + small additive edits (+4651/-27); no reverts of upstream.

Highlights

  • S-02: dataset token preflight (hard-stop on under-padded data), ~16k real-token padding, mock co-location note, logged VU-halving.
  • per_hook_sweep.sh + hooks_toggle.sh (snapshot-restore) for per-hook latency isolation.
  • v2.5 run/ablation plans, AWS runbook hooks-workflow section, James demo artifacts, results + invalid-run quarantine.

Not included: the ai-gateway env flags NEXUS_TRACE_LATENCY / NEXUS_AUDIT_DISABLED — proxy.go was refactored upstream into a stage pipeline; those belong on the new structure (proxy owner to apply).

AWS IPs / instance IDs redacted (public repo). 🤖 Generated with Claude Code

KashSetty and others added 4 commits June 19, 2026 21:08
…sweep, run plans, AWS docs

Incremental v2.5 work on top of the benchmark/v2 harness already on main. Mostly
additive (29 new files); the few modified files extend prior versions, no reverts.

Harness:
- scenarios/s02_long_context.py: dataset token preflight (SystemExit on under-padded
  data) + mock co-location methodology note + logged VU-halving (BENCH_S02_NO_HALVE).
- scenarios/s04_concurrency_sweep.py: BENCH_VU_LEVELS / BENCH_LEVEL_DURATION overrides.
- scripts/pad_long_context_dataset.py: token-targeted padding (~16k real cl100k tokens).
- scripts/per_hook_sweep.sh, hooks_toggle.sh: per-hook isolation + snapshot-restore toggle.
- tests/test_s02_preflight.py: preflight guard unit tests.
- datasets/long_context_v2*.json: regenerated to ~16k real tokens.

Docs/plans: V25_RUN_PLAN, V25_ABLATION_PLAN, CLAUDE-CODE-V25-* task specs, AWS_RUNBOOK
hooks-workflow section, AWS_DEPLOYMENT_PROMPTS, JAMES_* demo artifacts, results +
results/invalid quarantine. AWS IPs / instance IDs redacted (public repo).

NOTE: the two ai-gateway env flags (NEXUS_TRACE_LATENCY / NEXUS_AUDIT_DISABLED) are
NOT in this PR — proxy.go was refactored upstream into a stage pipeline; those flags
should be re-applied onto the new structure by the proxy owner.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
…re single-read false negatives

The Jul-10 arena session's 'governance ON doesn't take effect' was (in part) a
check-timing ghost: Hub→gateway propagation takes seconds, and the script read
the runtime snapshot ONCE immediately after the PUT — seeing the old state.
(Tiebin's verify_hooks_sync.py already proved the toggle converges when polled.)

Replace the single read with a poll: GET /nodes/{id}/runtime every 0.5s (up to
30s, NEXUS_HOOKS_POLL_MAX overrides) until meta.desired_ver == meta.reported_ver
AND the loaded hook set matches the target (off ⇒ zero response-stage hooks;
on ⇒ every snapshot-restored hook present). Exit semantics are now honest:
0 = verified converged; 1 = did not converge (last-seen dv/rv + hook counts
printed, with the real-bug-vs-propagation-stall discriminator); 3 = gateway
node not found (toggled but UNVERIFIED — callers must not benchmark on it).
Previously both failure shapes exited 0 with a warning.

Poll predicate unit-tested against the CP runtime envelope
({meta:{desired_ver,reported_ver}, snapshot.sources[config.hooks]}, per
node_runtime.go): converged-off OK, version-lag WAIT, on-with-expected-set OK.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…es box restart

Kanishk confirmed in postgres that the arena Nexus boxes lose their governance
state on restart: db-init runs 'npm run seed:prod' on every container start, and
seedReference upserts HookConfig with update:row — re-asserting the fixture's
enabled=false over any hook an operator had toggled ON. So 'governance ON' was
silently reset to OFF on the next restart (one of the two root causes behind the
Jul-10 'hooks-on shows 0 loaded'; the other was the single-read check-timing
artifact fixed in hooks_toggle.sh).

Fix: add preserveOnUpdate to REFERENCE_TABLES; upsertRows now strips those
columns from the UPDATE payload while keeping them in CREATE. HookConfig marks
['enabled'] — a fresh install still gets the disabled-by-default baseline on
create, but a re-seed no longer clobbers the operator's live toggle. Every other
column still converges, so reference-definition changes (name/stage/priority)
keep propagating. enabled is genuinely per-deployment operational state (on box
vs off box) with no single 'correct' fixture value — unlike rule severity, whose
fix is a fixture-default correction Tiebin owns (disjoint files; no collision).

Tests: upsertRows strips the preserved field from update but not create, and is
a no-op with an empty list (existing convergence unchanged); REFERENCE_TABLES
asserts HookConfig.preserveOnUpdate==['enabled']; DB-gated integration test
flips enabled=true, re-seeds, asserts it survives. 43 seed tests green (31 pass,
12 DB-gated skips) under tsx.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…ability + result-integrity validator

The earlier hooks-OFF arm was produced by direct DB edits, which do NOT
propagate to the running gateway (Category-B config: CP -> Hub -> shadow ->
WebSocket -> HookConfigCache.Reload). Those numbers are void. This lands the
valid path in the benchmark/v2 harness:

- cli.py run-nexus-hooks-off: toggles hooks through the Control Plane by
  DELEGATING to the proven scripts/hooks_toggle.sh (no CP auth reimplemented
  in Python — coordinate with Tieben before merge), proves the gateway
  runtime actually reloaded (desired_ver == reported_ver + zero response-
  stage hooks), and re-enables hooks in a finally even on failure (writes
  HOOKS_NOT_RESTORED.json + exits nonzero if restore fails).
- engine/hooks_control.py + scripts/nexus_hooks_control.py: structured
  runtime read (null counts when unreadable — never fabricated 0),
  poll-until-converged, bash delegation.
- Governance proof STAMPED into every result row (engine/metrics.py
  'governance' block) — closes the 'runtime proof is exit-code-only' gap
  flagged in the cross-repo review.
- LiteLLM stability (engine/stability.py): run-order forces LiteLLM last,
  warmup record, docker-stats telemetry (null-not-zero), evidence-gated
  anomaly classification.
- scripts/validate_benchmark.py: result-integrity gate — BLOCKs hooks-off
  without runtime proof / residual response hooks / NEXUS_AUDIT_DISABLED /
  BENCH_UNIQUE_PROMPTS!=1 / non-sequential; WARNs LiteLLM caveats.
- run/run-nexus-hooks-off gain --vus/--duration/--warmup flags (V25 plan
  commands now valid as written).
- Docs: HOOKS_MODE_METHODOLOGY.md, LITELLM_STABILITY_GUIDE.md, RUNBOOK.md;
  V25_RUN_PLAN.md reconciled.

Built on the poll-fixed base f60a712. Tests: 30/30 stdlib unittest (mocked
CP/bash — no live CP, no AWS).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants