Add a checkpoint gate that refuses a worse Laya checkpoint #28
Loading…
Reference in a new issue
No description provided.
Delete branch "eval-gate"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Adds
centinela-gate, which decides whether a retrained Laya checkpoint may replace the one in service. It is step 1 of moving retraining into this repo: retraining can run unattended, so something has to stop a worse checkpoint from going live. r4, for example, lost theadmin'--SQLi block.What it does
It replays the same recorded model inputs through the serving checkpoint (baseline) and the candidate, applies the production policy (
balanced), and refuses the candidate if, in any suite:-max-detection-drop/-max-fp-risedefault to 0), orevaleval/dataset.jsonlgrey zone (centinela-eval -states)productioncentinela-gate heldout)labelscentinela-gate labels)should_blockblocked;false_positivenot blockedThe report (Markdown, ids only, no request content) goes in the PR that changes
laya/checkpoint.env;laya/README.mdnow says to merge that only onACCEPT. Usage is ineval/README.md#checkpoint-gate.Held-out labels never train
labelssplits by a SHA-256 of the normalized method, host and path (case, trailing slash/dot, percent-encoding, port, IPv6 brackets), 30% of endpoints by default. It writes the training side to a separate file, and the training pipeline must read labels only from that file.Run integrity
comparestops (exit 2) unless:-checkpoint, the two differ, and they don't answer every record identically;eval,productionandlabelssuites are present and non-empty.Malformed, duplicated or empty input is rejected, and every file it writes is owner-only, since suites and replays carry request bodies from the training log.
Also in this PR
decider.TypeSafe.AssessStatereplays a recorded state exactly as given;Assessnow builds the state and calls it.centinela-eval -stateswrites its grey zone as a gate suite (owner-only).make gate.Review
Three rounds of adversarial review and two of test review (Crush/GPT); every concrete finding was fixed except these, declined on purpose:
-checkpointname). The gate is a check an operator runs on their own files, not tamper-proofing. The Laya endpoint exposes no checkpoint digest to bind to, so the identical-answers check is there to catch mix-ups, not forgery.labelsreports how many there are.Testing
make testandmake vetpass.cmd/centinela-gate/gate_test.gocovers the split, the label join,heldout, replay against a fake System One server, every compare rule, run validation and file modes.centinela-eval -stateson the new dataset sends 59 of 77 records to the model (all 34 attacks), and rules 1014938 and 1031852 appear in their states.🔎 ojo scan results
No findings.