Skip to content

refactor(requirements): collapse single-use evaluation helpers - #129753

Merged
steipete merged 1 commit into
mainfrom
codex/refactor-shared-requirements-00367880
Aug 26, 2026
Merged

steipete merged 1 commit into
mainfrom
codex/refactor-shared-requirements-00367880

Conversation

@steipete

Copy link
Copy Markdown
Contributor

What Problem This Solves

Skill and hook eligibility share one requirements evaluator, but its actual decision path was spread across seven single-use private helpers and a redundant context type. That indirection made platform restrictions, remote binary checks, and the interaction between always and operating-system compatibility harder to inspect together.

Why This Change Was Made

Collapse normalization and capability evaluation into the existing canonical requirements owner while preserving its exported types, evaluator signature, result shape, callback ordering, and remote-execution behavior. The earlier helper privatization in #106837 makes these removals internal; the compatibility invariant established in #123731 remains explicit: always never bypasses operating-system requirements.

User Impact

No user-visible behavior changes. Skills and hooks retain identical local and remote binary detection, any-binary groups, platform aliases, environment/config diagnostics, and platform-incompatibility reporting. No CLI, configuration, Plugin SDK, or security contract changes.

Evidence

  • Production: +49/-181 (132 fewer lines) in one owner module; tests unchanged.
  • Existing owner, caller, skill-status/workspace, and hook-status suites: 38 passing tests across five files.
  • Focused proof: node scripts/run-vitest.mjs src/shared/requirements.test.ts src/shared/entry-status.test.ts src/skills/discovery/status.test.ts src/skills/discovery/status-workspace.test.ts src/hooks/hooks-status.test.ts.
  • Full unrestricted changed gate passed, including all three dead-code scans, core/test typechecks, formatting, lint, and architecture guards: node scripts/check-changed.mjs --base 0036788055b5631f95d5eaeff9a1ba684fd78bb3.
  • Fresh pre-commit and exact-commit reviews found no actionable issues; independent source review verified exported contracts, callback order, remote behavior, and the always/OS invariant.

@clawsweeper

clawsweeper Bot commented Aug 26, 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: M maintainer Maintainer-authored PR labels Aug 26, 2026
@steipete
steipete marked this pull request as ready for review August 26, 2026 01:46
@clawsweeper clawsweeper Bot added P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. 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. labels Aug 26, 2026
@clawsweeper

clawsweeper Bot commented Aug 26, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 25, 2026, 11:10 PM ET / August 26, 2026, 03:10 UTC.

ClawSweeper review

What this changes

The PR collapses private binary, platform, environment, and config requirement helpers into the exported evaluator used by skill and hook status flows.

Merge readiness

⚠️ Ready for maintainer review - 1 item remains

No blocking findings: the refactor preserves the shared evaluator’s decision order and result contract, while current main still contains the older helper split. Keep this maintainer-labeled PR open for normal exact-head CI and maintainer handling.

Priority: P3
Reviewed head: bf2ef7ce18d76325ff2c7c06f4e4e445e0c3b1d0

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) The patch is a focused net-negative consolidation with preserved boundary coverage and no actionable review finding.
Proof confidence 🌊 off-meta tidepool Not applicable: This maintainer-authored, non-user-visible refactor is exempt from the external-contributor real-behavior-proof gate; the PR body supplies focused test evidence as supplemental validation.
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, non-user-visible refactor is exempt from the external-contributor real-behavior-proof gate; the PR body supplies focused test evidence as supplemental validation.
Evidence reviewed 6 items Changed owner preserves the evaluator contract: The exported evaluator still normalizes metadata, evaluates local and remote binary/platform requirements, records config diagnostics, and keeps OS incompatibility outside the always bypass.
Caller and sibling consumers use the stable wrapper: The entry-status boundary passes the same local and remote capability callbacks through to the evaluator; skill and hook status consume its eligibility and missing-OS result rather than the removed private helpers.
Behavior coverage remains at public and consumer boundaries: Existing tests cover local/remote bins, platform aliases, environment/config diagnostics, the always/OS invariant, and skill/hook status presentation.
Findings None None.
Security None None.

Live Verification

Command: node scripts/run-vitest.mjs src/shared/requirements.test.ts

Result: PASS (completed)

[test] starting test/vitest/vitest.unit-fast.config.ts

 RUN  v4.1.10 /tmp/clawsweeper-live-proof-129753-8aDAjD/target

 ✓  unit-fast  src/shared/requirements.test.ts (8 tests) 7ms

 Test Files  1 passed (1)
      Tests  8 passed (8)
   Start at  03:12:01
   Duration  297ms (transform 94ms, setup 103ms, import 22ms, tests 7ms, environment 0ms)

