Skip to content

refactor(dashboard): enforce strict checks for small modules - #1141

Merged
steipete merged 4 commits into
mainfrom
steipete/dashboard-strict-slice-1
Aug 12, 2026
Merged

steipete merged 4 commits into
mainfrom
steipete/dashboard-strict-slice-1

Conversation

@steipete

@steipete steipete commented Aug 12, 2026 •

Copy link
Copy Markdown
Contributor

Related: #1128

What Problem This Solves

The small dashboard modules were still compiled only through the relaxed dashboard configuration,
so future edits could silently reintroduce implicit-any, unchecked-index, or inaccurate optional-
property assumptions even after those modules had become small enough to migrate safely.

Why This Change Was Made

This is Phase 2, slice 1 of #1128. It brings every
requested small module under strict, noUncheckedIndexedAccess, and
exactOptionalPropertyTypes without changing the main dashboard tsconfig or touching the excluded
monoliths.

The chosen ratchet is tsconfig.dashboard-strict.json with an explicit monotonic files allowlist.
TypeScript follows type-only imports into excluded modules, so direct tsc -p would also report 417
known diagnostics owned by later-slice files. check:dashboard-strict therefore resolves and checks
the real import closure, but fails only on diagnostics whose source file is an allowlisted root. It
also verifies that all three flags remain enabled and that the resolved roots exactly match the
checker-owned 13-file baseline. Removing a baseline root fails and names it; adding a root without
recording it in the baseline also fails. Future strict promotions add one line to both lists in the
same PR. The check runs through check:static, and therefore check:parallel and CI.

Current-head diagnostics eliminated:

Module Errors before Errors after
dashboard/github-api.ts 28 0
dashboard/exact-review-decision.ts 10 0
dashboard/exact-review-read-model.ts 17 0
dashboard/exact-review-queue-shared.ts 3 0
dashboard/exact-review-publication-retry.ts 0 0
dashboard/review-run-telemetry.ts 0 0
dashboard/review-observability.ts 0 0
dashboard/operational-health.ts 2 0
dashboard/dashboard-health.ts 0 0
dashboard/automerge-metrics.ts 0 0
dashboard/apply-observability.ts 2 0
dashboard/error-safety.ts 0 0
dashboard/state-blobs.ts 0 0
Total 62 0

No runtime-reachable latent bug was found. The indexed-access findings were internal nonempty
collections; the new empty-case branches make those invariants safe without assertions. All
production edits are annotations, narrowing, or honest undefined handling, and no any or non-null
assertion was added.

User Impact

There is no intended user-visible behavior change. Developers now get CI enforcement whenever one
of these 13 modules regresses under the Node-matching strict flags, and no allowlisted root can
silently leave or enter the checker-owned baseline.

OpenClaw Bay Impact

None. No queue, lifecycle, telemetry, route, response-schema, or observer-control contract changes.
The real-Worker proof includes the status projection and shows normalized status bytes unchanged;
Bay remains observer-only.

Documentation Lifecycle

The page under docs/proof/dashboard-strict-slice-1/ is historical proof for this change. It does
not add or change an active runbook.

Evidence

  • pnpm run check:dashboard-strict — all 13 allowlisted modules green.
  • Strict-ratchet suite — 4 passed: full baseline, missing named root, extended baseline, and
    unrecorded addition rejection.
  • Focused dashboard suite — 89 passed, 0 failed.
  • pnpm run check on Node 24 — 3,360 tests; 3,352 passed, 8 skipped, 0 failed; coverage thresholds
    passed.
  • Pre-commit implementation review, receipt-refresh review, and committed branch review against
    origin/main — no accepted/actionable findings after fixing the first review's unrecorded-addition
    loophole.
  • Net original slice delta: +373/-76 across 13 files (+297 net). The largest production-module
    addition is github-api.ts at +39 lines; no requested module exceeded the slice churn limit.

