Skip to content

fix: restore node-host test lint with direct tail assertions - #137159

Closed
steipete wants to merge 1 commit into
mainfrom
codex/perf6-node-host-test-cleanup
Closed

steipete wants to merge 1 commit into
mainfrom
codex/perf6-node-host-test-cleanup

Conversation

@steipete

@steipete steipete commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

What problem does this PR solve?

Main’s node-host runner test exceeded the configured 1,000-line lint limit by six lines, failing unrelated PR checks. The failure is visible in check-lint-core-4 for #137132; the offending test file is identical on the current main inspected here.

Why this change

Use the same Array.at(-1) last-entry idiom already used by lastCapturedOptions in this test, and assert directly instead of repeating length-based indexing and one-use locals three times. All test cases, input values, expected values, optional access and empty-context-path semantics remain unchanged. This removes six test lines; production LOC is unchanged. The existing lint limit stays enforced.

Validation

  • node node_modules/oxlint/bin/oxlint --type-aware --threads=1 src/node-host/runner.test.ts: passes with no warning/error.
  • node scripts/run-vitest.mjs run src/node-host/runner.test.ts: all 41 tests pass.
  • Independent managed Codex review through P2: no actionable finding.

This is a test maintenance and CI repair. It changes no runtime behavior, dependencies, configuration, persistence or public API and makes no memory or speed claim.

@clawsweeper

clawsweeper Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

@openclaw-barnacle openclaw-barnacle Bot added size: XS maintainer Maintainer-authored PR labels Sep 3, 2026
@steipete
steipete marked this pull request as ready for review September 3, 2026 07:46
@clawsweeper

clawsweeper Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 3, 2026, 3:53 AM ET / 07:53 UTC.

ClawSweeper review

What this changes

The PR replaces three repeated length-based last-entry assertions in the node-host runner test with direct Array.at(-1) assertions, reducing the test file by six lines.

Merge readiness

✅ Ready for maintainer review

Keep open: this protected maintainer PR is a coherent, behavior-preserving test-only lint repair with no actionable correctness or security finding.

Priority: P3
Reviewed head: 1e4f112aea3001e0021f6ae365e5faa9ed96fb46

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused, behavior-preserving test repair with direct exact-head lint evidence.
Proof confidence 🌊 off-meta tidepool Not applicable: This maintainer-authored PR changes only a test assertion expression; no production behavior requires real-behavior proof.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: This maintainer-authored PR changes only a test assertion expression; no production behavior requires real-behavior proof.
Evidence reviewed 6 items Current-main test behavior: Current main retains the three context-path cases: explicit path, omitted path, and empty path, using the pre-PR length-based last-entry expression.
Introduced assertion change: The verified PR delta changes only the three local test assertions; Array.at(-1) is equivalent to indexing at length - 1 for these captured arrays, including an empty array returning undefined.
Owner boundary: The runner builds the Gateway snapshot from node-host options and passes it to the configuration owner; the test mock records that exact gateway argument before the assertions inspect it.
Findings None None.
Security None None.

How this fits together

The node-host runner persists the selected Gateway connection settings before creating a client. Its test mock captures that persisted configuration so context-path behavior can be checked after each connection scenario.

flowchart LR
  A[Node host options] --> B[Node host runner]
  B --> C[Persisted Gateway configuration]
  C --> D[Test mock capture]
  D --> E[Context-path assertions]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Tests -6. Total -6 across 1 file.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 1 3 9 -6
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 1 3 9 -6

Review metrics

Metric Value Why it matters
Production versus test LOC production 0, tests -6 net All changes are in one existing test file; the reduced test code preserves the same three assertions.

Technical review

Best possible solution:

Retain the three existing context-path cases and land this focused test-only simplification after normal exact-head checks complete.

Do we have a high-confidence way to reproduce the issue?

Not applicable: the change is test maintenance rather than a user-facing bug; the supplied exact-head CI context shows the relevant lint shard passing.

Is this the best way to solve the issue?

Yes: direct tail assertions reuse the existing Array.at(-1) test idiom and preserve the captured-configuration semantics without changing production code.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 7b67c28e2e96.

Labels

Label changes:

  • add P3: This is low-risk internal test maintenance that restores compliance with the repository's test-file lint limit.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.

Label justifications:

  • P3: This is low-risk internal test maintenance that restores compliance with the repository's test-file lint limit.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.

Evidence

What I checked:

  • Current-main test behavior: Current main retains the three context-path cases: explicit path, omitted path, and empty path, using the pre-PR length-based last-entry expression. (src/node-host/runner.test.ts:1061, 7b67c28e2e96)
  • Introduced assertion change: The verified PR delta changes only the three local test assertions; Array.at(-1) is equivalent to indexing at length - 1 for these captured arrays, including an empty array returning undefined. (src/node-host/runner.test.ts:1070, 1e4f112aea30)
  • Owner boundary: The runner builds the Gateway snapshot from node-host options and passes it to the configuration owner; the test mock records that exact gateway argument before the assertions inspect it. (src/node-host/runner.ts:136, 1e4f112aea30)
  • Lint contract: The repository applies a 1,000-line maximum to TypeScript test files, excluding blank lines and comments; this PR removes six test lines without changing that policy. (.oxlintrc.json:383, 1e4f112aea30)
  • Area history: Recent history shows Peter Steinberger repeatedly maintaining the node-host runner test, including the preceding node-host fix on current main; Vincent Koc also recently changed this test surface. (src/node-host/runner.test.ts:1070, dc000070e4bb)
  • Exact-head validation context: The supplied exact-head check context reports check-lint-core-4 successful; remaining queued or in-progress checks are routine and do not establish a patch defect. (1e4f112aea30)

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • Vincent Koc: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

@vincentkoc

Copy link
Copy Markdown
Member

Superseded by #137149, landed on main as 7aff510afad21033fd0e7cd9bfc8197fdab1d4f3.

That change split the runner tests, restored the max-lines gate, and rewrote the exact file this PR would edit while preserving the same 41 tests. There is no remaining delta to land here.

@vincentkoc vincentkoc closed this Sep 3, 2026
@RomneyDa
RomneyDa deleted the codex/perf6-node-host-test-cleanup branch October 22, 2026 00:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintainer Maintainer-authored PR size: XS

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants