Skip to content

fix(test): capture the SQLite close method without an unbound reference - #204397

Merged
obviyus merged 1 commit into
mainfrom
fix/lint-close-failure-unbound
Nov 24, 2026
Merged

obviyus merged 1 commit into
mainfrom
fix/lint-close-failure-unbound

Conversation

@obviyus

@obviyus obviyus commented Nov 24, 2026

Copy link
Copy Markdown
Collaborator

Result

check-lint-core-3 on main passes again. Since #202514 (ad2f629) it fails type-aware oxlint:

src/config/sessions/session-transcript-reconcile.close-failure.test-support.mjs:3:38:
error: Avoid referencing unbound methods ... (typescript(unbound-method))

Cause

#202514 rewrote this worker fixture to patch DatabaseSync.prototype.close directly, without the source loader. In the same PR it removed the fixture's lint-suppression entry as unused. The new line const close = DatabaseSync.prototype.close; is an unbound method reference, so the type-aware core stripe fails on every PR that runs it, and on main.

Change

Capture the method with Reflect.get(DatabaseSync.prototype, "close"). This is the same receiver-explicit pattern as test/helpers/capture-method-call.ts, which the worker cannot import because it deliberately loads no source graph. The call site already passes its receiver (close.call(this)). Behavior is unchanged. No suppression is added.

Evidence

  • node scripts/run-oxlint.mjs --tsconfig config/tsconfig/oxlint.core.json src/config/sessions: the unbound-method error is reported on main and gone on this head. The remaining max-lines items are warnings, unchanged.
  • session-transcript-reconcile.lifecycle-phases.test.ts: 6 passed, including the close-failure scenario that runs this fixture.

@clawsweeper

clawsweeper Bot commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Nov 24, 2026
@clawsweeper

clawsweeper Bot commented Nov 24, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

This PR captures SQLite’s native close method through Reflect.get while preserving its explicit receiver.

Example: CI runs check-lint-core-3 against the reconciliation close-failure fixture.

  • Before: The direct DatabaseSync.prototype.close reference triggers typescript/unbound-method.
  • After: The exact-head lint check passes, and the fixture retains close.call(this).

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A minimal, source-supported tooling repair with a passing exact-head lint check and reported existing lifecycle coverage.
Proof confidence 🐚 platinum hermit (4/6) This behavior-preserving test-fixture repair requires no shipped-entry-point demonstration; exact-head lint passes, and the author reports six passing lifecycle cases.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: Contributors encounter a failing core lint gate caused by a test fixture’s native-method capture.
Reason: The maintainer-authored change repairs a demonstrated tooling failure while preserving the established worker-testing design.

Regression provenance

Possible regression — suspected (reviewed change). No predecessor PR is attributed.

Merge readiness

✅ Ready for maintainer review

This PR fixes a current-main lint failure with a focused, behavior-preserving fixture change; no actionable defects were found.

Priority: P2
Reviewed head: 7035e54786686b9a34feff0c52ec855adf78dedc

Before merge

None.

Findings

None.

Agent review details

How this fits together

The lifecycle test launches a worker fixture that injects one SQLite close failure before loading the compiled reconciliation worker, allowing cleanup and worker-exit behavior to be checked.

flowchart LR
  A[Lifecycle test] --> B[Worker fixture]
  B --> C[Capture native close]
  C --> D[Inject one close failure]
  D --> E[Compiled reconciliation worker]
  E --> F[Cleanup assertions]
Loading

Technical review

Best possible solution:

Keep the inline native-method capture and explicit receiver without restoring the source loader or adding another helper.

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

The reported diagnostic matches the direct method reference still present on fetched main, with a clean-main reproduction recorded in the linked discussion; no target code was executed during this read-only review.

Is this the best way to solve the issue?

This is the smallest complete repair within the existing fixture: it preserves native receiver binding and the intentional compiled-worker boundary without adding suppression entries or test scaffolding.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 336a2d11e475.

Provenance checked

  • Native close capture in the compiled-worker fixture keeps the original intent (ad2f629: Exercise the compiled reconciliation worker in both normal and injected-close-failure cases without loading the source graph inside the worker deadline.)

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

Likely related people:

  • Daniel: Raw commit ad2f629 adds src/config/sessions/session-transcript-reconcile.close-failure.test-support.mjs:1 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: ad2f629e55fc; files: src/config/sessions/session-transcript-reconcile.close-failure.test-support.mjs)

PR surface

Tests +1. Total +1 across 1 file. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 1 2 1 +1
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 1 2 1 +1

Preflight source

Source unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified.

Labels

Label changes:

  • add P2: A concrete current-main lint failure blocks development gates without a demonstrated end-user runtime failure.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Label justifications:

  • P2: A concrete current-main lint failure blocks development gates without a demonstrated end-user runtime failure.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Rating scale

6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

Reviewed November 24, 2026, 12:07 AM ET / 05:07 UTC.

@obviyus
obviyus merged commit 3091ba8 into main Nov 24, 2026
131 checks passed
@obviyus
obviyus deleted the fix/lint-close-failure-unbound branch November 24, 2026 05:23
tideclaw-bot pushed a commit that referenced this pull request Nov 24, 2026
…ce (#204397)

## Result

`check-lint-core-3` on `main` passes again. Since #202514 (ad2f629) it fails type-aware oxlint:

```
src/config/sessions/session-transcript-reconcile.close-failure.test-support.mjs:3:38:
error: Avoid referencing unbound methods ... (typescript(unbound-method))
```

## Cause

#202514 rewrote this worker fixture to patch `DatabaseSync.prototype.close` directly, without the source loader. In the same PR it removed the fixture's lint-suppression entry as unused. The new line `const close = DatabaseSync.prototype.close;` is an unbound method reference, so the type-aware core stripe fails on every PR that runs it, and on `main`.

## Change

Capture the method with `Reflect.get(DatabaseSync.prototype, "close")`. This is the same receiver-explicit pattern as `test/helpers/capture-method-call.ts`, which the worker cannot import because it deliberately loads no source graph. The call site already passes its receiver (`close.call(this)`). Behavior is unchanged. No suppression is added.

## Evidence

- `node scripts/run-oxlint.mjs --tsconfig config/tsconfig/oxlint.core.json src/config/sessions`: the unbound-method error is reported on `main` and gone on this head. The remaining `max-lines` items are warnings, unchanged.
- `session-transcript-reconcile.lifecycle-phases.test.ts`: 6 passed, including the close-failure scenario that runs this fixture.

Co-authored-by: Ayaan Zaidi <[email protected]>
(cherry picked from commit 3091ba8)
tideclaw-bot pushed a commit that referenced this pull request Nov 24, 2026
…ce (#204397)

## Result

`check-lint-core-3` on `main` passes again. Since #202514 (ad2f629) it fails type-aware oxlint:

```
src/config/sessions/session-transcript-reconcile.close-failure.test-support.mjs:3:38:
error: Avoid referencing unbound methods ... (typescript(unbound-method))
```

## Cause

#202514 rewrote this worker fixture to patch `DatabaseSync.prototype.close` directly, without the source loader. In the same PR it removed the fixture's lint-suppression entry as unused. The new line `const close = DatabaseSync.prototype.close;` is an unbound method reference, so the type-aware core stripe fails on every PR that runs it, and on `main`.

## Change

Capture the method with `Reflect.get(DatabaseSync.prototype, "close")`. This is the same receiver-explicit pattern as `test/helpers/capture-method-call.ts`, which the worker cannot import because it deliberately loads no source graph. The call site already passes its receiver (`close.call(this)`). Behavior is unchanged. No suppression is added.

## Evidence

- `node scripts/run-oxlint.mjs --tsconfig config/tsconfig/oxlint.core.json src/config/sessions`: the unbound-method error is reported on `main` and gone on this head. The remaining `max-lines` items are warnings, unchanged.
- `session-transcript-reconcile.lifecycle-phases.test.ts`: 6 passed, including the close-failure scenario that runs this fixture.

Co-authored-by: Ayaan Zaidi <[email protected]>
(cherry picked from commit 3091ba8)
Co-authored-by: RomneyDa <[email protected]>
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 25, 2026
…ce (openclaw#204397)

## Result

`check-lint-core-3` on `main` passes again. Since openclaw#202514 (312af24) it fails type-aware oxlint:

```
src/config/sessions/session-transcript-reconcile.close-failure.test-support.mjs:3:38:
error: Avoid referencing unbound methods ... (typescript(unbound-method))
```

## Cause

openclaw#202514 rewrote this worker fixture to patch `DatabaseSync.prototype.close` directly, without the source loader. In the same PR it removed the fixture's lint-suppression entry as unused. The new line `const close = DatabaseSync.prototype.close;` is an unbound method reference, so the type-aware core stripe fails on every PR that runs it, and on `main`.

## Change

Capture the method with `Reflect.get(DatabaseSync.prototype, "close")`. This is the same receiver-explicit pattern as `test/helpers/capture-method-call.ts`, which the worker cannot import because it deliberately loads no source graph. The call site already passes its receiver (`close.call(this)`). Behavior is unchanged. No suppression is added.

## Evidence

- `node scripts/run-oxlint.mjs --tsconfig config/tsconfig/oxlint.core.json src/config/sessions`: the unbound-method error is reported on `main` and gone on this head. The remaining `max-lines` items are warnings, unchanged.
- `session-transcript-reconcile.lifecycle-phases.test.ts`: 6 passed, including the close-failure scenario that runs this fixture.

Co-authored-by: Ayaan Zaidi <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: XS status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant