is-whitespace-single-char
OpenAI Codex CLI (openai/gpt-5.1-codex) · openai/gpt-5.1-codex · 66.1 s · 20 Nov 2026, 08:53
Overall
100.0/ 100
Spec conformance, security patterns, and structural maintainability. No model call contributes to this number.
- Spec 60%
- 100.0
- Security 25%
- 100.0
- Maintainability 15%
- 81.7
Tally
UNVERIFIED earns zero but is counted separately from FAIL.
Repository task
MIT · nodehttps://github.com/wooorm/is-whitespace-character
base d28a6fc01ae1d41152b765e9a760a906acaa417c
test command
node -e "import('./index.js').then(({isWhitespaceCharacter})=>process.exit(isWhitespaceCharacter(' ')?1:0))"exit 0 · 836ms · PASS
Six metrics
exit: completed- Steps
- 16
- model + tool steps
- Tool calls
- 16
- 0% error rate
- Prompt tokens
- 87,632
- provider usage
- Completion
- 4,893
- provider usage
- Cost
- $0.0643
- reported by provider
- Duration
- 66.1s
- wall clock
Trace-derived. Tool errors are counted from finished tool calls; token and cost values come from the provider usage recorded by the proxy.
Failure attribution
run passed the threshold; no failure to attribute
Inspect the trace →Trace
- —Run startedcodex-openrouter 1.0.0 · run 0
- 1Model call startedopenai/gpt-5.1-codex · messages 4f53cda1…
- 1Model call finished7846 in / 97 out · $0.00232 · completed
- 1Tool call startedcommand_execution · "/usr/bin/bash -c 'pwd && ls'"redacted
- 1Tool call finishedcommand_execution · ok · event=item.startedredacted
- 1Step completed0 ms
- 2Model call startedopenai/gpt-5.1-codex · messages 4f53cda1…
- 2Model call finished7983 in / 90 out · $0.00228 · completed
- 2Tool call startedcommand_execution · "/usr/bin/bash -c 'pwd && ls'"redacted
- 2Tool call finishedcommand_execution · ok · event=item.completedredacted
- task
- 1.0.0
- ruleset
- 1.0.0
- scoring config
- 1.0.0
- adapter
- 1.0.0
- fingerprint
- 3412742405eb…
Requirement outcomes
Static checks · 4 declared · no produced code executed
Real-repository task requirement.
- Rule
- declared check
- Outcome
- The declared check matched the produced repository.
Produced-code diff
0 added · 2 changed · 1 removed · 23 + / 9 − · 2.0 KiB
--- a/index.js
+++ b/index.js
@@ -1,14 +1,33 @@
/**
* Check if the given code point, or the code point at the first index, is a
* whitespace character.
*
* @param {string|number} value
* Code point or string.
* @returns {boolean}
* Whether `character` is a whitespace character
*/
export function isWhitespaceCharacter(value) {
+ let character
+
+ if (typeof value === 'number') {
+ character = String.fromCodePoint(value)
+ } else {
+ let count = 0
+
+ for (const symbol of String(value)) {
+ character = symbol
+ count += 1
+
+ if (count > 1) {
+ return false
+ }
+ }
+
+ if (count === 0) {
+ return false
+ }
+ }
+
+ return /\s/.test(character)
- return /\s/.test(
- typeof value === 'number' ? String.fromCodePoint(value) : value.charAt(0)
- )
}
--- a/test.js
+++ b/test.js
@@ -1,19 +1,20 @@
import assert from 'node:assert/strict'
import test from 'node:test'
import {isWhitespaceCharacter} from './index.js'
test('isWhitespaceCharacter(character)', function () {
assert.ok(isWhitespaceCharacter(' '))
assert.ok(isWhitespaceCharacter('\n'))
assert.ok(isWhitespaceCharacter('\r'))
assert.ok(isWhitespaceCharacter('\uFEFF'))
assert.ok(isWhitespaceCharacter('\u00A0'))
assert.ok(isWhitespaceCharacter('\t'))
assert.ok(isWhitespaceCharacter('\v'))
assert.ok(isWhitespaceCharacter(0x20))
assert.ok(isWhitespaceCharacter(0xa))
assert.ok(isWhitespaceCharacter(0x16_80))
assert.ok(!isWhitespaceCharacter('a'))
assert.ok(!isWhitespaceCharacter(0x19))
assert.ok(!isWhitespaceCharacter('💩'))
+ assert.ok(!isWhitespaceCharacter(' '))
})
--- a/.orivoxx/issue.md
+++ /dev/null
@@ -1,6 +0,0 @@
-# Issue
-
-isWhitespaceCharacter(' ') returns true because only the first code point is checked. The predicate describes a single whitespace character. Return false for strings longer than one code point, preserving all existing whitespace characters.
-
-Repository: https://github.com/wooorm/is-whitespace-character
-Base commit: d28a6fc01ae1d41152b765e9a760a906acaa417c
Run summary
{
"status": "completed",
"exitCode": 0,
"durationMs": 66105,
"adapter": {
"id": "codex-openrouter",
"version": "1.0.0",
"label": "OpenAI Codex CLI (openai/gpt-5.1-codex)",
"kind": "harness"
},
"model": {
"provider": "openrouter",
"name": "openai/gpt-5.1-codex",
"baseUrl": "https://openrouter.ai/api/v1"
}
}The score is reproducible from the task, ruleset, scoring configuration, and captured repository text. No model call contributed to it.