Real Behavior Proof

  • Claim: strict annotations, narrowing, and the strengthened allowlist ratchet leave dashboard queue
    and status behavior byte-identical.
  • Exercised surface: real wrangler dev --local Workers, signed exact-review enqueue, independent
    SQLite-backed ExactReviewQueue stores, and public /api/exact-review-queue and /api/status
    reads.
  • Scenario: merge-base and implementation head each receive the same six synthetic review items;
    only volatile time/request/lease fields are normalized before byte comparison.
  • Command/environment: docs/proof/dashboard-strict-slice-1/run-proof.sh; Node 24, pinned pnpm,
    Wrangler 4.107.0. The committed container run used Crabbox provider=aws, lease
    cbx_901b91555bcc (crimson-hermit-e90b), run run_011ffe49ee37, machine c7a.8xlarge, and
    Docker image node:24-bookworm at digest
    sha256:934240a162082fd8b8a2f90cd5114446443f1eba1c5378f6687167ca405e6584.
  • Observable result: four focused ratchet tests passed; container pnpm run check passed with 3,352
    tests passed and 8 skipped; PROOF_RECEIPT=COMMITTED; PROOF_RC=0; both normalized responses
    were byte-identical. Queue hash c4e7a44913eba76959cf4e77a7013280f8ab8a8c44cfb363de43f0935680e1fe;
    status hash 314392ffddd90227440036562863ec4a69bd2b1636f9f5930724cec2f6f6ade8.
  • Artifact: docs/proof/dashboard-strict-slice-1/container-receipt.json records provider, lease, run,
    image, timing, hashes, exit 0, and automatic lease cleanup. The tested implementation head is
    ffb10b0d664fad354d4ef6648573efad1d117c13; final head
    d7308fa7034596f5886b594ad9a340194b0ebe2d adds only this refreshed receipt.
  • Limits: synthetic pending issues and a loopback GitHub error stub; no live GitHub call,
    deployment, Worker-side lease acquisition, record publication, or production mutation.

@steipete
steipete requested a review from a team as a code owner August 12, 2026 14:39
@clawsweeper

clawsweeper Bot commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

@steipete

Copy link
Copy Markdown
Contributor Author

@clawsweeper review

@clawsweeper

clawsweeper Bot commented Aug 12, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@clawsweeper clawsweeper Bot added merge-risk: 🚨 automation 🚨 Merging this PR could break CI, automerge, proof capture, label sync, or automation. P3 Low-risk cleanup, docs, polish, ergonomics, or speculative feature. proof: sufficient Contributor real behavior proof is sufficient. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Aug 12, 2026
@clawsweeper

clawsweeper Bot commented Aug 12, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 12, 2026, 11:45 AM ET / 15:45 UTC.

ClawSweeper review

What this changes

The PR adds a strict TypeScript ratchet for 13 small dashboard modules, updates their types, and records Worker-equivalence proof.

Merge readiness

⚠️ Ready for maintainer review - 2 items remain

Keep open. The strict dashboard check is not on current main, and the prior baseline-removal finding is fixed on the current PR head with strong real-Worker proof.

Priority: P3
Reviewed head: d7308fa7034596f5886b594ad9a340194b0ebe2d

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A bounded maintenance patch with resolved review feedback and strong real-behavior evidence; current CI remains the final normal landing check.
Proof confidence 🦞 diamond lobster (5/6) ✨ media proof bonus Sufficient (linked_artifact): The PR supplies a committed Crabbox local-Worker comparison showing byte-identical normalized queue and status responses after the implementation change.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (linked_artifact): The PR supplies a committed Crabbox local-Worker comparison showing byte-identical normalized queue and status responses after the implementation change.
Evidence reviewed 6 items Current main still lacks the requested enforcement: Current main's static-check command does not include a dashboard-strict check, so the PR's central CI hardening is not already implemented.
Prior finding resolved on the current head: The checker now rejects both omitted baseline roots and unrecorded additions; focused tests cover each case.
CI integration: The new strict check is included in check:static, which is called by the repository check command and CI.
Findings None None.
Security None None.

How this fits together

The dashboard Worker builds review-queue and status API responses from durable queue state. This change adds compile-time enforcement around selected dashboard modules while preserving those runtime outputs.

