mirror of
https://github.com/garrytan/gstack.git
synced 2026-09-12 07:59:02 +02:00
fix(security): delete the dead ML layers — transcript classifier and DeBERTa ensemble
The L4b Haiku transcript classifier and the opt-in DeBERTa ensemble
(GSTACK_SECURITY_ENSEMBLE=deberta, a documented 721MB download) had ZERO
production callers since the chat-path agent that invoked them was ripped.
The only live ML path is scanPageContent (testsavant) inside the security
sidecar subprocess. Deleted by import graph:
- security-classifier.ts 614 -> 265 lines: HAIKU_MODEL, checkTranscript,
shouldRunTranscriptCheck, loadDeberta, scanPageContentDeberta, ToolCallInput,
all DEBERTA_* consts + load state. Header now states the live truth
(imported only by security-sidecar-entry.ts). downloadFile kept, name
intact — it is an enumerated egress sink (HF model download).
- security-bunnative.ts + test: a research skeleton self-described as 'NOT a
production replacement', shipped into src/ with zero importers.
- security-bench-ensemble{,-live}.test.ts + the Haiku response fixture: a
paid live-model benchmark for a layer that could not fire. The
security-classifier-tdz test's only case exercised checkTranscript — gone.
- security.ts: layer-model header rewritten to the live architecture;
StatusDetail.layers -> {testsavant, canary}; getStatus() no longer requires
the impossible transcript==='ok' for 'protected' (old on-disk session state
with a transcript key is tolerated on read, never re-emitted).
- security-sidecar-entry.ts needed zero changes: it serializes
getClassifierStatus() verbatim and no consumer read .transcript (verified
in sidecar-client + server.ts).
- BROWSER.md security section matches reality (ensemble knob gone, 112MB not
22MB, sidecar hosting documented). combineVerdict/THRESHOLDS retained as
the pure, tested combiner of record — comments now flag transcript/deberta
votes as producer-less.
Net: 26 pass in security.test.ts incl. a NEW regression test for stale-
transcript disk tolerance; egress-receipt tripwire green.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Fable 5
parent
ef186cccb3
commit
4328748136
@@ -1872,10 +1872,9 @@ describe('no compiled binaries in git', () => {
|
||||
// repository size without blocking those fixtures from living in git.
|
||||
// Known-good fixtures are exempted from the warning to keep CI logs clean.
|
||||
const MAX_BYTES = 2 * 1024 * 1024;
|
||||
const knownLargeFixtures = new Set([
|
||||
// Deterministic replay fixture for BrowseSafe-Bench. The live bench is
|
||||
// expensive; this file is intentionally committed so the gate is free.
|
||||
'browse/test/fixtures/security-bench-haiku-responses.json',
|
||||
const knownLargeFixtures = new Set<string>([
|
||||
// Currently empty — add repo-relative paths of intentionally-committed
|
||||
// large fixtures here with a reason.
|
||||
]);
|
||||
const oversized = trackedFiles.flatMap((f: string) => {
|
||||
if (knownLargeFixtures.has(f)) return [];
|
||||
@@ -1902,11 +1901,6 @@ describe('no compiled binaries in git', () => {
|
||||
});
|
||||
});
|
||||
|
||||
// `sidebar agent (#584)` describe block was here. sidebar-agent.ts and
|
||||
// the entire chat-queue path were ripped in favor of the interactive
|
||||
// claude PTY (terminal-agent.ts); these assertions had no target file.
|
||||
// Terminal-pane invariants are covered by browse/test/sidebar-tabs.test.ts
|
||||
// and browse/test/terminal-agent.test.ts.
|
||||
|
||||
// ─── Browser-skills validation ──────────────────────────────────
|
||||
//
|
||||
|
||||
Reference in New Issue
Block a user