[test] passed 1 Vitest shard in 12.58s
[test] starting test/vitest/vitest.unit-fast.config.ts

 RUN  v4.1.10 /tmp/clawsweeper-live-proof-129753-8aDAjD/target

 ✓  unit-fast  src/shared/requirements.test.ts (8 tests) 7ms

 Test Files  1 passed (1)
      Tests  8 passed (8)
   Start at  03:12:14
   Duration  218ms (transform 20ms, setup 37ms, import 12ms, tests 7ms, environment 0ms)

[test] passed 1 Vitest shard in 12.43s

Assertions:

  • PASS expect_output: Test Files

How this fits together

Skill and hook metadata is evaluated against local and optional remote capabilities by one shared requirements owner. Its availability result feeds status reports that explain whether each entry can load or run.

flowchart LR
  A[Skill metadata] --> C[Shared requirements evaluator]
  B[Hook metadata] --> C
  D[Local capabilities] --> C
  E[Remote capabilities] --> C
  C --> F[Eligibility and diagnostics]
  F --> G[Skill status]
  F --> H[Hook status]
Loading

Before merge

  • Complete next step (P2) - No mechanical repair is indicated; retain normal exact-head CI and maintainer review before merge.
Agent review details

Security

None.

PR surface

Source -132. Total -132 across 1 file.

View PR surface stats
Area Files Added Removed Net
Source 1 49 181 -132
Tests 0 0 0 0
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 1 49 181 -132

Review metrics

Metric Value Why it matters
Production versus test LOC production -132, tests 0 The sole production module is materially smaller while the existing behavior coverage remains unchanged.

Technical review

Best possible solution:

Keep one exported requirements evaluator as the canonical path, with the existing boundary tests protecting remote capability handling and the always/OS rule.

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

Not applicable: this is a behavior-preserving refactor, and current source plus existing tests define the evaluated contract.

Is this the best way to solve the issue?

Yes: integrating single-use private logic into the existing canonical evaluator removes indirection without introducing a parallel path or changing callers.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 03262dfb0497.

Labels

Label justifications:

  • P3: This is a contained, behavior-preserving internal cleanup with no claimed user-facing change.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: This maintainer-authored, non-user-visible refactor is exempt from the external-contributor real-behavior-proof gate; the PR body supplies focused test evidence as supplemental validation.

Evidence

What I checked:

  • Changed owner preserves the evaluator contract: The exported evaluator still normalizes metadata, evaluates local and remote binary/platform requirements, records config diagnostics, and keeps OS incompatibility outside the always bypass. (src/shared/requirements.ts:40, bf2ef7ce18d7)
  • Caller and sibling consumers use the stable wrapper: The entry-status boundary passes the same local and remote capability callbacks through to the evaluator; skill and hook status consume its eligibility and missing-OS result rather than the removed private helpers. (src/shared/entry-status.ts:38, bf2ef7ce18d7)
  • Behavior coverage remains at public and consumer boundaries: Existing tests cover local/remote bins, platform aliases, environment/config diagnostics, the always/OS invariant, and skill/hook status presentation. (src/shared/requirements.test.ts:18, bf2ef7ce18d7)
  • Current main has not already absorbed this refactor: Comparing the checked-out PR head with current main shows this one production file changing by +49/-181; current main retains the helper decomposition. (src/shared/requirements.ts:40, 03262dfb0497)
  • History establishes the relevant invariants and owners: History shows the prior helper privatization and the later always-does-not-bypass-OS repair; this PR is a follow-on consolidation rather than a duplicate implementation. (src/shared/requirements.ts:92, 3bc61f296617)
  • No Codex dependency contract is implicated: The changed shared evaluator and its immediate caller use only the repository-local generic RequirementRemote contract and contain no Codex import or protocol reference. (src/shared/requirements.ts:20, bf2ef7ce18d7)

Likely related people:

  • steipete: Authored this refactor and several earlier requirements-owner changes in the file history. (role: recent area contributor; confidence: high; commits: bf2ef7ce18d7, 9210dfc0912b, 4f61a3f52735; files: src/shared/requirements.ts)
  • shakkernerd: Authored the merged repair that made OS compatibility remain mandatory for always-on entries. (role: invariant author; confidence: high; commits: 3bc61f296617; files: src/shared/requirements.ts, src/hooks/hooks-status.test.ts)
  • vincentkoc: Authored the prior merged helper-privatization change that established these removed helpers as internal. (role: adjacent refactor author; confidence: high; commits: d08228eee13b; files: src/shared/requirements.ts)

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.

History

Review history (1 earlier review cycle)
  • reviewed 2026-08-26T01:58:30.802Z sha 19a66f1 :: needs maintainer review before merge. :: none

@steipete
steipete force-pushed the codex/refactor-shared-requirements-00367880 branch from 19a66f1 to bf2ef7c Compare August 26, 2026 02:58
@steipete
steipete merged commit 857f470 into main Aug 26, 2026
195 checks passed
@steipete
steipete deleted the codex/refactor-shared-requirements-00367880 branch August 26, 2026 04:43
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintainer Maintainer-authored PR P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: M 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