flowchart LR
  A[Dashboard source modules] --> B[Strict TypeScript allowlist]
  B --> C[Baseline consistency check]
  C --> D[Static checks and CI]
  A --> E[Dashboard Worker]
  E --> F[Review queue API]
  E --> G[Status API]
Loading

Before merge

  • Resolve merge risk (P1) - Merging adds a repository-wide static gate; a checker regression or baseline drift could block CI, although exact-root tests constrain that risk.
  • Complete next step (P2) - No concrete repair remains after the prior baseline finding was fixed; this current PR should proceed through normal CI and maintainer review.
Agent review details

Security

None.

Review metrics

Metric Value Why it matters
Changed surface 14 files; +460/-76 lines The change combines a bounded 13-module strictness slice with its enforcement, tests, and proof artifacts.
Runtime dashboard delta +119/-73 lines across 6 modules Runtime edits are limited to type narrowing and undefined handling on queue, status, and GitHub API helpers.
Ratchet coverage 13 baseline roots; 4 focused baseline tests The check explicitly detects both removed and unrecorded strict roots.

Root-cause cluster

Relationship: fixed_by_candidate
Canonical: #1128
Summary: This PR is explicitly a bounded implementation slice of the linked dashboard strictness work.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Merge-risk options

Maintainer options:

  1. Complete current-head static validation (recommended)
    Let the current CI run validate the new check:static gate before landing the proof-backed implementation.

Technical review

Best possible solution:

Land the narrow strict ratchet after current-head CI completes, retaining the paired baseline checks so promoted modules cannot silently leave enforcement.

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

Not applicable: this PR hardens compile-time checks rather than addressing a reported user-facing failure.

Is this the best way to solve the issue?

Yes. An isolated strict configuration plus an exact baseline check is a narrow way to ratchet selected modules without changing the relaxed dashboard-wide configuration.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 6ca63d912cb1.

Labels

Label changes:

  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (linked_artifact): The PR supplies a committed Crabbox local-Worker comparison showing byte-identical normalized queue and status responses after the implementation change.
  • remove status: ⏳ waiting on author: Current PR status label is status: 👀 ready for maintainer look.
  • remove rating: 🦐 gold shrimp: Current PR rating is rating: 🐚 platinum hermit, so this older rating label is no longer current.

Label justifications:

  • P3: This is developer-facing type-safety and CI hardening with no intended user-visible runtime change.
  • merge-risk: 🚨 automation: The PR adds a new static checker to the repository-wide CI validation path.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (linked_artifact): The PR supplies a committed Crabbox local-Worker comparison showing byte-identical normalized queue and status responses after the implementation change.
  • proof: sufficient: Contributor real behavior proof is sufficient. The PR supplies a committed Crabbox local-Worker comparison showing byte-identical normalized queue and status responses after the implementation change.

Evidence

What I checked:

Likely related people:

  • steipete: Current-main history attributes the extracted decision policy, read model, and canonical GitHub App stack to this contributor. (role: recent dashboard queue contributor; confidence: high; commits: d8471a64e56b, 6bf7f483fb03, 5a964dadc813; files: dashboard/exact-review-decision.ts, dashboard/exact-review-read-model.ts, dashboard/github-api.ts)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Allow the current-head CI run to complete before landing.

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 (2 earlier review cycles)
  • reviewed 2026-08-12T14:42:51.356Z sha 8b3b4a4 :: needs changes before merge. :: [P2] Prevent allowlisted modules from being removed
  • reviewed 2026-08-12T14:47:02.058Z sha 8b3b4a4 :: needs changes before merge. :: [P2] Reject removal of baseline strict roots

@steipete

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Aug 12, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@clawsweeper clawsweeper Bot added 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 status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. labels Aug 12, 2026
@steipete
steipete merged commit bd86954 into main Aug 12, 2026
22 checks passed
@steipete
steipete deleted the steipete/dashboard-strict-slice-1 branch August 12, 2026 15:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge-risk: 🚨 automation 🚨 Merging this PR could break CI, automerge, proof capture, label sync, or automation. P3 Low-risk cleanup, docs, polish, ergonomics, or speculative feature. proof: sufficient Contributor real behavior proof is sufficient. 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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant