Skip to content

Commit 2428ab6

Browse files
sahrizviclaude
andcommitted
test: time every rule classifier cue on 450 KB inputs
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01XM3J9mB75wZRnzTSGcW2kc
1 parent f35f67c commit 2428ab6

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

‎packages/opencode/test/skill/release-v0.12.9-adversarial.test.ts‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -490,6 +490,17 @@ describe("v0.12.9 adversarial: rule classify", () => {
490490
expect(performance.now() - start).toBeLessThan(5_000)
491491
})
492492

493+
test.each(["means ", "remember ", "remember that ", "for me ", "i prefer ", "our warehouse ", "use x ", "name x ", "don't use "])(
494+
"450 KB of %p classifies in bounded time",
495+
(word) => {
496+
const text = word.repeat(Math.ceil(450_000 / word.length))
497+
const start = performance.now()
498+
classifyRule(text)
499+
memoryScope(text)
500+
expect(performance.now() - start).toBeLessThan(5_000)
501+
},
502+
)
503+
493504
test("cues across lines are still found", () => {
494505
expect(classifyRule("Staging models:\n\nalways prefix with stg_").kind).toBe("rule")
495506
})

0 commit comments

Comments
 (0)